Bug 254076 - MediaSource duration change algorithm incorrectly update the duration
Summary: MediaSource duration change algorithm incorrectly update the duration
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jean-Yves Avenard [:jya]
URL:
Keywords: InRadar
Depends on:
Blocks: 225367
  Show dependency treegraph
 
Reported: 2023-03-17 08:10 PDT by Jean-Yves Avenard [:jya]
Modified: 2023-03-18 16:53 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Yves Avenard [:jya] 2023-03-17 08:10:13 PDT
Per the duration change algorithm [1]
```
4. If new duration is less than highest end time, then
Note :This condition can occur because the coded frame removal algorithm preserves coded frames that start before the start of the removal range.

    1. Update new duration to equal highest end time.

Update duration to new duration.
```

However
https://searchfox.org/wubkat/rev/0df98689c59d069de39d9ddb7e7fe403bf15070e/Source/WebCore/Modules/mediasource/MediaSource.cpp#520-525
we set the duration to the value originally passed. 

This causes the test `LayoutTests/media/media-source/media-source-play.html` when run in the GPU test, this wasn't an issue when the MockMSE runs in the content process as it always reads the duration from the parent MSE instead which is correct.


[1] https://w3c.github.io/media-source/#dfn-duration-change
Comment 1 Radar WebKit Bug Importer 2023-03-17 08:10:39 PDT
<rdar://problem/106858912>
Comment 2 Jean-Yves Avenard [:jya] 2023-03-17 08:31:44 PDT
Pull request: https://github.com/WebKit/WebKit/pull/11654
Comment 3 EWS 2023-03-18 16:53:11 PDT
Committed 261830@main (8575978fe5ef): <https://commits.webkit.org/261830@main>

Reviewed commits have been landed. Closing PR #11654 and removing active labels.