mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 21:28:55 +00:00
Bug 1112438 - Make newCurrentFrameTime more accurate while seeking by checking audio & video timestamp boundary in addition. r=cpearce
This commit is contained in:
parent
6e9087fc50
commit
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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user