]> git.sesse.net Git - nageru/commitdiff
When creating a fake master card frame, create some fake silence with it.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 1 Jun 2020 19:31:48 +0000 (21:31 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 1 Jun 2020 19:31:48 +0000 (21:31 +0200)
nageru/mixer.cpp

index 26296180ac1371a0f14486849d451639d7a3d092..c6f126fc6682ef78fa23757205a4ceaff0a36526 100644 (file)
@@ -1576,6 +1576,14 @@ start:
        fractional_samples = num_samples_times_timebase % TIMEBASE;
        assert(output_frame_info.num_samples >= 0);
 
+       if (timed_out) {
+               DeviceSpec device{InputSourceType::CAPTURE_CARD, master_card_index};
+               bool success;
+               do {
+                       success = audio_mixer->add_silence(device, output_frame_info.num_samples, /*dropped_frames=*/0);
+               } while (!success);
+       }
+
        return output_frame_info;
 }