Bug 1244639: P2. Don't clamp audio time to seek time if there's no video track. r=cpearce

This remove the need for working around the MP3 decoder returning decoded frames in the future.
This commit is contained in:
Jean-Yves Avenard 2016-02-03 11:46:59 +11:00
parent 5ed283f651
commit 5f96837fbb

View File

@ -2099,11 +2099,9 @@ MediaDecoderStateMachine::SeekCompleted()
// seekTime is bounded in suitable duration. See Bug 1112438.
int64_t audioStart = audio ? audio->mTime : seekTime;
// We only pin the seek time to the video start time if the video frame
// contains the seek time. We also perform this operation if there's no
// video in order to get around bug 1244639.
if (!video || (video->mTime <= seekTime && video->GetEndTime() > seekTime)) {
int64_t videoStart = video ? video->mTime : seekTime;
newCurrentTime = std::min(audioStart, videoStart);
// contains the seek time.
if (video && video->mTime <= seekTime && video->GetEndTime() > seekTime) {
newCurrentTime = std::min(audioStart, video->mTime);
} else {
newCurrentTime = audioStart;
}