path: root/demux/demux_mkv.c
diff options
authorwm4 <wm4@nowhere>2013-07-12 21:58:11 +0200
committerwm4 <wm4@nowhere>2013-07-12 22:16:26 +0200
commit3269bd178020c5d821e8b2d1fd807a38d63e93ce (patch)
tree474e0f7a712cc7002984ec1bdda7d445b5fd8c77 /demux/demux_mkv.c
parent311d2f199a7b1f4d819cfb799a0f0f571596b91e (diff)
demux: rewrite probing and demuxer initialization
Get rid of the strange and messy reliance on DEMUXER_TYPE_ constants. Instead of having two open functions for the demuxer callbacks (which somehow are both optional, but you can also decide to implement both...), just have one function. This function takes a parameter that tells the demuxer how strictly it should check for the file headers. This is a nice simplification and allows more flexibility. Remove the file extension code. This literally did nothing (anymore). Change demux_lavf so that we check our other builtin demuxers first before libavformat tries to guess by file extension.
Diffstat (limited to 'demux/demux_mkv.c')
1 files changed, 2 insertions, 3 deletions
diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c
index a60172cce9..efc4c8f989 100644
--- a/demux/demux_mkv.c
+++ b/demux/demux_mkv.c
@@ -1751,7 +1751,7 @@ static int read_mkv_segment_header(demuxer_t *demuxer)
return 0;
-static int demux_mkv_open(demuxer_t *demuxer)
+static int demux_mkv_open(demuxer_t *demuxer, enum demux_check check)
stream_t *s = demuxer->stream;
mkv_demuxer_t *mkv_d;
@@ -2724,8 +2724,7 @@ const demuxer_desc_t demuxer_desc_matroska = {
.author = "Aurelien Jacobs",
.comment = "",
- .safe_check = 1, // safe autodetect
- .check_file = demux_mkv_open,
+ .open = demux_mkv_open,
.fill_buffer = demux_mkv_fill_buffer,
.close = mkv_free,
.seek = demux_mkv_seek,