Reset the speech encoder when creating a comfort noise encoder.
This is to make sure that the two encoders are "in sync" (the CNG encoder can be created from an existing speech encoder). This is a speculative fix for a crash in the CNG encoder where a packet is unexpectedly emitted from the speech encoder. Bug: webrtc:42225071 Change-Id: I42571e56e032897f7f083f04d785f6a08ebfb813 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355160 Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org> Reviewed-by: Tomas Lundqvist <tomasl@google.com> Cr-Commit-Position: refs/heads/main@{#42516}
This commit is contained in:
parent
85c1db046f
commit
0fd67312ea
@ -89,7 +89,9 @@ AudioEncoderCng::AudioEncoderCng(AudioEncoderCngConfig&& config)
|
||||
: CreateVad(config.vad_mode)),
|
||||
cng_encoder_(new ComfortNoiseEncoder(SampleRateHz(),
|
||||
sid_frame_interval_ms_,
|
||||
num_cng_coefficients_)) {}
|
||||
num_cng_coefficients_)) {
|
||||
speech_encoder_->Reset();
|
||||
}
|
||||
|
||||
AudioEncoderCng::~AudioEncoderCng() = default;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user