From 8d414e2fe7f79f1bbf9158e8aa034e9ac9cf2222 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 16 Oct 2015 16:16:10 +0200 Subject: command: make time properties unavailable if timestamp is unknown Let's hope this doesn't confuse client API users too much. It's still the best solution to get rid of corner cases where it actually return the wrong timestamp on start, and then suddenly jump. --- player/configfiles.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'player/configfiles.c') diff --git a/player/configfiles.c b/player/configfiles.c index 29acdda6b9..db19685c0f 100644 --- a/player/configfiles.c +++ b/player/configfiles.c @@ -286,10 +286,6 @@ void mp_write_watch_later_conf(struct MPContext *mpctx) goto exit; } - double pos = get_current_time(mpctx); - if (pos == MP_NOPTS_VALUE) - goto exit; - mp_mk_config_dir(mpctx->global, MP_WATCH_LATER_CONF); conffile = mp_get_playback_resume_config_filename(mpctx, filename); @@ -307,7 +303,9 @@ void mp_write_watch_later_conf(struct MPContext *mpctx) write_name[n] = (unsigned char)filename[n] < 32 ? '_' : filename[n]; fprintf(file, "# %s\n", write_name); } - fprintf(file, "start=%f\n", pos); + double pos = get_current_time(mpctx); + if (pos != MP_NOPTS_VALUE) + fprintf(file, "start=%f\n", pos); for (int i = 0; backup_properties[i]; i++) { const char *pname = backup_properties[i]; char *val = NULL; -- cgit v1.2.3