summaryrefslogtreecommitdiffstats
path: root/core/mplayer.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-04-04 14:24:42 +0200
committerwm4 <wm4@nowhere>2013-04-04 14:24:42 +0200
commitccc213fdac9783b9e450342cf5a346508e961e2f (patch)
treeb98a96a0c6514e48b0322eaf3552f8503d331f16 /core/mplayer.c
parente1d57504b3e48099f447842713e60f0eef0e04db (diff)
downloadmpv-ccc213fdac9783b9e450342cf5a346508e961e2f.tar.bz2
mpv-ccc213fdac9783b9e450342cf5a346508e961e2f.tar.xz
core: add --heartbeat-interval option
This closely follows MPlayer commit 36099, with some changes. Move a mutable static variable into MPContext.
Diffstat (limited to 'core/mplayer.c')
-rw-r--r--core/mplayer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/mplayer.c b/core/mplayer.c
index 460862f057..21af9ca57a 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -3243,10 +3243,11 @@ static void run_playloop(struct MPContext *mpctx)
vo_check_events(vo);
if (opts->heartbeat_cmd) {
- static unsigned last_heartbeat;
unsigned now = GetTimerMS();
- if (now - last_heartbeat > 30000) {
- last_heartbeat = now;
+ if (now - mpctx->last_heartbeat >
+ (unsigned)(opts->heartbeat_interval * 1000))
+ {
+ mpctx->last_heartbeat = now;
system(opts->heartbeat_cmd);
}
}