summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2013-10-01 16:36:52 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-10-01 16:36:52 +0000
commit353fb9bf940ee34a3885bc85ec7891228e958a4b (patch)
tree10970a60eeeef1af0170cab7bf0937a465851c21 /media
parent5fd39f777d54368a93fc9d8a6a24da0239d41fcf (diff)
parent6218fdc2bef7b9c912bc4d132c12ee43b7b2dd37 (diff)
downloadframeworks_av-353fb9bf940ee34a3885bc85ec7891228e958a4b.zip
frameworks_av-353fb9bf940ee34a3885bc85ec7891228e958a4b.tar.gz
frameworks_av-353fb9bf940ee34a3885bc85ec7891228e958a4b.tar.bz2
Merge "MediaTimeProvider support fixes" into klp-dev
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/AwesomePlayer.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index 3b516af..e7cfc78 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -1413,8 +1413,10 @@ status_t AwesomePlayer::seekTo_l(int64_t timeUs) {
mSeekTimeUs = timeUs;
modifyFlags((AT_EOS | AUDIO_AT_EOS | VIDEO_AT_EOS), CLEAR);
- notifyListener_l(MEDIA_PAUSED);
- mMediaRenderingStartGeneration = ++mStartGeneration;
+ if (mFlags & PLAYING) {
+ notifyListener_l(MEDIA_PAUSED);
+ mMediaRenderingStartGeneration = ++mStartGeneration;
+ }
seekAudioIfNecessary_l();
@@ -1659,6 +1661,16 @@ void AwesomePlayer::finishSeekIfNecessary(int64_t videoTimeUs) {
return;
}
+ // If we paused, then seeked, then resumed, it is possible that we have
+ // signaled SEEK_COMPLETE at a copmletely different media time than where
+ // we are now resuming. Signal new position to media time provider.
+ // Cannot signal another SEEK_COMPLETE, as existing clients may not expect
+ // multiple SEEK_COMPLETE responses to a single seek() request.
+ if (mSeekNotificationSent && abs(mSeekTimeUs - videoTimeUs) > 10000) {
+ // notify if we are resuming more than 10ms away from desired seek time
+ notifyListener_l(MEDIA_SKIPPED);
+ }
+
if (mAudioPlayer != NULL) {
ALOGV("seeking audio to %lld us (%.2f secs).", videoTimeUs, videoTimeUs / 1E6);
@@ -1930,7 +1942,9 @@ void AwesomePlayer::onVideoEvent() {
notifyListener_l(MEDIA_INFO, MEDIA_INFO_RENDERING_START);
}
- notifyIfMediaStarted_l();
+ if (mFlags & PLAYING) {
+ notifyIfMediaStarted_l();
+ }
}
mVideoBuffer->release();