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
This commit is contained in:
committed by
Android (Google) Code Review
commit
88a995edcf
@@ -423,6 +423,12 @@ status_t AudioPlayer::seekTo(int64_t time_us) {
|
||||
mReachedEOS = false;
|
||||
mSeekTimeUs = time_us;
|
||||
|
||||
if (mAudioSink != NULL) {
|
||||
mAudioSink->flush();
|
||||
} else {
|
||||
mAudioTrack->flush();
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -171,6 +171,10 @@ status_t AACDecoder::read(
|
||||
mInputBuffer->release();
|
||||
mInputBuffer = NULL;
|
||||
}
|
||||
|
||||
// Make sure that the next buffer output does not still
|
||||
// depend on fragments from the last one decoded.
|
||||
PVMP4AudioDecoderResetBuffer(mDecoderBuf);
|
||||
} else {
|
||||
seekTimeUs = -1;
|
||||
}
|
||||
|
||||
@@ -132,6 +132,10 @@ status_t MP3Decoder::read(
|
||||
mInputBuffer->release();
|
||||
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 {
|
||||
seekTimeUs = -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user