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

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

Merge "DO NOT MERGE - m4v_h263: check header first before decoding a frame."...

Merge "DO NOT MERGE - m4v_h263: check header first before decoding a frame." into klp-dev am: da924b45
am: fdfad589

Change-Id: Ibfeec763c09ce978dd44d7cade7cb848b31aa528
parents fe7c2700 fdfad589
Loading
Loading
Loading
Loading
+18 −4
Original line number Diff line number Diff line
@@ -239,13 +239,27 @@ 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;
        if (PVDecodeVopHeader(
                    mHandle, &bitstream, &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 (portSettingsChanged()) {
            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);