2 * This file is part of MPlayer.
4 * MPlayer is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * MPlayer is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #include "stream/stream.h"
29 * An autodetection based on the extension is not a good idea, but we don't care ;-)
32 const char *extension
;
34 } extensions_table
[] = {
35 // { "mpeg", DEMUXER_TYPE_MPEG_PS },
36 // { "mpg", DEMUXER_TYPE_MPEG_PS },
37 // { "mpe", DEMUXER_TYPE_MPEG_PS },
38 { "vob", DEMUXER_TYPE_MPEG_PS
},
39 { "m2v", DEMUXER_TYPE_MPEG_PS
},
40 { "avi", DEMUXER_TYPE_AVI
},
41 { "mp4", DEMUXER_TYPE_LAVF
},
42 { "mov", DEMUXER_TYPE_LAVF
},
43 { "qt", DEMUXER_TYPE_LAVF
},
44 { "asx", DEMUXER_TYPE_ASF
},
45 { "asf", DEMUXER_TYPE_ASF
},
46 { "wmv", DEMUXER_TYPE_ASF
},
47 { "wma", DEMUXER_TYPE_ASF
},
48 { "viv", DEMUXER_TYPE_VIVO
},
49 { "vivo", DEMUXER_TYPE_VIVO
},
50 { "rm", DEMUXER_TYPE_REAL
},
51 { "rmvb", DEMUXER_TYPE_REAL
},
52 { "ra", DEMUXER_TYPE_REAL
},
53 { "y4m", DEMUXER_TYPE_Y4M
},
54 { "mp3", DEMUXER_TYPE_AUDIO
},
55 { "wav", DEMUXER_TYPE_AUDIO
},
56 { "flac", DEMUXER_TYPE_AUDIO
},
57 { "fla", DEMUXER_TYPE_AUDIO
},
58 { "ogg", DEMUXER_TYPE_OGG
},
59 { "ogm", DEMUXER_TYPE_OGG
},
60 // { "pls", DEMUXER_TYPE_PLAYLIST },
61 // { "m3u", DEMUXER_TYPE_PLAYLIST },
62 { "xm", DEMUXER_TYPE_XMMS
},
63 { "mod", DEMUXER_TYPE_XMMS
},
64 { "s3m", DEMUXER_TYPE_XMMS
},
65 { "it", DEMUXER_TYPE_XMMS
},
66 { "mid", DEMUXER_TYPE_XMMS
},
67 { "midi", DEMUXER_TYPE_XMMS
},
68 { "vqf", DEMUXER_TYPE_XMMS
},
69 { "nsv", DEMUXER_TYPE_NSV
},
70 { "nsa", DEMUXER_TYPE_NSV
},
71 { "mpc", DEMUXER_TYPE_MPC
},
72 #ifdef CONFIG_WIN32DLL
73 { "avs", DEMUXER_TYPE_AVS
},
75 { "302", DEMUXER_TYPE_LAVF
},
76 { "264", DEMUXER_TYPE_H264_ES
},
77 { "26l", DEMUXER_TYPE_H264_ES
},
78 { "ac3", DEMUXER_TYPE_LAVF
},
79 { "ape", DEMUXER_TYPE_LAVF
},
80 { "apl", DEMUXER_TYPE_LAVF
},
81 { "eac3",DEMUXER_TYPE_LAVF
},
82 { "mac", DEMUXER_TYPE_LAVF
},
83 { "str", DEMUXER_TYPE_LAVF
},
85 // At least the following are hacks against broken autodetection
86 // that should not be there
90 int demuxer_type_by_filename(char* filename
){
92 char* extension
=strrchr(filename
,'.');
93 mp_msg(MSGT_OPEN
, MSGL_V
, "Searching demuxer type for filename %s ext: %s\n",filename
,extension
);
96 // mp_msg(MSGT_CPLAYER,MSGL_DBG2,"Extension: %s\n", extension );
97 // Look for the extension in the extensions table
98 for( i
=0 ; i
<(sizeof(extensions_table
)/sizeof(extensions_table
[0])) ; i
++ ) {
99 if( !strcasecmp(extension
, extensions_table
[i
].extension
) ) {
100 mp_msg(MSGT_OPEN
, MSGL_V
, "Trying demuxer %d based on filename extension\n",extensions_table
[i
].demuxer_type
);
101 return extensions_table
[i
].demuxer_type
;
105 return DEMUXER_TYPE_UNKNOWN
;