Merge "DO NOT MERGE: Fix a race condition when playing an audio-only stream and seeking before starting." into honeycomb-mr1

This commit is contained in:
Andreas Huber
2011-03-16 13:06:52 -07:00
committed by Android (Google) Code Review

View File

@@ -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...