diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/encode_lavc.c | 4 | ||||
-rw-r--r-- | common/playlist.c | 6 | ||||
-rw-r--r-- | common/playlist.h | 7 |
3 files changed, 9 insertions, 8 deletions
diff --git a/common/encode_lavc.c b/common/encode_lavc.c index 2b9bdb4a66..b64232fb87 100644 --- a/common/encode_lavc.c +++ b/common/encode_lavc.c @@ -830,7 +830,9 @@ static void encoder_2pass_prepare(struct encoder_context *p) if (p->encoder->flags & AV_CODEC_FLAG_PASS2) { MP_INFO(p, "Reading 2-pass log: %s\n", filename); - struct stream *s = stream_open(filename, p->global); + struct stream *s = stream_create(filename, + STREAM_ORIGIN_DIRECT | STREAM_READ, + NULL, p->global); if (s) { struct bstr content = stream_read_complete(s, p, 1000000000); if (content.start) { diff --git a/common/playlist.c b/common/playlist.c index 7572e67780..b5d6ca15c2 100644 --- a/common/playlist.c +++ b/common/playlist.c @@ -32,6 +32,7 @@ struct playlist_entry *playlist_entry_new(const char *filename) struct playlist_entry *e = talloc_zero(NULL, struct playlist_entry); char *local_filename = mp_file_url_to_filename(e, bstr0(filename)); e->filename = local_filename ? local_filename : talloc_strdup(e, filename); + e->stream_flags = STREAM_ORIGIN_DIRECT; return e; } @@ -281,7 +282,10 @@ struct playlist *playlist_parse_file(const char *file, struct mp_cancel *cancel, struct mp_log *log = mp_log_new(NULL, global->log, "!playlist_parser"); mp_verbose(log, "Parsing playlist file %s...\n", file); - struct demuxer_params p = {.force_format = "playlist"}; + struct demuxer_params p = { + .force_format = "playlist", + .stream_flags = STREAM_ORIGIN_DIRECT, + }; struct demuxer *d = demux_open_url(file, &p, cancel, global); if (!d) { talloc_free(log); diff --git a/common/playlist.h b/common/playlist.h index a37c516519..bbf6821428 100644 --- a/common/playlist.h +++ b/common/playlist.h @@ -53,11 +53,8 @@ struct playlist_entry { // Additional refcount. Normally (reserved==0), the entry is owned by the // playlist, and this can be used to keep the entry alive. int reserved; + // Any flags from STREAM_ORIGIN_FLAGS. 0 if unknown. // Used to reject loading of unsafe entries from external playlists. - // Can have any of the following bit flags set: - // STREAM_SAFE_ONLY: only allow streams marked with is_safe - // STREAM_NETWORK_ONLY: only allow streams marked with is_network - // The value 0 allows everything. int stream_flags; }; @@ -69,8 +66,6 @@ struct playlist { // current_was_replaced is set to true. struct playlist_entry *current; bool current_was_replaced; - - bool disable_safety; }; void playlist_entry_add_param(struct playlist_entry *e, bstr name, bstr value); |