diff options
author | Chaithanya Krishna Bacharaju <chaithan@codeaurora.org> | 2015-05-12 10:16:10 -0700 |
---|---|---|
committer | Andy Hung <hunga@google.com> | 2015-05-28 09:41:54 -0700 |
commit | 2dcec6ae30b50d611758f8ee492901bf2235a8dc (patch) | |
tree | cc84f6b21ca48bd676c3cc1b0a41ead7cf4dad4d /media/libstagefright/codecs | |
parent | 0a62c1948cede8f99eaed1ba55f4880380a4f3ee (diff) | |
download | frameworks_av-2dcec6ae30b50d611758f8ee492901bf2235a8dc.zip frameworks_av-2dcec6ae30b50d611758f8ee492901bf2235a8dc.tar.gz frameworks_av-2dcec6ae30b50d611758f8ee492901bf2235a8dc.tar.bz2 |
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
Diffstat (limited to 'media/libstagefright/codecs')
-rw-r--r-- | media/libstagefright/codecs/amrnb/dec/SoftAMR.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
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) { |