summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Jia <wjia@google.com>2015-05-02 00:26:06 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-05-02 00:26:07 +0000
commit0247f0db93a828f0754a6d2d278cb08c6609cf26 (patch)
tree83c7a816892699eb183627255054c70d9b3eef6b
parent939270353bff5bc7497b0c77e203520b997268c9 (diff)
parent9e7ed3315298b42db485963b182a572e9ab42f9f (diff)
downloadframeworks_av-0247f0db93a828f0754a6d2d278cb08c6609cf26.zip
frameworks_av-0247f0db93a828f0754a6d2d278cb08c6609cf26.tar.gz
frameworks_av-0247f0db93a828f0754a6d2d278cb08c6609cf26.tar.bz2
Merge "mediaplayer: flush audio sink when renderer is flushed." into mnc-dev
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
index ae01cfc..6b8f99c 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
@@ -1240,6 +1240,16 @@ void NuPlayer::Renderer::onFlush(const sp<AMessage> &msg) {
mAudioSink->pause();
mAudioSink->flush();
mAudioSink->start();
+ } else {
+ mAudioSink->pause();
+ mAudioSink->flush();
+ // Call stop() to signal to the AudioSink to completely fill the
+ // internal buffer before resuming playback.
+ mAudioSink->stop();
+ if (!mPaused) {
+ mAudioSink->start();
+ }
+ mNumFramesWritten = 0;
}
} else {
flushQueue(&mVideoQueue);