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

Commit 65959d34 authored by Wonsik Kim's avatar Wonsik Kim
Browse files

mpeg2ts: more error tolerance

Be more tolerant with corrupt packet. Instead of reporting EOS,
simply discard the damaged packet and continue.

Bug: 21764375

Change-Id: Ibfd112db884732a082371c1abbd047077d1bf57e
parent ca097142
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -694,7 +694,8 @@ status_t ATSParser::Stream::parse(
            status_t err = flush(event);

            if (err != OK) {
                return err;
                ALOGW("Error (%08x) happened while flushing; we simply discard "
                      "the PES packet and continue.", err);
            }
        }

@@ -996,10 +997,6 @@ status_t ATSParser::Stream::parsePES(ABitReader *br, SyncEvent *event) {
                return ERROR_MALFORMED;
            }

            if (br->numBitsLeft() < dataLength * 8) {
                return ERROR_MALFORMED;
            }

            onPayloadData(
                    PTS_DTS_flags, PTS, DTS, br->data(), dataLength, event);