From ee7be62dbc3c25b835c5f14b81382a5c306aa15b Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 17 Jan 2020 15:26:16 +0100 Subject: player: write watch-later config even for unseekable streams I think there was a user complaint that this does not restore the playlist position. There's no reason not to save the "state" for unseekable streams; what we probably don't want is to make restoring trying to issue a seek. So just don't save the position. (Although we probably could anyway, since seek requests on unseekable streams are ignored now.) Fixes: issue number forgotten, if it even exists. --- player/configfiles.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/player/configfiles.c b/player/configfiles.c index 5cea24e22c..95fa5938e0 100644 --- a/player/configfiles.c +++ b/player/configfiles.c @@ -334,10 +334,6 @@ void mp_write_watch_later_conf(struct MPContext *mpctx) goto exit; struct demuxer *demux = mpctx->demuxer; - if (demux && (!demux->seekable || demux->partially_seekable)) { - MP_INFO(mpctx, "Not seekable - not saving state.\n"); - goto exit; - } conffile = mp_get_playback_resume_config_filename(mpctx, cur->filename); if (!conffile) @@ -354,8 +350,14 @@ void mp_write_watch_later_conf(struct MPContext *mpctx) write_filename(mpctx, file, cur->filename); double pos = get_current_time(mpctx); - if (pos != MP_NOPTS_VALUE) + + if ((demux && (!demux->seekable || demux->partially_seekable)) || + pos == MP_NOPTS_VALUE) + { + MP_INFO(mpctx, "Not seekable, or time unknown - not saving position.\n"); + } else { 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