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

Commit a67eacac authored by Venkatarama Avadhani's avatar Venkatarama Avadhani Committed by Ray Essick
Browse files

Change MPEG2 reinit Error Handling

Changing reinit handling to not notify error in case init fails.

Bug: 37237396
Test: ran poc before/after on nyc-mr2
Change-Id: I694a9d2ccee7622d9c736efac12c9ec8639911f4
parent 346941bc
Loading
Loading
Loading
Loading
+9 −14
Original line number Diff line number Diff line
@@ -80,13 +80,6 @@ SoftMPEG2::SoftMPEG2(
    // If input dump is enabled, then open create an empty file
    GENERATE_FILE_NAMES();
    CREATE_DUMP_FILE(mInFile);

    if (OK != initDecoder()) {
        ALOGE("Failed to initialize decoder");
        notify(OMX_EventError, OMX_ErrorUnsupportedSetting, 0, NULL);
        mSignalledError = true;
        return;
    }
}

SoftMPEG2::~SoftMPEG2() {
@@ -456,8 +449,6 @@ status_t SoftMPEG2::reInitDecoder() {
    if (OK != ret) {
        ALOGE("Failed to initialize decoder");
        deInitDecoder();
        notify(OMX_EventError, OMX_ErrorUnsupportedSetting, 0, NULL);
        mSignalledError = true;
        return ret;
    }
    mSignalledError = false;
@@ -565,6 +556,15 @@ void SoftMPEG2::onQueueFilled(OMX_U32 portIndex) {
        return;
    }

    if (NULL == mCodecCtx) {
        if (OK != initDecoder()) {
            ALOGE("Failed to initialize decoder");
            notify(OMX_EventError, OMX_ErrorUnsupportedSetting, 0, NULL);
            mSignalledError = true;
            return;
        }
    }

    List<BufferInfo *> &inQueue = getPortQueue(kInputPortIndex);
    List<BufferInfo *> &outQueue = getPortQueue(kOutputPortIndex);

@@ -629,9 +629,6 @@ void SoftMPEG2::onQueueFilled(OMX_U32 portIndex) {

            if (OK != reInitDecoder()) {
                ALOGE("Failed to reinitialize decoder");
                notify(OMX_EventError, OMX_ErrorUnsupportedSetting, 0, NULL);
                mSignalledError = true;
                return;
            }
            return;
        }
@@ -705,8 +702,6 @@ void SoftMPEG2::onQueueFilled(OMX_U32 portIndex) {

                if (OK != reInitDecoder()) {
                    ALOGE("Failed to reinitialize decoder");
                    notify(OMX_EventError, OMX_ErrorUnsupportedSetting, 0, NULL);
                    mSignalledError = true;
                    return;
                }