diff options
author | wm4 <wm4@nowhere> | 2018-09-07 22:40:12 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-09-19 20:37:04 +0200 |
commit | b1c202c12fdd2b53f49e7a9ca5c2f4b84733f511 (patch) | |
tree | 20d564f9f6e68bd628d236cc6fd2841dcc686e33 /demux/demux_edl.c | |
parent | 5c7ecad93a771d71a773cace996afd706bbef3d2 (diff) | |
download | mpv-b1c202c12fdd2b53f49e7a9ca5c2f4b84733f511.tar.bz2 mpv-b1c202c12fdd2b53f49e7a9ca5c2f4b84733f511.tar.xz |
demux: make demux_open() private
I always wanted to get rid of this, because it makes the ownership rules
for the stream pointer really awkward. demux_edl.c was the only
remaining user of this. Replace it with a semi-clever idea: the init
segment shit can be used to pass the "file" contents as memory block,
and "memory://" itself provides an empty stream. I have no idea if this
actually works, because I didn't immediately find a test stream (would
have to be some youtube DASH shit).
Diffstat (limited to 'demux/demux_edl.c')
-rw-r--r-- | demux/demux_edl.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/demux/demux_edl.c b/demux/demux_edl.c index 7f85568eae..9fbdbc9acf 100644 --- a/demux/demux_edl.c +++ b/demux/demux_edl.c @@ -237,10 +237,12 @@ static void build_timeline(struct timeline *tl, struct tl_parts *parts) MP_ERR(tl, "Could not read init fragment.\n"); goto error; } - s = open_memory_stream(tl->init_fragment.start, tl->init_fragment.len); - tl->track_layout = demux_open(s, NULL, tl->global); + struct demuxer_params params = { + .init_fragment = tl->init_fragment, + }; + tl->track_layout = demux_open_url("memory://", ¶ms, tl->cancel, + tl->global); if (!tl->track_layout) { - free_stream(s); MP_ERR(tl, "Could not demux init fragment.\n"); goto error; } |