From 2dcec6ae30b50d611758f8ee492901bf2235a8dc Mon Sep 17 00:00:00 2001 From: Chaithanya Krishna Bacharaju Date: Tue, 12 May 2015 10:16:10 -0700 Subject: libstagefright: Reset AMR decoder on input port flush Fix issue of noise being observed when seeking AMR clip because the AMR decoder states were not reset. Reset decoder state on input port flush, as that is the best indication of a seek. Change-Id: Ic71a014f9a87ebfe5b8520d44420716f7099f5e7 --- media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'media/libstagefright/codecs/amrnb') diff --git a/media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp b/media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp index d1b0f76..a9723ea 100644 --- a/media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp +++ b/media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp @@ -428,7 +428,15 @@ void SoftAMR::onQueueFilled(OMX_U32 /* portIndex */) { } } -void SoftAMR::onPortFlushCompleted(OMX_U32 /* portIndex */) { +void SoftAMR::onPortFlushCompleted(OMX_U32 portIndex) { + ALOGV("onPortFlushCompleted portindex %d, resetting frame ", portIndex); + if (portIndex == 0) { + if (mMode == MODE_NARROW) { + Speech_Decode_Frame_reset(mState); + } else { + pvDecoder_AmrWb_Reset(mState, 0 /* reset_all */); + } + } } void SoftAMR::onPortEnableCompleted(OMX_U32 portIndex, bool enabled) { -- cgit v1.1