summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-01-17 15:26:16 +0100
committerwm4 <wm4@nowhere>2020-01-17 15:26:16 +0100
commitee7be62dbc3c25b835c5f14b81382a5c306aa15b (patch)
treeaff72f056da03603fb0880d0e57fe2d6609c7953
parentad1ae6425196cd6ad6237f96423caa5c8533a2ba (diff)
downloadmpv-ee7be62dbc3c25b835c5f14b81382a5c306aa15b.tar.bz2
mpv-ee7be62dbc3c25b835c5f14b81382a5c306aa15b.tar.xz
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.
-rw-r--r--player/configfiles.c12
1 files 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;