S028: gst_mse patch 12: coded frames raise the duration to the buffered end (C test)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-12 22:01:59 -06:00
commit cdf16a59eb

View file

@ -157,6 +157,18 @@ seek to 3.5 back to 1.0. The spec only raises the duration from coded frames.
**Fix.** The handler returns when the current duration is valid and not below the new maximum. **Test:** mse-player
smoke case `seekUnbuffered`.
## 12. Coded frames don't raise the duration (S028)
**What.** `on_duration_changed()` took only the append pipeline's (demuxer's) duration. For fragmented MP4 with an
empty `moov` that is 0 or the first fragment's length, so after appending a 5 s clip `MediaSource.duration` read 1.0
(Chromium: 5.08), and nothing re-ran the handler after later fragments.
**Fix.** The handler also takes each source buffer's highest buffered end, and every successful append calls it
(outside the source buffer's object lock, before update-end). **Test:** C test `/mse/duration-from-frames`.
**Seen:** `/mse/split-audio-video` failed its final ready-state check (HAVE_METADATA after playing past 1 s) 2 times
in ~70 rounds after this patch, 0 in 24 before (not conclusive). msesrc reads its position from a pad's
`segment.position` (the feed's push position, not playback); Nacre's DOM computes readyState itself.
## Found, not fixed here
- `gst_source_buffer_change_content_type()` always fails (NotSupported). Nacre's backend accepts a change within the