diff options
author | Weiyin Jiang <wjiang@codeaurora.org> | 2016-01-06 15:49:06 +0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-01-18 23:52:20 -0800 |
commit | 4486f97b6652b6b111a809827355b6ce5bf9c21e (patch) | |
tree | 7412426eceb35921e0da018b056a6e6a4587f8b7 /media/libmediaplayerservice | |
parent | 9dae27c03dd73ca23c6aa778ed1423e4e133eb48 (diff) | |
download | frameworks_av-4486f97b6652b6b111a809827355b6ce5bf9c21e.zip frameworks_av-4486f97b6652b6b111a809827355b6ce5bf9c21e.tar.gz frameworks_av-4486f97b6652b6b111a809827355b6ce5bf9c21e.tar.bz2 |
nuplayer: looping playback only if it was running
Audio buffer filling in renderer is still happening, though pause was
issued. As a result, EOS was reported irrespective of renderer state.
If nuplayer driver receives playback complete after stopped, it will
again be activated, which appears stop is not taking effect.
Add a check for driver state to allow looping only if it was in running
state.
Change-Id: Ic9f8eac635a774cd805b3978fab640d73ae35744
CRs-Fixed: 958311
Diffstat (limited to 'media/libmediaplayerservice')
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp index 7c71e4e..4383fce 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp @@ -750,12 +750,19 @@ void NuPlayerDriver::notifyListener_l( } } if (mLooping || mAutoLoop) { - mPlayer->seekToAsync(0); - if (mAudioSink != NULL) { - // The renderer has stopped the sink at the end in order to play out - // the last little bit of audio. If we're looping, we need to restart it. - mAudioSink->start(); + if (mState == STATE_RUNNING) { + mPlayer->seekToAsync(0); + if (mAudioSink != NULL) { + // The renderer has stopped the sink at the end in order to play out + // the last little bit of audio. If we're looping, we need to restart it. + mAudioSink->start(); + } + } else { + mPlayer->pause(); + mState = STATE_PAUSED; + mAtEOS = true; } + // don't send completion event when looping return; } |