From 654c34f77166d24914d3ff0a2923c128d846430d Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 14 Apr 2013 19:19:35 +0200 Subject: demux: add functions to simplify demuxers Some preparations to simplify demux_mkv and demux_lavf. struct demux_stream manages state for each stream type that is being demuxed (audio/video/sub). demux_stream is rather annoying, especially the id and sh members, which are often used by the demuxers to determine current stream and so on. Demuxers don't really have to access this, except for testing whether a stream is selected and to add packets. Add a new_sh_stream(), which allows creating streams without having the caller specify any kind of stream ID. Demuxers should just use sh_stream pointers, instead of multiple kinds of IDs and indexes. --- demux/stheader.h | 1 + 1 file changed, 1 insertion(+) (limited to 'demux/stheader.h') diff --git a/demux/stheader.h b/demux/stheader.h index 8d1822c99f..03fdf4d2ea 100644 --- a/demux/stheader.h +++ b/demux/stheader.h @@ -190,6 +190,7 @@ struct sh_video *new_sh_video_vid(struct demuxer *demuxer, int id, int vid); struct sh_sub *new_sh_sub_sid(struct demuxer *demuxer, int id, int sid); struct sh_sub *new_sh_sub_sid_lang(struct demuxer *demuxer, int id, int sid, const char *lang); +struct sh_stream *new_sh_stream(struct demuxer *demuxer, enum stream_type type); const char *sh_sub_type2str(int type); -- cgit v1.2.3