summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-04-14 22:19:07 +0200
committerwm4 <wm4@nowhere>2014-04-14 22:19:07 +0200
commit60b900487257a3435df02c2b2ce54551c59e4311 (patch)
tree3e9975204ed1403e250604ea60bd5fc14b1b0abf /player/command.c
parent1e3e7bb7f4dd87d767c519c73a0ac6e26bd19c15 (diff)
downloadmpv-60b900487257a3435df02c2b2ce54551c59e4311.tar.bz2
mpv-60b900487257a3435df02c2b2ce54551c59e4311.tar.xz
command: add property to indicate when pausing due to --keep-open
This property is set to "yes" if playback was paused due to --keep-open. The change notification might not always be perfect; maybe that should be improved.
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/player/command.c b/player/command.c
index 1bf05bf56e..f718cb3147 100644
--- a/player/command.c
+++ b/player/command.c
@@ -991,6 +991,13 @@ static int mp_property_core_idle(m_option_t *prop, int action, void *arg,
return m_property_int_ro(prop, action, arg, mpctx->paused);
}
+static int mp_property_eof_reached(m_option_t *prop, int action, void *arg,
+ void *ctx)
+{
+ MPContext *mpctx = ctx;
+ return m_property_int_ro(prop, action, arg, mpctx->eof_reached);
+}
+
static int mp_property_cache(m_option_t *prop, int action, void *arg,
void *ctx)
{
@@ -2252,6 +2259,8 @@ static const m_option_t mp_properties[] = {
M_OPTION_PROPERTY_CUSTOM("pause", mp_property_pause),
{ "core-idle", mp_property_core_idle, CONF_TYPE_FLAG,
M_OPT_RANGE, 0, 1, NULL },
+ { "eof-reached", mp_property_eof_reached, CONF_TYPE_FLAG,
+ M_OPT_RANGE, 0, 1, NULL },
{ "cache", mp_property_cache, CONF_TYPE_INT },
{ "cache-size", mp_property_cache_size, CONF_TYPE_INT, M_OPT_MIN, 0 },
{ "paused-for-cache", mp_property_paused_for_cache, CONF_TYPE_FLAG,
@@ -2389,8 +2398,8 @@ const char **mp_event_property_change[] = {
E(MPV_EVENT_TRACK_SWITCHED, "vid", "video", "aid", "audio", "sid", "sub",
"secondary-sid"),
E(MPV_EVENT_IDLE, "*"),
- E(MPV_EVENT_PAUSE, "pause", "paused-on-cache", "core-idle"),
- E(MPV_EVENT_UNPAUSE, "pause", "paused-on-cache", "core-idle"),
+ E(MPV_EVENT_PAUSE, "pause", "paused-on-cache", "core-idle", "eof-reached"),
+ E(MPV_EVENT_UNPAUSE, "pause", "paused-on-cache", "core-idle", "eof-reached"),
E(MPV_EVENT_TICK, "time-pos", "stream-pos", "stream-time-pos", "avsync",
"percent-pos", "time-remaining", "playtime-remaining"),
E(MPV_EVENT_VIDEO_RECONFIG, "video-out-params", "video-params",