Bug 1717171 - only skip to next key frame when video decoding is too slow and later than the media time. r=bryce

We should only seek to the next keyframe in a really bad situation where the video is way too slow and we probably already drop a lot of frames.

Using the audio clock causes seeking to next key frame is too aggresively. That might happen even if only one video frame is late ,which is usually ignorable and won't cause any effect to users. So we should use the media time to perform such checking, not audio clock time.

Differential Revision: https://phabricator.services.mozilla.com/D120418
This commit is contained in:
alwu 2021-07-21 16:58:28 +00:00
Родитель 4eef5e5f47
Коммит edc181cd0f
1 изменённых файлов: 1 добавлений и 3 удалений

Просмотреть файл

@ -592,9 +592,7 @@ class MediaDecoderStateMachine::DecodingState
}
void HandleVideoDecoded(VideoData* aVideo, TimeStamp aDecodeStart) override {
const auto currentTime = mMaster->mMediaSink->IsStarted()
? mMaster->GetClock()
: mMaster->GetMediaTime();
const auto currentTime = mMaster->GetMediaTime();
if (aVideo->GetEndTime() < currentTime) {
SLOG("video %" PRId64 " is too late (current=%" PRId64 ")",
aVideo->GetEndTime().ToMicroseconds(), currentTime.ToMicroseconds());