Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflicting constraints detected when taking a screenshot #4808

Open
1 task done
low-batt opened this issue Feb 7, 2024 · 0 comments · May be fixed by #4897
Open
1 task done

Conflicting constraints detected when taking a screenshot #4808

low-batt opened this issue Feb 7, 2024 · 0 comments · May be fixed by #4897

Comments

@low-batt
Copy link
Contributor

low-batt commented Feb 7, 2024

System and IINA version:

  • macOS 14.3
  • IINA 1.3.4

Expected behavior:
Conflicting constraints are never reported.

Actual behavior:
Conflicting constraints are detected when taking a screenshot of the given video:

Conflicting constraints detected: (
    "<NSLayoutConstraint:0x7b140008f160 NSView:0x7b5400131000.width >= 240   (active)>",
    "<NSLayoutConstraint:0x7b14000b6d50 H:[NSImageView:0x7b58000e4900]-(0)-|   (active, names: '|':NSView:0x7b5400131000 )>",
    "<NSLayoutConstraint:0x7b140009dda0 H:|-(0)-[NSImageView:0x7b58000e4900]   (active, names: '|':NSView:0x7b5400131000 )>",
    "<NSLayoutConstraint:0x7b140007a8f0 NSImageView:0x7b58000e4900.width == 200   (active)>"
).

Will attempt to recover by breaking <NSLayoutConstraint:0x7b140007a8f0 NSImageView:0x7b58000e4900.width == 200   (active)>.
Unable to simultaneously satisfy constraints:
(
    "<NSLayoutConstraint:0x7b140008f160 NSView:0x7b5400131000.width >= 240   (active)>",
    "<NSLayoutConstraint:0x7b14000b6d50 H:[NSImageView:0x7b58000e4900]-(0)-|   (active, names: '|':NSView:0x7b5400131000 )>",
    "<NSLayoutConstraint:0x7b140009dda0 H:|-(0)-[NSImageView:0x7b58000e4900]   (active, names: '|':NSView:0x7b5400131000 )>",
    "<NSLayoutConstraint:0x7b140007a8f0 NSImageView:0x7b58000e4900.width == 200   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x7b140007a8f0 NSImageView:0x7b58000e4900.width == 200   (active)>

Set the NSUserDefault NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints to YES to have -[NSWindow visualizeConstraints:] automatically called when this happens.  And/or, set a symbolic breakpoint on LAYOUT_CONSTRAINTS_NOT_SATISFIABLE to catch this in the debugger.

Setting a breakpoint at LAYOUT_CONSTRAINTS_NOT_SATISFIABLE the stack trace shows IINA is displaying the screenshot preview in the OSD:

    frame #17: 0x0000000106f67e7d IINA`MainWindowController.displayOSD(message=screenshot, autoHide=true, forcedTimeout=5, accessoryView=0x00007b54000ba900, context=0x00007b3800002ca0, self=0x00007b640000aa00) at MainWindowController.swift:1980:15
    frame #18: 0x00000001074768ae IINA`closure #1 in PlayerCore.sendOSD(self=0x00007b400001eb00, osd=screenshot, autoHide=true, forcedTimeout=5, accessoryView=0x00007b54000ba900, context=0x00007b3800002ca0) at PlayerCore.swift:1997:23
Full Stack Trace:
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  * frame #0: 0x00007ff81a16c79d AppKit`LAYOUT_CONSTRAINTS_NOT_SATISFIABLE
    frame #1: 0x00007ff81ae090a6 AppKit`-[NSView(NSConstraintBasedLayoutInternal) engine:willBreakConstraint:dueToMutuallyExclusiveConstraints:] + 299
    frame #2: 0x00007ff81f4c0570 CoreAutoLayout`-[NSISEngine handleUnsatisfiableRow:usingInfeasibilityHandlingBehavior:prospectiveRowHead:mutuallyExclusiveConstraints:] + 798
    frame #3: 0x00007ff81f4c29ef CoreAutoLayout`-[NSISEngine tryUsingArtificialVariableToAddConstraintWithMarker:row:usingInfeasibilityHandlingBehavior:mutuallyExclusiveConstraints:] + 777
    frame #4: 0x00007ff81f4c5f5a CoreAutoLayout`-[NSISEngine _tryToAddConstraintWithMarkerEngineVar:row:mutuallyExclusiveConstraints:] + 410
    frame #5: 0x00007ff81f4c5bf0 CoreAutoLayout`-[NSISEngine tryToAddConstraintWithMarker:expression:mutuallyExclusiveConstraints:] + 589
    frame #6: 0x00007ff81f4da3d0 CoreAutoLayout`-[NSLayoutConstraint _addLoweredExpression:toEngine:lastLoweredConstantWasRounded:mutuallyExclusiveConstraints:] + 268
    frame #7: 0x00007ff81f4dd927 CoreAutoLayout`-[NSLayoutConstraint _addToEngine:mutuallyExclusiveConstraints:] + 136
    frame #8: 0x00007ff81ae08536 AppKit`-[NSView(NSConstraintBasedLayoutInternal) _layoutEngine_didAddLayoutConstraint:integralizationAdjustment:mutuallyExclusiveConstraints:] + 91
    frame #9: 0x00007ff81ae088c9 AppKit`-[NSView(NSConstraintBasedLayoutInternal) _tryToAddConstraint:integralizationAdjustment:mutuallyExclusiveConstraints:] + 275
    frame #10: 0x00007ff81f4deed9 CoreAutoLayout`__55+[NSLayoutConstraint _addOrRemoveConstraints:activate:]_block_invoke + 53
    frame #11: 0x00007ff81f4c4cb7 CoreAutoLayout`-[NSISEngine withBehaviors:performModifications:] + 84
    frame #12: 0x00007ff81f4dedb0 CoreAutoLayout`+[NSLayoutConstraint _addOrRemoveConstraints:activate:] + 404
    frame #13: 0x0000000106dfe013 IINA`closure #1 in static Utility.quickConstraints(c="H:|-0-[v(>=240)]-0-|", views=1 key/value pair) at Utility.swift:450:26
    frame #14: 0x0000000106e04c9c IINA`partial apply for closure #1 in static Utility.quickConstraints(_:_:) at <compiler-generated>:0
    frame #15: 0x00007ff826b8ac73 libswiftCore.dylib`Swift.Sequence.forEach((τ_0_0.Element) throws -> ()) throws -> () + 435
    frame #16: 0x0000000106dfdcc2 IINA`static Utility.quickConstraints(constraints=1 value, views=1 key/value pair, self=@thick IINA.Utility.Type) at Utility.swift:448:17
    frame #17: 0x0000000106f67e7d IINA`MainWindowController.displayOSD(message=screenshot, autoHide=true, forcedTimeout=5, accessoryView=0x00007b54000ba900, context=0x00007b3800002ca0, self=0x00007b640000aa00) at MainWindowController.swift:1980:15
    frame #18: 0x00000001074768ae IINA`closure #1 in PlayerCore.sendOSD(self=0x00007b400001eb00, osd=screenshot, autoHide=true, forcedTimeout=5, accessoryView=0x00007b54000ba900, context=0x00007b3800002ca0) at PlayerCore.swift:1997:23
    frame #19: 0x000000010748cc78 IINA`partial apply for closure #1 in PlayerCore.sendOSD(_:autoHide:forcedTimeout:accessoryView:context:external:) at <compiler-generated>:0
    frame #20: 0x0000000106d12493 IINA`thunk for @escaping @callee_guaranteed () -> () at <compiler-generated>:0
    frame #21: 0x0000000108a3e72c libclang_rt.tsan_osx_dynamic.dylib`__tsan::invoke_and_release_block(void*) + 12
    frame #22: 0x0000000108a3e5a7 libclang_rt.tsan_osx_dynamic.dylib`__tsan::dispatch_callback_wrap(void*) + 695
    frame #23: 0x000000010bcfdc6c libdispatch.dylib`_dispatch_client_callout + 8
    frame #24: 0x000000010bd0d585 libdispatch.dylib`_dispatch_main_queue_drain + 1124
    frame #25: 0x000000010bd0d113 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 31
    frame #26: 0x00007ff816942e16 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    frame #27: 0x00007ff816901fe5 CoreFoundation`__CFRunLoopRun + 2459
    frame #28: 0x00007ff816901082 CoreFoundation`CFRunLoopRunSpecific + 557
    frame #29: 0x00007ff8211f39d9 HIToolbox`RunCurrentEventLoopInMode + 292
    frame #30: 0x00007ff8211f37e6 HIToolbox`ReceiveNextEventCommon + 665
    frame #31: 0x00007ff8211f3531 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 66
    frame #32: 0x00007ff819f11c39 AppKit`_DPSNextEvent + 880
    frame #33: 0x00007ff81a81b804 AppKit`-[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1304
    frame #34: 0x00007ff819f031b2 AppKit`-[NSApplication run] + 603
    frame #35: 0x00007ff819ed71c1 AppKit`NSApplicationMain + 816
    frame #36: 0x000000010709e564 IINA`main at AppDelegate.swift:24:7
    frame #37: 0x00007ff81649c386 dyld`start + 1942

Steps to reproduce:

  • Start running IINA under Xcode

  • Ensure Show previews after taking screenshots is enabled

  • Start playing the YouTube video Keytar Bear

  • Press ⌘S to take a screenshot

  • Conflicting constraints will be reported in the Xcode console

  • MPV does not have this problem.

This is an IINA problem.

How often does this happen?
Every time.

yuxiqian added a commit to yuxiqian/iina that referenced this issue Apr 27, 2024
@yuxiqian yuxiqian linked a pull request Apr 27, 2024 that will close this issue
2 tasks
@low-batt low-batt linked a pull request Apr 27, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant