From 5b6033771f3962bb8ea7498c4f894d1b2ac8b0fb Mon Sep 17 00:00:00 2001 From: Sotaro Ikeda Date: Thu, 20 Nov 2014 06:34:16 -0800 Subject: [PATCH] Bug 1101742 - Fix OmxDecoder::mIsVideoSeeking r= cajbir --- dom/media/omx/OmxDecoder.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/dom/media/omx/OmxDecoder.cpp b/dom/media/omx/OmxDecoder.cpp index ee5e09197c9..5fbd3160d0e 100644 --- a/dom/media/omx/OmxDecoder.cpp +++ b/dom/media/omx/OmxDecoder.cpp @@ -582,20 +582,24 @@ bool OmxDecoder::ReadVideo(VideoFrame *aFrame, int64_t aTimeUs, } // If there is no next Keyframe, jump to the previous key frame. if (err == ERROR_END_OF_STREAM && seekMode == MediaSource::ReadOptions::SEEK_NEXT_SYNC) { - seekMode = MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC; - findNextBuffer = true; - { - Mutex::Autolock autoLock(mSeekLock); - mIsVideoSeeking = true; - } - continue; + seekMode = MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC; + findNextBuffer = true; + { + Mutex::Autolock autoLock(mSeekLock); + mIsVideoSeeking = true; + } + continue; } else if (err != OK) { - ALOG("Unexpected error when seeking to %lld", aTimeUs); + ALOG("Unexpected error when seeking to %lld", aTimeUs); break; } if (mVideoBuffer->range_length() == 0) { ReleaseVideoBuffer(); - findNextBuffer = true; + findNextBuffer = true; + { + Mutex::Autolock autoLock(mSeekLock); + mIsVideoSeeking = true; + } } } aDoSeek = false;