diff options
author | Andreas Huber <andih@google.com> | 2010-10-07 12:21:33 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-10-07 12:21:33 -0700 |
commit | 2eb16c2250c57a8009ab58e9aeb1606ab62bbbbc (patch) | |
tree | 9a9d97d42b7c495876a9f87d2a709926118c197c /media/libstagefright/AwesomePlayer.cpp | |
parent | fff59460a567a96ffc8d946bf6f477b4570080a1 (diff) | |
parent | a782d22f3eacd337c135feb12362934fc0adb6ca (diff) | |
download | frameworks_av-2eb16c2250c57a8009ab58e9aeb1606ab62bbbbc.zip frameworks_av-2eb16c2250c57a8009ab58e9aeb1606ab62bbbbc.tar.gz frameworks_av-2eb16c2250c57a8009ab58e9aeb1606ab62bbbbc.tar.bz2 |
am 56ee1080: am 17bc4f65: Merge "Make sure to call AudioTrack::stop() instead of AudioTrack::pause() after submitting all samples to AudioTrack to make sure those remaining samples are actually played out." into gingerbread
Merge commit '56ee1080f004110bff622e5b60c243d9cabfe120'
* commit '56ee1080f004110bff622e5b60c243d9cabfe120':
Make sure to call AudioTrack::stop() instead of AudioTrack::pause() after submitting all samples to AudioTrack to make sure those remaining samples are actually played out.
Diffstat (limited to 'media/libstagefright/AwesomePlayer.cpp')
-rw-r--r-- | media/libstagefright/AwesomePlayer.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index 31c03ad..4f5ff75 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -579,7 +579,7 @@ void AwesomePlayer::onStreamDone() { notifyListener_l( MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, mStreamDoneStatus); - pause_l(); + pause_l(true /* at eos */); mFlags |= AT_EOS; return; @@ -603,7 +603,7 @@ void AwesomePlayer::onStreamDone() { LOGV("MEDIA_PLAYBACK_COMPLETE"); notifyListener_l(MEDIA_PLAYBACK_COMPLETE); - pause_l(); + pause_l(true /* at eos */); mFlags |= AT_EOS; } @@ -752,7 +752,7 @@ status_t AwesomePlayer::pause() { return pause_l(); } -status_t AwesomePlayer::pause_l() { +status_t AwesomePlayer::pause_l(bool at_eos) { if (!(mFlags & PLAYING)) { return OK; } @@ -760,7 +760,14 @@ status_t AwesomePlayer::pause_l() { cancelPlayerEvents(true /* keepBufferingGoing */); if (mAudioPlayer != NULL) { - mAudioPlayer->pause(); + if (at_eos) { + // If we played the audio stream to completion we + // want to make sure that all samples remaining in the audio + // track's queue are played out. + mAudioPlayer->pause(true /* playPendingSamples */); + } else { + mAudioPlayer->pause(); + } } mFlags &= ~PLAYING; |