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.
This commit is contained in:
wm4 2020-01-17 15:26:16 +01:00
parent ad1ae64251
commit ee7be62dbc
1 changed files with 7 additions and 5 deletions

View File

@ -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;