<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>254076</bug_id>
          
          <creation_ts>2023-03-17 08:10:13 -0700</creation_ts>
          <short_desc>MediaSource duration change algorithm incorrectly update the duration</short_desc>
          <delta_ts>2023-03-18 16:53:13 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>225367</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Jean-Yves Avenard [:jya]">jean-yves.avenard</reporter>
          <assigned_to name="Jean-Yves Avenard [:jya]">jean-yves.avenard</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1942092</commentid>
    <comment_count>0</comment_count>
    <who name="Jean-Yves Avenard [:jya]">jean-yves.avenard</who>
    <bug_when>2023-03-17 08:10:13 -0700</bug_when>
    <thetext>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&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1942093</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-03-17 08:10:39 -0700</bug_when>
    <thetext>&lt;rdar://problem/106858912&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1942101</commentid>
    <comment_count>2</comment_count>
    <who name="Jean-Yves Avenard [:jya]">jean-yves.avenard</who>
    <bug_when>2023-03-17 08:31:44 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/11654</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1942342</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-03-18 16:53:11 -0700</bug_when>
    <thetext>Committed 261830@main (8575978fe5ef): &lt;https://commits.webkit.org/261830@main&gt;

Reviewed commits have been landed. Closing PR #11654 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>