diff options
author | wm4 <wm4@nowhere> | 2015-02-20 21:56:55 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-02-20 21:56:55 +0100 |
commit | 1cac7d1a659faffd1514a3269edf9fcae4d357c1 (patch) | |
tree | feaa280fa28a416691f2fe2e0cd56f588746dcd1 /demux/demux_edl.c | |
parent | 6aa6778ac46672dd237acc86856353d133917f06 (diff) | |
download | mpv-1cac7d1a659faffd1514a3269edf9fcae4d357c1.tar.bz2 mpv-1cac7d1a659faffd1514a3269edf9fcae4d357c1.tar.xz |
demux: add a demux_open_url() function
Often stream and a demuxer are opened at the same time. Provide a
function for this and replace most of its uses.
Diffstat (limited to 'demux/demux_edl.c')
-rw-r--r-- | demux/demux_edl.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/demux/demux_edl.c b/demux/demux_edl.c index ba88e6a3d5..7986489397 100644 --- a/demux/demux_edl.c +++ b/demux/demux_edl.c @@ -134,22 +134,6 @@ error: return NULL; } -static struct demuxer *open_file(char *filename, struct timeline *tl) -{ - struct MPOpts *opts = tl->global->opts; - struct demuxer *d = NULL; - struct stream *s = stream_open(filename, tl->global); - if (s) { - stream_enable_cache(&s, &opts->stream_cache); - d = demux_open(s, NULL, tl->global); - } - if (!d) { - MP_ERR(tl, "EDL: Could not open source file '%s'.\n", filename); - free_stream(s); - } - return d; -} - static struct demuxer *open_source(struct timeline *tl, char *filename) { for (int n = 0; n < tl->num_sources; n++) { @@ -157,9 +141,12 @@ static struct demuxer *open_source(struct timeline *tl, char *filename) if (strcmp(d->stream->url, filename) == 0) return d; } - struct demuxer *d = open_file(filename, tl); - if (d) + struct demuxer *d = demux_open_url(filename, NULL, NULL, tl->global); + if (d) { MP_TARRAY_APPEND(tl, tl->sources, tl->num_sources, d); + } else { + MP_ERR(tl, "EDL: Could not open source file '%s'.\n", filename); + } return d; } |