Closed Bug 1803252 Opened 2 years ago Closed 2 years ago

Video stuttering and corruption after seeking if playback rate is > 1

Categories

(Core :: Audio/Video: Playback, defect, P2)

defect

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

Details

Attachments

(1 file)

When using playback rate > 1 for media engine playback, after seeking, sometime I can see the video corruption and video stuttering after seeking.

The corruption is probably media engine internal issue, but the stuttering seems related with our workaround for setting playback rate (because of another media engine internal issue, which doesn't preserve the playback rate well)

We had a workaround [1] to keep the playback correct after pausing and
seeking, because the media engine would incorrectly reset the playback
rate to 1.

Because of this workaround, whenever the playback starts, we would
always change playback rapidly from 1 to another expected rate, which
seems causing video stuttering because the media engine might not be
able to deal with this rapidly playback rate modification very well. It
also results in some video corruption sometime.

After doing some reseach, I found that the media engine uses another
default playback rate [2] to determine the playback after calling
play(). And that value is completely independent from the playback rate. Therefore, by setting default playback rate at the same time, we
no longer encounter the situation where the media engine reset our
playback rate, so we don't need to rapidly adjust playback when the
engine starts playing so that we can avoid the stuttering and corruption
issue.

[1] https://searchfox.org/mozilla-central/rev/670e2e0999f04dc7734c8c12b2c3d420a1e31f12/dom/media/ipc/MFMediaEngineParent.cpp#412-419
[2] https://learn.microsoft.com/en-us/windows/win32/api/mfmediaengine/nf-mfmediaengine-imfmediaengine-getdefaultplaybackrate

Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0c2f58ed2271 set playback rate and default playback rate together. r=jolin
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: