X-Git-Url: https://git.sesse.net/?p=nageru;a=blobdiff_plain;f=nageru%2Faudio_mixer.cpp;h=cef3c3c87fb31416b78e50c7ac601797265f41f3;hp=360689b83406b04e6737cb6b7815d4092aca0a90;hb=6fe0ba86faca3769c57bf30cbf526959b418fc9a;hpb=09886e5989fe0dc2516bcadeacae4269ac22f03a 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]);