summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-03-16 13:18:42 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-03-16 13:18:42 -0700
commit7532ae7f79d6d849faae1a9bee171c66bd534d97 (patch)
tree221dbd707a76fa3eed58e532df4eb66578a8b011 /media
parent1d8b5a5e866f75d516dd6f03424f37b1de9a3d97 (diff)
parent46956b0691b2a228237d17536fe4ad33a760c0af (diff)
downloadframeworks_base-7532ae7f79d6d849faae1a9bee171c66bd534d97.zip
frameworks_base-7532ae7f79d6d849faae1a9bee171c66bd534d97.tar.gz
frameworks_base-7532ae7f79d6d849faae1a9bee171c66bd534d97.tar.bz2
am 46956b06: Merge "DO NOT MERGE: Fix a race condition when playing an audio-only stream and seeking before starting." into honeycomb-mr1
* commit '46956b0691b2a228237d17536fe4ad33a760c0af': DO NOT MERGE: Fix a race condition when playing an audio-only stream and seeking before starting.
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/AwesomePlayer.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index 5734c7e..1f8de9f 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -750,8 +750,6 @@ status_t AwesomePlayer::play_l() {
mFlags |= PLAYING;
mFlags |= FIRST_FRAME;
- bool deferredAudioSeek = false;
-
if (mDecryptHandle != NULL) {
int64_t position;
getPosition(&position);
@@ -767,10 +765,11 @@ status_t AwesomePlayer::play_l() {
mTimeSource = mAudioPlayer;
- deferredAudioSeek = true;
-
- mWatchForAudioSeekComplete = false;
- mWatchForAudioEOS = true;
+ // If there was a seek request before we ever started,
+ // honor the request now.
+ // Make sure to do this before starting the audio player
+ // to avoid a race condition.
+ seekAudioIfNecessary_l();
}
}
@@ -808,12 +807,6 @@ status_t AwesomePlayer::play_l() {
}
}
- if (deferredAudioSeek) {
- // If there was a seek request while we were paused
- // and we're just starting up again, honor the request now.
- seekAudioIfNecessary_l();
- }
-
if (mFlags & AT_EOS) {
// Legacy behaviour, if a stream finishes playing and then
// is started again, we play from the start...