8000 Fix crash in mpv_render_context_report_swap, #4315 (#4330) · iina/iina@813a8fc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 813a8fc

Browse files
authored
Fix crash in mpv_render_context_report_swap, #4315 (#4330)
This commit will change PlayerCore.shutdown to suspend the video layer mpvGLQueue dispatch queue and stop the display link before sending a quit command to mpv.
1 parent 246
8000
30f1 commit 813a8fc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

iina/PlayerCore.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,11 @@ class PlayerCore: NSObject {
493493
isShuttingDown = true
494494
Logger.log("Shutting down", subsystem: subsystem)
495495
savePlayerState()
496+
// Once mpv has been instructed to quit accessing the mpv core can result in a crash. Must not
497+
// allow the display link thread or the mpvGLQueue dispatch queue to continue processing because
498+
// these entities will call mpv.
499+
mainWindow.videoView.videoLayer.suspend()
500+
mainWindow.videoView.stopDisplayLink()
496501
mpv.mpvQuit()
497502
}
498503

0 commit comments

Comments
 (0)
0