From d5dee706a6f0a0b5a4a65e8e128131f06d572e6b Mon Sep 17 00:00:00 2001 From: Amit Shekhar Date: Tue, 8 Dec 2015 20:41:24 -0800 Subject: frameworks/av: fix channelmask and source format for pcm files -Update channel mask from channel count if parser reports channel mask to be 0 -Update source format for each buffer by extending call to setPcmFormat when aggregation is not done Change-Id: I1f4ce07e3e784d85e63be03a69ac1395bfa913e2 CRs-Fixed: 948222 --- media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.cpp | 1 + media/libstagefright/Utils.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.cpp index 0b50d0d..6bed918 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.cpp @@ -224,6 +224,7 @@ sp NuPlayer::DecoderPassThrough::aggregateBuffer( } else { // decided not to aggregate aggregate = accessUnit; + setPcmFormat(aggregate->meta()); } return aggregate; diff --git a/media/libstagefright/Utils.cpp b/media/libstagefright/Utils.cpp index e9d585f..592510b 100644 --- a/media/libstagefright/Utils.cpp +++ b/media/libstagefright/Utils.cpp @@ -893,7 +893,7 @@ bool canOffloadStream(const sp& meta, bool hasVideo, info.sample_rate = srate; int32_t cmask = 0; - if (!meta->findInt32(kKeyChannelMask, &cmask)) { + if (!meta->findInt32(kKeyChannelMask, &cmask) || 0 == cmask) { ALOGV("track of type '%s' does not publish channel mask", mime); // Try a channel count instead -- cgit v1.1