From 3269bd178020c5d821e8b2d1fd807a38d63e93ce Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 12 Jul 2013 21:58:11 +0200 Subject: 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. --- demux/demux_rawaudio.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'demux/demux_rawaudio.c') diff --git a/demux/demux_rawaudio.c b/demux/demux_rawaudio.c index 13bbbb341a..83a89e7c1c 100644 --- a/demux/demux_rawaudio.c +++ b/demux/demux_rawaudio.c @@ -43,11 +43,15 @@ const m_option_t demux_rawaudio_opts[] = { }; -static int demux_rawaudio_open(demuxer_t* demuxer) { +static int demux_rawaudio_open(demuxer_t* demuxer, enum demux_check check) +{ struct sh_stream *sh; sh_audio_t* sh_audio; WAVEFORMATEX* w; + if (check != DEMUX_CHECK_REQUEST && check != DEMUX_CHECK_FORCE) + return -1; + if ((format & AF_FORMAT_SPECIAL_MASK) != 0) return -1; @@ -115,7 +119,6 @@ const demuxer_desc_t demuxer_desc_rawaudio = { .shortdesc = "rawaudio", .author = "?", .comment = "", - .type = DEMUXER_TYPE_RAWAUDIO, .fill_buffer = demux_rawaudio_fill_buffer, .open = demux_rawaudio_open, .seek = demux_rawaudio_seek, -- cgit v1.2.3