From 9037e1639fe2595d7640d37a6b746fa7705fbecb Mon Sep 17 00:00:00 2001 From: Chris Pearce Date: Mon, 12 May 2014 14:35:46 +1200 Subject: [PATCH] Bug 1008785 - Ensure the last video frame end time is correct on Android MP4 playback. r=kinetik --- content/media/plugins/MediaPluginReader.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/content/media/plugins/MediaPluginReader.cpp b/content/media/plugins/MediaPluginReader.cpp index 5e925286955a..88b0ce81adb4 100644 --- a/content/media/plugins/MediaPluginReader.cpp +++ b/content/media/plugins/MediaPluginReader.cpp @@ -144,9 +144,7 @@ bool MediaPluginReader::DecodeVideoFrame(bool &aKeyframeSkip, if (mLastVideoFrame) { int64_t durationUs; mPlugin->GetDuration(mPlugin, &durationUs); - if (durationUs < mLastVideoFrame->mTime) { - durationUs = 0; - } + durationUs = std::max(durationUs - mLastVideoFrame->mTime, 0); mVideoQueue.Push(VideoData::ShallowCopyUpdateDuration(mLastVideoFrame, durationUs)); mLastVideoFrame = nullptr;