From 39fc5e1deb0c5753e7123529e4dd5c750aed1e8d Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 2 Oct 2016 12:33:34 +0200 Subject: player: make --stop-screensaver runtime-changeable Move the screensaver enable/disable determination to a central place, and call it if the stop-screensaver property is changed. Also, do not stop the screensaver when in idle mode (i.e. no file is loaded). Fixes #3615. --- player/loadfile.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'player/loadfile.c') diff --git a/player/loadfile.c b/player/loadfile.c index ba0e0bd257..ec8ddd6004 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1123,6 +1123,7 @@ reopen_file: mpctx->playback_initialized = true; mp_notify(mpctx, MPV_EVENT_FILE_LOADED, NULL); + update_screensaver_state(mpctx); if (mpctx->max_frames == 0) { if (!mpctx->stop_play) @@ -1177,6 +1178,7 @@ terminate_playback: uninit_audio_out(mpctx); mpctx->playback_initialized = false; + update_screensaver_state(mpctx); if (mpctx->stop_play == PT_RELOAD_FILE) { mpctx->stop_play = KEEP_PLAYING; -- cgit v1.2.3