Chromium Code Reviews| Index: media/filters/ffmpeg_audio_decoder.cc |
| diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc |
| index a0e5889eff11aca7e6c84c6bdbf26080ca2fd8c0..8de9f962a8f2d7d8c8a6940654667759259d31f9 100644 |
| --- a/media/filters/ffmpeg_audio_decoder.cc |
| +++ b/media/filters/ffmpeg_audio_decoder.cc |
| @@ -155,12 +155,20 @@ void FFmpegAudioDecoder::Reset(const base::Closure& closure) { |
| reset_cb.Run(); |
| } |
| -FFmpegAudioDecoder::~FFmpegAudioDecoder() { |
| - // TODO(scherkus): should we require Stop() to be called? this might end up |
| - // getting called on a random thread due to refcounting. |
| +void FFmpegAudioDecoder::Stop(const base::Closure& closure) { |
| + DCHECK(task_runner_->BelongsToCurrentThread()); |
| + base::Closure stop_cb = BindToCurrentLoop(closure); |
| + |
| + avcodec_flush_buffers(codec_context_.get()); |
|
DaleCurtis
2014/01/08 00:30:54
What made you add this? We don't make a similar c
rileya (GONE FROM CHROMIUM)
2014/01/08 21:05:50
I'm not sure actually I think I saw it done in Res
|
| + ResetTimestampState(); |
| + queued_audio_.clear(); |
| ReleaseFFmpegResources(); |
| + |
| + stop_cb.Run(); |
|
xhwang
2014/01/08 01:33:37
Here and in Reset(), what if we have |read_cb_| pe
rileya (GONE FROM CHROMIUM)
2014/01/08 21:05:50
I'd wondered about this, added a TODO.
|
| } |
| +FFmpegAudioDecoder::~FFmpegAudioDecoder() {} |
| + |
| int FFmpegAudioDecoder::GetAudioBuffer(AVCodecContext* codec, |
| AVFrame* frame, |
| int flags) { |