<?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>314643</bug_id>
          
          <creation_ts>2026-05-12 08:52:27 -0700</creation_ts>
          <short_desc>[GStreamer][MSE] ended event may not always fire when the duration change</short_desc>
          <delta_ts>2026-05-15 10:50:30 -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>Platform</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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>
          <dependson>314628</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Philippe Normand">philn</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>jean-yves.avenard</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2210145</commentid>
    <comment_count>0</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2026-05-12 08:52:27 -0700</bug_when>
    <thetext>+++ This bug was initially created as a clone of Bug #314628 +++
          
          Consider the following.

a MediaSource is created with data from [0-5][6-10]

playback stalls at currentTime = 5.
Now the player removes data from [6-10] and set the duration to 5.

The ended event will never fire as timeChanged would only be called at the completion of the seek handled by

https://searchfox.org/wubkat/source/Source/WebCore/html/HTMLMediaElement.cpp#6060-6061

```
    if (now &gt; dur)
        seekInternal(dur);

```

this causes the intermittent timeout in the test 
imported/w3c/web-platform-tests/media-source/mediasource-duration.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2210433</commentid>
    <comment_count>1</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2026-05-13 01:11:58 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/64826</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>