Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

HDR broken on latest release #9

Closed
avdimdv opened this issue Dec 15, 2021 · 7 comments
Closed

HDR broken on latest release #9

avdimdv opened this issue Dec 15, 2021 · 7 comments

Comments

@avdimdv
Copy link

avdimdv commented Dec 15, 2021

I've updated to the latest release and have HDR disabled at least with the last file I started to watch. Inspector reports colorspace as Unspecified(SDR). Downgrading to previous release work fine.
Here is a couple of seconds sample
https://drive.google.com/file/d/14A6UbjhwrpJsp9Z2Hhp811gDpyA92rSD/view?usp=sharing

@CarterLi
Copy link
Owner

Works for me

image

@CarterLi
Copy link
Owner

I'm having trouble building IINA because of the XCode 13.2 bug, but I have released a binary with what I'm using ( /Application/IINA.app ). Please test it

@avdimdv
Copy link
Author

avdimdv commented Dec 15, 2021

Well, I also failed to reproduce bug repeatedly.

Original case was

  1. File played via WiFi on Macbook Pro M1 from SMB share
  2. Auto resume was turned on and playback started from approx. chapter start
    In such conditions I got no HDR on .14 version and everything is ok on .13
    That also applied to small cut I sent to you.

However I failed to reproduce it when small file was stored locally.
And playing big file from network share from the beginning also does not give errors on both versions.

I will try to compile project myself and debug it.
Though I am Windows developer and being new to Macs.

@avdimdv
Copy link
Author

avdimdv commented Dec 16, 2021

Damn, had to install Xcode outside Appstore to be able to compile, they just broke it before I even started to test it.
And full Visual Studio is a way easier to use with years of experience against couple of hours in Xcode.

After all I manage to run under debugger.
I don't reproduce bug but there is a definite point when that can happen.
requestEdrMode() is called twice after opening file, first from PlayerCore.initVideo() on the stack and at that point of time check of guard mpv.getDouble(MPVProperty.videoParamsSigPeak) > 1.0 will default to SDR being initialised at the moment.
Second call came from closure #1 in PlayerCore.refreshEdrMode() on the call stack and then colorspace will become corrected. I suspect that in some rare cases second call will not come or will fail.

If it will I who write the code I will try to avoid unitialised first setting of wrong colorspace at the first place.

@avdimdv
Copy link
Author

avdimdv commented Dec 16, 2021

Full call stack on the first an second passes

first

#0 0x000000010031d698 in VideoView.requestEdrMode() at /Users/Shared/SOURCES/iina-plus/iina/iina/VideoView.swift:277
#1 0x000000010031c598 in VideoView.refreshEdrMode() at /Users/Shared/SOURCES/iina-plus/iina/iina/VideoView.swift:268
#2 0x000000010031c368 in VideoView.updateDisplayLink() at /Users/Shared/SOURCES/iina-plus/iina/iina/VideoView.swift:226
#3 0x000000010031b49c in VideoView.startDisplayLink() at /Users/Shared/SOURCES/iina-plus/iina/iina/VideoView.swift:187
#4 0x000000010038c0ec in PlayerCore.initVideo() at /Users/Shared/SOURCES/iina-plus/iina/iina/PlayerCore.swift:368
#5 0x0000000100195f88 in MainWindowController.windowDidLoad() at /Users/Shared/SOURCES/iina-plus/iina/iina/MainWindowController.swift:529
#6 0x0000000100197ce0 in @objc MainWindowController.windowDidLoad() ()
#7 0x00000001882e71b0 in -[NSWindowController windowDidLoad] ()
#8 0x00000001882e2978 in -[NSWindowController window] ()
#9 0x00000001003894b0 in PlayerCore.openMainWindow(path:url:isNetwork:) at /Users/Shared/SOURCES/iina-plus/iina/iina/PlayerCore.swift:298
#10 0x0000000100387a98 in PlayerCore.open(
:shouldAutoLoad:) at /Users/Shared/SOURCES/iina-plus/iina/iina/PlayerCore.swift:216
#11 0x0000000100388250 in PlayerCore.openURLs(:shouldAutoLoad:) at /Users/Shared/SOURCES/iina-plus/iina/iina/PlayerCore.swift:254
#12 0x0000000100388790 in PlayerCore.openURL(
:shouldAutoLoad:) at /Users/Shared/SOURCES/iina-plus/iina/iina/PlayerCore.swift:270
#13 0x000000010007ed44 in InitialWindowViewActionButton.mouseDown(with:) at /Users/Shared/SOURCES/iina-plus/iina/iina/InitialWindowController.swift:279
#14 0x000000010007edec in @objc InitialWindowViewActionButton.mouseDown(with:) ()
#15 0x0000000188326874 in -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] ()
#16 0x0000000188299ce4 in -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] ()
#17 0x00000001882990ec in -[NSWindow(NSEventRouting) sendEvent:] ()
#18 0x0000000188298050 in -[NSApplication(NSEvent) sendEvent:] ()
iina#19 0x000000018855059c in -[NSApplication _handleEvent:] ()
#20 0x00000001881195cc in -[NSApplication run] ()
#21 0x00000001880eac78 in NSApplicationMain ()
#22 0x0000000100225a10 in main at /Users/Shared/SOURCES/iina-plus/iina/iina/AppDelegate.swift:22
#23 0x0000000100fa50f4 in start ()

second

#0 0x0000000102f79788 in VideoView.requestEdrMode() at /Users/Shared/SOURCES/iina-plus/iina/iina/VideoView.swift:279
#1 0x0000000102f78598 in VideoView.refreshEdrMode() at /Users/Shared/SOURCES/iina-plus/iina/iina/VideoView.swift:268
#2 0x0000000102fff708 in closure #1 in PlayerCore.refreshEdrMode() at /Users/Shared/SOURCES/iina-plus/iina/iina/PlayerCore.swift:1249
#3 0x0000000102ceb944 in thunk for @escaping @callee_guaranteed () -> () ()
#4 0x00000001061ffff0 in _dispatch_call_block_and_release ()
#5 0x0000000106201d24 in _dispatch_client_callout ()
#6 0x0000000106214f80 in _dispatch_main_queue_callback_4CF ()
#7 0x0000000185615f00 in CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE ()
#8 0x00000001855d38c0 in __CFRunLoopRun ()
#9 0x00000001855d2734 in CFRunLoopRunSpecific ()
#10 0x000000018e164f68 in RunCurrentEventLoopInMode ()
#11 0x000000018e164cdc in ReceiveNextEventCommon ()
#12 0x000000018e164a9c in _BlockUntilNextEventMatchingListInModeWithFilter ()
#13 0x0000000188128ce0 in _DPSNextEvent ()
#14 0x0000000188127584 in -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] ()
#15 0x00000001881195a4 in -[NSApplication run] ()
#16 0x00000001880eac78 in NSApplicationMain ()
#17 0x0000000102e81a10 in main at /Users/Shared/SOURCES/iina-plus/iina/iina/AppDelegate.swift:22
#18 0x0000000103d690f4 in start ()

@CarterLi
Copy link
Owner

You are right. The VideoView.updateDisplayLink path definitely needs revisit. However let's wait for apple fixing the xcode bug first.

@CarterLi
Copy link
Owner

The first path should be avoid by 5a9259a

Try the latest binary please. If you can still reproduce this issue, please open a new issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants