diff options
Diffstat (limited to 'demux')
-rw-r--r-- | demux/demux.c | 14 | ||||
-rw-r--r-- | demux/demux.h | 7 |
2 files changed, 17 insertions, 4 deletions
diff --git a/demux/demux.c b/demux/demux.c index 2d40643a71..ba2678466f 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -1077,14 +1077,22 @@ struct demuxer *demux_open_url(const char *url, struct mpv_global *global) { struct MPOpts *opts = global->opts; - struct stream *s = stream_create(url, STREAM_READ, cancel, global); + struct demuxer_params dummy = {0}; + if (!params) + params = &dummy; + struct stream *s = stream_create(url, STREAM_READ | params->stream_flags, + cancel, global); if (!s) return NULL; - if (!(params && params->disable_cache)) + if (params->allow_capture) + stream_set_capture_file(s, opts->stream_capture); + if (!params->disable_cache) stream_enable_cache(&s, &opts->stream_cache); struct demuxer *d = demux_open(s, params, global); - if (!d) + if (!d) { + params->demuxer_failed = true; free_stream(s); + } return d; } diff --git a/demux/demux.h b/demux/demux.h index 09b49bbf97..22c7323ef1 100644 --- a/demux/demux.h +++ b/demux/demux.h @@ -169,7 +169,12 @@ struct demuxer_params { int matroska_wanted_segment; bool *matroska_was_valid; bool expect_subtitle; - bool disable_cache; // demux_open_url() only + // -- demux_open_url() only + int stream_flags; + bool allow_capture; + bool disable_cache; + // result + bool demuxer_failed; }; typedef struct demuxer { |