summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-08 00:13:27 +0200
committerwm4 <wm4@nowhere>2014-08-08 00:16:20 +0200
commitfa682af6ee1f545eaee2127096121848dd20abbf (patch)
tree5fa0531b27529ee5810756d9bd94d61bd0577087 /player
parent5f042864f5f0a0d0b785bbede81f4628ba478c87 (diff)
downloadmpv-fa682af6ee1f545eaee2127096121848dd20abbf.tar.bz2
mpv-fa682af6ee1f545eaee2127096121848dd20abbf.tar.xz
command: add a "seeking" property
The client API exports this state via events already, but maybe it's better to explicitly provide this property in order to facilitate use on OSD and similar cases.
Diffstat (limited to 'player')
-rw-r--r--player/command.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c
index df59e34714..9c73f076b9 100644
--- a/player/command.c
+++ b/player/command.c
@@ -1084,6 +1084,13 @@ static int mp_property_eof_reached(void *ctx, struct m_property *prop,
return m_property_flag_ro(action, arg, eof);
}
+static int mp_property_seeking(void *ctx, struct m_property *prop,
+ int action, void *arg)
+{
+ MPContext *mpctx = ctx;
+ return m_property_flag_ro(action, arg, !mpctx->restart_complete);
+}
+
static int mp_property_cache(void *ctx, struct m_property *prop,
int action, void *arg)
{
@@ -2695,6 +2702,7 @@ static const struct m_property mp_properties[] = {
{"pause", mp_property_pause},
{"core-idle", mp_property_core_idle},
{"eof-reached", mp_property_eof_reached},
+ {"seeking", mp_property_seeking},
{"cache", mp_property_cache},
{"cache-free", mp_property_cache_free},
{"cache-used", mp_property_cache_used},
@@ -2828,6 +2836,8 @@ static const char *const *const mp_event_property_change[] = {
"width", "height", "fps", "aspect"),
E(MPV_EVENT_AUDIO_RECONFIG, "audio-format", "audio-codec", "audio-bitrate",
"samplerate", "channels", "audio"),
+ E(MPV_EVENT_SEEK, "seeking"),
+ E(MPV_EVENT_PLAYBACK_RESTART, "seeking"),
E(MPV_EVENT_METADATA_UPDATE, "metadata"),
E(MPV_EVENT_CHAPTER_CHANGE, "chapter", "chapter-metadata"),
E(MP_EVENT_CACHE_UPDATE, "cache", "cache-free", "cache-used", "cache-idle"),