summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-09-15 02:13:54 +0200
committerwm4 <wm4@nowhere>2013-09-15 02:13:54 +0200
commita87298e5015f083b6ea294f578dc0d54e1f0f88f (patch)
treea2ddd9ec2264a64dec1a28163e9a19e3feca8d3f
parent534842b69400698435c7937f15a1347ba12ff605 (diff)
downloadmpv-a87298e5015f083b6ea294f578dc0d54e1f0f88f.tar.bz2
mpv-a87298e5015f083b6ea294f578dc0d54e1f0f88f.tar.xz
mplayer: don't run heartbeat command while paused
This is commonly used to disable the screensaver with broken/non- standard X screensavers. During pause, the screensaver should not be disabled, so not calling this command while paused seems sensible. See github issue #236.
-rw-r--r--DOCS/man/en/options.rst6
-rw-r--r--mpvcore/mplayer.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst
index 8ac563004a..e1134ef864 100644
--- a/DOCS/man/en/options.rst
+++ b/DOCS/man/en/options.rst
@@ -989,7 +989,8 @@
``--heartbeat-cmd=<command>``
Command that is executed every 30 seconds during playback via *system()* -
i.e. using the shell. The time between the commands can be customized with
- the ``--heartbeat-interval`` option.
+ the ``--heartbeat-interval`` option. The command is not run while playback
+ is paused.
.. note::
@@ -1002,7 +1003,8 @@
This can be "misused" to disable screensavers that do not support the
proper X API (see also ``--stop-screensaver``). If you think this is too
complicated, ask the author of the screensaver program to support the
- proper X APIs.
+ proper X APIs. Note that the ``--stop-screensaver`` does not influence the
+ heartbeat code at all.
.. admonition:: Example for xscreensaver
diff --git a/mpvcore/mplayer.c b/mpvcore/mplayer.c
index c8991fb64e..06017c7d32 100644
--- a/mpvcore/mplayer.c
+++ b/mpvcore/mplayer.c
@@ -3392,7 +3392,7 @@ static void handle_pause_on_low_cache(struct MPContext *mpctx)
static void handle_heartbeat_cmd(struct MPContext *mpctx)
{
struct MPOpts *opts = mpctx->opts;
- if (opts->heartbeat_cmd) {
+ if (opts->heartbeat_cmd && !mpctx->paused) {
double now = mp_time_sec();
if (now - mpctx->last_heartbeat > opts->heartbeat_interval) {
mpctx->last_heartbeat = now;