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

Commit 266e8cff authored by Satish Babu Patakokila's avatar Satish Babu Patakokila Committed by Ricardo Cerqueira
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: Id783af8a84f313ea31cd5454c8163928805a7072
parent 0d44b5b2
Loading
Loading
Loading
Loading
+8 −5
Original line number Original line Diff line number Diff line
@@ -110,7 +110,7 @@ void SoftMP3::initPorts() {
void SoftMP3::initDecoder() {
void SoftMP3::initDecoder() {
    mConfig->equalizerType = flat;
    mConfig->equalizerType = flat;
    mConfig->crcEnabled = false;
    mConfig->crcEnabled = false;

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


@@ -252,11 +252,14 @@ void SoftMP3::onQueueFilled(OMX_U32 portIndex) {
            if (decoderErr != NO_ENOUGH_MAIN_DATA_ERROR
            if (decoderErr != NO_ENOUGH_MAIN_DATA_ERROR
                        && decoderErr != SIDE_INFO_ERROR) {
                        && decoderErr != SIDE_INFO_ERROR) {
                ALOGE("mp3 decoder returned error %d", decoderErr);
                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);
                    notify(OMX_EventError, OMX_ErrorUndefined, decoderErr, NULL);
                    mSignalledError = true;
                    mSignalledError = true;
                    return;
                    return;
                }
                }
            }


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