summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOscar Rydhé <oscar.rydhe@sonymobile.com>2015-01-30 12:38:03 +0100
committerSteve Kondik <steve@cyngn.com>2015-01-31 23:27:18 -0800
commit33a4c907402dc92bb9befff0609689b8783a71c9 (patch)
tree0ad56684a670e21d00b5f9c6adbd36f45f8f456b
parent3aad113f6c4f5f282e460dcfa3f2dcdd073218b7 (diff)
downloadframeworks_av-33a4c907402dc92bb9befff0609689b8783a71c9.tar.gz
frameworks_av-33a4c907402dc92bb9befff0609689b8783a71c9.tar.bz2
frameworks_av-33a4c907402dc92bb9befff0609689b8783a71c9.zip
Flush the audio sink if NuPlayerRenderer is paused during a flush
If the NuPlayerRenderer is paused when the audio is flushed, some audio will still be in the audio sink buffer. It will be played when the sink is resumed. If the renderer is flushed because of a seek, the old audio will be heard before the audio from the new position is played. Change-Id: I016ea352903104ba1bc5f5586aa46012c52427c1
-rwxr-xr-xmedia/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
index f2ec3e40d5..402a19fef7 100755
--- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
@@ -1123,6 +1123,13 @@ void NuPlayer::Renderer::onFlush(const sp<AMessage> &msg) {
mAudioSink->flush();
mAudioSink->start();
}
+
+ if (mPaused) {
+ mAudioSink->flush();
+ mAnchorTimeMediaUs = -1;
+ mAnchorTimeRealUs = -1;
+ mNumFramesWritten = 0;
+ }
} else {
flushQueue(&mVideoQueue);