Fixing a race condition in ACMGenericCodec
The old object was deleted before the pointer to it was removed from the decoder proxy. BUG=chromium:467209 TBR=tina.legrand@webrtc.org Review URL: https://webrtc-codereview.appspot.com/49429004 Cr-Commit-Position: refs/heads/master@{#8736} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8736 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -339,8 +339,8 @@ void ACMGenericCodec::ResetAudioEncoder() {
|
|||||||
config.payload_type = codec_inst.pltype;
|
config.payload_type = codec_inst.pltype;
|
||||||
enc_dec = new AudioEncoderDecoderIsacFix(config);
|
enc_dec = new AudioEncoderDecoderIsacFix(config);
|
||||||
}
|
}
|
||||||
audio_encoder_.reset(enc_dec);
|
|
||||||
decoder_proxy_.SetDecoder(enc_dec);
|
decoder_proxy_.SetDecoder(enc_dec);
|
||||||
|
audio_encoder_.reset(enc_dec);
|
||||||
#endif
|
#endif
|
||||||
#ifdef WEBRTC_CODEC_ISAC
|
#ifdef WEBRTC_CODEC_ISAC
|
||||||
} else if (!STR_CASE_CMP(codec_inst.plname, "ISAC")) {
|
} else if (!STR_CASE_CMP(codec_inst.plname, "ISAC")) {
|
||||||
@ -368,8 +368,8 @@ void ACMGenericCodec::ResetAudioEncoder() {
|
|||||||
config.payload_type = codec_inst.pltype;
|
config.payload_type = codec_inst.pltype;
|
||||||
enc_dec = new AudioEncoderDecoderIsac(config);
|
enc_dec = new AudioEncoderDecoderIsac(config);
|
||||||
}
|
}
|
||||||
audio_encoder_.reset(enc_dec);
|
|
||||||
decoder_proxy_.SetDecoder(enc_dec);
|
decoder_proxy_.SetDecoder(enc_dec);
|
||||||
|
audio_encoder_.reset(enc_dec);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
FATAL();
|
FATAL();
|
||||||
|
Reference in New Issue
Block a user