Mercurial > mplayer.hg
changeset 11759:29eea271490e
add -codecs-file for selecting a specific codecs.conf on the comand line
author | attila |
---|---|
date | Thu, 08 Jan 2004 18:02:31 +0000 |
parents | f15a92de64fd |
children | 82a8fe2d8984 |
files | DOCS/man/en/mplayer.1 cfg-common.h codec-cfg.c mencoder.c mplayer.c |
diffstat | 5 files changed, 26 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/DOCS/man/en/mplayer.1 Tue Jan 06 22:19:12 2004 +0000 +++ b/DOCS/man/en/mplayer.1 Thu Jan 08 18:02:31 2004 +0000 @@ -2067,6 +2067,10 @@ .PD 1 . .TP +.B \-codecs-file <filename> +Use the specified file instead of system wide installed or build in codecs.conf. +See also \-afm, \-ac, \-vfm and \-vc. +.TP .B \-flip \ Flip image upside-down. .TP
--- a/cfg-common.h Tue Jan 06 22:19:12 2004 +0000 +++ b/cfg-common.h Thu Jan 08 18:02:31 2004 +0000 @@ -198,6 +198,7 @@ #if defined(HAVE_XVID3) || defined(HAVE_XVID4) {"xvidopts", xvid_dec_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, #endif + {"codecs-file", &codecs_file, CONF_TYPE_STRING, 0, 0, 0, NULL}, // ------------------------- subtitles options -------------------- #ifdef USE_SUB @@ -273,6 +274,9 @@ extern int vd_use_slices; extern int divx_quality; +/* defined in codec-cfg.c */ +extern char * codecs_file; + /* from dec_audio, currently used for ac3surround decoder only */ extern int audio_output_channels;
--- a/codec-cfg.c Tue Jan 06 22:19:12 2004 +0000 +++ b/codec-cfg.c Thu Jan 08 18:02:31 2004 +0000 @@ -48,6 +48,8 @@ #define TYPE_VIDEO 0 #define TYPE_AUDIO 1 +char * codecs_file = NULL; + static int add_to_fourcc(char *s, char *alias, unsigned int *fourcc, unsigned int *map) {
--- a/mencoder.c Tue Jan 06 22:19:12 2004 +0000 +++ b/mencoder.c Thu Jan 08 18:02:31 2004 +0000 @@ -406,13 +406,15 @@ InitTimer(); // check codec.conf -if(!parse_codec_cfg(get_path("codecs.conf"))){ - if(!parse_codec_cfg(MPLAYER_CONFDIR "/codecs.conf")){ - if(!parse_codec_cfg(NULL)){ - mp_msg(MSGT_MENCODER,MSGL_HINT,MSGTR_CopyCodecsConf); - mencoder_exit(1,NULL); +if(!codecs_file || !parse_codec_cfg(codecs_file)){ + if(!parse_codec_cfg(get_path("codecs.conf"))){ + if(!parse_codec_cfg(MPLAYER_CONFDIR "/codecs.conf")){ + if(!parse_codec_cfg(NULL)){ + mp_msg(MSGT_MENCODER,MSGL_HINT,MSGTR_CopyCodecsConf); + mencoder_exit(1,NULL); + } + mp_msg(MSGT_MENCODER,MSGL_INFO,MSGTR_BuiltinCodecsConf); } - mp_msg(MSGT_MENCODER,MSGL_INFO,MSGTR_BuiltinCodecsConf); } }
--- a/mplayer.c Tue Jan 06 22:19:12 2004 +0000 +++ b/mplayer.c Thu Jan 08 18:02:31 2004 +0000 @@ -893,13 +893,15 @@ } // check codec.conf -if(!parse_codec_cfg(get_path("codecs.conf"))){ - if(!parse_codec_cfg(MPLAYER_CONFDIR "/codecs.conf")){ - if(!parse_codec_cfg(NULL)){ - mp_msg(MSGT_CPLAYER,MSGL_HINT,MSGTR_CopyCodecsConf); - exit(0); +if(!codecs_file || !parse_codec_cfg(codecs_file)){ + if(!parse_codec_cfg(get_path("codecs.conf"))){ + if(!parse_codec_cfg(MPLAYER_CONFDIR "/codecs.conf")){ + if(!parse_codec_cfg(NULL)){ + mp_msg(MSGT_CPLAYER,MSGL_HINT,MSGTR_CopyCodecsConf); + exit(0); + } + mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_BuiltinCodecsConf); } - mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_BuiltinCodecsConf); } }