From 2aa016c2d02857629ece0aaec742c8c5ac211a8c Mon Sep 17 00:00:00 2001 From: Mingming Yin Date: Mon, 8 Sep 2014 17:09:56 -0700 Subject: 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 --- media/libstagefright/codecs/mp3dec/SoftMP3.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'media') diff --git a/media/libstagefright/codecs/mp3dec/SoftMP3.cpp b/media/libstagefright/codecs/mp3dec/SoftMP3.cpp index f743b1c..aeaea81 100644 --- a/media/libstagefright/codecs/mp3dec/SoftMP3.cpp +++ b/media/libstagefright/codecs/mp3dec/SoftMP3.cpp @@ -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,10 +259,13 @@ void SoftMP3::onQueueFilled(OMX_U32 /* portIndex */) { if (decoderErr != NO_ENOUGH_MAIN_DATA_ERROR && decoderErr != SIDE_INFO_ERROR) { ALOGE("mp3 decoder returned error %d", decoderErr); - - notify(OMX_EventError, OMX_ErrorUndefined, decoderErr, NULL); - mSignalledError = true; - return; + 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) { -- cgit v1.1