diff options
author | Akemi <der.richter@gmx.de> | 2017-01-27 20:41:40 +0100 |
---|---|---|
committer | Akemi <der.richter@gmx.de> | 2017-02-02 16:22:27 +0100 |
commit | f39a1cb1b0214ee3fb0640e11c1eeea6b3af47eb (patch) | |
tree | b507937a560341c2304559ef3fa13727c4767875 /DOCS/man | |
parent | 8bbdecea8358e1a00630f095d9859bef9bc1535d (diff) | |
download | mpv-f39a1cb1b0214ee3fb0640e11c1eeea6b3af47eb.tar.bz2 mpv-f39a1cb1b0214ee3fb0640e11c1eeea6b3af47eb.tar.xz |
cocoa: fix displaylink refresh rate retrieval
we are dealing with several problems here, which weren't apparent
because we always initialised a new displaylink for the display refresh
rate retrieval, previously to commit 449eb20 and bug 9490b62.
just changing the display with CVDisplayLinkSetCurrentCGDisplay
can cause inconsistent refresh rates and discontinuity in timestamps.
this can either lead to bogus values for the Actual display refresh rate
or retrieving the refresh rate of the previous display if we immediately
try to get a new value. since the Actual refresh rate is computed i
assume that it at least needs one refresh period to actual return
something useful.
furthermore when changing the screen and updating the displaylink, it
seems that the retrieved refresh rates for the screen mpv wasn't opened
on are being estimated in a sub-optimal way. as an example, when moving
my window to my second screen the Actual refresh rate was always a
constant 60Hz, even though it is supposed to fluctuate a little bit.
though if mpv was started on the secondary screen the Actual refresh
rate fluctuated around 59.94Hz like expected. in that case my primary
screen always reported a constant 60Hz instead.
for the first problem we moved the actual retrieval of the refresh rate
to the very last moment when mpv actual requests a new value and not
when the refresh rate changed. we only update the displaylink itself
when a possible refresh rate change is detected. this gives the
displaylink some time to calculate the new refresh rate. for the second
problem, instead of setting the new display we completely uninitialise
the old dislaylink and create a new one for the new screen. this gives
us properly estimated refresh rates.
additionally we also optimised the display refresh rate fallback
heuristic. it will never be 0 anymore and we prevent it from returning
bogus values with a simple threshold for the difference of the Actual
and Nominal refresh rate.
Diffstat (limited to 'DOCS/man')
0 files changed, 0 insertions, 0 deletions