summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
diff options
context:
space:
mode:
authorChong Zhang <chz@google.com>2014-10-03 01:31:21 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-10-03 01:31:22 +0000
commitaaa527fbd790d30353d15608e54b5b94625b7b6d (patch)
treebe42f2ebd1e511e641723a53601b6d3acfccec7e /media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
parentfc93499e83403d5959693efa040cb29fd6825abb (diff)
parente47d44486f0a9f9b828b01d0fbaf84f5573f0aa2 (diff)
downloadframeworks_av-aaa527fbd790d30353d15608e54b5b94625b7b6d.zip
frameworks_av-aaa527fbd790d30353d15608e54b5b94625b7b6d.tar.gz
frameworks_av-aaa527fbd790d30353d15608e54b5b94625b7b6d.tar.bz2
Merge "send available codec buffer count with codec notification" into lmp-dev
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
index f131b1f..27f6131 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
@@ -622,13 +622,21 @@ void NuPlayer::Decoder::onMessageReceived(const sp<AMessage> &msg) {
case kWhatCodecNotify:
{
if (!isStaleReply(msg)) {
- if (!mPaused) {
- while (handleAnInputBuffer()) {
- }
+ int32_t numInput, numOutput;
+
+ if (!msg->findInt32("input-buffers", &numInput)) {
+ numInput = INT32_MAX;
}
- while (handleAnOutputBuffer()) {
+ if (!msg->findInt32("output-buffers", &numOutput)) {
+ numOutput = INT32_MAX;
}
+
+ if (!mPaused) {
+ while (numInput-- > 0 && handleAnInputBuffer()) {}
+ }
+
+ while (numOutput-- > 0 && handleAnOutputBuffer()) {}
}
requestCodecNotification();