From 9e7ed3315298b42db485963b182a572e9ab42f9f Mon Sep 17 00:00:00 2001 From: Wei Jia Date: Fri, 1 May 2015 16:35:43 -0700 Subject: mediaplayer: flush audio sink when renderer is flushed. Bug: 17488729 Change-Id: Ie56018367cb6aec1749ca148e94173e6c5864b27 --- media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp index f229452..6fc48b1 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp @@ -1087,6 +1087,16 @@ void NuPlayer::Renderer::onFlush(const sp &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); -- cgit v1.1