fix: treat PlaceMarker failure as non-fatal and shut down sink on error#157
Merged
ruccho merged 2 commits intoJul 17, 2026
Conversation
On some Windows builds (observed on 26200 with mfmp4srcsnk.dll 10.0.26100.8457) the OS MPEG4 media sink rejects every IMFStreamSink::PlaceMarker call with MF_E_INVALIDTYPE, which killed the stream event loop and made export fail with "channel closed" (CyberAgentGameEntertainment#156). - PlaceMarker(ENDOFSEGMENT) failure is now logged and ignored so finalization still runs and writes the moov box. - The muxer task now calls sink.Shutdown() on the error path so the output file handle is not leaked until process exit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ruccho
self-requested a review
July 17, 2026 06:35
ruccho
approved these changes
Jul 17, 2026
Collaborator
|
Thank you for the report. This indeed seems to be specific to that build... I could not reproduce it with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #156.
On recent Windows 11 builds (observed on OS build 10.0.26200 with
mfmp4srcsnk.dll10.0.26100.8457),IMFStreamSink::PlaceMarkeron the OS-provided MPEG4 media sink returnsMF_E_INVALIDTYPEfor every marker type and argument combination. The?on thePlaceMarkercall killed the stream event loop, the finish signal was never sent, andCompleteAsyncfailed withFailed to complete muxer: channel closed(a hard Rust panic on versions beforebetter_error_handling).Changes
PlaceMarker(ENDOFSEGMENT)failure is now logged and treated as non-fatal. The marker is only used as a completion hint; finalization still runs and writes themoovbox without it.sink.Shutdown()on the error path, so the output file handle is no longer leaked until process exit when muxing fails.Verification
StopAndExportAsynccompletes and produces a valid, playable mp4 (moovpresent). Confirmed on two machines with the same build.PlaceMarkeris rejected at the OS level independently of this package, so skipping it is the only client-side mitigation available.Native binaries are intentionally not included; they can be rebuilt via the
Build uniencworkflow.🤖 Generated with Claude Code