diff options
author | GhostNaN <GhostNaN@protonmail.com> | 2023-11-02 14:40:09 -0400 |
---|---|---|
committer | GhostNaN <GhostNaN@protonmail.com> | 2023-11-02 14:40:09 -0400 |
commit | 8678234c163d0b0b616ec9ff6e5e0e1c87e0e6f4 (patch) | |
tree | b3a89b6b142c313ac7bb86033a12a9dc2b05aa81 | |
parent | 390f763cf368fe07ae2637b059485ddeab63ec91 (diff) |
Make the auto pause unpause faster1.4
-rw-r--r-- | src/main.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -301,23 +301,23 @@ static void *monitor_stoplist() { static void *handle_auto_pause() { pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); - bool auto_paused = 0; while (halt_info.auto_pause) { // Set deadman switch timer halt_info.frame_ready = 0; pthread_sleep(2); - if (!halt_info.frame_ready && !auto_paused && !halt_info.is_paused) { + if (!halt_info.frame_ready && !halt_info.is_paused) { if (VERBOSE) cflp_info("Pausing because mpvpaper is hidden"); mpv_command_async(mpv, 0, (const char*[]) {"set", "pause", "yes", NULL}); - auto_paused = 1; halt_info.is_paused += 1; - } else if (halt_info.frame_ready && auto_paused) { - auto_paused = 0; - if (halt_info.is_paused) - halt_info.is_paused -= 1; + + while(!halt_info.frame_ready) { + pthread_usleep(10000); + } + if (halt_info.is_paused) + halt_info.is_paused -= 1; } } pthread_exit(NULL); |