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

Commit e96460a6 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Nuplayer: Handle get input/output format errors cleanly" into main

parents 6cf5c740 f7573c77
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -374,9 +374,18 @@ void NuPlayer::Decoder::onConfigure(const sp<AMessage> &format) {
    }
    rememberCodecSpecificData(format);

    // the following should work in configured state
    CHECK_EQ((status_t)OK, mCodec->getOutputFormat(&mOutputFormat));
    CHECK_EQ((status_t)OK, mCodec->getInputFormat(&mInputFormat));
    err = mCodec->getOutputFormat(&mOutputFormat);
    if (err == OK) {
        err = mCodec->getInputFormat(&mInputFormat);
    }
    if (err != OK) {
        ALOGE("Failed to get input/output format from [%s] decoder (err=%d)",
                mComponentName.c_str(), err);
        mCodec->release();
        mCodec.clear();
        handleError(err);
        return;
    }

    {
        Mutex::Autolock autolock(mStatsLock);