aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpdemux
diff options
context:
space:
mode:
authorGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-04-14 10:03:42 +0000
committerGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-04-14 10:03:42 +0000
commitef91f5aad83e6f017cbfa37339ae037d9f845800 (patch)
treeee883c495b57a96608590170dd4a62a36841a60f /libmpdemux
parentd6e892148652175a49f9376228cf677169df85c2 (diff)
Add lavf_preferred demuxer for lavf formats we want to be probed
before our native demuxers and remove some now unneeded file-extension hacks. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22989 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_lavf.c38
-rw-r--r--libmpdemux/demuxer.c2
-rw-r--r--libmpdemux/demuxer.h3
-rw-r--r--libmpdemux/extension.c4
4 files changed, 42 insertions, 5 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
index 8cee30b154..943739d323 100644
--- a/libmpdemux/demux_lavf.c
+++ b/libmpdemux/demux_lavf.c
@@ -210,6 +210,29 @@ static int lavf_check_file(demuxer_t *demuxer){
return DEMUXER_TYPE_LAVF;
}
+
+static const char *preferred_list[] = {
+ "dxa",
+ "wv",
+ "nuv",
+ "nut",
+ "gxf",
+ "mxf",
+ NULL
+};
+
+static int lavf_check_preferred_file(demuxer_t *demuxer){
+ if (lavf_check_file(demuxer)) {
+ char **p = preferred_list;
+ lavf_priv_t *priv = demuxer->priv;
+ while (*p) {
+ if (strcmp(*p, priv->avif->name) == 0)
+ return DEMUXER_TYPE_LAVF_PREFERRED;
+ p++;
+ }
+ }
+ return 0;
+}
static demuxer_t* demux_open_lavf(demuxer_t *demuxer){
AVFormatContext *avfc;
@@ -609,3 +632,18 @@ demuxer_desc_t demuxer_desc_lavf = {
demux_lavf_control
};
+demuxer_desc_t demuxer_desc_lavf_preferred = {
+ "libavformat preferred demuxer",
+ "lavfpref",
+ "libavformat",
+ "Michael Niedermayer",
+ "supports many formats, requires libavformat",
+ DEMUXER_TYPE_LAVF_PREFERRED,
+ 0, // Check after other demuxer
+ lavf_check_preferred_file,
+ demux_lavf_fill_buffer,
+ demux_open_lavf,
+ demux_close_lavf,
+ demux_seek_lavf,
+ demux_lavf_control
+};
diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c
index 5546d8b09b..b05e990e31 100644
--- a/libmpdemux/demuxer.c
+++ b/libmpdemux/demuxer.c
@@ -64,6 +64,7 @@ extern demuxer_desc_t demuxer_desc_xmms;
extern demuxer_desc_t demuxer_desc_mpeg_ty;
extern demuxer_desc_t demuxer_desc_rtp;
extern demuxer_desc_t demuxer_desc_lavf;
+extern demuxer_desc_t demuxer_desc_lavf_preferred;
extern demuxer_desc_t demuxer_desc_aac;
extern demuxer_desc_t demuxer_desc_nut;
@@ -74,6 +75,7 @@ demuxer_desc_t* demuxer_list[] = {
&demuxer_desc_tv,
#endif
&demuxer_desc_mf,
+ &demuxer_desc_lavf_preferred,
&demuxer_desc_avi,
&demuxer_desc_y4m,
&demuxer_desc_asf,
diff --git a/libmpdemux/demuxer.h b/libmpdemux/demuxer.h
index e3973fde88..6c9eb2b57d 100644
--- a/libmpdemux/demuxer.h
+++ b/libmpdemux/demuxer.h
@@ -55,11 +55,12 @@
#define DEMUXER_TYPE_MPEG_PES 41
#define DEMUXER_TYPE_MPEG_GXF 42
#define DEMUXER_TYPE_NUT 43
+#define DEMUXER_TYPE_LAVF_PREFERRED 44
// This should always match the higest demuxer type number.
// Unless you want to disallow users to force the demuxer to some types
#define DEMUXER_TYPE_MIN 0
-#define DEMUXER_TYPE_MAX 43
+#define DEMUXER_TYPE_MAX 44
#define DEMUXER_TYPE_DEMUXERS (1<<16)
// A virtual demuxer type for the network code
diff --git a/libmpdemux/extension.c b/libmpdemux/extension.c
index 3cded017da..463c21cfc0 100644
--- a/libmpdemux/extension.c
+++ b/libmpdemux/extension.c
@@ -57,20 +57,16 @@ static struct {
#ifdef USE_WIN32DLL
{ "avs", DEMUXER_TYPE_AVS },
#endif
- { "nut", DEMUXER_TYPE_LAVF },
{ "swf", DEMUXER_TYPE_LAVF },
{ "flv", DEMUXER_TYPE_LAVF },
{ "302", DEMUXER_TYPE_LAVF },
{ "264", DEMUXER_TYPE_H264_ES },
{ "26l", DEMUXER_TYPE_H264_ES },
{ "ac3", DEMUXER_TYPE_LAVF },
- { "wv", DEMUXER_TYPE_LAVF },
// At least the following are hacks against broken autodetection
// that should not be there
-// demux_audio is too greedy
- { "dxa", DEMUXER_TYPE_LAVF },
};
int demuxer_type_by_filename(char* filename){