Re: [MPlayer-dev-eng] [PATCH] Override binary codec path
- Date: Thu, 11 Mar 2010 21:31:07 +0900
- From: KO Myung-Hun <komh@xxxxxxxxxxxx>
- Subject: Re: [MPlayer-dev-eng] [PATCH] Override binary codec path
Diego Biurrun wrote:
> On Wed, Mar 10, 2010 at 09:39:48PM +0900, KO Myung-Hun wrote:
>> compn wrote:
>>> On Wed, 10 Mar 2010 20:38:07 +0900, KO Myung-Hun wrote:
>>>> +#ifdef WIN32_LOADER
>>>> + if (bin_codec_path)
>>>> + SetCodecPath(bin_codec_path);
>>>> +#endif
>>>
>>> i think it would be better to just have -codecpath , get rid of the
>>> ifdef, and have it work for all binary (linux/mac/win32) codecs...
>>
>> Ok. But I don't think SetCodecPath() is always linked.
>>
>> So use CONFIG_WIN32DLL instead of WIN32_LOADER.
>
> Hmmm, I'm not sure this is the right #ifdef.
>
Please suggest the alternatives as well as the objections.
>> --- mplayer.c (revision 30880)
>> +++ mplayer.c (working copy)
>> @@ -103,6 +103,12 @@
>>
>> #include "osdep/priority.h"
>>
>> +#ifdef CONFIG_WIN32DLL
>> +extern void SetCodecPath(const char *); // in loader/drv.c
>> +
>> +char *codec_path=NULL;
>> +#endif
>> +
>> --- mencoder.c (revision 30880)
>> +++ mencoder.c (working copy)
>> @@ -155,6 +155,12 @@
>>
>> #include "osdep/priority.h"
>>
>> +#ifdef CONFIG_WIN32DLL
>> +extern void SetCodecPath(const char *); // in loader/drv.c
>> +
>> +char *codec_path=NULL;
>> +#endif
>
> This looks like a candidate for the common code.
>
Ok. I've put them into get_path.h.
>> --- cfg-common-opts.h (revision 30880)
>> +++ cfg-common-opts.h (working copy)
>> @@ -40,6 +40,9 @@
>> #ifdef CONFIG_PRIORITY
>> {"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL},
>> #endif
>> +#ifdef CONFIG_WIN32DLL
>> + {"codecpath", &codec_path, CONF_TYPE_STRING, 0, 0, 0, NULL},
>> +#endif
>> {"noconfig", noconfig_opts, CONF_TYPE_SUBCONFIG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 0, NULL},
>
> Documentation is missing.
Added.
--
KO Myung-Hun
Using Mozilla SeaMonkey 2.0.3
Under OS/2 Warp 4 for Korean with FixPak #15
On AMD ThunderBird 1GHz with 512 MB RAM
Korean OS/2 User Community : http://www.ecomstation.co.kr
Index: get_path.h
===================================================================
--- get_path.h (revision 30880)
+++ get_path.h (working copy)
@@ -24,4 +24,10 @@
char *get_path(const char *filename);
void set_path_env(void);
+#ifdef CONFIG_WIN32DLL
+extern void SetCodecPath(const char *); // in loader/drv.c
+
+static char *codec_path=NULL;
+#endif
+
#endif /* MPLAYER_GET_PATH_H */
Index: DOCS/man/en/mplayer.1
===================================================================
--- DOCS/man/en/mplayer.1 (revision 30880)
+++ DOCS/man/en/mplayer.1 (working copy)
@@ -754,6 +754,10 @@
.RE
.
.TP
+.B \-codecpath <dir>
+Specify a directory for binary codecs.
+.
+.TP
.B \-profile <profile1,profile2,...>
Use the given profile(s), \-profile help displays a list of the defined profiles.
.
Index: mplayer.c
===================================================================
--- mplayer.c (revision 30880)
+++ mplayer.c (working copy)
@@ -2701,6 +2701,11 @@
set_priority();
#endif
+#ifdef CONFIG_WIN32DLL
+ if (codec_path)
+ SetCodecPath(codec_path);
+#endif
+
#ifndef CONFIG_GUI
if(use_gui){
mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_NoGui);
Index: cfg-common-opts.h
===================================================================
--- cfg-common-opts.h (revision 30880)
+++ cfg-common-opts.h (working copy)
@@ -40,6 +40,9 @@
#ifdef CONFIG_PRIORITY
{"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL},
#endif
+#ifdef CONFIG_WIN32DLL
+ {"codecpath", &codec_path, CONF_TYPE_STRING, 0, 0, 0, NULL},
+#endif
{"noconfig", noconfig_opts, CONF_TYPE_SUBCONFIG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 0, NULL},
// ------------------------- stream options --------------------
Index: mencoder.c
===================================================================
--- mencoder.c (revision 30880)
+++ mencoder.c (working copy)
@@ -534,6 +534,11 @@
set_priority();
#endif
+#ifdef CONFIG_WIN32DLL
+ if (codec_path)
+ SetCodecPath(codec_path);
+#endif
+
// check font
#ifdef CONFIG_FREETYPE
init_freetype();
_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng@xxxxxxxxxxxx
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng