summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/AwesomePlayer.cpp
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2012-01-09 13:47:48 -0800
committerEric Laurent <elaurent@google.com>2012-01-09 13:48:25 -0800
commit86d24aa35adf82512d341d9aaebd62b36b0a0847 (patch)
tree0ddf435e065f725aebbd1a726eb1087f6e5decfb /media/libstagefright/AwesomePlayer.cpp
parent60a78ac9535878984b0777788760b9ee7465c5e6 (diff)
downloadframeworks_av-86d24aa35adf82512d341d9aaebd62b36b0a0847.zip
frameworks_av-86d24aa35adf82512d341d9aaebd62b36b0a0847.tar.gz
frameworks_av-86d24aa35adf82512d341d9aaebd62b36b0a0847.tar.bz2
stagefright: limit audio gap for looped playback
The audio gap when looping audio is mostly due to a delay requested by the audio player when executing the end of stream message. This is to allow the audio to be drained out of the pipe before actually stopping the AudioTrack. This delay is not needed when looping as the AudioTrack is not stopped. The fix consists in ignoring the requested delay when the looping flag is set in awesome player. Issue 5800981. Change-Id: Ib32d2930c53ecebc21ca8440e6e054c7e20db4a5
Diffstat (limited to 'media/libstagefright/AwesomePlayer.cpp')
-rw-r--r--media/libstagefright/AwesomePlayer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index 50c264e..bc45f83 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -1841,6 +1841,10 @@ void AwesomePlayer::postCheckAudioStatusEvent(int64_t delayUs) {
return;
}
mAudioStatusEventPending = true;
+ // Do not honor delay when looping in order to limit audio gap
+ if (mFlags & (LOOPING | AUTO_LOOPING)) {
+ delayUs = 0;
+ }
mQueue.postEventWithDelay(mCheckAudioStatusEvent, delayUs);
}