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

Commit 7e336b2b authored by Mingming Yin's avatar Mingming Yin Committed by Linux Build Service Account
Browse files

stagefright: Fix to play a specific Mp4 clip due to SYNCH_LOST_ERROR.

- Unable to play a Specific Mp4 clip.
- Mp3 playback is stopped if the Decoder errors out with SYNCH_LOST_ERROR.
- Ignore the frame with SYNCH_LOST_ERROR and play silence instead.

Change-Id: I6b94a83cf89e8bc6792d8ee3804042d629aa505b
parent 6575313c
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ void SoftMP3::initPorts() {
void SoftMP3::initDecoder() {
    mConfig->equalizerType = flat;
    mConfig->crcEnabled = false;

    mConfig->samplingRate = mSamplingRate;
    uint32_t memRequirements = pvmp3_decoderMemRequirements();
    mDecoderBuf = malloc(memRequirements);

@@ -259,11 +259,14 @@ void SoftMP3::onQueueFilled(OMX_U32 /* portIndex */) {
            if (decoderErr != NO_ENOUGH_MAIN_DATA_ERROR
                        && decoderErr != SIDE_INFO_ERROR) {
                ALOGE("mp3 decoder returned error %d", decoderErr);

                if(decoderErr == SYNCH_LOST_ERROR) {
                    mConfig->outputFrameSize = kOutputBufferSize / sizeof(int16_t);
                } else {
                    notify(OMX_EventError, OMX_ErrorUndefined, decoderErr, NULL);
                    mSignalledError = true;
                    return;
                }
            }

            if (mConfig->outputFrameSize == 0) {
                mConfig->outputFrameSize = kOutputBufferSize / sizeof(int16_t);