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

Commit 4471e47e authored by Andreas Huber's avatar Andreas Huber
Browse files

Properly signal an error if codec configuration goes wrong.

previously any error signaled by setupXXX inside ACodec::configureCodec
would be overwritten with the result of setMinBufferSize at the end
of the function.

Change-Id: Id4beb571ca52ea4646239d0af006e09ce1130268
related-to-bug: 7542181
parent 78b012f5
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -937,7 +937,8 @@ status_t ACodec::configureCodec(
            }

            err = setupAACCodec(
                    encoder, numChannels, sampleRate, bitRate, aacProfile, isADTS != 0);
                    encoder, numChannels, sampleRate, bitRate, aacProfile,
                    isADTS != 0);
        }
    } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AMR_NB)) {
        err = setupAMRCodec(encoder, false /* isWAMR */, bitRate);
@@ -986,6 +987,10 @@ status_t ACodec::configureCodec(
        }
    }

    if (err != OK) {
        return err;
    }

    if (!msg->findInt32("encoder-delay", &mEncoderDelay)) {
        mEncoderDelay = 0;
    }