diff options
author | wm4 <wm4@nowhere> | 2015-10-16 16:16:10 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-10-16 16:16:10 +0200 |
commit | 8d414e2fe7f79f1bbf9158e8aa034e9ac9cf2222 (patch) | |
tree | 6c5d512e3d79f882e8a5b16599f91b02109cfb6c /player/configfiles.c | |
parent | 2483dab54d77288db218030910f6b1b4b08292e5 (diff) | |
download | mpv-8d414e2fe7f79f1bbf9158e8aa034e9ac9cf2222.tar.bz2 mpv-8d414e2fe7f79f1bbf9158e8aa034e9ac9cf2222.tar.xz |
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.
Diffstat (limited to 'player/configfiles.c')
-rw-r--r-- | player/configfiles.c | 8 |
1 files changed, 3 insertions, 5 deletions
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; |