-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
loadfile: discard prefetched files if demuxer options changed #15456
base: master
Are you sure you want to change the base?
Conversation
Download the artifacts for this pull request: |
ab8137f
to
9603a0a
Compare
options/m_option.h
Outdated
@@ -443,7 +443,8 @@ char *format_file_size(int64_t size); | |||
#define UPDATE_VIDEO (1 << 15) // force redraw if needed | |||
#define UPDATE_VO (1 << 16) // reinit the VO | |||
#define UPDATE_CLIPBOARD (1 << 17) // reinit the clipboard | |||
#define UPDATE_OPT_LAST (1 << 17) | |||
#define UPDATE_DEMUXER (1 << 18) // invalidate prefetched files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this invalidate prefetched files or all demuxer cache? The name is ambiguous.
player/loadfile.c
Outdated
} else { | ||
if (done) { | ||
if (correct_url && !mpctx->demuxer_changed && failed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is hard to read for me. Not sure I get it right, but I would try to reduce demuxer_changed
checks,
if (correct_url && !mpctx->demuxer_changed && !failed) {
MP_VERBOSE(mpctx, "Using prefetched/prefetching URL.\n");
} else {
if (correct_url && failed) {
MP_VERBOSE(mpctx, "Prefetched URL failed, retrying.\n");
} else if (mpctx->demuxer_changed) {
if (done) {
MP_VERBOSE(mpctx, "Dropping finished prefetch because demuxer options changed.\n");
} else {
MP_VERBOSE(mpctx, "Aborting ongoing prefetch because demuxer options changed.\n");
}
} else {
if (done) {
MP_VERBOSE(mpctx, "Dropping finished prefetch of wrong URL.\n");
} else {
MP_VERBOSE(mpctx, "Aborting ongoing prefetch of wrong URL.\n");
}
}
cancel_open(mpctx);
}
When using --prefetch-playlist, if demuxer options are changed in the time window between the start of prefetching and the playback of the next file, the old values are used. This includes setting demuxer options in legacy extension auto profiles. Fix this by setting a flag when demuxer options change and not using the prefetched data when that flag is true. UPDATE_DEMUXER is not added to demux.c's options because those already support updates while playing.
9603a0a
to
cfa8f91
Compare
When using --prefetch-playlist, if demuxer options are changed in the time window between the start of prefetching and the playback of the next file, the old values are used. This includes setting demuxer options in legacy extension auto profiles.
Fix this by setting a flag when demuxer options change and not using the prefetched data when that flag is true.
UPDATE_DEMUXER is not added to demux.c's options because those already support updates while playing.