summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/rtsp
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
commita45a600d69a5d8ab99eeb7e0dfa58c3cb99a2e61 (patch)
tree3ea3d973b2147245f54b98e378b08a922a181725 /media/libstagefright/rtsp
parentf42cde8ede088529c231de6a7aee7f043a7fcd09 (diff)
downloadframeworks_av-a45a600d69a5d8ab99eeb7e0dfa58c3cb99a2e61.zip
frameworks_av-a45a600d69a5d8ab99eeb7e0dfa58c3cb99a2e61.tar.gz
frameworks_av-a45a600d69a5d8ab99eeb7e0dfa58c3cb99a2e61.tar.bz2
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
Diffstat (limited to 'media/libstagefright/rtsp')
-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 f9a44f0..aa8ffc6 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);
}