From e40885d963f8b60d83aa5ea8104985dd20af262f Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 19 Jun 2019 16:48:46 +0200 Subject: stream: create memory streams in more straightforward way Instead of having to rely on the protocol matching, make a function that creates a stream from a stream_info_t directly. Instead of going through a weird indirection with STREAM_CTRL, add a direct argument for non-text arguments to the open callback. Instead of creating a weird dummy mpv_global, just pass an existing one from all callers. (The latter one is just an artifact from the past, where mpv_global wasn't available everywhere.) Actually I just wanted a function that creates a stream without any of that bullshit. This goal was slightly missed, since you still need this heavy "constructor" just to setup a shitty struct with some shitty callbacks. --- demux/demux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demux/demux.c') diff --git a/demux/demux.c b/demux/demux.c index 2ce9010a86..075db9bd26 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -2968,7 +2968,7 @@ void demux_close_stream(struct demuxer *demuxer) MP_VERBOSE(demuxer, "demuxer read all data; closing stream\n"); free_stream(demuxer->stream); - demuxer->stream = open_memory_stream(NULL, 0); // dummy + demuxer->stream = stream_memory_open(demuxer->global, NULL, 0); // dummy demuxer->stream->cancel = demuxer->cancel; in->d_user->stream = demuxer->stream; } -- cgit v1.2.3