summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/man/en/mplayer.14
-rw-r--r--cfg-common.h4
-rw-r--r--codec-cfg.c2
-rw-r--r--mencoder.c14
-rw-r--r--mplayer.c14
5 files changed, 26 insertions, 12 deletions
diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1
index ea0bcefe24..f92c5ba59c 100644
--- a/DOCS/man/en/mplayer.1
+++ b/DOCS/man/en/mplayer.1
@@ -2067,6 +2067,10 @@ It's autodetected on MPEG files, but can't be autodetected on most AVI files.
.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
diff --git a/cfg-common.h b/cfg-common.h
index f33b3e650a..1e85e282cc 100644
--- a/cfg-common.h
+++ b/cfg-common.h
@@ -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 flip;
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;
diff --git a/codec-cfg.c b/codec-cfg.c
index 13071675d7..52b7b7c7b4 100644
--- a/codec-cfg.c
+++ b/codec-cfg.c
@@ -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)
{
diff --git a/mencoder.c b/mencoder.c
index b15d475994..2f9e3e87c2 100644
--- a/mencoder.c
+++ b/mencoder.c
@@ -406,13 +406,15 @@ unsigned int timer_start;
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);
}
}
diff --git a/mplayer.c b/mplayer.c
index 5c7a2aadfb..1cfb5cd8d5 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -893,13 +893,15 @@ int gui_no_filename=0;
}
// 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);
}
}