Skip to content

Commit

Permalink
player: write watch-later config even for unseekable streams
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wm4 committed Jan 17, 2020
1 parent ad1ae64 commit ee7be62
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions player/configfiles.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
Expand Down

0 comments on commit ee7be62

Please sign in to comment.