diff --git a/Plans/05 Engine/S028-mse-player.md b/Plans/05 Engine/S028-mse-player.md index 5a5f5fc..b1a1ee5 100644 --- a/Plans/05 Engine/S028-mse-player.md +++ b/Plans/05 Engine/S028-mse-player.md @@ -21,12 +21,12 @@ work happens on main. ## Steps - [x] `git merge main` into the branch; build; mse smoke green -- [ ] Attach without blocking the script thread: setup for `StreamType::MediaSource` returns at once; readiness +- [x] Attach without blocking the script thread: setup for `StreamType::MediaSource` returns at once; readiness arrives as a player event; test: a page appends while the player starts and the `js` probe answers in <1 s -- [ ] Seeking: `currentTime =` inside and outside buffered ranges (waits for an append, then `seeked`); playback +- [x] Seeking: `currentTime =` inside and outside buffered ranges (waits for an append, then `seeked`); playback rate; `ended` after endOfStream; smoke asserts each -- [ ] Errors: decode error → `MediaError` + `sourceended`/error events; append of garbage → SourceBuffer `error` -- [ ] Codec table: `isTypeSupported` consistent with `canPlayType` (registry scanner learns opus/webm, vp09.*, av01 +- [x] Errors: decode error → `MediaError` + `sourceended`/error events; append of garbage → SourceBuffer `error` +- [x] Codec table: `isTypeSupported` consistent with `canPlayType` (registry scanner learns opus/webm, vp09.*, av01 when dav1d is installed); unit test for the mime/codec mapping - [ ] Full smoke set green on the branch (launch, basics, input, chrome, keys, mse, settings; heavy-web where the network allows) and `nice cargo test --release -j 2` diff --git a/docs/engine/gst-mse-patches.md b/docs/engine/gst-mse-patches.md index d2f03bb..8f7e2dd 100644 --- a/docs/engine/gst-mse-patches.md +++ b/docs/engine/gst-mse-patches.md @@ -136,6 +136,25 @@ to `0..+inf`, so it failed too. **Fix.** The check is `start >= append_window_end` (an end of `GST_CLOCK_TIME_NONE` is +infinity in the unsigned compare). **Test:** `/mse/remove` sets the window. +## 10. endOfStream never reaches msesrc (S028) + +**What.** Upstream `gst_media_source_end_of_stream()` relied on `abort_all_source_buffers()` pushing EOS into each +appsrc, which then reached the track buffers and msesrc. Patch 6 made abort drop data instead, so after +`endOfStream()` msesrc never sent EOS and the element never fired `ended`. + +**Fix.** End of stream (no error) marks every track buffer of every source buffer EOS (`gst_source_buffer_set_eos`, +under TRACKS_LOCK); `gst_media_source_open()` clears it again when the state was ENDED (a new append reopens the +source; new `gst_media_source_track_buffer_clear_eos`). **Test:** mse-player smoke case `ended`. + +## 11. Coded frames shrink a duration the page set (S028) + +**What.** `on_duration_changed()` set the duration to the highest buffered end whenever buffers arrived, so a page +that set `duration = 5` and appended the first second got its duration cut back to 1.0; the element then clamped a +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`. + ## Found, not fixed here - `gst_source_buffer_change_content_type()` always fails (NotSupported). Nacre's backend accepts a change within the