From: Dragos Oancea Date: Wed, 19 Aug 2015 18:29:19 +0000 (-0400) Subject: FS-8005: mod_opus : fix for rare decoder error when doing PLC, OPUS_GET_LAST_PACKET_D... X-Git-Tag: v1.6.2~154^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecabfc7f9a71b8ec17e1a0253d3811c08fbdcbce;p=thirdparty%2Ffreeswitch.git FS-8005: mod_opus : fix for rare decoder error when doing PLC, OPUS_GET_LAST_PACKET_DURATION might return 0 --- diff --git a/src/mod/codecs/mod_opus/mod_opus.c b/src/mod/codecs/mod_opus/mod_opus.c index 9a3469b6ff..bac1f9d54e 100644 --- a/src/mod/codecs/mod_opus/mod_opus.c +++ b/src/mod/codecs/mod_opus/mod_opus.c @@ -571,6 +571,9 @@ static switch_status_t switch_opus_decode(switch_codec_t *codec, plc = 1; encoded_data = NULL; opus_decoder_ctl(context->decoder_object, OPUS_GET_LAST_PACKET_DURATION(&frame_size)); + if (!frame_size) { + frame_size = frame_samples - (frame_samples % (codec->implementation->actual_samples_per_second / 400)); + } if (context->codec_settings.useinbandfec) { fec = 1;