summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Rydgren <erik.rydgren@sonyericsson.com>2011-09-19 10:38:10 +0200
committerHenrik Baard <henrik.baard@sonymobile.com>2012-11-19 09:22:47 +0100
commit8af5fe5a2431522a7d30bc546dcd31c0c64db70c (patch)
tree0b99ecf940acc19dbe13036416000b900ea0681d
parentda33d66e68791d0bfeccebc8253a59467b5ef670 (diff)
Use default values when MPEG4 audio config parsing fails.
MPEG4 audio packets may be multiplexed using the so called LATM (Low Overhead Audio Transport Multiplex) scheme. LATM parsing was recently introduced in Stagefright and it has caused issues in cases when the LATM config element cannot be parsed correctly. The main problem occurrs when the AudioSpecificConfig part of the config element contains more information than what is expected, causing the frameLengthType parameter to get the wrong value. This fix introduces default values of some config parameters that are used in case config parsing fails. Change-Id: I3cb35df76826f95ca0831dc08c2a1e7c6c2c586d
-rw-r--r--media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp b/media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp
index f9a44f02..aa8ffc65 100644
--- a/media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp
+++ b/media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp
@@ -311,9 +311,7 @@ static status_t parseStreamMuxConfig(
case 2:
{
- // reserved
- TRESPASS();
- break;
+ return ERROR_UNSUPPORTED;
}
case 3:
@@ -460,6 +458,15 @@ AMPEG4AudioAssembler::AMPEG4AudioAssembler(
&mFixedFrameLength,
&mOtherDataPresent, &mOtherDataLenBits);
+ if (err == ERROR_UNSUPPORTED) {
+ ALOGW("Failed to parse stream mux config, using default values for playback.");
+ mMuxConfigPresent = false;
+ mNumSubFrames = 0;
+ mFrameLengthType = 0;
+ mOtherDataPresent = false;
+ mOtherDataLenBits = 0;
+ return;
+ }
CHECK_EQ(err, (status_t)NO_ERROR);
}