Skip to content

Commit 577d6cc

Browse files
author
Eric Laurent
committed
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
1 parent 7944704 commit 577d6cc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

media/libstagefright/AwesomePlayer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1841,6 +1841,10 @@ void AwesomePlayer::postCheckAudioStatusEvent(int64_t delayUs) {
18411841
return;
18421842
}
18431843
mAudioStatusEventPending = true;
1844+
// Do not honor delay when looping in order to limit audio gap
1845+
if (mFlags & (LOOPING | AUTO_LOOPING)) {
1846+
delayUs = 0;
1847+
}
18441848
mQueue.postEventWithDelay(mCheckAudioStatusEvent, delayUs);
18451849
}
18461850

0 commit comments

Comments
 (0)