Commit b47ee1e
committed
gfx: toggle Sync to Exact Content Framerate without a driver reinit
vrr_runloop_enable ("Sync to Exact Content Framerate") fired CMD_EVENT_REINIT
on change, reinitialising video/audio/input and flashing the screen. But the
VRR frame-timing is read per-frame in the runloop (swap-interval logic), so
that part needs no reinit -- the hotkey toggle already flips the setting with
none. The only init-time effect is the audio/video system-rate recompute in
driver_adjust_system_rates(): VRR locks audio to the exact content rate rather
than adjusting it to the display refresh.
That recompute has a lightweight, existing entry point --
RARCH_DRIVER_CTL_SET_REFRESH_RATE, already used by the refresh-rate settings --
which calls driver_adjust_system_rates() without recreating any driver. So:
- general_write_handler(): for VRR_RUNLOOP_ENABLE, re-adjust the rates via
that ctl, and point the setting at CMD_EVENT_NONE instead of the reinit.
- CMD_EVENT_VRR_RUNLOOP_TOGGLE (the hotkey): do the same rate re-adjust
after flipping the value. Previously the hotkey changed frame timing but
never recomputed the audio rate, leaving it stale until the next reinit;
this makes the hotkey and the menu toggle consistent.
Compile-verified. Reuses the existing SET_REFRESH_RATE rate-adjust path rather
than a new lifecycle, but it does touch runtime audio timing, so it warrants
an on-device check that toggling VRR still switches audio between exact-rate
and adjusted correctly.
Signed-off-by: LibretroAdmin <LibretroAdmin@users.noreply.github.com>1 parent 29da841 commit b47ee1e
2 files changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8937 | 8937 | | |
8938 | 8938 | | |
8939 | 8939 | | |
| 8940 | + | |
| 8941 | + | |
| 8942 | + | |
| 8943 | + | |
| 8944 | + | |
| 8945 | + | |
| 8946 | + | |
| 8947 | + | |
8940 | 8948 | | |
8941 | 8949 | | |
8942 | 8950 | | |
| |||
17325 | 17333 | | |
17326 | 17334 | | |
17327 | 17335 | | |
17328 | | - | |
| 17336 | + | |
17329 | 17337 | | |
17330 | 17338 | | |
17331 | 17339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5890 | 5890 | | |
5891 | 5891 | | |
5892 | 5892 | | |
| 5893 | + | |
| 5894 | + | |
| 5895 | + | |
| 5896 | + | |
| 5897 | + | |
5893 | 5898 | | |
5894 | 5899 | | |
5895 | 5900 | | |
| |||
0 commit comments