]> git.sesse.net Git - nageru/commitdiff
Don't bother adding audio for silent cards.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 29 Jun 2017 21:10:00 +0000 (23:10 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 29 Jun 2017 21:10:00 +0000 (23:10 +0200)
mixer.cpp

index 9c07dc5002b09c6d9cf6b99648e889c0c9b93b37..ce00bd41a3454fbfaa579349fa4f4b75c59a6beb 100644 (file)
--- a/mixer.cpp
+++ b/mixer.cpp
@@ -729,7 +729,9 @@ void Mixer::bm_frame(unsigned card_index, uint16_t timecode,
                } while (!success);
        }
 
-       audio_mixer.add_audio(device, audio_frame.data + audio_offset, num_samples, audio_format, frame_length, audio_frame.received_timestamp);
+       if (num_samples > 0) {
+               audio_mixer.add_audio(device, audio_frame.data + audio_offset, num_samples, audio_format, frame_length, audio_frame.received_timestamp);
+       }
 
        // Done with the audio, so release it.
        if (audio_frame.owner) {