From 6fe0ba86faca3769c57bf30cbf526959b418fc9a Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 17 Feb 2020 20:00:50 +0100 Subject: [PATCH 1/1] Fix an assertion error when FFmpeg inputs were dropping frames. --- nageru/audio_mixer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nageru/audio_mixer.cpp b/nageru/audio_mixer.cpp index 360689b..cef3c3c 100644 --- a/nageru/audio_mixer.cpp +++ b/nageru/audio_mixer.cpp @@ -320,7 +320,12 @@ bool AudioMixer::add_audio(DeviceSpec device_spec, const uint8_t *data, unsigned } unsigned num_channels = device->interesting_channels.size(); - assert(num_channels > 0); + if (num_channels == 0) { + // No buses use this device; throw it away. (Normally, we should not + // be here, but probably, we are in the process of changing a mapping, + // and the queue just isn't gone yet. In any case, returning is harmless.) + return true; + } // Convert the audio to fp32. unique_ptr audio(new float[num_samples * num_channels]); -- 2.39.2