提交 9e89639c authored 作者: Michael Jerris's avatar Michael Jerris

Revert "Fix for FS-9313"

This reverts commit cf610796.
上级 aae7f06d
...@@ -244,14 +244,11 @@ static switch_status_t switch_opus_fmtp_parse(const char *fmtp, switch_codec_fmt ...@@ -244,14 +244,11 @@ static switch_status_t switch_opus_fmtp_parse(const char *fmtp, switch_codec_fmt
if (!strcasecmp(data, "stereo")) { if (!strcasecmp(data, "stereo")) {
codec_settings->stereo = atoi(arg); codec_settings->stereo = atoi(arg);
if(codec_settings->stereo) codec_fmtp->stereo = codec_settings->stereo;
codec_fmtp->stereo = 1;
} }
if (!strcasecmp(data, "sprop-stereo")) { if (!strcasecmp(data, "sprop-stereo")) {
codec_settings->sprop_stereo = atoi(arg); codec_settings->sprop_stereo = atoi(arg);
if(codec_settings->sprop_stereo)
codec_fmtp->stereo = 1;
} }
if (!strcasecmp(data, "maxaveragebitrate")) { if (!strcasecmp(data, "maxaveragebitrate")) {
...@@ -632,7 +629,7 @@ static switch_status_t switch_opus_init(switch_codec_t *codec, switch_codec_flag ...@@ -632,7 +629,7 @@ static switch_status_t switch_opus_init(switch_codec_t *codec, switch_codec_flag
} }
} }
context->decoder_object = opus_decoder_create(dec_samplerate, codec->implementation->number_of_channels, &err); context->decoder_object = opus_decoder_create(dec_samplerate, (!context->codec_settings.sprop_stereo ? codec->implementation->number_of_channels : 2), &err);
switch_set_flag(codec, SWITCH_CODEC_FLAG_HAS_PLC); switch_set_flag(codec, SWITCH_CODEC_FLAG_HAS_PLC);
...@@ -730,7 +727,7 @@ static switch_status_t switch_opus_decode(switch_codec_t *codec, ...@@ -730,7 +727,7 @@ static switch_status_t switch_opus_decode(switch_codec_t *codec,
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
frame_samples = *decoded_data_len / 2 / codec->implementation->number_of_channels); frame_samples = *decoded_data_len / 2 / (!context->codec_settings.sprop_stereo ? codec->implementation->number_of_channels : 2);
frame_size = frame_samples - (frame_samples % (codec->implementation->actual_samples_per_second / 400)); frame_size = frame_samples - (frame_samples % (codec->implementation->actual_samples_per_second / 400));
if (*flag & SFF_PLC) { if (*flag & SFF_PLC) {
...@@ -831,7 +828,7 @@ static switch_status_t switch_opus_decode(switch_codec_t *codec, ...@@ -831,7 +828,7 @@ static switch_status_t switch_opus_decode(switch_codec_t *codec,
return SWITCH_STATUS_GENERR; return SWITCH_STATUS_GENERR;
} }
*decoded_data_len = samples * 2 * codec->implementation->number_of_channels; *decoded_data_len = samples * 2 * (!context->codec_settings.sprop_stereo ? codec->implementation->number_of_channels : 2);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论