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 '88a995edcf3c371845cb32aed8bcddb7509bf875' into gingerbread-plus-aosp * commit '88a995edcf3c371845cb32aed8bcddb7509bf875': 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.
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user