summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-08-31 15:04:25 -0700
committerAndreas Huber <andih@google.com>2011-08-31 15:35:49 -0700
commitea8c9b1bd9cd416b51b0040763af501004110fe7 (patch)
tree4c755eb97392366bc93bb1598dfeea6238bb7a2e /media/libmediaplayerservice/nuplayer
parent49fb943db85c748fc7dd4f5ee4a461d7489fb1b0 (diff)
downloadframeworks_base-ea8c9b1bd9cd416b51b0040763af501004110fe7.zip
frameworks_base-ea8c9b1bd9cd416b51b0040763af501004110fe7.tar.gz
frameworks_base-ea8c9b1bd9cd416b51b0040763af501004110fe7.tar.bz2
Discontinuities are only signalled on streams that have been identified, i.e.
those that have a queue. This ensures that the player doesn't observe discontinuities that don't match up across streams. Also, make sure output buffers arriving from the decoder to be rendered are sent back to the decoder if we started flushing. Finally, don't parse TS packets for streams we don't support. And don't allocate memory for them. Change-Id: I708e0de4cba8110a62e4c8ceb1e5702430d5d2bb
Diffstat (limited to 'media/libmediaplayerservice/nuplayer')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayer.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
index 1f08a91..ee77f47 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
@@ -663,6 +663,19 @@ void NuPlayer::renderBuffer(bool audio, const sp<AMessage> &msg) {
sp<AMessage> reply;
CHECK(msg->findMessage("reply", &reply));
+ if (IsFlushingState(audio ? mFlushingAudio : mFlushingVideo)) {
+ // We're currently attempting to flush the decoder, in order
+ // to complete this, the decoder wants all its buffers back,
+ // so we don't want any output buffers it sent us (from before
+ // we initiated the flush) to be stuck in the renderer's queue.
+
+ LOGV("we're still flushing the %s decoder, sending its output buffer"
+ " right back.", audio ? "audio" : "video");
+
+ reply->post();
+ return;
+ }
+
sp<RefBase> obj;
CHECK(msg->findObject("buffer", &obj));