1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-24 07:42:17 +00:00

demux_lavf: use lavf for all formats except those listed

lavf demuxers are mostly better and receive more maintenance,
therefore it makes sense to prefer them in most cases. Change the
"preferred" logic from listing all formats for which lavf is preferred
to listing exceptions for which it isn't. Currently there are 3
exceptions: Matroska, FLAC and RealMedia (.rm).
This commit is contained in:
Anton Khirnov 2010-11-08 17:02:42 +01:00 committed by Uoti Urpala
parent a4ce95de81
commit 91ea30c585

View File

@ -229,21 +229,15 @@ static bool matches_avinputformat_name(struct lavf_priv *priv,
} }
} }
static const char * const preferred_list[] = { /* formats for which an internal demuxer is preferred */
"dxa", static const char * const preferred_internal[] = {
"flv", /* lavf Matroska demuxer doesn't support ordered chapters and fails
"gxf", * for more files */
"nut", "matroska",
"nuv", /* seeking won't work in lavf FLAC demuxer until a parser is committed */
"mov", "mp4", // "mov,mp4,m4a,3gp,3g2,mj2" is one AVInputFormat "flac",
"mpc", /* lavf gives neither pts nor dts for some video frames in .rm */
"mpc8", "rm",
"mxf",
"ogg",
"swf",
"vqf",
"w64",
"wv",
NULL NULL
}; };
@ -251,11 +245,11 @@ static int lavf_check_preferred_file(demuxer_t *demuxer){
if (lavf_check_file(demuxer)) { if (lavf_check_file(demuxer)) {
const char * const *p; const char * const *p;
lavf_priv_t *priv = demuxer->priv; lavf_priv_t *priv = demuxer->priv;
for (p = preferred_list; *p; p++) for (p = preferred_internal; *p; p++)
if (matches_avinputformat_name(priv, *p)) if (matches_avinputformat_name(priv, *p))
return DEMUXER_TYPE_LAVF_PREFERRED;
}
return 0; return 0;
}
return DEMUXER_TYPE_LAVF_PREFERRED;
} }
static uint8_t char2int(char c) { static uint8_t char2int(char c) {