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

Unverified Commit 8931fa8f authored by Jiajia Cong's avatar Jiajia Cong Committed by Michael Bestas
Browse files

codec2: a workaround to solve backward compatibility issue

As framework change depends on HAL change . In those platforms only
have framework change, the empty work couldn't be handled properly.
Then the result C2_NOT_FOUND will be returned and framework will report
a fatal error to client. We have to avoid such dependency issue

CRs-Fixed: 2916108

Change-Id: I5270f5e2bd1922b84fb34364bb4cb8522ff389ec
parent 6905352f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2305,6 +2305,12 @@ bool CCodecBufferChannel::handleWork(
        ALOGV("[%s] empty work returned; omitted.", mName);
        return false; // omitted
    } else if (work->result == C2_NOT_FOUND) {
        if (work->input.flags & C2FrameData::FLAG_DROP_FRAME) {
            // NOTE: This is to solve backward compatibility issue of queueDummyWork. If no HAL fix,
            //       we will receive C2_NOT_FOUND here and then issue fatal error to MediaCodec
            ALOGV("[%s] empty work returned; omitted.", mName);
            return false; // omitted
        }
        ALOGD("[%s] flushed work; ignored.", mName);
    } else {
        // C2_OK and C2_NOT_FOUND are the only results that we accept for processing