Skip to content

Prevent stale FFmpeg loads from publishing after close or replacement - #95

Draft
Blackspirits wants to merge 2 commits into
upl/review-base-c77cfrom
fix/ffmpeg-stale-load-c77c
Draft

Prevent stale FFmpeg loads from publishing after close or replacement#95
Blackspirits wants to merge 2 commits into
upl/review-base-c77cfrom
fix/ffmpeg-stale-load-c77c

Conversation

@Blackspirits

@Blackspirits Blackspirits commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Summary

FfmpegPlayer.LoadFile still creates its native Session inside Task.Run, while VideoPlayerControl.Open explicitly permits teardown/layout/fullscreen transitions during the await.

A Session that is still being constructed is invisible to CloseFile. It can therefore publish after close, or an older overlapping load can overwrite a newer Session.

This current-base port:

  • reserves each load/close with a monotonically increasing generation;
  • serializes Session publication/replacement;
  • disposes stale Sessions before they can publish;
  • prevents an old failed load from clearing the file name of a newer load;
  • preserves current-frame cleanup and paused-first-frame behavior.

Validation

  • based on upstream c77c4b428649ce7030e6cf218b4d7c384b955232
  • supersedes draft Prevent stale FFmpeg loads from publishing after close or replacement #92 on the older hardware-decoder base
  • current upstream still has the original unguarded async publication sequence
  • no public interface change
  • full solution restore passed
  • full solution build passed
  • full solution test suite passed on the first run
  • UI suite: 5,151 passed, 9 skipped, 0 failed (5,160 total)
  • retry step was not used
  • validation run: #34778908588

AI assistance: ChatGPT was used to revalidate asynchronous Session ownership after upstream FFmpeg changes.

@Blackspirits Blackspirits left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent adversarial re-check on the revised concurrency patch: the first version still allowed an older load/close to clear a newer Session's first frame while disposing the previous Session. The final generation-safe cleanup fixes that race too: stale requests skip frame/file-name cleanup, Session publication is atomic with generation validation, and old failed loads cannot clobber newer state. Full CI #34778908588 passed restore, build and the complete suite on the first run; UITests reported 5,151 passed, 9 skipped and 0 failed. Retry was not used. No blocker identified. Keep draft; no merge performed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant