summaryrefslogtreecommitdiffstats
path: root/DOCS
diff options
context:
space:
mode:
authorAkemi <der.richter@gmx.de>2017-01-27 20:41:40 +0100
committerAkemi <der.richter@gmx.de>2017-02-02 16:22:27 +0100
commitf39a1cb1b0214ee3fb0640e11c1eeea6b3af47eb (patch)
treeb507937a560341c2304559ef3fa13727c4767875 /DOCS
parent8bbdecea8358e1a00630f095d9859bef9bc1535d (diff)
downloadmpv-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')
0 files changed, 0 insertions, 0 deletions