summaryrefslogtreecommitdiffstats
path: root/media/libstagefright
diff options
context:
space:
mode:
authorDaniel Bonnevier <daniel.bonnevier@sonymobile.com>2014-02-11 10:34:43 +0100
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2015-04-15 01:01:05 +0000
commitebada74ec20c6bd46e81d2f4c160ac176c10784d (patch)
treecb7129e3086cad601bb9e78fe4e2aea613c92e6e /media/libstagefright
parent0958e926fef85d7e1e0eb08f330ff46218b72822 (diff)
downloadframeworks_av-ebada74ec20c6bd46e81d2f4c160ac176c10784d.zip
frameworks_av-ebada74ec20c6bd46e81d2f4c160ac176c10784d.tar.gz
frameworks_av-ebada74ec20c6bd46e81d2f4c160ac176c10784d.tar.bz2
MPEG4Writer: Set the correct audio bit rate for camera recorded content
Remove the hard coded value for bit rate. Use the audio bit rate from the stream format, if it is specified, otherwise default to 96kpbs. Change-Id: Ib643c79bbdddaafb3dc703448645606267f7ca4d
Diffstat (limited to 'media/libstagefright')
-rw-r--r--media/libstagefright/MPEG4Writer.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp
index 9f20b1d..91d9db5 100644
--- a/media/libstagefright/MPEG4Writer.cpp
+++ b/media/libstagefright/MPEG4Writer.cpp
@@ -2800,8 +2800,10 @@ void MPEG4Writer::Track::writeMp4aEsdsBox() {
mOwner->writeInt16(0x03); // XXX
mOwner->writeInt8(0x00); // buffer size 24-bit
- mOwner->writeInt32(96000); // max bit rate
- mOwner->writeInt32(96000); // avg bit rate
+ int32_t bitRate;
+ bool success = mMeta->findInt32(kKeyBitRate, &bitRate);
+ mOwner->writeInt32(success ? bitRate : 96000); // max bit rate
+ mOwner->writeInt32(success ? bitRate : 96000); // avg bit rate
mOwner->writeInt8(0x05); // DecoderSpecificInfoTag
mOwner->writeInt8(mCodecSpecificDataSize);