summaryrefslogtreecommitdiffstats
path: root/core/mplayer.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-06-14 00:24:41 +0200
committerwm4 <wm4@nowhere>2013-06-14 00:37:39 +0200
commitf1d3ba0e3318eb4b0ac5686fed4b80acb3753919 (patch)
treeb433072a2e2fc7ff04d4e413bdea94bada3a335c /core/mplayer.c
parent648c3d790a2e5123fdea0f02743058b59e85dd94 (diff)
downloadmpv-f1d3ba0e3318eb4b0ac5686fed4b80acb3753919.tar.bz2
mpv-f1d3ba0e3318eb4b0ac5686fed4b80acb3753919.tar.xz
x11: enable screensaver when paused, rename/change --stop-xscreensaver
Use the recently introduced screensaver VOCTRLs to control the screensaver in the X11 backend. This means the behavior when paused changes: the old code always kept the screensaver disabled, but now the screensaver is reenabled on pausing. Rename the --stop-xscreensaver option to --stop-screensaver and make it more generic. Now it affects all backends that respond to the screensaver VOCTRLs.
Diffstat (limited to 'core/mplayer.c')
-rw-r--r--core/mplayer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/mplayer.c b/core/mplayer.c
index 8b98e12bf0..5e1d58835e 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -2474,7 +2474,8 @@ int reinit_video_chain(struct MPContext *mpctx)
mpctx->initialized_flags |= INITIALIZED_VCODEC;
- vo_control(mpctx->video_out, opts->pause ? VOCTRL_RESTORE_SCREENSAVER
+ bool saver_state = opts->pause || !opts->stop_screensaver;
+ vo_control(mpctx->video_out, saver_state ? VOCTRL_RESTORE_SCREENSAVER
: VOCTRL_KILL_SCREENSAVER, NULL);
vo_control(mpctx->video_out, mpctx->paused ? VOCTRL_PAUSE
@@ -2754,7 +2755,7 @@ void unpause_player(struct MPContext *mpctx)
{
mpctx->opts.pause = 0;
- if (mpctx->video_out)
+ if (mpctx->video_out && mpctx->opts.stop_screensaver)
vo_control(mpctx->video_out, VOCTRL_KILL_SCREENSAVER, NULL);
if (!mpctx->paused)