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

Commit da91578d authored by Chaithanya Krishna Bacharaju's avatar Chaithanya Krishna Bacharaju Committed by Gerrit - the friendly Code Review server
Browse files

libstagefright: Reset the decoder while performing seek

-Noise is observed when seeking to beginning of recorded AMR clip.
-While performing seek, the AMR decoder states are not being reset.
In AMR decoder, the current frame output is predicted using the states
from previous frame. If these states are not cleared, it might cause
noise when seek is performed.
-Fixed by resetting the decoder when seek is issued and port flush
completion is notified to the decoder.
Reset functions are different for AMRWB and AMRNB. Ensure to check
for mode and call appropriate reset function.

original commit -
Ibf0ebc7b154ff4866211eaf178a447f96e33341c
Ia8480b88521abc09c8b01d6052df4730a0359518

Change-Id: Ic71a014f9a87ebfe5b8520d44420716f7099f5e7
parent 0c52765e
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -435,7 +435,14 @@ void SoftAMR::onQueueFilled(OMX_U32 /* portIndex */) {
    }
}

void SoftAMR::onPortFlushCompleted(OMX_U32 /* portIndex */) {
void SoftAMR::onPortFlushCompleted(OMX_U32 portIndex) {
    ALOGE("onPortFlushCompleted portindex %d, resetting frame ",portIndex);
    if (portIndex == 0) {
        if(mMode == MODE_NARROW)
           Speech_Decode_Frame_reset(mState);
        else
           pvDecoder_AmrWb_Reset(mState, 0);
    }
}

void SoftAMR::onPortEnableCompleted(OMX_U32 portIndex, bool enabled) {