fix: samples_per_frame must multiply fps_den for fractional framerates
sample_rate / fps_num gave 48000/30000 = 1 for 29.97 fps, producing silence. Correct formula is sample_rate * fps_den / fps_num, matching the calculation already used in testpattern. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -72,7 +72,7 @@ class NDIOutNode : public dmf::NodeBase {
|
||||
const auto audio_flow_id = audio_flow_info.at("id").get<std::string>();
|
||||
sample_rate = audio_flow_info.value("sample_rate", 48000);
|
||||
channels = audio_flow_info.value("channels", 2);
|
||||
samples_per_frame = sample_rate / fps_num;
|
||||
samples_per_frame = sample_rate * fps_den / fps_num;
|
||||
|
||||
log("audio flow=%s %d Hz %dch %d samples/frame",
|
||||
audio_flow_id.c_str(), sample_rate, channels, samples_per_frame);
|
||||
|
||||
Reference in New Issue
Block a user