зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1112438 - Make newCurrentFrameTime more accurate while seeking by checking audio & video timestamp boundary in addition. r=cpearce
This commit is contained in:
Родитель
6e9087fc50
Коммит
cbe28e8d8f
|
@ -2592,7 +2592,16 @@ MediaDecoderStateMachine::SeekCompleted()
|
|||
newCurrentTime = mAudioStartTime = seekTime;
|
||||
} else if (HasAudio()) {
|
||||
AudioData* audio = AudioQueue().PeekFront();
|
||||
newCurrentTime = mAudioStartTime = audio ? audio->mTime : seekTime;
|
||||
// Though we adjust the newCurrentTime in audio-based, and supplemented
|
||||
// by video. For better UX, should NOT bind the slide position to
|
||||
// the first audio data timestamp directly.
|
||||
// While seeking to a position where there's only either audio or video, or
|
||||
// seeking to a position lies before audio or video, we need to check if
|
||||
// seekTime is bounded in suitable duration. See Bug 1112438.
|
||||
int64_t videoStart = video ? video->mTime : seekTime;
|
||||
int64_t audioStart = audio ? audio->mTime : seekTime;
|
||||
newCurrentTime = mAudioStartTime =
|
||||
std::min(std::min(audioStart, videoStart), seekTime);
|
||||
} else {
|
||||
newCurrentTime = video ? video->mTime : seekTime;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче