You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(windows): defer Skia bitmap release to avoid race conditions during resolution changes
- Add deferred-close queue to safely manage bitmap lifecycle during adaptive bitrate (HLS) resolution changes.
- Ensure old bitmaps are cleared only after a safe number of frames to prevent Skia use-after-free crashes.
- Implement `drainPendingCloseBitmaps` to manage and clean pending bitmaps effectively.
- Extend JVM buildArgs to enable custom URL protocols (`--enable-url-protocols=http,https`).
Copy file name to clipboardExpand all lines: mediaplayer/src/jvmMain/kotlin/io/github/kdroidfilter/composemediaplayer/windows/WindowsVideoPlayerState.kt
+38-9Lines changed: 38 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -292,6 +292,14 @@ class WindowsVideoPlayerState : VideoPlayerState {
292
292
privatevar skiaBitmapWidth:Int=0
293
293
privatevar skiaBitmapHeight:Int=0
294
294
295
+
// Bitmaps awaiting safe closure. When the video resolution changes mid-stream
296
+
// (HLS adaptive bitrate) the old double-buffer bitmaps may still be read by
297
+
// Compose on the AWT thread via currentFrameState. We defer close() by a few
298
+
// consumed frames so Compose has swapped to the new bitmap first.
0 commit comments