[MPlayer-dev-eng] [PATCH] list_options valid for MEncoder
Danny - liste
pi at digitalfantasy.it
Mon Jan 9 17:54:28 CET 2006
Diego Biurrun wrote:
> On Mon, Jan 09, 2006 at 09:02:59AM +0100, Danny - liste wrote:
>
>> Working on a profile support for MEncoder I find useful have the
>> -list-options avaible also for MEncoder and not only for MPlayer and I
>> made this little patch.
>>
>> --- orig/parser-mecmd.c 2006-01-01 02:19:25.000000000 +0100
>> +++ main/parser-mecmd.c 2006-01-08 20:09:35.902161608 +0100
>> @@ -85,6 +85,12 @@
>> /* remove trailing '-' */
>> opt++;
>> mp_msg(MSGT_CFGPARSER, MSGL_DBG3, "this_opt = option: %s\n", opt);
>> +
>> + if(strcasecmp(opt,"list-options") == 0) {
>> + m_config_print_option_list(config);
>> + exit(1);
>> + } else {
>>
>
> Hmm, this just duplicates the code from parser-mpcmd.c. Isn't there a
> cleaner solution?
>
>
1. Make a function that prints the option ( list_options( m_option_t
*config) ) and use the standard option handling adding in the common
options a line with:
{"list-options", list_options, CONF_TYPE_FUNC, CONF_GLOBAL |
CONF_NOSAVE, 0, 0, NULL},
2. Make a function that handle the common part and return 0 if the
caller must process the option (but only for this option is too much work).
The code duplication seems so small that other solutions may be too
expensive ;)
> Diego
>
>
Daniele
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
>
>
>
More information about the MPlayer-dev-eng
mailing list