Merge pull request #403 in FS/freeswitch from ~DRAGOS_OANCEA/freeswitch-dragos:opus-fix-plc-init to master

* commit 'ecabfc7f9a71b8ec17e1a0253d3811c08fbdcbce':
  FS-8005: mod_opus : fix for rare decoder error when doing PLC, OPUS_GET_LAST_PACKET_DURATION might return 0
This commit is contained in:
Mike Jerris 2015-08-19 15:04:07 -05:00
commit 6b23acc100
1 changed files with 3 additions and 0 deletions

View File

@ -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;