Closed Bug 1706760 Opened 4 years ago Closed 4 years ago

Remove useless `AdjustByLooping` in CompletedState

Categories

(Core :: Audio/Video, task, P3)

task

Tracking

()

RESOLVED INVALID

People

(Reporter: alwu, Assigned: alwu)

Details

Attachments

(1 obsolete file)

We have two types of looping,

(1) non-seamless looping : for media with both video and audio, or video only. In this kind of looping, MDSM would enter CompletedState that would trigger ended singnal to the media element, then the media element seek to the start position in order to achieve looping. The process of seeking includes shutdown and recreate the media sink, which takes some time so that is non-seamless.

(2) seamless looping : for media with audio only. In this kind of looping, MDSM would keep staying at the LoopingDecodingState. After receiving EOS, we would directly seek demuxer to the start position without recreating the media sink, which is faster so we call it seamless.

The AdjustByLooping() is used to deal with the situation for the seamless looping, because we would automatically adjust the sample time [1] which would exceed the end of the media time. However, we're in the CompletedState, then the clock would never exceed the media end time so this line is actually useless and can be removed.

[1]
eg.
media end time = 10s
the sample in 1s after looping once would be 11s
the sample in 1s after looping twice would be 21s

This line is used to handle the case of seamless looping, but in CompletedState we won't possible to be in the seamless looping.

See more detailed explanation in [1].

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1706760#c0

Attachment #9217538 - Attachment is obsolete: true

Hmm, no, I think this is still needed. Because we can enter the CompletedState after LoopingDecodingState, which means the audio end time might already exceed the media duration.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: