Skip to content

Commit 88e511f

Browse files
committed
audio codec: if received no data, pass it further
This is an exception to the normal behavior used by the passive audio mixer participant, that sends empty packets to request receiving the data. It doesn't affect the normal UG behavior, because the situation when nonzero_channels=0 doesn't occur otherwise. Either we receive at least some packet from a frame and if not, the decoding doesn't take place.
1 parent abd7582 commit 88e511f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/audio/codec.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,13 @@ audio_frame2 audio_codec_decompress(struct audio_codec_state *s, audio_frame2 *f
344344
}
345345
}
346346

347+
if (nonzero_channels == 0 &&
348+
frame->get_data_len() == 0) { // produced by acap/passive
349+
ret.init(frame->get_channel_count(), AC_PCM, frame->get_bps(),
350+
frame->get_sample_rate());
351+
return ret;
352+
}
353+
347354
if (nonzero_channels != frame->get_channel_count()) {
348355
log_msg(LOG_LEVEL_WARNING,
349356
"[Audio decompress] %d empty channel(s) returned!\n",

0 commit comments

Comments
 (0)