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

Commit 387bdcda authored by Andreas Huber's avatar Andreas Huber Committed by Android Git Automerger
Browse files

am 88a995ed: Merge "Properly flush the AudioTrack/AudioSink on a seek request...

am 88a995ed: Merge "Properly flush the AudioTrack/AudioSink on a seek request and make sure that both the mp3 decoder and aac software decoders start fresh after a seek without any dependency on previously decoded content." into gingerbread

Merge commit '88a995ed' into gingerbread-plus-aosp

* commit '88a995ed':
  Properly flush the AudioTrack/AudioSink on a seek request and make sure that both the mp3 decoder and aac software decoders start fresh after a seek without any dependency on previously decoded content.
parents 0d447760 88a995ed
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -423,6 +423,12 @@ status_t AudioPlayer::seekTo(int64_t time_us) {
    mReachedEOS = false;
    mReachedEOS = false;
    mSeekTimeUs = time_us;
    mSeekTimeUs = time_us;


    if (mAudioSink != NULL) {
        mAudioSink->flush();
    } else {
        mAudioTrack->flush();
    }

    return OK;
    return OK;
}
}


+4 −0
Original line number Original line Diff line number Diff line
@@ -171,6 +171,10 @@ status_t AACDecoder::read(
            mInputBuffer->release();
            mInputBuffer->release();
            mInputBuffer = NULL;
            mInputBuffer = NULL;
        }
        }

        // Make sure that the next buffer output does not still
        // depend on fragments from the last one decoded.
        PVMP4AudioDecoderResetBuffer(mDecoderBuf);
    } else {
    } else {
        seekTimeUs = -1;
        seekTimeUs = -1;
    }
    }
+4 −0
Original line number Original line Diff line number Diff line
@@ -132,6 +132,10 @@ status_t MP3Decoder::read(
            mInputBuffer->release();
            mInputBuffer->release();
            mInputBuffer = NULL;
            mInputBuffer = NULL;
        }
        }

        // Make sure that the next buffer output does not still
        // depend on fragments from the last one decoded.
        pvmp3_InitDecoder(mConfig, mDecoderBuf);
    } else {
    } else {
        seekTimeUs = -1;
        seekTimeUs = -1;
    }
    }