Validate WinMM hardening on integrated FFmpeg audio core - #148
Draft
Blackspirits wants to merge 1 commit into
Draft
Blackspirits wants to merge 1 commit into
Blackspirits wants to merge 1 commit into
Conversation
Blackspirits
force-pushed
the
audit/ffmpeg-audio-winmm-integration-fa52
branch
from
September 16, 2026 13:39
efc09be to
fd98fcc
Compare
Blackspirits
commented
Sep 16, 2026
Blackspirits
left a comment
Owner
Author
There was a problem hiding this comment.
Final adversarial integration review on fd98fcc6bce4c01845ddff9b1ad5d35757478c99 after CI SubtitleEdit#292: no blocker found. Verified serial-fenced Reset(int), position-format/wrap normalization, all-or-nothing WinMM open, atomic copy+enqueue vs Reset, fail-closed teardown, retryable retained native cleanup, and monotonic position across driver format changes. The only new warning seen in superseded CI SubtitleEdit#290 was a duplicate using introduced by integration; it was removed before SubtitleEdit#292. Native clock-query health remains explicitly open for the follow-up. No merge/promotion performed.
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.
Purpose
Integration-only validation of the audited FFmpeg Windows/WinMM audio sink hardening on top of the integrated audio-core stack #147.
The base is #147, so it already composes:
This integration commit layers the Windows-specific audited behavior from:
It is audit evidence only and is not a merge candidate.
Current upstream
SubtitleEdit/subtitleeditmain was rechecked at2998aeedbc39a3a5a1c19269c2464122df1aa66b; the newer upstream changes remain outside the FFmpeg player/sinks.Composition invariants
Seek serial remains the ownership fence.
Fail closed when native FFmpeg audio reset fails #128's
Reset(int serial)remains intact: generation advances first, the accepted serial is set to rejected before native reset, and a new serial is published only after successfulwaveOutReset.Position-format hardening does not weaken reset semantics.
Handle alternate WinMM playback position formats #126's position normalization/wrap tracking is reset only after native reset succeeds.
Open is all-or-nothing.
Fail closed when WinMM output setup is incomplete #129 verifies the event handle and every
waveOutPrepareHeader; all headers are initialized before any partial cleanup can inspect them.Write remains copy+enqueue atomic against Reset.
The Fence FFmpeg audio writes by seek serial #125 critical section and serial/generation checks remain unchanged while the Handle alternate WinMM playback position formats #126 position logic is layered around them.
Teardown is fail closed.
Retain WinMM buffers when teardown cannot reclaim them #131 frees no header/data buffer while WinMM still reports reset/unprepare/close failure.
Retryable native cleanup is preserved.
A later Open/Dispose can retry retained WinMM state instead of using/freing a half-reclaimed device boundary.
Clock position is monotonic across driver format changes.
Samples/bytes/ms replies are normalized to bytes and format-switch rounding cannot manufacture a 32-bit wrap jump.
Deliberate residual finding
This integration does not yet solve native clock-query health.
Both WinMM and Core Audio currently return their last known playback position when the native clock API itself fails. That is safer than returning garbage, but it means the player cannot distinguish “temporarily unchanged clock” from “clock query is no longer valid”.
A separate follow-up will expose clock validity explicitly so persistent
waveOutGetPosition/AudioQueueGetCurrentTimefailure can trigger the #144 wall-clock failover without timeout heuristics.Scope / branch state
017540a328cfb460a90cd3b6bace32d698edb1c7fd98fcc6bce4c01845ddff9b1ad5d35757478c992998aeedbc39a3a5a1c19269c2464122df1aa66bAcceptance
AI assistance: ChatGPT was used for cross-branch WinMM reconciliation, serial/reset/open/teardown invariant review, and integration acceptance design.
Final CI
Authoritative run: SubtitleEdit#292 on
fd98fcc6bce4c01845ddff9b1ad5d35757478c99The first integrated run SubtitleEdit#290 exposed one integration-only duplicate-using warning in WaveOutAudioSink. That warning was removed, the branch was re-compacted to one commit, and SubtitleEdit#292 is the authoritative clean run.
Final adversarial integration review was performed on this exact HEAD after CI; all seven WinMM composition invariants remain satisfied.