summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.cpp
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2015-03-12 20:32:39 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-03-12 20:32:40 +0000
commit3cb7e0dcc2e915280cb9a5121def8b5277d8a6e6 (patch)
tree281f392a8018d7398667b3cf390ce25438bb93e6 /media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.cpp
parent5c9054bc6efc080b265e028f2ebb1abd2a2e3953 (diff)
parent66704af4d82c2b6303609b29402641f861fdcb19 (diff)
downloadframeworks_av-3cb7e0dcc2e915280cb9a5121def8b5277d8a6e6.zip
frameworks_av-3cb7e0dcc2e915280cb9a5121def8b5277d8a6e6.tar.gz
frameworks_av-3cb7e0dcc2e915280cb9a5121def8b5277d8a6e6.tar.bz2
Merge "NuPlayer: play out pending frames on discontinuity"
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.cpp')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.cpp
index 479eba1..29b4c26 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.cpp
@@ -247,7 +247,7 @@ status_t NuPlayer::DecoderPassThrough::fetchInputData(sp<AMessage> &reply) {
}
if (timeChange) {
- onFlush(false /* notifyComplete */);
+ doFlush(false /* notifyComplete */);
err = OK;
} else if (formatChange) {
// do seamless format change
@@ -364,7 +364,7 @@ void NuPlayer::DecoderPassThrough::onResume(bool notifyComplete) {
}
}
-void NuPlayer::DecoderPassThrough::onFlush(bool notifyComplete) {
+void NuPlayer::DecoderPassThrough::doFlush(bool notifyComplete) {
++mBufferGeneration;
mSkipRenderingUntilMediaTimeUs = -1;
mPendingAudioAccessUnit.clear();
@@ -376,18 +376,21 @@ void NuPlayer::DecoderPassThrough::onFlush(bool notifyComplete) {
mRenderer->signalTimeDiscontinuity();
}
- if (notifyComplete) {
- mPaused = true;
- sp<AMessage> notify = mNotify->dup();
- notify->setInt32("what", kWhatFlushCompleted);
- notify->post();
- }
-
mPendingBuffersToDrain = 0;
mCachedBytes = 0;
mReachedEOS = false;
}
+void NuPlayer::DecoderPassThrough::onFlush() {
+ doFlush(true /* notifyComplete */);
+
+ mPaused = true;
+ sp<AMessage> notify = mNotify->dup();
+ notify->setInt32("what", kWhatFlushCompleted);
+ notify->post();
+
+}
+
void NuPlayer::DecoderPassThrough::onShutdown(bool notifyComplete) {
++mBufferGeneration;
mSkipRenderingUntilMediaTimeUs = -1;