From 2d4fd36955368bc01092a9698314ff404693b105 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 29 Jun 2017 23:10:00 +0200 Subject: [PATCH] Don't bother adding audio for silent cards. --- mixer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) { -- 2.39.2