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

Commit a4a232c7 authored by Wei Jia's avatar Wei Jia Committed by android-build-merger
Browse files

Merge "m4v_h263: check header first before decoding a frame." into lmp-dev am:...

Merge "m4v_h263: check header first before decoding a frame." into lmp-dev am: 6aed93d5 am: 8772f84f am: fc97c43c am: c5726162
am: 0c259278

Change-Id: Ib17e3a67871a039b1665742c5cb6b74e931a88ec
parents ba97351e 0c259278
Loading
Loading
Loading
Loading
+19 −4
Original line number Diff line number Diff line
@@ -255,13 +255,28 @@ void SoftMPEG4::onQueueFilled(OMX_U32 /* portIndex */) {
            mSignalledError = true;
            return;
        }

        // Need to check if header contains new info, e.g., width/height, etc.
        VopHeaderInfo header_info;
        uint8_t *bitstreamTmp = bitstream;
        if (PVDecodeVopHeader(
                    mHandle, &bitstreamTmp, &timestamp, &tmp,
                    &header_info, &useExtTimestamp,
                    outHeader->pBuffer) != PV_TRUE) {
            ALOGE("failed to decode vop header.");

            notify(OMX_EventError, OMX_ErrorUndefined, 0, NULL);
            mSignalledError = true;
            return;
        }
        if (handlePortSettingsChange()) {
            return;
        }

        // The PV decoder is lying to us, sometimes it'll claim to only have
        // consumed a subset of the buffer when it clearly consumed all of it.
        // ignore whatever it says...
        if (PVDecodeVideoFrame(
                    mHandle, &bitstream, &timestamp, &tmp,
                    &useExtTimestamp,
                    outHeader->pBuffer) != PV_TRUE) {
        if (PVDecodeVopBody(mHandle, &tmp) != PV_TRUE) {
            ALOGE("failed to decode video frame.");

            notify(OMX_EventError, OMX_ErrorUndefined, 0, NULL);