diff options
author | Leena Winterrowd <lenhardw@codeaurora.org> | 2014-09-24 14:49:17 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:24:22 -0600 |
commit | b47468e6057942ee9ae5cee1e2b02e2d30cbe30a (patch) | |
tree | 1a9db97edfd8ba53002a23ee40186b8c07e84f34 /media/libstagefright/MPEG4Writer.cpp | |
parent | 4e8db62960854ca954f593b565ce225ca3cc18e4 (diff) | |
download | frameworks_av-b47468e6057942ee9ae5cee1e2b02e2d30cbe30a.zip frameworks_av-b47468e6057942ee9ae5cee1e2b02e2d30cbe30a.tar.gz frameworks_av-b47468e6057942ee9ae5cee1e2b02e2d30cbe30a.tar.bz2 |
libstagefright: Allow multi-byte CSD sizes for non-m4v clips
As per ISO/IEC 14496-15, there is no explicit limit on the size of
codec-specific-data for AVC clips. Only mpeg4 video requires that
CSD size must fit within a single byte. Make the assertion enforcing
this condition specific to m4v content.
CRs-Fixed: 724526
Change-Id: Id006030ac65d5ec0bf285c040e4c536039f9489b
Diffstat (limited to 'media/libstagefright/MPEG4Writer.cpp')
-rw-r--r-- | media/libstagefright/MPEG4Writer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp index df37ea8..ed22ade 100644 --- a/media/libstagefright/MPEG4Writer.cpp +++ b/media/libstagefright/MPEG4Writer.cpp @@ -2811,8 +2811,6 @@ void MPEG4Writer::Track::writeVideoFourCCBox() { mOwner->writeInt16(0x18); // depth mOwner->writeInt16(-1); // predefined - CHECK_LT(23 + mCodecSpecificDataSize, 128); - if (!strcasecmp(MEDIA_MIMETYPE_VIDEO_MPEG4, mime)) { writeMp4vEsdsBox(); } else if (!strcasecmp(MEDIA_MIMETYPE_VIDEO_H263, mime)) { @@ -2906,6 +2904,9 @@ void MPEG4Writer::Track::writeMp4vEsdsBox() { CHECK_GT(mCodecSpecificDataSize, 0); mOwner->beginBox("esds"); + // Make sure all sizes encode to a single byte. + CHECK_LT(mCodecSpecificDataSize + 23, 128); + mOwner->writeInt32(0); // version=0, flags=0 mOwner->writeInt8(0x03); // ES_DescrTag |