From: Steinar H. Gunderson Date: Thu, 29 Jun 2017 21:10:00 +0000 (+0200) Subject: Don't bother adding audio for silent cards. X-Git-Tag: 1.6.1~15 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=2d4fd36955368bc01092a9698314ff404693b105;p=nageru Don't bother adding audio for silent cards. --- diff --git a/mixer.cpp b/mixer.cpp index 9c07dc5..ce00bd4 100644 --- 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) {