Bug 1900191 - use default duration if exists.
ClosedPublic

Authored by alwu on Jun 21 2024, 9:58 PM.
Referenced Files
Unknown Object (File)
Tue, Jul 9, 3:04 PM
Unknown Object (File)
Tue, Jul 9, 12:26 AM
Unknown Object (File)
Sat, Jul 6, 9:51 PM
Unknown Object (File)
Fri, Jul 5, 1:14 AM
Unknown Object (File)
Mon, Jul 1, 8:10 AM
Unknown Object (File)
Sun, Jun 30, 9:50 AM
Unknown Object (File)
Jun 28 2024, 7:52 PM
Unknown Object (File)
Jun 25 2024, 9:57 PM
Subscribers

Diff Detail

Repository
rMOZILLACENTRAL mozilla-central
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.
karlt added a subscriber: karlt.

Using DefaultDuration is what the spec implies and is more consistent with what Chromium is doing, so I agree with what this is doing, thanks.

I'm not familiar with how easy it might be to create a webm file for testing.
https://phabricator.services.mozilla.com/D156677 added some basic webm files. Have you tried at mkvtoolnix?

dom/media/webm/NesteggPacketHolder.h
51

The existing code in this file is inconsistent, but comparing the result with -1 or 0 would clarify that the function does not return a bool.

102

Thanks for adding this!

105

t<->a

dom/media/webm/WebMDemuxer.cpp
602

Can defaultDuration be obtained from Context(aType), here or in ReadMetadata().
Repeating the track property on the NesteggPacketHolders is unexpected to me, given it is not a property of the packet.

ReadMetadata() is already doing some nanosecond conversion.

I can see some benefit of getting the default duration in the NesteggPacketHolder, if it were to use the default duration as a default/fallback value for Duration(). That is, if you are happy to prefer the default duration over using the previous timestamp difference.

624

Any idea why next_holder->Timestamp() is preferred over holder->Duration().
The docs are clear that BlockDuration should be preferred over using the timecode of the next Block.

When not written and with no DefaultDuration, the value is assumed to be the difference between the timecode of this Block and the timecode of the next Block in "display" order (not coding order).

Do you know why next_holder is assumed to be the next in display order?
I was expecting next_holder to be the next in *coding* order.

We don't need to make a change here at the same time as adding the DefaultDuration, and perhaps better if we don't, at least if this patch might be uplifted. Would be good to know why we do it this way though.

628–632

defaultDuration looks a better indicator of duration than tstamp - lastFrameTime.ref(). How would you feel about preferring defaultDuration?

That would be more consistent with what Chromium is doing.

This revision is now accepted and ready to land.Jun 24 2024, 5:49 AM

This revision requires a Testing Policy Project Tag to be set before landing. Please apply one of testing-approved, testing-exception-unchanged, testing-exception-ui, testing-exception-elsewhere, testing-exception-other. Tip: this Firefox add-on makes it easy!

As the patch has been landed, I will handle review suggestions in bug 1904394.