Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 95b73962 authored by Leena Winterrowd's avatar Leena Winterrowd Committed by Linux Build Service Account
Browse files

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
parent 5353a502
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -2965,8 +2965,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)) {
@@ -3088,6 +3086,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