mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-25 04:29:53 +08:00
cocoa-cb: render on main queue instead of dedicated queue
initially we drew on a dedicated render queue to circumvent certain bottlenecks on the main queue, like concurrent events that could lead to late drawing. though due to the way cocoa works we need to draw an the main queue otherwise we get undefined behaviour that could lead to crashes. Fixes #10276
This commit is contained in:
@@ -82,8 +82,6 @@ class GLLayer: CAOpenGLLayer {
|
||||
enum Draw: Int { case normal = 1, atomic, atomicEnd }
|
||||
var draw: Draw = .normal
|
||||
|
||||
let queue: DispatchQueue = DispatchQueue(label: "io.mpv.queue.draw")
|
||||
|
||||
var needsICCUpdate: Bool = false {
|
||||
didSet {
|
||||
if needsICCUpdate == true {
|
||||
@@ -239,7 +237,7 @@ class GLLayer: CAOpenGLLayer {
|
||||
|
||||
func update(force: Bool = false) {
|
||||
if force { forceDraw = true }
|
||||
queue.async {
|
||||
DispatchQueue.main.async {
|
||||
if self.forceDraw || !self.inLiveResize {
|
||||
self.needsFlip = true
|
||||
self.display()
|
||||
|
||||
Reference in New Issue
Block a user