| Index: media/gpu/android_video_decode_accelerator.cc
|
| diff --git a/media/gpu/android_video_decode_accelerator.cc b/media/gpu/android_video_decode_accelerator.cc
|
| index 13186b6db9340abbc63a78490a853ccc6657bd95..11dce853efe68eb625fadc9c235ab3969dc54372 100644
|
| --- a/media/gpu/android_video_decode_accelerator.cc
|
| +++ b/media/gpu/android_video_decode_accelerator.cc
|
| @@ -1219,15 +1219,14 @@ void AndroidVideoDecodeAccelerator::ResetCodecState() {
|
| // conservative approach and let the errors post.
|
| // TODO(liberato): revisit this once we sort out the error state a bit more.
|
|
|
| - // When codec is not in error state we can quickly reset (internally calls
|
| - // flush()) for JB-MR2 and beyond. Prior to JB-MR2, flush() had several bugs
|
| - // (b/8125974, b/8347958) so we must delete the MediaCodec and create a new
|
| - // one. The full reconfigure is much slower and may cause visible freezing if
|
| - // done mid-stream.
|
| + // When the codec is not in error state we can flush() for JB-MR2 and beyond.
|
| + // Prior to JB-MR2, flush() had several bugs (b/8125974, b/8347958) so we must
|
| + // delete the MediaCodec and create a new one. The full reconfigure is much
|
| + // slower and may cause visible freezing if done mid-stream.
|
| if (!did_codec_error_happen &&
|
| base::android::BuildInfo::GetInstance()->sdk_int() >= 18) {
|
| - DVLOG(3) << __FUNCTION__ << " Doing fast MediaCodec reset (flush).";
|
| - media_codec_->Reset();
|
| + DVLOG(3) << __FUNCTION__ << " Flushing MediaCodec.";
|
| + media_codec_->Flush();
|
| // Since we just flushed all the output buffers, make sure that nothing is
|
| // using them.
|
| strategy_->CodecChanged(media_codec_.get());
|
| @@ -1235,8 +1234,6 @@ void AndroidVideoDecodeAccelerator::ResetCodecState() {
|
| DVLOG(3) << __FUNCTION__
|
| << " Deleting the MediaCodec and creating a new one.";
|
| g_avda_timer.Pointer()->StopTimer(this);
|
| - // Changing the codec will also notify the strategy to forget about any
|
| - // output buffers it has currently.
|
| ConfigureMediaCodecAsynchronously();
|
| }
|
| }
|
|
|