summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice
diff options
context:
space:
mode:
authorPhil Burk <philburk@google.com>2014-09-18 22:37:13 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-09-18 22:37:13 +0000
commitc0651e858ae4ef4c9a2df2e4506b4093b6666ae9 (patch)
treed40713191961b4d32299ac3ef68747969659ac01 /media/libmediaplayerservice
parent6aadfce1d8c972faad7f4437dcd88d8cd3557611 (diff)
parent33b51b07ca90cc3b48e86598f7e82f93e440fe02 (diff)
downloadframeworks_av-c0651e858ae4ef4c9a2df2e4506b4093b6666ae9.zip
frameworks_av-c0651e858ae4ef4c9a2df2e4506b4093b6666ae9.tar.gz
frameworks_av-c0651e858ae4ef4c9a2df2e4506b4093b6666ae9.tar.bz2
Merge "mediaplayer: fix buffer aggregation when video has offloaded audio" into lmp-dev
Diffstat (limited to 'media/libmediaplayerservice')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayer.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
index 5321deb..cdbea9f 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
@@ -1270,8 +1270,8 @@ status_t NuPlayer::feedDecoderInputData(bool audio, const sp<AMessage> &msg) {
// Aggregate smaller buffers into a larger buffer.
// The goal is to reduce power consumption.
- // Unfortunately this does not work with the software AAC decoder.
- bool doBufferAggregation = (audio && mOffloadAudio);;
+ // Note this will not work if the decoder requires one frame per buffer.
+ bool doBufferAggregation = (audio && mOffloadAudio);
bool needMoreData = false;
bool dropAccessUnit;
@@ -1291,7 +1291,7 @@ status_t NuPlayer::feedDecoderInputData(bool audio, const sp<AMessage> &msg) {
return err;
} else if (err != OK) {
if (err == INFO_DISCONTINUITY) {
- if (mAggregateBuffer != NULL) {
+ if (doBufferAggregation && (mAggregateBuffer != NULL)) {
// We already have some data so save this for later.
mPendingAudioErr = err;
mPendingAudioAccessUnit = accessUnit;
@@ -1414,7 +1414,7 @@ status_t NuPlayer::feedDecoderInputData(bool audio, const sp<AMessage> &msg) {
mAggregateBuffer->setRange(0, 0); // start empty
}
- if (mAggregateBuffer != NULL) {
+ if (doBufferAggregation && (mAggregateBuffer != NULL)) {
int64_t timeUs;
int64_t dummy;
bool smallTimestampValid = accessUnit->meta()->findInt64("timeUs", &timeUs);
@@ -1463,7 +1463,7 @@ status_t NuPlayer::feedDecoderInputData(bool audio, const sp<AMessage> &msg) {
mCCDecoder->decode(accessUnit);
}
- if (mAggregateBuffer != NULL) {
+ if (doBufferAggregation && (mAggregateBuffer != NULL)) {
ALOGV("feedDecoderInputData() reply with aggregated buffer, %zu",
mAggregateBuffer->size());
reply->setBuffer("buffer", mAggregateBuffer);