diff options
| author | 2011-08-18 15:14:36 -0700 | |
|---|---|---|
| committer | 2011-08-18 15:14:36 -0700 | |
| commit | 0bf049c63584e3e1b7e1c079b39fd6744705fbc7 (patch) | |
| tree | dd7dfad3905ae6b9400599794369bc22f2a9e452 | |
| parent | 9a20fa54c9ba4bd19f2afd6e8cc6e9954e7cb739 (diff) | |
| parent | 3c578f2d6ad0cd7a31e2f947f6bb41d05c15c1f2 (diff) | |
Merge "When switching surface, do not set mSeekNotificationSent as true, because there could be a previous uncompleted seeking which needs to send back MEDIA_SEEK_COMPLETE message. If we set mSeekNotificationSent as true here, then mediaplayer.cpp will be waiting for message MEDIA_SEEK_COMPLETE. The getCurrentPosition() will always return the seek time before MEDIA_SEEK_COMPLETE being received by mediaplayer.cpp. Fix for bug 5181272."
| -rw-r--r-- | media/libstagefright/AwesomePlayer.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index 8b23da7ba09a..f2673b33a867 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -549,7 +549,7 @@ void AwesomePlayer::reset_l() { mVideoTimeUs = 0; mSeeking = NO_SEEK; - mSeekNotificationSent = false; + mSeekNotificationSent = true; mSeekTimeUs = 0; mUri.setTo(""); @@ -1210,7 +1210,6 @@ void AwesomePlayer::setNativeWindow_l(const sp<ANativeWindow> &native) { if (mLastVideoTimeUs >= 0) { mSeeking = SEEK; - mSeekNotificationSent = true; mSeekTimeUs = mLastVideoTimeUs; modifyFlags((AT_EOS | AUDIO_AT_EOS | VIDEO_AT_EOS), CLEAR); } @@ -1311,8 +1310,10 @@ void AwesomePlayer::OnRTSPSeekDoneWrapper(void *cookie) { } void AwesomePlayer::onRTSPSeekDone() { - notifyListener_l(MEDIA_SEEK_COMPLETE); - mSeekNotificationSent = true; + if (!mSeekNotificationSent) { + notifyListener_l(MEDIA_SEEK_COMPLETE); + mSeekNotificationSent = true; + } } status_t AwesomePlayer::seekTo_l(int64_t timeUs) { |