| Index: media/filters/opus_audio_decoder.cc
|
| diff --git a/media/filters/opus_audio_decoder.cc b/media/filters/opus_audio_decoder.cc
|
| index e427c0abacae566b9941bdc6632d0892d573f70f..4337b6474239623c9d440b6b1bae6faad0304b5e 100644
|
| --- a/media/filters/opus_audio_decoder.cc
|
| +++ b/media/filters/opus_audio_decoder.cc
|
| @@ -327,12 +327,21 @@ void OpusAudioDecoder::Reset(const base::Closure& closure) {
|
| reset_cb.Run();
|
| }
|
|
|
| -OpusAudioDecoder::~OpusAudioDecoder() {
|
| - // TODO(scherkus): should we require Stop() to be called? this might end up
|
| - // getting called on a random thread due to refcounting.
|
| +void OpusAudioDecoder::Stop(const base::Closure& closure) {
|
| + DCHECK(task_runner_->BelongsToCurrentThread());
|
| + base::Closure stop_cb = BindToCurrentLoop(closure);
|
| +
|
| + opus_multistream_decoder_ctl(opus_decoder_, OPUS_RESET_STATE);
|
| + ResetTimestampState();
|
| CloseDecoder();
|
| +
|
| + // TODO(rileya): Properly handle the case in which we have a pending
|
| + // |read_cb_| when Stop() or Reset()-ing.
|
| + stop_cb.Run();
|
| }
|
|
|
| +OpusAudioDecoder::~OpusAudioDecoder() {}
|
| +
|
| void OpusAudioDecoder::ReadFromDemuxerStream() {
|
| DCHECK(!read_cb_.is_null());
|
| demuxer_stream_->Read(base::Bind(&OpusAudioDecoder::BufferReady, weak_this_));
|
|
|