File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
pjmedia/src/pjmedia-codec Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -641,6 +641,7 @@ static pj_status_t codec_open( pjmedia_codec *codec,
641
641
struct opus_data * opus_data = (struct opus_data * )codec -> codec_data ;
642
642
int idx , err ;
643
643
pj_bool_t auto_bit_rate = PJ_TRUE ;
644
+ pj_bool_t enc_use_plc = PJ_FALSE ;
644
645
645
646
PJ_ASSERT_RETURN (codec && attr && opus_data , PJ_EINVAL );
646
647
@@ -697,7 +698,10 @@ static pj_status_t codec_open( pjmedia_codec *codec,
697
698
if (idx >= 0 ) {
698
699
unsigned plc ;
699
700
plc = (unsigned ) pj_strtoul (& attr -> setting .enc_fmtp .param [idx ].val );
700
- attr -> setting .plc = plc > 0 ? PJ_TRUE : PJ_FALSE ;
701
+ if (plc > 0 )
702
+ enc_use_plc = PJ_TRUE ;
703
+ /* Do not modify local PLC setting as it's used for decoding. */
704
+ // attr->setting.plc = plc > 0? PJ_TRUE: PJ_FALSE
701
705
}
702
706
703
707
/* Check vad */
@@ -750,7 +754,7 @@ static pj_status_t codec_open( pjmedia_codec *codec,
750
754
opus_encoder_ctl (opus_data -> enc , OPUS_SET_DTX (attr -> setting .vad ? 1 : 0 ));
751
755
/* Set PLC */
752
756
opus_encoder_ctl (opus_data -> enc ,
753
- OPUS_SET_INBAND_FEC (attr -> setting . plc ? 1 : 0 ));
757
+ OPUS_SET_INBAND_FEC (enc_use_plc ));
754
758
/* Set bandwidth */
755
759
opus_encoder_ctl (opus_data -> enc ,
756
760
OPUS_SET_MAX_BANDWIDTH (get_opus_bw_constant (
You can’t perform that action at this time.
0 commit comments