From 75b1d5043fdfe672417ef8d58f8fa87672aadde9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 4 Aug 2015 01:01:09 +0200 Subject: player: use demux_open_url() to open main files Instead of opening a stream and then a demuxer, do both at once with demux_open_url(). This requires some awkward additions to demuxer_params, because there are some weird features associated with opening the main file. E.g. the relatively useless --stream-capture features requires enabling capturing on the stream before the demuxer is opened, but on the other hand shouldn't be done on secondary files like external subtitles. Also relatively bad: since demux_open_url() returns just a demuxer pointer or NULL, additional error reporting is done via demuxer_params. Still, at least conceptually, it's ok, and simpler than before. --- demux/demux.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'demux/demux.h') 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 { -- cgit v1.2.3