Files
simplex-chat/apps
Narasimha-sc ff36d401ce desktop: fix video playback hang caused by stuck preview snapshot (#6983)
* desktop: fix video playback hang caused by stuck preview snapshot

Problem: clicking play on a video did nothing when an earlier video's
preview generation was stuck — every subsequent VideoPlayer.play() was
queued behind it on the shared playerThread.

Cause: helper player reuse across previews exhausted the libavcodec h264
frame-buffer pool with --avcodec-hw=none (PR #6924), and the synchronous
libvlc snapshots().get() call then hung waiting for a frame that was
never decoded.

Fix: drop the helper-player pool (release each helper after use) and run
preview generation on a dedicated previewThread so a stuck preview can
no longer block playback.

* plans: add 2026-05-15-fix-video-preview-snapshot-hang.md

* desktop: capture preview via callback surface, keep helper pool

Follows up on the previous commit (4a964c66). The actual hang was in
libvlc's synchronous snapshots().get() on a reused helper, not in the
pooling itself. Replace the polling loop with a CallbackVideoSurface
(the existing SkiaBitmapVideoSurface) wrapped in withTimeoutOrNull —
the wait is bounded, so a non-decoding helper can't block previewThread.
Restore the helper-player pool that the previous commit dropped.

* plans: update 2026-05-15-fix-video-preview-snapshot-hang.md for final fix
2026-05-25 16:10:55 +01:00
..
2026-05-23 15:39:53 +01:00
2025-07-08 12:22:57 +01:00