diff options
Diffstat (limited to 'player/command.c')
-rw-r--r-- | player/command.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c index 0b19b20b6c..1bcf0c47e3 100644 --- a/player/command.c +++ b/player/command.c @@ -484,6 +484,9 @@ static int mp_property_stream_end(void *ctx, struct m_property *prop, // Assumes prop is the type of the actual property. static int property_time(int action, void *arg, double time) { + if (time == MP_NOPTS_VALUE) + return M_PROPERTY_UNAVAILABLE; + const struct m_option time_type = {.type = CONF_TYPE_TIME}; switch (action) { case M_PROPERTY_GET: @@ -652,6 +655,9 @@ static bool time_remaining(MPContext *mpctx, double *remaining) double len = get_time_length(mpctx); double playback = get_playback_time(mpctx); + if (playback == MP_NOPTS_VALUE) + return false; + *remaining = len - playback; return len >= 0; |