From 5432aea4b1b107b722ddb507c610bdfc4c61c8aa Mon Sep 17 00:00:00 2001 From: Roger1 Jonsson Date: Thu, 11 Oct 2012 10:32:33 +0200 Subject: Avoid jumps to faulty position after seeks When seeking multiple times it is possible that some seeks are discarded in AwesomePlayer, which causes unwanted jumps to faulty positions. The reason is that a seek flag is reset twice in AwesomePlayer. At first when the video seek is completed and then again when the audio seek is completed. If a new seek is made after the previous video seek completed but before the previous audio seek completed, the new seek position is discarded by the previous audio seek completion. This fix makes sure that the seek flag is reset only when video has completed the seek. Change-Id: I8f8741d4cb8682345f1d1855bbad57c05f4e3c8d --- media/libstagefright/AwesomePlayer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'media/libstagefright/AwesomePlayer.cpp') diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index 130207d..aae6800 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -2096,7 +2096,10 @@ void AwesomePlayer::onCheckAudioStatus() { mSeekNotificationSent = true; } - mSeeking = NO_SEEK; + if (mVideoSource == NULL) { + // For video the mSeeking flag is always reset in finishSeekIfNecessary + mSeeking = NO_SEEK; + } notifyIfMediaStarted_l(); } -- cgit v1.1