diff -Nru mplayer-1.0~rc3+svn20090426/access_mpcontext.h mplayer-1.0~rc4.dfsg1/access_mpcontext.h --- mplayer-1.0~rc3+svn20090426/access_mpcontext.h 2008-02-22 09:09:46.000000000 +0000 +++ mplayer-1.0~rc4.dfsg1/access_mpcontext.h 2010-01-30 23:24:23.000000000 +0000 @@ -1,3 +1,21 @@ +/* + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #ifndef MPLAYER_ACCESS_MPCONTEXT_H #define MPLAYER_ACCESS_MPCONTEXT_H diff -Nru mplayer-1.0~rc3+svn20090426/asxparser.c mplayer-1.0~rc4.dfsg1/asxparser.c --- mplayer-1.0~rc3+svn20090426/asxparser.c 2008-02-08 18:28:12.000000000 +0000 +++ mplayer-1.0~rc4.dfsg1/asxparser.c 2010-05-03 23:34:38.000000000 +0000 @@ -1,3 +1,21 @@ +/* + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include "config.h" #include @@ -19,53 +37,6 @@ ////// List utils void -asx_list_add(void* list_ptr,void* entry){ - void** list = *(void***)list_ptr; - int c = 0; - - if(list != NULL) - for( ; list[c] != NULL; c++) ; - - list = (void*)realloc(list,sizeof(void*)*(c+2)); - - list[c] = entry; - list[c+1] = NULL; - - *(void***)list_ptr = list; -} - - -void -asx_list_remove(void* list_ptr,void* entry,ASX_FreeFunc free_func) { - void** list = *(void***)list_ptr; - int c,e = -1; - - if(list == NULL) return; - - for(c = 0 ; list[c] != NULL; c++){ - if(list[c] == entry) e = c; - } - - if(e == -1) return; // Not found - - if(free_func != NULL) free_func(list[e]); - - if(c == 1) { // Only one entry, we drop all - free(list); - *(void**)list_ptr = NULL; - return; - } - - if(c > e) // If c==e the memmove is not needed - memmove(list+e,list+e+1,(c-e)*sizeof(void*)); - - list = (void*)realloc(list,(c-1)*sizeof(void*)); - list[c-1] = NULL; - - *(void***)list_ptr = list; -} - -void asx_list_free(void* list_ptr,ASX_FreeFunc free_func) { void** ptr = *(void***)list_ptr; if(ptr == NULL) return; @@ -141,8 +112,8 @@ if(ptr3 == NULL) break; for(ptr2 = ptr3-1; strchr(SPACE,*ptr2) != NULL; ptr2--) { if (ptr2 == ptr1) { - mp_msg(MSGT_PLAYTREE,MSGL_ERR,"At line %d : this should never append, back to attribute begin while skipping end space",parser->line); - break; + mp_msg(MSGT_PLAYTREE,MSGL_ERR,"At line %d : this should never append, back to attribute begin while skipping end space",parser->line); + break; } } attrib = malloc(ptr2-ptr1+2); @@ -167,28 +138,28 @@ strncpy(val,ptr1,ptr2-ptr1); val[ptr2-ptr1] = '\0'; n_attrib++; - - attribs = (char**)realloc(attribs,(2*n_attrib+1)*sizeof(char*)); + + attribs = realloc(attribs, (2 * n_attrib + 1) * sizeof(char*)); attribs[n_attrib*2-2] = attrib; attribs[n_attrib*2-1] = val; - + ptr1 = ptr2+1; } - + if(n_attrib > 0) attribs[n_attrib*2] = NULL; *_attribs = attribs; - + return n_attrib; } - + /* * Return -1 on error, 0 when nothing is found, 1 on sucess */ int asx_get_element(ASX_Parser_t* parser,char** _buffer, - char** _element,char** _body,char*** _attribs) { + char** _element,char** _body,char*** _attribs) { char *ptr1,*ptr2, *ptr3, *ptr4; char *attribs = NULL; char *element = NULL, *body = NULL, *ret = NULL, *buffer; @@ -212,21 +183,21 @@ int i; for(i = 0 ; i < parser->ret_stack_size ; i++) { if(buffer == ls[i].buffer) { - parser->line = ls[i].line; - break; + parser->line = ls[i].line; + break; } - + } if( i < parser->ret_stack_size) { i++; - if( i < parser->ret_stack_size) - memmove(parser->ret_stack,parser->ret_stack+i, (parser->ret_stack_size - i)*sizeof(ASX_LineSave_t)); + if( i < parser->ret_stack_size) + memmove(parser->ret_stack,parser->ret_stack+i, (parser->ret_stack_size - i)*sizeof(ASX_LineSave_t)); parser->ret_stack_size -= i; if(parser->ret_stack_size > 0) - parser->ret_stack = (ASX_LineSave_t*)realloc(parser->ret_stack,parser->ret_stack_size*sizeof(ASX_LineSave_t)); + parser->ret_stack = realloc(parser->ret_stack,parser->ret_stack_size*sizeof(ASX_LineSave_t)); else { - free(parser->ret_stack); - parser->ret_stack = NULL; + free(parser->ret_stack); + parser->ret_stack = NULL; } } } @@ -235,32 +206,32 @@ while(1) { for( ; ptr1[0] != '<' ; ptr1++) { if(ptr1[0] == '\0') { - ptr1 = NULL; - break; + ptr1 = NULL; + break; } if(ptr1[0] == '\n') parser->line++; } //ptr1 = strchr(ptr1,'<'); if(!ptr1 || ptr1[1] == '\0') return 0; // Nothing found - + if(strncmp(ptr1,"",3) != 0 ; ptr1++) { - if(ptr1[0] == '\0') { - ptr1 = NULL; - break; - } - if(ptr1[0] == '\n') parser->line++; + if(ptr1[0] == '\0') { + ptr1 = NULL; + break; + } + if(ptr1[0] == '\n') parser->line++; } //ptr1 = strstr(ptr1,"-->"); if(!ptr1) { - mp_msg(MSGT_PLAYTREE,MSGL_ERR,"At line %d : unfinished comment",parser->line); - return -1; + mp_msg(MSGT_PLAYTREE,MSGL_ERR,"At line %d : unfinished comment",parser->line); + return -1; } } else { break; } } - + // Is this space skip very useful ?? for(ptr1++; strchr(SPACE,ptr1[0]) != NULL; ptr1++) { // Skip space if(ptr1[0] == '\0') { @@ -268,7 +239,7 @@ return -1; } if(ptr1[0] == '\n') parser->line++; - } + } for(ptr2 = ptr1; strchr(LETTER,*ptr2) != NULL;ptr2++) { // Go to end of name if(*ptr2 == '\0'){ @@ -292,10 +263,10 @@ } attrib_line = parser->line; - + for(ptr3 = ptr2; ptr3[0] != '\0'; ptr3++) { // Go to element end - if(ptr3[0] == '"') quotes ^= 1; + if(ptr3[0] == '"') quotes ^= 1; if(!quotes && (ptr3[0] == '>' || strncmp(ptr3,"/>",2) == 0)) break; if(ptr3[0] == '\n') parser->line++; @@ -317,10 +288,10 @@ ptr3++; for( ; strchr(SPACE,*ptr3) != NULL; ptr3++) { // Skip space on body begin if(*ptr3 == '\0') { - mp_msg(MSGT_PLAYTREE,MSGL_ERR,"At line %d : EOB reached while parsing %s element body",parser->line,element); - free(element); - if(attribs) free(attribs); - return -1; + mp_msg(MSGT_PLAYTREE,MSGL_ERR,"At line %d : EOB reached while parsing %s element body",parser->line,element); + free(element); + if(attribs) free(attribs); + return -1; } if(ptr3[0] == '\n') parser->line++; } @@ -328,52 +299,52 @@ body_line = parser->line; while(1) { // Find closing element for( ; ptr4[0] != '<' ; ptr4++) { - if(ptr4[0] == '\0') { - ptr4 = NULL; - break; - } - if(ptr4[0] == '\n') parser->line++; + if(ptr4[0] == '\0') { + ptr4 = NULL; + break; + } + if(ptr4[0] == '\n') parser->line++; } if(ptr4 && strncmp(ptr4,"",3) != 0 ; ptr4++) { - if(ptr4[0] == '\0') { - ptr4 = NULL; - break; - } - if(ptr1[0] == '\n') parser->line++; - } - continue; - } - if(ptr4 == NULL || ptr4[1] == '\0') { - mp_msg(MSGT_PLAYTREE,MSGL_ERR,"At line %d : EOB reached while parsing %s element body",parser->line,element); - free(element); - if(attribs) free(attribs); - return -1; + for( ; strncmp(ptr4,"-->",3) != 0 ; ptr4++) { + if(ptr4[0] == '\0') { + ptr4 = NULL; + break; + } + if(ptr1[0] == '\n') parser->line++; + } + continue; + } + if(ptr4 == NULL || ptr4[1] == '\0') { + mp_msg(MSGT_PLAYTREE,MSGL_ERR,"At line %d : EOB reached while parsing %s element body",parser->line,element); + free(element); + if(attribs) free(attribs); + return -1; } if(ptr4[1] != '/' && strncasecmp(element,ptr4+1,strlen(element)) == 0) { - in++; - ptr4+=2; - continue; + in++; + ptr4+=2; + continue; } else if(strncasecmp(element,ptr4+2,strlen(element)) == 0) { // Extract body - if(in > 0) { - in--; - ptr4 += 2+strlen(element); - continue; - } - ret = ptr4+strlen(element)+3; - if(ptr4 != ptr3) { - ptr4--; - for( ; ptr4 != ptr3 && strchr(SPACE,*ptr4) != NULL; ptr4--) ;// Skip space on body end - // if(ptr4[0] == '\0') parser->line--; - //} - ptr4++; - body = malloc(ptr4-ptr3+1); - strncpy(body,ptr3,ptr4-ptr3); - body[ptr4-ptr3] = '\0'; - } - break; + if(in > 0) { + in--; + ptr4 += 2+strlen(element); + continue; + } + ret = ptr4+strlen(element)+3; + if(ptr4 != ptr3) { + ptr4--; + for( ; ptr4 != ptr3 && strchr(SPACE,*ptr4) != NULL; ptr4--) ;// Skip space on body end + // if(ptr4[0] == '\0') parser->line--; + //} + ptr4++; + body = malloc(ptr4-ptr3+1); + strncpy(body,ptr3,ptr4-ptr3); + body[ptr4-ptr3] = '\0'; + } + break; } else { - ptr4 += 2; + ptr4 += 2; } } } else { @@ -404,7 +375,7 @@ parser->last_body = body; parser->ret_stack_size++; - parser->ret_stack = (ASX_LineSave_t*)realloc(parser->ret_stack,parser->ret_stack_size*sizeof(ASX_LineSave_t)); + parser->ret_stack = realloc(parser->ret_stack,parser->ret_stack_size*sizeof(ASX_LineSave_t)); if(parser->ret_stack_size > 1) memmove(parser->ret_stack+1,parser->ret_stack,(parser->ret_stack_size-1)*sizeof(ASX_LineSave_t)); parser->ret_stack[0].buffer = ret; @@ -419,7 +390,7 @@ static void asx_parse_param(ASX_Parser_t* parser, char** attribs, play_tree_t* pt) { char *name,*val; - + name = asx_get_attrib("NAME",attribs); if(!name) { asx_warning_attrib_required(parser,"PARAM" ,"NAME" ); @@ -502,7 +473,7 @@ free_stream(stream); free(href); //mp_msg(MSGT_PLAYTREE,MSGL_INFO,"Need to implement entryref\n"); - + return pt; } @@ -539,7 +510,7 @@ return ref; } - + static play_tree_t* asx_parse_repeat(ASX_Parser_t* parser,char* buffer,char** _attribs) { @@ -572,23 +543,23 @@ if(strcasecmp(element,"ENTRY") == 0) { entry = asx_parse_entry(parser,body,attribs); if(entry) { - if(!list) list = entry; - else play_tree_append_entry(list,entry); - mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Adding element %s to repeat\n",element); + if(!list) list = entry; + else play_tree_append_entry(list,entry); + mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Adding element %s to repeat\n",element); } } else if(strcasecmp(element,"ENTRYREF") == 0) { entry = asx_parse_entryref(parser,body,attribs); if(entry) { - if(!list) list = entry; - else play_tree_append_entry(list,entry); - mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Adding element %s to repeat\n",element); + if(!list) list = entry; + else play_tree_append_entry(list,entry); + mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Adding element %s to repeat\n",element); } } else if(strcasecmp(element,"REPEAT") == 0) { entry = asx_parse_repeat(parser,body,attribs); if(entry) { - if(!list) list = entry; - else play_tree_append_entry(list,entry); - mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Adding element %s to repeat\n",element); + if(!list) list = entry; + else play_tree_append_entry(list,entry); + mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Adding element %s to repeat\n",element); } } else if(strcasecmp(element,"PARAM") == 0) { asx_parse_param(parser,attribs,repeat); @@ -659,23 +630,23 @@ if(strcasecmp(element,"ENTRY") == 0) { entry = asx_parse_entry(parser,body,attribs); if(entry) { - if(!list) list = entry; - else play_tree_append_entry(list,entry); - mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Adding element %s to asx\n",element); + if(!list) list = entry; + else play_tree_append_entry(list,entry); + mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Adding element %s to asx\n",element); } } else if(strcasecmp(element,"ENTRYREF") == 0) { entry = asx_parse_entryref(parser,body,attribs); if(entry) { - if(!list) list = entry; - else play_tree_append_entry(list,entry); - mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Adding element %s to asx\n",element); + if(!list) list = entry; + else play_tree_append_entry(list,entry); + mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Adding element %s to asx\n",element); } } else if(strcasecmp(element,"REPEAT") == 0) { entry = asx_parse_repeat(parser,body,attribs); if(entry) { - if(!list) list = entry; - else play_tree_append_entry(list,entry); - mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Adding element %s to asx\n",element); + if(!list) list = entry; + else play_tree_append_entry(list,entry); + mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Adding element %s to asx\n",element); } } else mp_msg(MSGT_PLAYTREE,MSGL_DBG2,"Ignoring element %s\n",element); @@ -690,7 +661,7 @@ if(!list) { play_tree_free(asx,1); - + return NULL; } diff -Nru mplayer-1.0~rc3+svn20090426/asxparser.h mplayer-1.0~rc4.dfsg1/asxparser.h --- mplayer-1.0~rc3+svn20090426/asxparser.h 2008-02-22 09:09:46.000000000 +0000 +++ mplayer-1.0~rc4.dfsg1/asxparser.h 2010-05-03 23:34:38.000000000 +0000 @@ -1,6 +1,26 @@ +/* + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #ifndef MPLAYER_ASXPARSER_H #define MPLAYER_ASXPARSER_H +#include "playtree.h" + typedef struct ASX_Parser_t ASX_Parser_t; typedef struct { @@ -15,7 +35,7 @@ char* last_body; int deep; }; - + ASX_Parser_t* asx_parser_new(void); @@ -27,7 +47,7 @@ */ int asx_get_element(ASX_Parser_t* parser,char** _buffer, - char** _element,char** _body,char*** _attribs); + char** _element,char** _body,char*** _attribs); int asx_parse_attribs(ASX_Parser_t* parser,char* buffer,char*** _attribs); @@ -49,4 +69,7 @@ void asx_list_free(void* list_ptr,ASX_FreeFunc free_func); +play_tree_t* +asx_parser_build_tree(char* buffer,int deep); + #endif /* MPLAYER_ASXPARSER_H */ diff -Nru mplayer-1.0~rc3+svn20090426/AUTHORS mplayer-1.0~rc4.dfsg1/AUTHORS --- mplayer-1.0~rc3+svn20090426/AUTHORS 2009-03-11 00:25:23.000000000 +0000 +++ mplayer-1.0~rc4.dfsg1/AUTHORS 2010-05-29 22:04:35.000000000 +0000 @@ -168,7 +168,7 @@ Christiansen, Dan Villiom Podlaski (danchr) * timer-darwin.c - * ao_macosx + * CoreAudio audio output driver for Mac OS X * build system cleanups for Darwin Clagg, Jeff (snacky) @@ -385,6 +385,9 @@ * Darwin DVD support (mpdvdkit2) * various fixes +Hysseo, Jehan + * af_add, af_switch, af_del, af_clr commands. + Isani, Sidik * get_delay() smoothing code (-autosync) * RTC initialization fixes @@ -637,7 +640,7 @@ Plourde, Nicolas * quartz video output driver for Mac OS X - * macosx CoreVideo output driver for Mac OS X + * CoreVideo video output driver for Mac OS X * Darwin VCD/SVCD support Poettering, Lennart @@ -768,8 +771,16 @@ Szecsi, Gabor * directsound AO driver -Tackaberry, Jason +Tartler, Reinhard + * release assistance + * various backports from trunk + * official Debian and Ubuntu packages + +Tackaberry, Jason * second DVD ripping guide + * multichannel audio fixes + * support for 8 channel audio + * various minor features and bug fixes Tam, Howell (Pigeon) * native libcaca driver (-vo caca) @@ -794,6 +805,7 @@ Tresoldi, Paolo "PaulTT" (ptt) * mplayer -endpos option + * -name, -title and -use-filename-title options * Italian man page and console messages translations * Italian documentation translation diff -Nru mplayer-1.0~rc3+svn20090426/av_opts.c mplayer-1.0~rc4.dfsg1/av_opts.c --- mplayer-1.0~rc3+svn20090426/av_opts.c 2008-05-11 13:42:43.000000000 +0000 +++ mplayer-1.0~rc4.dfsg1/av_opts.c 2010-05-29 10:13:39.000000000 +0000 @@ -21,6 +21,8 @@ #include #include + +#include "av_opts.h" #include "libavcodec/opt.h" int parse_avopts(void *v, char *str){ diff -Nru mplayer-1.0~rc3+svn20090426/cfg-common.h mplayer-1.0~rc4.dfsg1/cfg-common.h --- mplayer-1.0~rc3+svn20090426/cfg-common.h 2009-02-10 15:34:44.000000000 +0000 +++ mplayer-1.0~rc4.dfsg1/cfg-common.h 2010-07-05 17:04:46.000000000 +0000 @@ -1,63 +1,54 @@ +/* + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #ifndef MPLAYER_CFG_COMMON_H #define MPLAYER_CFG_COMMON_H #include + +#include "libmpcodecs/ad.h" +#include "libmpcodecs/dec_audio.h" +#include "libmpcodecs/dec_video.h" +#include "libmpcodecs/vd.h" +#include "libmpcodecs/vf_scale.h" +#include "libmpdemux/demux_audio.h" +#include "libmpdemux/demux_mpg.h" +#include "libmpdemux/demux_ts.h" +#include "libmpdemux/demux_viv.h" +#include "libmpdemux/demuxer.h" +#include "libmpdemux/mf.h" +#include "libpostproc/postprocess.h" +#include "libvo/sub.h" +#include "osdep/priority.h" +#include "stream/cdd.h" +#include "stream/network.h" +#include "stream/pvr.h" +#include "stream/stream.h" +#include "stream/stream_radio.h" +#include "stream/tcp.h" +#include "stream/tv.h" +#include "stream/udp.h" +#include "codec-cfg.h" #include "config.h" #include "m_config.h" #include "m_option.h" - -extern char *mp_msg_charset; -extern int mp_msg_color; -extern int mp_msg_module; - -// codec/filter opts: (defined at libmpcodecs/vd.c) -extern float screen_size_xy; -extern float movie_aspect; -extern int softzoom; -extern int flip; - -/* defined in codec-cfg.c */ -extern char * codecs_file; - -/* defined in dec_video.c */ -extern int field_dominance; - -/* from dec_audio, currently used for ac3surround decoder only */ -extern int audio_output_channels; -extern int fakemono; - -/* defined in network.c */ -extern char *network_username; -extern char *network_password; -extern int network_bandwidth; -extern char *network_useragent; -extern int network_cookies_enabled; -extern char *cookies_file; - -extern int network_prefer_ipv4; -extern int network_ipv4_only_proxy; -extern int reuse_socket; - -extern int dvd_speed; /* stream/stream_dvd.c */ - -extern float a52_drc_level; - -/* defined in libmpdemux: */ -extern int hr_mp3_seek; -extern const m_option_t demux_rawaudio_opts[]; -extern const m_option_t demux_rawvideo_opts[]; -extern const m_option_t cdda_opts[]; - -extern char* sub_stream; -extern int demuxer_type, audio_demuxer_type, sub_demuxer_type; -extern int ts_prog; -extern int ts_keep_broken; -extern off_t ts_probe; -extern int audio_substream_id; -extern off_t ps_probe; - -#include "stream/tv.h" -#include "stream/stream_radio.h" +#include "mp_msg.h" +#include "mpcommon.h" @@ -80,281 +71,578 @@ #ifdef CONFIG_TV const m_option_t tvopts_conf[]={ - {"on", "-tv on has been removed, use tv:// instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, - {"immediatemode", &stream_tv_defaults.immediate, CONF_TYPE_INT, CONF_RANGE, 0, 1, NULL}, - {"noaudio", &stream_tv_defaults.noaudio, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"audiorate", &stream_tv_defaults.audiorate, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"driver", &stream_tv_defaults.driver, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"device", &stream_tv_defaults.device, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"freq", &stream_tv_defaults.freq, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"channel", &stream_tv_defaults.channel, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"chanlist", &stream_tv_defaults.chanlist, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"norm", &stream_tv_defaults.norm, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"automute", &stream_tv_defaults.automute, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL}, + {"on", "-tv on has been removed, use tv:// instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"immediatemode", &stream_tv_defaults.immediate, CONF_TYPE_INT, CONF_RANGE, 0, 1, NULL}, + {"noaudio", &stream_tv_defaults.noaudio, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"audiorate", &stream_tv_defaults.audiorate, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"driver", &stream_tv_defaults.driver, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"device", &stream_tv_defaults.device, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"freq", &stream_tv_defaults.freq, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"channel", &stream_tv_defaults.channel, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"chanlist", &stream_tv_defaults.chanlist, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"norm", &stream_tv_defaults.norm, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"automute", &stream_tv_defaults.automute, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL}, #if defined(CONFIG_TV_V4L2) || defined(CONFIG_TV_DSHOW) - {"normid", &stream_tv_defaults.normid, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"normid", &stream_tv_defaults.normid, CONF_TYPE_INT, 0, 0, 0, NULL}, #endif - {"width", &stream_tv_defaults.width, CONF_TYPE_INT, 0, 0, 4096, NULL}, - {"height", &stream_tv_defaults.height, CONF_TYPE_INT, 0, 0, 4096, NULL}, - {"input", &stream_tv_defaults.input, CONF_TYPE_INT, 0, 0, 20, NULL}, - {"outfmt", &stream_tv_defaults.outfmt, CONF_TYPE_IMGFMT, 0, 0, 0, NULL}, - {"fps", &stream_tv_defaults.fps, CONF_TYPE_FLOAT, 0, 0, 100.0, NULL}, - {"channels", &stream_tv_defaults.channels, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, - {"brightness", &stream_tv_defaults.brightness, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, - {"contrast", &stream_tv_defaults.contrast, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, - {"hue", &stream_tv_defaults.hue, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, - {"saturation", &stream_tv_defaults.saturation, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, - {"gain", &stream_tv_defaults.gain, CONF_TYPE_INT, CONF_RANGE, -1, 100, NULL}, + {"width", &stream_tv_defaults.width, CONF_TYPE_INT, 0, 0, 4096, NULL}, + {"height", &stream_tv_defaults.height, CONF_TYPE_INT, 0, 0, 4096, NULL}, + {"input", &stream_tv_defaults.input, CONF_TYPE_INT, 0, 0, 20, NULL}, + {"outfmt", &stream_tv_defaults.outfmt, CONF_TYPE_IMGFMT, 0, 0, 0, NULL}, + {"fps", &stream_tv_defaults.fps, CONF_TYPE_FLOAT, 0, 0, 100.0, NULL}, + {"channels", &stream_tv_defaults.channels, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, + {"brightness", &stream_tv_defaults.brightness, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, + {"contrast", &stream_tv_defaults.contrast, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, + {"hue", &stream_tv_defaults.hue, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, + {"saturation", &stream_tv_defaults.saturation, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, + {"gain", &stream_tv_defaults.gain, CONF_TYPE_INT, CONF_RANGE, -1, 100, NULL}, #if defined(CONFIG_TV_V4L) || defined(CONFIG_TV_V4L2) || defined(CONFIG_TV_DSHOW) - {"buffersize", &stream_tv_defaults.buffer_size, CONF_TYPE_INT, CONF_RANGE, 16, 1024, NULL}, - {"amode", &stream_tv_defaults.amode, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL}, - {"volume", &stream_tv_defaults.volume, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL}, + {"buffersize", &stream_tv_defaults.buffer_size, CONF_TYPE_INT, CONF_RANGE, 16, 1024, NULL}, + {"amode", &stream_tv_defaults.amode, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL}, + {"volume", &stream_tv_defaults.volume, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL}, #endif #if defined(CONFIG_TV_V4L) || defined(CONFIG_TV_V4L2) - {"bass", &stream_tv_defaults.bass, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL}, - {"treble", &stream_tv_defaults.treble, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL}, - {"balance", &stream_tv_defaults.balance, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL}, - {"forcechan", &stream_tv_defaults.forcechan, CONF_TYPE_INT, CONF_RANGE, 1, 2, NULL}, - {"forceaudio", &stream_tv_defaults.force_audio, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"buffersize", &stream_tv_defaults.buffer_size, CONF_TYPE_INT, CONF_RANGE, 16, 1024, NULL}, - {"mjpeg", &stream_tv_defaults.mjpeg, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"decimation", &stream_tv_defaults.decimation, CONF_TYPE_INT, CONF_RANGE, 1, 4, NULL}, - {"quality", &stream_tv_defaults.quality, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL}, + {"bass", &stream_tv_defaults.bass, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL}, + {"treble", &stream_tv_defaults.treble, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL}, + {"balance", &stream_tv_defaults.balance, CONF_TYPE_INT, CONF_RANGE, 0, 65535, NULL}, + {"forcechan", &stream_tv_defaults.forcechan, CONF_TYPE_INT, CONF_RANGE, 1, 2, NULL}, + {"forceaudio", &stream_tv_defaults.force_audio, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"buffersize", &stream_tv_defaults.buffer_size, CONF_TYPE_INT, CONF_RANGE, 16, 1024, NULL}, + {"mjpeg", &stream_tv_defaults.mjpeg, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"decimation", &stream_tv_defaults.decimation, CONF_TYPE_INT, CONF_RANGE, 1, 4, NULL}, + {"quality", &stream_tv_defaults.quality, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL}, #ifdef CONFIG_ALSA - {"alsa", &stream_tv_defaults.alsa, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"alsa", &stream_tv_defaults.alsa, CONF_TYPE_FLAG, 0, 0, 1, NULL}, #endif /* CONFIG_ALSA */ #endif /* defined(CONFIG_TV_V4L) || defined(CONFIG_TV_V4L2) */ - {"adevice", &stream_tv_defaults.adevice, CONF_TYPE_STRING, 0, 0, 0, NULL}, -#ifdef CONFIG_TV_TELETEXT - {"tdevice", &stream_tv_defaults.tdevice, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"tpage", &stream_tv_defaults.tpage, CONF_TYPE_INT, CONF_RANGE, 100, 899, NULL}, - {"tformat", &stream_tv_defaults.tformat, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL}, - {"tlang", &stream_tv_defaults.tlang, CONF_TYPE_INT, CONF_RANGE, -1, 0x7f, NULL}, -#endif /* CONFIG_TV_TELETEXT */ - {"audioid", &stream_tv_defaults.audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 9, NULL}, + {"adevice", &stream_tv_defaults.adevice, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"tdevice", &stream_tv_defaults.teletext.device, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"tpage", &stream_tv_defaults.teletext.page, CONF_TYPE_INT, CONF_RANGE, 100, 899, NULL}, + {"tformat", &stream_tv_defaults.teletext.format, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL}, + {"tlang", &stream_tv_defaults.teletext.lang, CONF_TYPE_INT, CONF_RANGE, -1, 0x7f, NULL}, + {"audioid", &stream_tv_defaults.audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 9, NULL}, #ifdef CONFIG_TV_DSHOW - {"hidden_video_renderer", &stream_tv_defaults.hidden_video_renderer, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nohidden_video_renderer", &stream_tv_defaults.hidden_video_renderer, CONF_TYPE_FLAG, 0, 0, 0, NULL}, - {"hidden_vp_renderer", &stream_tv_defaults.hidden_vp_renderer, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nohidden_vp_renderer", &stream_tv_defaults.hidden_vp_renderer, CONF_TYPE_FLAG, 0, 0, 0, NULL}, - {"system_clock", &stream_tv_defaults.system_clock, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nosystem_clock", &stream_tv_defaults.system_clock, CONF_TYPE_FLAG, 0, 0, 0, NULL}, - {"normalize_audio_chunks", &stream_tv_defaults.normalize_audio_chunks, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nonormalize_audio_chunks", &stream_tv_defaults.normalize_audio_chunks, CONF_TYPE_FLAG, 0, 0, 0, NULL}, + {"hidden_video_renderer", &stream_tv_defaults.hidden_video_renderer, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nohidden_video_renderer", &stream_tv_defaults.hidden_video_renderer, CONF_TYPE_FLAG, 0, 0, 0, NULL}, + {"hidden_vp_renderer", &stream_tv_defaults.hidden_vp_renderer, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nohidden_vp_renderer", &stream_tv_defaults.hidden_vp_renderer, CONF_TYPE_FLAG, 0, 0, 0, NULL}, + {"system_clock", &stream_tv_defaults.system_clock, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nosystem_clock", &stream_tv_defaults.system_clock, CONF_TYPE_FLAG, 0, 0, 0, NULL}, + {"normalize_audio_chunks", &stream_tv_defaults.normalize_audio_chunks, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nonormalize_audio_chunks", &stream_tv_defaults.normalize_audio_chunks, CONF_TYPE_FLAG, 0, 0, 0, NULL}, #endif - {NULL, NULL, 0, 0, 0, 0, NULL} + {NULL, NULL, 0, 0, 0, 0, NULL} }; #endif /* CONFIG_TV */ -extern int pvr_param_aspect_ratio; -extern int pvr_param_sample_rate; -extern int pvr_param_audio_layer; -extern int pvr_param_audio_bitrate; -extern char *pvr_param_audio_mode; -extern int pvr_param_bitrate; -extern char *pvr_param_bitrate_mode; -extern int pvr_param_bitrate_peak; -extern char *pvr_param_stream_type; - #ifdef CONFIG_PVR const m_option_t pvropts_conf[]={ - {"aspect", &pvr_param_aspect_ratio, CONF_TYPE_INT, 0, 1, 4, NULL}, - {"arate", &pvr_param_sample_rate, CONF_TYPE_INT, 0, 32000, 48000, NULL}, - {"alayer", &pvr_param_audio_layer, CONF_TYPE_INT, 0, 1, 2, NULL}, - {"abitrate", &pvr_param_audio_bitrate, CONF_TYPE_INT, 0, 32, 448, NULL}, - {"amode", &pvr_param_audio_mode, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"vbitrate", &pvr_param_bitrate, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"vmode", &pvr_param_bitrate_mode, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"vpeak", &pvr_param_bitrate_peak, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"fmt", &pvr_param_stream_type, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {NULL, NULL, 0, 0, 0, 0, NULL} + {"aspect", &pvr_param_aspect_ratio, CONF_TYPE_INT, 0, 1, 4, NULL}, + {"arate", &pvr_param_sample_rate, CONF_TYPE_INT, 0, 32000, 48000, NULL}, + {"alayer", &pvr_param_audio_layer, CONF_TYPE_INT, 0, 1, 2, NULL}, + {"abitrate", &pvr_param_audio_bitrate, CONF_TYPE_INT, 0, 32, 448, NULL}, + {"amode", &pvr_param_audio_mode, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"vbitrate", &pvr_param_bitrate, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"vmode", &pvr_param_bitrate_mode, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"vpeak", &pvr_param_bitrate_peak, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"fmt", &pvr_param_stream_type, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {NULL, NULL, 0, 0, 0, 0, NULL} }; #endif /* CONFIG_PVR */ -extern const m_config_t dvbin_opts_conf[]; -extern const m_option_t lavfdopts_conf[]; - -extern int rtspStreamOverTCP; -extern int rtsp_transport_tcp; -extern int rtsp_transport_sctp; -extern int rtsp_port; -extern char *rtsp_destination; - - -extern int audio_stream_cache; - -extern int sws_chr_vshift; -extern int sws_chr_hshift; -extern float sws_chr_gblur; -extern float sws_lum_gblur; -extern float sws_chr_sharpen; -extern float sws_lum_sharpen; - const m_option_t scaler_filter_conf[]={ - {"lgb", &sws_lum_gblur, CONF_TYPE_FLOAT, 0, 0, 100.0, NULL}, - {"cgb", &sws_chr_gblur, CONF_TYPE_FLOAT, 0, 0, 100.0, NULL}, - {"cvs", &sws_chr_vshift, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"chs", &sws_chr_hshift, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"ls", &sws_lum_sharpen, CONF_TYPE_FLOAT, 0, -100.0, 100.0, NULL}, - {"cs", &sws_chr_sharpen, CONF_TYPE_FLOAT, 0, -100.0, 100.0, NULL}, - {NULL, NULL, 0, 0, 0, 0, NULL} + {"lgb", &sws_lum_gblur, CONF_TYPE_FLOAT, 0, 0, 100.0, NULL}, + {"cgb", &sws_chr_gblur, CONF_TYPE_FLOAT, 0, 0, 100.0, NULL}, + {"cvs", &sws_chr_vshift, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"chs", &sws_chr_hshift, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"ls", &sws_lum_sharpen, CONF_TYPE_FLOAT, 0, -100.0, 100.0, NULL}, + {"cs", &sws_chr_sharpen, CONF_TYPE_FLOAT, 0, -100.0, 100.0, NULL}, + {NULL, NULL, 0, 0, 0, 0, NULL} }; -/* VIVO demuxer options: */ -extern int vivo_param_version; -extern char *vivo_param_acodec; -extern int vivo_param_abitrate; -extern int vivo_param_samplerate; -extern int vivo_param_bytesperblock; -extern int vivo_param_width; -extern int vivo_param_height; -extern int vivo_param_vformat; -extern char *dvd_device, *cdrom_device; - const m_option_t vivoopts_conf[]={ - {"version", &vivo_param_version, CONF_TYPE_INT, 0, 0, 0, NULL}, - /* audio options */ - {"acodec", &vivo_param_acodec, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"abitrate", &vivo_param_abitrate, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"samplerate", &vivo_param_samplerate, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"bytesperblock", &vivo_param_bytesperblock, CONF_TYPE_INT, 0, 0, 0, NULL}, - /* video options */ - {"width", &vivo_param_width, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"height", &vivo_param_height, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"vformat", &vivo_param_vformat, CONF_TYPE_INT, 0, 0, 0, NULL}, - {NULL, NULL, 0, 0, 0, 0, NULL} + {"version", &vivo_param_version, CONF_TYPE_INT, 0, 0, 0, NULL}, + /* audio options */ + {"acodec", &vivo_param_acodec, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"abitrate", &vivo_param_abitrate, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"samplerate", &vivo_param_samplerate, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"bytesperblock", &vivo_param_bytesperblock, CONF_TYPE_INT, 0, 0, 0, NULL}, + /* video options */ + {"width", &vivo_param_width, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"height", &vivo_param_height, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"vformat", &vivo_param_vformat, CONF_TYPE_INT, 0, 0, 0, NULL}, + {NULL, NULL, 0, 0, 0, 0, NULL} }; -extern int mf_w; -extern int mf_h; -extern double mf_fps; -extern char * mf_type; -extern m_obj_settings_t* vf_settings; -extern m_obj_list_t vf_obj_list; - const m_option_t mfopts_conf[]={ - {"on", "-mf on has been removed, use mf:// instead.\n", CONF_TYPE_PRINT, 0, 0, 1, NULL}, - {"w", &mf_w, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"h", &mf_h, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"fps", &mf_fps, CONF_TYPE_DOUBLE, 0, 0, 0, NULL}, - {"type", &mf_type, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {NULL, NULL, 0, 0, 0, 0, NULL} + {"on", "-mf on has been removed, use mf:// instead.\n", CONF_TYPE_PRINT, 0, 0, 1, NULL}, + {"w", &mf_w, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"h", &mf_h, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"fps", &mf_fps, CONF_TYPE_DOUBLE, 0, 0, 0, NULL}, + {"type", &mf_type, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {NULL, NULL, 0, 0, 0, 0, NULL} }; #include "libaf/af.h" -extern af_cfg_t af_cfg; // Audio filter configuration, defined in libmpcodecs/dec_audio.c -const m_option_t audio_filter_conf[]={ - {"list", &af_cfg.list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, - {"force", &af_cfg.force, CONF_TYPE_INT, CONF_RANGE, 0, 7, NULL}, - {NULL, NULL, 0, 0, 0, 0, NULL} +const m_option_t audio_filter_conf[]={ + {"list", &af_cfg.list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, + {"force", &af_cfg.force, CONF_TYPE_INT, CONF_RANGE, 0, 7, NULL}, + {NULL, NULL, 0, 0, 0, 0, NULL} }; -extern int mp_msg_levels[MSGT_MAX]; -extern int mp_msg_level_all; - const m_option_t msgl_config[]={ - { "all", &mp_msg_level_all, CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL}, + { "all", &mp_msg_level_all, CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL}, - { "global", &mp_msg_levels[MSGT_GLOBAL], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "cplayer", &mp_msg_levels[MSGT_CPLAYER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "gplayer", &mp_msg_levels[MSGT_GPLAYER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "vo", &mp_msg_levels[MSGT_VO], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "ao", &mp_msg_levels[MSGT_AO], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "demuxer", &mp_msg_levels[MSGT_DEMUXER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "ds", &mp_msg_levels[MSGT_DS], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "demux", &mp_msg_levels[MSGT_DEMUX], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "header", &mp_msg_levels[MSGT_HEADER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "avsync", &mp_msg_levels[MSGT_AVSYNC], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "autoq", &mp_msg_levels[MSGT_AUTOQ], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "cfgparser", &mp_msg_levels[MSGT_CFGPARSER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "decaudio", &mp_msg_levels[MSGT_DECAUDIO], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "decvideo", &mp_msg_levels[MSGT_DECVIDEO], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "seek", &mp_msg_levels[MSGT_SEEK], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "win32", &mp_msg_levels[MSGT_WIN32], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "open", &mp_msg_levels[MSGT_OPEN], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "dvd", &mp_msg_levels[MSGT_DVD], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "parsees", &mp_msg_levels[MSGT_PARSEES], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "lirc", &mp_msg_levels[MSGT_LIRC], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "stream", &mp_msg_levels[MSGT_STREAM], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "cache", &mp_msg_levels[MSGT_CACHE], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "mencoder", &mp_msg_levels[MSGT_MENCODER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "xacodec", &mp_msg_levels[MSGT_XACODEC], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "tv", &mp_msg_levels[MSGT_TV], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "radio", &mp_msg_levels[MSGT_RADIO], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "osdep", &mp_msg_levels[MSGT_OSDEP], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "spudec", &mp_msg_levels[MSGT_SPUDEC], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "playtree", &mp_msg_levels[MSGT_PLAYTREE], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "input", &mp_msg_levels[MSGT_INPUT], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "vfilter", &mp_msg_levels[MSGT_VFILTER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "osd", &mp_msg_levels[MSGT_OSD], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "network", &mp_msg_levels[MSGT_NETWORK], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "cpudetect", &mp_msg_levels[MSGT_CPUDETECT], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "codeccfg", &mp_msg_levels[MSGT_CODECCFG], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "sws", &mp_msg_levels[MSGT_SWS], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "vobsub", &mp_msg_levels[MSGT_VOBSUB], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "subreader", &mp_msg_levels[MSGT_SUBREADER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "afilter", &mp_msg_levels[MSGT_AFILTER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "netst", &mp_msg_levels[MSGT_NETST], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "muxer", &mp_msg_levels[MSGT_MUXER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "osd-menu", &mp_msg_levels[MSGT_OSD_MENU], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "identify", &mp_msg_levels[MSGT_IDENTIFY], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "ass", &mp_msg_levels[MSGT_ASS], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - { "statusline", &mp_msg_levels[MSGT_STATUSLINE], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, - {"help", "Available msg modules:\n" - " global - common player errors/information\n" - " cplayer - console player (mplayer.c)\n" - " gplayer - gui player\n" - " vo - libvo\n" - " ao - libao\n" - " demuxer - demuxer.c (general stuff)\n" - " ds - demux stream (add/read packet etc)\n" - " demux - fileformat-specific stuff (demux_*.c)\n" - " header - fileformat-specific header (*header.c)\n" - " avsync - mplayer.c timer stuff\n" - " autoq - mplayer.c auto-quality stuff\n" - " cfgparser - cfgparser.c\n" - " decaudio - av decoder\n" - " decvideo\n" - " seek - seeking code\n" - " win32 - win32 dll stuff\n" - " open - open.c (stream opening)\n" - " dvd - open.c (DVD init/read/seek)\n" - " parsees - parse_es.c (mpeg stream parser)\n" - " lirc - lirc_mp.c and input lirc driver\n" - " stream - stream.c\n" - " cache - cache2.c\n" - " mencoder\n" - " xacodec - XAnim codecs\n" - " tv - TV input subsystem\n" - " osdep - OS-dependent parts\n" - " spudec - spudec.c\n" - " playtree - Playtree handling (playtree.c, playtreeparser.c)\n" - " input\n" - " vfilter\n" - " osd\n" - " network\n" - " cpudetect\n" - " codeccfg\n" - " sws\n" - " vobsub\n" - " subreader\n" - " osd-menu - OSD menu messages\n" - " afilter - Audio filter messages\n" - " netst - Netstream\n" - " muxer - muxer layer\n" - " identify - identify output\n" - " ass - libass messages\n" - " statusline - playback/encoding status line\n" - "\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {NULL, NULL, 0, 0, 0, 0, NULL} + { "global", &mp_msg_levels[MSGT_GLOBAL], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "cplayer", &mp_msg_levels[MSGT_CPLAYER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "gplayer", &mp_msg_levels[MSGT_GPLAYER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "vo", &mp_msg_levels[MSGT_VO], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "ao", &mp_msg_levels[MSGT_AO], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "demuxer", &mp_msg_levels[MSGT_DEMUXER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "ds", &mp_msg_levels[MSGT_DS], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "demux", &mp_msg_levels[MSGT_DEMUX], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "header", &mp_msg_levels[MSGT_HEADER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "avsync", &mp_msg_levels[MSGT_AVSYNC], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "autoq", &mp_msg_levels[MSGT_AUTOQ], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "cfgparser", &mp_msg_levels[MSGT_CFGPARSER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "decaudio", &mp_msg_levels[MSGT_DECAUDIO], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "decvideo", &mp_msg_levels[MSGT_DECVIDEO], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "seek", &mp_msg_levels[MSGT_SEEK], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "win32", &mp_msg_levels[MSGT_WIN32], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "open", &mp_msg_levels[MSGT_OPEN], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "dvd", &mp_msg_levels[MSGT_DVD], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "parsees", &mp_msg_levels[MSGT_PARSEES], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "lirc", &mp_msg_levels[MSGT_LIRC], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "stream", &mp_msg_levels[MSGT_STREAM], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "cache", &mp_msg_levels[MSGT_CACHE], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "mencoder", &mp_msg_levels[MSGT_MENCODER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "xacodec", &mp_msg_levels[MSGT_XACODEC], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "tv", &mp_msg_levels[MSGT_TV], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "radio", &mp_msg_levels[MSGT_RADIO], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "osdep", &mp_msg_levels[MSGT_OSDEP], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "spudec", &mp_msg_levels[MSGT_SPUDEC], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "playtree", &mp_msg_levels[MSGT_PLAYTREE], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "input", &mp_msg_levels[MSGT_INPUT], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "vfilter", &mp_msg_levels[MSGT_VFILTER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "osd", &mp_msg_levels[MSGT_OSD], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "network", &mp_msg_levels[MSGT_NETWORK], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "cpudetect", &mp_msg_levels[MSGT_CPUDETECT], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "codeccfg", &mp_msg_levels[MSGT_CODECCFG], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "sws", &mp_msg_levels[MSGT_SWS], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "vobsub", &mp_msg_levels[MSGT_VOBSUB], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "subreader", &mp_msg_levels[MSGT_SUBREADER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "afilter", &mp_msg_levels[MSGT_AFILTER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "netst", &mp_msg_levels[MSGT_NETST], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "muxer", &mp_msg_levels[MSGT_MUXER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "osd-menu", &mp_msg_levels[MSGT_OSD_MENU], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "identify", &mp_msg_levels[MSGT_IDENTIFY], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "ass", &mp_msg_levels[MSGT_ASS], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + { "statusline", &mp_msg_levels[MSGT_STATUSLINE], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL }, + {"help", "Available msg modules:\n" + " global - common player errors/information\n" + " cplayer - console player (mplayer.c)\n" + " gplayer - gui player\n" + " vo - libvo\n" + " ao - libao\n" + " demuxer - demuxer.c (general stuff)\n" + " ds - demux stream (add/read packet etc)\n" + " demux - fileformat-specific stuff (demux_*.c)\n" + " header - fileformat-specific header (*header.c)\n" + " avsync - mplayer.c timer stuff\n" + " autoq - mplayer.c auto-quality stuff\n" + " cfgparser - cfgparser.c\n" + " decaudio - av decoder\n" + " decvideo\n" + " seek - seeking code\n" + " win32 - win32 dll stuff\n" + " open - open.c (stream opening)\n" + " dvd - open.c (DVD init/read/seek)\n" + " parsees - parse_es.c (mpeg stream parser)\n" + " lirc - lirc_mp.c and input lirc driver\n" + " stream - stream.c\n" + " cache - cache2.c\n" + " mencoder\n" + " xacodec - XAnim codecs\n" + " tv - TV input subsystem\n" + " osdep - OS-dependent parts\n" + " spudec - spudec.c\n" + " playtree - Playtree handling (playtree.c, playtreeparser.c)\n" + " input\n" + " vfilter\n" + " osd\n" + " network\n" + " cpudetect\n" + " codeccfg\n" + " sws\n" + " vobsub\n" + " subreader\n" + " osd-menu - OSD menu messages\n" + " afilter - Audio filter messages\n" + " netst - Netstream\n" + " muxer - muxer layer\n" + " identify - identify output\n" + " ass - libass messages\n" + " statusline - playback/encoding status line\n" + "\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {NULL, NULL, 0, 0, 0, 0, NULL} }; -extern const m_option_t noconfig_opts[]; +const m_option_t common_opts[] = { +// ------------------------- common options -------------------- + {"quiet", &quiet, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, + {"noquiet", &quiet, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, + {"really-quiet", &verbose, CONF_TYPE_FLAG, CONF_GLOBAL|CONF_PRE_PARSE, 0, -10, NULL}, + {"v", cfg_inc_verbose, CONF_TYPE_FUNC, CONF_GLOBAL|CONF_NOSAVE, 0, 0, NULL}, + {"msglevel", msgl_config, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, + {"msgcolor", &mp_msg_color, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, + {"nomsgcolor", &mp_msg_color, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, + {"msgmodule", &mp_msg_module, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, + {"nomsgmodule", &mp_msg_module, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, +#ifdef CONFIG_ICONV + {"msgcharset", &mp_msg_charset, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, +#endif + {"include", cfg_include, CONF_TYPE_FUNC_PARAM, CONF_NOSAVE, 0, 0, NULL}, +#ifdef CONFIG_PRIORITY + {"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL}, +#endif + {"codecpath", &codec_path, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"noconfig", noconfig_opts, CONF_TYPE_SUBCONFIG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 0, NULL}, + +// ------------------------- stream options -------------------- + +#ifdef CONFIG_STREAM_CACHE + {"cache", &stream_cache_size, CONF_TYPE_INT, CONF_RANGE, 32, 1048576, NULL}, + {"nocache", &stream_cache_size, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"cache-min", &stream_cache_min_percent, CONF_TYPE_FLOAT, CONF_RANGE, 0, 99, NULL}, + {"cache-seek-min", &stream_cache_seek_min_percent, CONF_TYPE_FLOAT, CONF_RANGE, 0, 99, NULL}, +#else + {"cache", "MPlayer was compiled without cache2 support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, +#endif /* CONFIG_STREAM_CACHE */ + {"vcd", "-vcd N has been removed, use vcd://N instead.\n", CONF_TYPE_PRINT, CONF_NOCFG ,0,0, NULL}, + {"cuefile", "-cuefile has been removed, use cue://filename:N where N is the track number.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"cdrom-device", &cdrom_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, +#ifdef CONFIG_DVDREAD + {"dvd-device", &dvd_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"dvd-speed", &dvd_speed, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"dvd", "-dvd N has been removed, use dvd://N instead.\n" , CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"dvdangle", &dvd_angle, CONF_TYPE_INT, CONF_RANGE, 1, 99, NULL}, + {"chapter", dvd_parse_chapter_range, CONF_TYPE_FUNC_PARAM, 0, 0, 0, NULL}, +#else + {"dvd-device", "MPlayer was compiled without libdvdread support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"dvd-speed", "MPlayer was compiled without libdvdread support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"dvd", "MPlayer was compiled without libdvdread support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, +#endif /* CONFIG_DVDREAD */ +#ifdef CONFIG_LIBBLURAY + {"bluray-device", &bluray_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"bluray-angle", &bluray_angle, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL}, + {"bluray-chapter", &bluray_chapter, CONF_TYPE_INT, CONF_RANGE, 0, 999, NULL}, +#else + {"bluray-device", "MPlayer was compiled without libbluray support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"bluray-angle", "MPlayer was compiled without libbluray support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"bluray-chapter", "MPlayer was compiled without libbluray support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, +#endif /* CONFIG_LIBBLURAY */ + {"alang", &audio_lang, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"slang", &dvdsub_lang, CONF_TYPE_STRING, 0, 0, 0, NULL}, + + {"dvdauth", "libcss is obsolete. Try libdvdread instead.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"dvdkey", "libcss is obsolete. Try libdvdread instead.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"csslib", "libcss is obsolete. Try libdvdread instead.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + +#ifdef CONFIG_NETWORK + {"user", &network_username, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"passwd", &network_password, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"bandwidth", &network_bandwidth, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL}, + {"user-agent", &network_useragent, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"referrer", &network_referrer, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"cookies", &network_cookies_enabled, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nocookies", &network_cookies_enabled, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"cookies-file", &cookies_file, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"prefer-ipv4", &network_prefer_ipv4, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"ipv4-only-proxy", &network_ipv4_only_proxy, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"reuse-socket", &reuse_socket, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, + {"noreuse-socket", &reuse_socket, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, +#ifdef HAVE_AF_INET6 + {"prefer-ipv6", &network_prefer_ipv4, CONF_TYPE_FLAG, 0, 1, 0, NULL}, +#else + {"prefer-ipv6", "MPlayer was compiled without IPv6 support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, +#endif /* HAVE_AF_INET6 */ + +#else + {"user", "MPlayer was compiled without streaming (network) support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"passwd", "MPlayer was compiled without streaming (network) support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"bandwidth", "MPlayer was compiled without streaming (network) support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"user-agent", "MPlayer was compiled without streaming (network) support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, +#endif /* CONFIG_NETWORK */ + +#ifdef CONFIG_LIVE555 + {"sdp", "-sdp has been removed, use sdp://file instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"rtsp-stream-over-http", &rtsp_transport_http, CONF_TYPE_FLAG, 0, 0, 1, NULL}, +#else + {"rtsp-stream-over-http", "-rtsp-stream-over-http requires the \"LIVE555 Streaming Media\" library.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, +#endif /* CONFIG_LIVE555 */ +#if defined(CONFIG_LIBNEMESI) || defined(CONFIG_LIVE555) + // -rtsp-stream-over-tcp option, specifying TCP streaming of RTP/RTCP + {"rtsp-stream-over-tcp", &rtsp_transport_tcp, CONF_TYPE_FLAG, 0, 0, 1, NULL}, +#else + {"rtsp-stream-over-tcp", "-rtsp-stream-over-tcp requires the \"LIVE555 Streaming Media\" or \"libnemesi\" libraries.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, +#endif /* defined(CONFIG_LIBNEMESI) || defined(CONFIG_LIVE555) */ +#ifdef CONFIG_LIBNEMESI + {"rtsp-stream-over-sctp", &rtsp_transport_sctp, CONF_TYPE_FLAG, 0, 0, 1, NULL}, +#else + {"rtsp-stream-over-sctp", "-rtsp-stream-over-sctp requires the \"libnemesi\" library\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, +#endif /* CONFIG_LIBNEMESI */ +#ifdef CONFIG_NETWORK + {"rtsp-port", &rtsp_port, CONF_TYPE_INT, CONF_RANGE, -1, 65535, NULL}, + {"rtsp-destination", &rtsp_destination, CONF_TYPE_STRING, CONF_MIN, 0, 0, NULL}, +#else + {"rtsp-port", "MPlayer was compiled without network support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"rtsp-destination", "MPlayer was compiled without network support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, +#endif /* CONFIG_NETWORK */ + +// ------------------------- demuxer options -------------------- + + // number of frames to play/convert + {"frames", &play_n_frames_mf, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL}, + + // seek to byte/seconds position + {"sb", &seek_to_byte, CONF_TYPE_POSITION, CONF_MIN, 0, 0, NULL}, + {"ss", &seek_to_sec, CONF_TYPE_TIME, 0, 0, 0, NULL}, + + // stop at given position + {"endpos", &end_at, CONF_TYPE_TIME_SIZE, 0, 0, 0, NULL}, + + {"edl", &edl_filename, CONF_TYPE_STRING, 0, 0, 0, NULL}, + + // AVI specific: force non-interleaved mode + {"ni", &force_ni, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"noni", &force_ni, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + + // AVI and Ogg only: (re)build index at startup + {"noidx", &index_mode, CONF_TYPE_FLAG, 0, -1, 0, NULL}, + {"idx", &index_mode, CONF_TYPE_FLAG, 0, -1, 1, NULL}, + {"forceidx", &index_mode, CONF_TYPE_FLAG, 0, -1, 2, NULL}, + {"saveidx", &index_file_save, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"loadidx", &index_file_load, CONF_TYPE_STRING, 0, 0, 0, NULL}, + + // select audio/video/subtitle stream + {"aid", &audio_id, CONF_TYPE_INT, CONF_RANGE, -2, 8190, NULL}, + {"ausid", &audio_substream_id, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"vid", &video_id, CONF_TYPE_INT, CONF_RANGE, -2, 8190, NULL}, + {"sid", &dvdsub_id, CONF_TYPE_INT, CONF_RANGE, -2, 8190, NULL}, + {"nosub", &dvdsub_id, CONF_TYPE_FLAG, 0, -1, -2, NULL}, + {"novideo", &video_id, CONF_TYPE_FLAG, 0, -1, -2, NULL}, + + { "hr-mp3-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 0, 1, NULL }, + { "nohr-mp3-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + + { "rawaudio", &demux_rawaudio_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, + { "rawvideo", &demux_rawvideo_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, + +#ifdef CONFIG_CDDA + { "cdda", &cdda_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, +#endif + + // demuxer.c - select audio/sub file/demuxer + { "audiofile", &audio_stream, CONF_TYPE_STRING, 0, 0, 0, NULL }, + { "audiofile-cache", &audio_stream_cache, CONF_TYPE_INT, CONF_RANGE, 50, 65536, NULL}, + { "subfile", &sub_stream, CONF_TYPE_STRING, 0, 0, 0, NULL }, + { "demuxer", &demuxer_name, CONF_TYPE_STRING, 0, 0, 0, NULL }, + { "audio-demuxer", &audio_demuxer_name, CONF_TYPE_STRING, 0, 0, 0, NULL }, + { "sub-demuxer", &sub_demuxer_name, CONF_TYPE_STRING, 0, 0, 0, NULL }, + { "extbased", &extension_parsing, CONF_TYPE_FLAG, 0, 0, 1, NULL }, + { "noextbased", &extension_parsing, CONF_TYPE_FLAG, 0, 1, 0, NULL }, -extern const m_option_t lavc_decode_opts_conf[]; -extern const m_option_t xvid_dec_opts[]; + {"mf", mfopts_conf, CONF_TYPE_SUBCONFIG, 0,0,0, NULL}, +#ifdef CONFIG_RADIO + {"radio", radioopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, +#else + {"radio", "MPlayer was compiled without Radio interface support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, +#endif /* CONFIG_RADIO */ +#ifdef CONFIG_TV + {"tv", tvopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, +#else + {"tv", "MPlayer was compiled without TV interface support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, +#endif /* CONFIG_TV */ +#ifdef CONFIG_PVR + {"pvr", pvropts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, +#else + {"pvr", "MPlayer was compiled without V4L2/PVR interface support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, +#endif /* CONFIG_PVR */ + {"vivo", vivoopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, +#ifdef CONFIG_DVBIN + {"dvbin", dvbin_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, +#endif + +// ------------------------- a-v sync options -------------------- + + // AVI specific: A-V sync mode (bps vs. interleaving) + {"bps", &pts_from_bps, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nobps", &pts_from_bps, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + + // set A-V sync correction speed (0=disables it): + {"mc", &default_max_pts_correction, CONF_TYPE_FLOAT, CONF_RANGE, 0, 100, NULL}, + + // force video/audio rate: + {"fps", &force_fps, CONF_TYPE_DOUBLE, CONF_MIN, 0, 0, NULL}, + {"srate", &force_srate, CONF_TYPE_INT, CONF_RANGE, 1000, 8*48000, NULL}, + {"channels", &audio_output_channels, CONF_TYPE_INT, CONF_RANGE, 1, 8, NULL}, + {"format", &audio_output_format, CONF_TYPE_AFMT, 0, 0, 0, NULL}, + {"speed", &playback_speed, CONF_TYPE_FLOAT, CONF_RANGE, 0.01, 100.0, NULL}, + + // set a-v distance + {"delay", &audio_delay, CONF_TYPE_FLOAT, CONF_RANGE, -100.0, 100.0, NULL}, + + // ignore header-specified delay (dwStart) + {"ignore-start", &ignore_start, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"noignore-start", &ignore_start, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + + {"a52drc", &drc_level, CONF_TYPE_FLOAT, CONF_RANGE, 0, 2, NULL}, + +// ------------------------- codec/vfilter options -------------------- -int dvd_parse_chapter_range(const m_option_t*, const char*); + // MP3-only: select stereo/left/right +#ifdef CONFIG_FAKE_MONO + {"stereo", &fakemono, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL}, +#endif + + // disable audio + {"sound", &audio_id, CONF_TYPE_FLAG, 0, -2, -1, NULL}, + {"nosound", &audio_id, CONF_TYPE_FLAG, 0, -1, -2, NULL}, + + {"af*", &af_cfg.list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, + {"af-adv", audio_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, + + {"vop", "-vop has been removed, use -vf instead.\n", CONF_TYPE_PRINT, CONF_NOCFG ,0,0, NULL}, + {"vf*", &vf_settings, CONF_TYPE_OBJ_SETTINGS_LIST, 0, 0, 0, &vf_obj_list}, + // select audio/video codec (by name) or codec family (by number): + {"afm", &audio_fm_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, + {"vfm", &video_fm_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, + {"ac", &audio_codec_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, + {"vc", &video_codec_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, + + // postprocessing: +#ifdef CONFIG_LIBAVCODEC + {"pp", &divx_quality, CONF_TYPE_INT, 0, 0, 0, NULL}, +#endif +#ifdef CONFIG_LIBPOSTPROC + {"pphelp", &pp_help, CONF_TYPE_PRINT_INDIRECT, CONF_NOCFG, 0, 0, NULL}, +#endif + + // scaling: + {"sws", &sws_flags, CONF_TYPE_INT, 0, 0, 2, NULL}, + {"ssf", scaler_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, + {"zoom", &softzoom, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nozoom", &softzoom, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"aspect", &movie_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.2, 3.0, NULL}, + {"noaspect", &movie_aspect, CONF_TYPE_FLAG, 0, 0, 0, NULL}, + {"xy", &screen_size_xy, CONF_TYPE_FLOAT, CONF_RANGE, 0.001, 4096, NULL}, + + {"flip", &flip, CONF_TYPE_FLAG, 0, -1, 1, NULL}, + {"noflip", &flip, CONF_TYPE_FLAG, 0, -1, 0, NULL}, + {"tsfastparse", "-tsfastparse is no longer a valid option.\n", CONF_TYPE_PRINT, CONF_NOCFG ,0,0, NULL +}, + {"tsprog", &ts_prog, CONF_TYPE_INT, CONF_RANGE, 0, 65534, NULL}, + {"tsprobe", &ts_probe, CONF_TYPE_POSITION, 0, 0, TS_MAX_PROBE_SIZE, NULL}, + {"psprobe", &ps_probe, CONF_TYPE_POSITION, 0, 0, TS_MAX_PROBE_SIZE, NULL}, + {"tskeepbroken", &ts_keep_broken, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + + // draw by slices or whole frame (useful with libmpeg2/libavcodec) + {"slices", &vd_use_slices, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"noslices", &vd_use_slices, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"field-dominance", &field_dominance, CONF_TYPE_INT, CONF_RANGE, -1, 1, NULL}, + +#ifdef CONFIG_LIBAVCODEC + {"lavdopts", lavc_decode_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, +#endif +#ifdef CONFIG_LIBAVFORMAT + {"lavfdopts", lavfdopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, +#endif +#ifdef CONFIG_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 -------------------- + + {"sub", &sub_name, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, +#ifdef CONFIG_FRIBIDI + {"fribidi-charset", &fribidi_charset, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"flip-hebrew", &flip_hebrew, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"noflip-hebrew", &flip_hebrew, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"flip-hebrew-commas", &fribidi_flip_commas, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"noflip-hebrew-commas", &fribidi_flip_commas, CONF_TYPE_FLAG, 0, 0, 1, NULL}, +#else + {"fribidi-charset", "MPlayer was compiled without FriBiDi support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"flip-hebrew", "MPlayer was compiled without FriBiDi support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"noflip-hebrew", "MPlayer was compiled without FriBiDi support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"flip-hebrew-commas", "MPlayer was compiled without FriBiDi support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"noflip-hebrew-commas", "MPlayer was compiled without FriBiDi support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, +#endif /* CONFIG_FRIBIDI */ +#ifdef CONFIG_ICONV + {"subcp", &sub_cp, CONF_TYPE_STRING, 0, 0, 0, NULL}, +#endif + {"subdelay", &sub_delay, CONF_TYPE_FLOAT, 0, 0.0, 10.0, NULL}, + {"subfps", &sub_fps, CONF_TYPE_FLOAT, 0, 0.0, 10.0, NULL}, + {"autosub", &sub_auto, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"noautosub", &sub_auto, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"unicode", &sub_unicode, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nounicode", &sub_unicode, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"utf8", &sub_utf8, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"noutf8", &sub_utf8, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"forcedsubsonly", &forced_subs_only, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + // specify IFO file for VOBSUB subtitle + {"ifo", &spudec_ifo, CONF_TYPE_STRING, 0, 0, 0, NULL}, + // enable Closed Captioning display + {"subcc", &subcc_enabled, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nosubcc", &subcc_enabled, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"overlapsub", &suboverlap_enabled, CONF_TYPE_FLAG, 0, 0, 2, NULL}, + {"nooverlapsub", &suboverlap_enabled, CONF_TYPE_FLAG, 0, 0, 0, NULL}, + {"sub-bg-color", &sub_bg_color, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL}, + {"sub-bg-alpha", &sub_bg_alpha, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL}, + {"sub-no-text-pp", &sub_no_text_pp, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"sub-fuzziness", &sub_match_fuzziness, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL}, + {"font", &font_name, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"subfont", &sub_font_name, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"ffactor", &font_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 10.0, NULL}, + {"subpos", &sub_pos, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL}, + {"subalign", &sub_alignment, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL}, + {"subwidth", &sub_width_p, CONF_TYPE_INT, CONF_RANGE, 10, 100, NULL}, + {"spualign", &spu_alignment, CONF_TYPE_INT, CONF_RANGE, -1, 2, NULL}, + {"spuaa", &spu_aamode, CONF_TYPE_INT, CONF_RANGE, 0, 31, NULL}, + {"spugauss", &spu_gaussvar, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 3.0, NULL}, +#ifdef CONFIG_FREETYPE + {"subfont-encoding", &subtitle_font_encoding, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"subfont-text-scale", &text_font_scale_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0, 100, NULL}, + {"subfont-osd-scale", &osd_font_scale_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0, 100, NULL}, + {"subfont-blur", &subtitle_font_radius, CONF_TYPE_FLOAT, CONF_RANGE, 0, 8, NULL}, + {"subfont-outline", &subtitle_font_thickness, CONF_TYPE_FLOAT, CONF_RANGE, 0, 8, NULL}, + {"subfont-autoscale", &subtitle_autoscale, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL}, +#endif +#ifdef CONFIG_ASS + {"ass", &ass_enabled, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"noass", &ass_enabled, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"ass-font-scale", &ass_font_scale, CONF_TYPE_FLOAT, CONF_RANGE, 0, 100, NULL}, + {"ass-line-spacing", &ass_line_spacing, CONF_TYPE_FLOAT, CONF_RANGE, -1000, 1000, NULL}, + {"ass-top-margin", &ass_top_margin, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL}, + {"ass-bottom-margin", &ass_bottom_margin, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL}, + {"ass-use-margins", &ass_use_margins, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"noass-use-margins", &ass_use_margins, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"embeddedfonts", &extract_embedded_fonts, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"noembeddedfonts", &extract_embedded_fonts, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"ass-force-style", &ass_force_style_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, + {"ass-color", &ass_color, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"ass-border-color", &ass_border_color, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"ass-styles", &ass_styles_file, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"ass-hinting", &ass_hinting, CONF_TYPE_INT, CONF_RANGE, 0, 7, NULL}, +#endif +#ifdef CONFIG_FONTCONFIG + {"fontconfig", &font_fontconfig, CONF_TYPE_FLAG, 0, -1, 1, NULL}, + {"nofontconfig", &font_fontconfig, CONF_TYPE_FLAG, 0, 1, -1, NULL}, +#else + {"fontconfig", "MPlayer was compiled without fontconfig support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"nofontconfig", "MPlayer was compiled without fontconfig support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, +#endif /* CONFIG_FONTCONFIG */ + {NULL, NULL, 0, 0, 0, 0, NULL} +}; #endif /* MPLAYER_CFG_COMMON_H */ diff -Nru mplayer-1.0~rc3+svn20090426/cfg-common-opts.h mplayer-1.0~rc4.dfsg1/cfg-common-opts.h --- mplayer-1.0~rc3+svn20090426/cfg-common-opts.h 2009-02-10 15:34:44.000000000 +0000 +++ mplayer-1.0~rc4.dfsg1/cfg-common-opts.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,350 +0,0 @@ -#ifndef MPLAYER_CFG_COMMON_OPTS_H -#define MPLAYER_CFG_COMMON_OPTS_H - -#include "config.h" - -#include "osdep/priority.h" - -// ------------------------- common options -------------------- - {"quiet", &quiet, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, - {"noquiet", &quiet, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, - {"really-quiet", &verbose, CONF_TYPE_FLAG, CONF_GLOBAL|CONF_PRE_PARSE, 0, -10, NULL}, - {"v", cfg_inc_verbose, CONF_TYPE_FUNC, CONF_GLOBAL|CONF_NOSAVE, 0, 0, NULL}, - {"msglevel", msgl_config, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, - {"msgcolor", &mp_msg_color, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, - {"nomsgcolor", &mp_msg_color, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, - {"msgmodule", &mp_msg_module, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, - {"nomsgmodule", &mp_msg_module, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, -#ifdef CONFIG_ICONV - {"msgcharset", &mp_msg_charset, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, -#endif - {"include", cfg_include, CONF_TYPE_FUNC_PARAM, CONF_NOSAVE, 0, 0, NULL}, -#ifdef CONFIG_PRIORITY - {"priority", &proc_priority, 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 -------------------- - -#ifdef CONFIG_STREAM_CACHE - {"cache", &stream_cache_size, CONF_TYPE_INT, CONF_RANGE, 32, 1048576, NULL}, - {"nocache", &stream_cache_size, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"cache-min", &stream_cache_min_percent, CONF_TYPE_FLOAT, CONF_RANGE, 0, 99, NULL}, - {"cache-seek-min", &stream_cache_seek_min_percent, CONF_TYPE_FLOAT, CONF_RANGE, 0, 99, NULL}, -#else - {"cache", "MPlayer was compiled without cache2 support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, -#endif /* CONFIG_STREAM_CACHE */ - {"vcd", "-vcd N has been removed, use vcd://N instead.\n", CONF_TYPE_PRINT, CONF_NOCFG ,0,0, NULL}, - {"cuefile", "-cuefile has been removed, use cue://filename:N where N is the track number.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, - {"cdrom-device", &cdrom_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, -#ifdef CONFIG_DVDREAD - {"dvd-device", &dvd_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"dvd-speed", &dvd_speed, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"dvd", "-dvd N has been removed, use dvd://N instead.\n" , CONF_TYPE_PRINT, 0, 0, 0, NULL}, - {"dvdangle", &dvd_angle, CONF_TYPE_INT, CONF_RANGE, 1, 99, NULL}, - {"chapter", dvd_parse_chapter_range, CONF_TYPE_FUNC_PARAM, 0, 0, 0, NULL}, -#else - {"dvd-device", "MPlayer was compiled without libdvdread support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, - {"dvd-speed", "MPlayer was compiled without libdvdread support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, - {"dvd", "MPlayer was compiled without libdvdread support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, -#endif /* CONFIG_DVDREAD */ - {"alang", &audio_lang, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"slang", &dvdsub_lang, CONF_TYPE_STRING, 0, 0, 0, NULL}, - - {"dvdauth", "libcss is obsolete. Try libdvdread instead.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {"dvdkey", "libcss is obsolete. Try libdvdread instead.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {"csslib", "libcss is obsolete. Try libdvdread instead.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - -#ifdef CONFIG_NETWORK - {"user", &network_username, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"passwd", &network_password, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"bandwidth", &network_bandwidth, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL}, - {"user-agent", &network_useragent, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"cookies", &network_cookies_enabled, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nocookies", &network_cookies_enabled, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"cookies-file", &cookies_file, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"prefer-ipv4", &network_prefer_ipv4, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"ipv4-only-proxy", &network_ipv4_only_proxy, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"reuse-socket", &reuse_socket, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, - {"noreuse-socket", &reuse_socket, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, -#ifdef HAVE_AF_INET6 - {"prefer-ipv6", &network_prefer_ipv4, CONF_TYPE_FLAG, 0, 1, 0, NULL}, -#else - {"prefer-ipv6", "MPlayer was compiled without IPv6 support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, -#endif /* HAVE_AF_INET6 */ - -#else - {"user", "MPlayer was compiled without streaming (network) support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {"passwd", "MPlayer was compiled without streaming (network) support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {"bandwidth", "MPlayer was compiled without streaming (network) support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {"user-agent", "MPlayer was compiled without streaming (network) support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, -#endif /* CONFIG_NETWORK */ - -#ifdef CONFIG_LIVE555 - {"sdp", "-sdp has been removed, use sdp://file instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, - // -rtsp-stream-over-tcp option, specifying TCP streaming of RTP/RTCP - {"rtsp-stream-over-tcp", &rtspStreamOverTCP, CONF_TYPE_FLAG, 0, 0, 1, NULL}, -#elif defined (CONFIG_LIBNEMESI) - {"rtsp-stream-over-tcp", &rtsp_transport_tcp, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"rtsp-stream-over-sctp", &rtsp_transport_sctp, CONF_TYPE_FLAG, 0, 0, 1, NULL}, -#else - {"rtsp-stream-over-tcp", "-rtsp-stream-over-tcp requires the \"LIVE555 Streaming Media\" libraries.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, -#endif /* CONFIG_LIVE555 */ -#ifdef CONFIG_NETWORK - {"rtsp-port", &rtsp_port, CONF_TYPE_INT, CONF_RANGE, -1, 65535, NULL}, - {"rtsp-destination", &rtsp_destination, CONF_TYPE_STRING, CONF_MIN, 0, 0, NULL}, -#else - {"rtsp-port", "MPlayer was compiled without network support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {"rtsp-destination", "MPlayer was compiled without network support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, -#endif /* CONFIG_NETWORK */ - -// ------------------------- demuxer options -------------------- - - // number of frames to play/convert - {"frames", &play_n_frames_mf, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL}, - - // seek to byte/seconds position - {"sb", &seek_to_byte, CONF_TYPE_POSITION, CONF_MIN, 0, 0, NULL}, - {"ss", &seek_to_sec, CONF_TYPE_TIME, 0, 0, 0, NULL}, - - // stop at given position - {"endpos", &end_at, CONF_TYPE_TIME_SIZE, 0, 0, 0, NULL}, - - {"edl", &edl_filename, CONF_TYPE_STRING, 0, 0, 0, NULL}, - - // AVI specific: force non-interleaved mode - {"ni", &force_ni, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"noni", &force_ni, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - - // AVI and Ogg only: (re)build index at startup - {"noidx", &index_mode, CONF_TYPE_FLAG, 0, -1, 0, NULL}, - {"idx", &index_mode, CONF_TYPE_FLAG, 0, -1, 1, NULL}, - {"forceidx", &index_mode, CONF_TYPE_FLAG, 0, -1, 2, NULL}, - {"saveidx", &index_file_save, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"loadidx", &index_file_load, CONF_TYPE_STRING, 0, 0, 0, NULL}, - - // select audio/video/subtitle stream - {"aid", &audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 8190, NULL}, - {"ausid", &audio_substream_id, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"vid", &video_id, CONF_TYPE_INT, CONF_RANGE, 0, 8190, NULL}, - {"sid", &dvdsub_id, CONF_TYPE_INT, CONF_RANGE, 0, 8190, NULL}, - {"novideo", &video_id, CONF_TYPE_FLAG, 0, -1, -2, NULL}, - - { "hr-mp3-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 0, 1, NULL }, - { "nohr-mp3-seek", &hr_mp3_seek, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - - { "rawaudio", &demux_rawaudio_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, - { "rawvideo", &demux_rawvideo_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, - -#ifdef CONFIG_CDDA - { "cdda", &cdda_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, -#endif - - // demuxer.c - select audio/sub file/demuxer - { "audiofile", &audio_stream, CONF_TYPE_STRING, 0, 0, 0, NULL }, - { "audiofile-cache", &audio_stream_cache, CONF_TYPE_INT, CONF_RANGE, 50, 65536, NULL}, - { "subfile", &sub_stream, CONF_TYPE_STRING, 0, 0, 0, NULL }, - { "demuxer", &demuxer_name, CONF_TYPE_STRING, 0, 0, 0, NULL }, - { "audio-demuxer", &audio_demuxer_name, CONF_TYPE_STRING, 0, 0, 0, NULL }, - { "sub-demuxer", &sub_demuxer_name, CONF_TYPE_STRING, 0, 0, 0, NULL }, - { "extbased", &extension_parsing, CONF_TYPE_FLAG, 0, 0, 1, NULL }, - { "noextbased", &extension_parsing, CONF_TYPE_FLAG, 0, 1, 0, NULL }, - - {"mf", mfopts_conf, CONF_TYPE_SUBCONFIG, 0,0,0, NULL}, -#ifdef CONFIG_RADIO - {"radio", radioopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, -#else - {"radio", "MPlayer was compiled without Radio interface support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, -#endif /* CONFIG_RADIO */ -#ifdef CONFIG_TV - {"tv", tvopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, -#else - {"tv", "MPlayer was compiled without TV interface support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, -#endif /* CONFIG_TV */ -#ifdef CONFIG_PVR - {"pvr", pvropts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, -#else - {"pvr", "MPlayer was compiled without V4L2/PVR interface support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, -#endif /* CONFIG_PVR */ - {"vivo", vivoopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, -#ifdef CONFIG_DVBIN - {"dvbin", dvbin_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, -#endif - -// ------------------------- a-v sync options -------------------- - - // AVI specific: A-V sync mode (bps vs. interleaving) - {"bps", &pts_from_bps, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nobps", &pts_from_bps, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - - // set A-V sync correction speed (0=disables it): - {"mc", &default_max_pts_correction, CONF_TYPE_FLOAT, CONF_RANGE, 0, 100, NULL}, - - // force video/audio rate: - {"fps", &force_fps, CONF_TYPE_DOUBLE, CONF_MIN, 0, 0, NULL}, - {"srate", &force_srate, CONF_TYPE_INT, CONF_RANGE, 1000, 8*48000, NULL}, - {"channels", &audio_output_channels, CONF_TYPE_INT, CONF_RANGE, 1, 6, NULL}, - {"format", &audio_output_format, CONF_TYPE_AFMT, 0, 0, 0, NULL}, - {"speed", &playback_speed, CONF_TYPE_FLOAT, CONF_RANGE, 0.01, 100.0, NULL}, - - // set a-v distance - {"delay", &audio_delay, CONF_TYPE_FLOAT, CONF_RANGE, -100.0, 100.0, NULL}, - - // ignore header-specified delay (dwStart) - {"ignore-start", &ignore_start, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"noignore-start", &ignore_start, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - -#ifdef CONFIG_LIBA52 - {"a52drc", &a52_drc_level, CONF_TYPE_FLOAT, CONF_RANGE, 0, 1, NULL}, -#endif - -// ------------------------- codec/vfilter options -------------------- - - // MP3-only: select stereo/left/right -#ifdef CONFIG_FAKE_MONO - {"stereo", &fakemono, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL}, -#endif - - // disable audio - {"sound", &audio_id, CONF_TYPE_FLAG, 0, -2, -1, NULL}, - {"nosound", &audio_id, CONF_TYPE_FLAG, 0, -1, -2, NULL}, - - {"af*", &af_cfg.list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, - {"af-adv", audio_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, - - {"vop", "-vop has been removed, use -vf instead.\n", CONF_TYPE_PRINT, CONF_NOCFG ,0,0, NULL}, - {"vf*", &vf_settings, CONF_TYPE_OBJ_SETTINGS_LIST, 0, 0, 0, &vf_obj_list}, - // select audio/video codec (by name) or codec family (by number): -// {"afm", &audio_family, CONF_TYPE_INT, CONF_MIN, 0, 22, NULL}, // keep ranges in sync -// {"vfm", &video_family, CONF_TYPE_INT, CONF_MIN, 0, 29, NULL}, // with codec-cfg.c -// {"afm", &audio_fm, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"afm", &audio_fm_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, - {"vfm", &video_fm_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, -// {"ac", &audio_codec, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"ac", &audio_codec_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, - {"vc", &video_codec_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, - - // postprocessing: -#ifdef CONFIG_LIBAVCODEC - {"pp", &divx_quality, CONF_TYPE_INT, 0, 0, 0, NULL}, -#endif -#ifdef CONFIG_LIBPOSTPROC - {"pphelp", &pp_help, CONF_TYPE_PRINT_INDIRECT, CONF_NOCFG, 0, 0, NULL}, -#endif - - // scaling: - {"sws", &sws_flags, CONF_TYPE_INT, 0, 0, 2, NULL}, - {"ssf", scaler_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, - {"zoom", &softzoom, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nozoom", &softzoom, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"aspect", &movie_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.2, 3.0, NULL}, - {"noaspect", &movie_aspect, CONF_TYPE_FLAG, 0, 0, 0, NULL}, - {"xy", &screen_size_xy, CONF_TYPE_FLOAT, CONF_RANGE, 0.001, 4096, NULL}, - - {"flip", &flip, CONF_TYPE_FLAG, 0, -1, 1, NULL}, - {"noflip", &flip, CONF_TYPE_FLAG, 0, -1, 0, NULL}, - {"tsfastparse", "-tsfastparse is no longer a valid option.\n", CONF_TYPE_PRINT, CONF_NOCFG ,0,0, NULL -}, - {"tsprog", &ts_prog, CONF_TYPE_INT, CONF_RANGE, 0, 65534, NULL}, -#define TS_MAX_PROBE_SIZE 2000000 /* don't forget to change this in libmpdemux/demux_ts.c too */ - {"tsprobe", &ts_probe, CONF_TYPE_POSITION, 0, 0, TS_MAX_PROBE_SIZE, NULL}, - {"psprobe", &ps_probe, CONF_TYPE_POSITION, 0, 0, TS_MAX_PROBE_SIZE, NULL}, - {"tskeepbroken", &ts_keep_broken, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - - // draw by slices or whole frame (useful with libmpeg2/libavcodec) - {"slices", &vd_use_slices, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"noslices", &vd_use_slices, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"field-dominance", &field_dominance, CONF_TYPE_INT, CONF_RANGE, -1, 1, NULL}, - -#ifdef CONFIG_LIBAVCODEC - {"lavdopts", lavc_decode_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, -#endif -#ifdef CONFIG_LIBAVFORMAT - {"lavfdopts", lavfdopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, -#endif -#ifdef CONFIG_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 -------------------- - - {"sub", &sub_name, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, -#ifdef CONFIG_FRIBIDI - {"fribidi-charset", &fribidi_charset, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"flip-hebrew", &flip_hebrew, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"noflip-hebrew", &flip_hebrew, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"flip-hebrew-commas", &fribidi_flip_commas, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"noflip-hebrew-commas", &fribidi_flip_commas, CONF_TYPE_FLAG, 0, 0, 1, NULL}, -#else - {"fribidi-charset", "MPlayer was compiled without FriBiDi support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {"flip-hebrew", "MPlayer was compiled without FriBiDi support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {"noflip-hebrew", "MPlayer was compiled without FriBiDi support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {"flip-hebrew-commas", "MPlayer was compiled without FriBiDi support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {"noflip-hebrew-commas", "MPlayer was compiled without FriBiDi support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, -#endif /* CONFIG_FRIBIDI */ -#ifdef CONFIG_ICONV - {"subcp", &sub_cp, CONF_TYPE_STRING, 0, 0, 0, NULL}, -#endif - {"subdelay", &sub_delay, CONF_TYPE_FLOAT, 0, 0.0, 10.0, NULL}, - {"subfps", &sub_fps, CONF_TYPE_FLOAT, 0, 0.0, 10.0, NULL}, - {"autosub", &sub_auto, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"noautosub", &sub_auto, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"unicode", &sub_unicode, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nounicode", &sub_unicode, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"utf8", &sub_utf8, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"noutf8", &sub_utf8, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"forcedsubsonly", &forced_subs_only, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - // specify IFO file for VOBSUB subtitle - {"ifo", &spudec_ifo, CONF_TYPE_STRING, 0, 0, 0, NULL}, - // enable Closed Captioning display - {"subcc", &subcc_enabled, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nosubcc", &subcc_enabled, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"overlapsub", &suboverlap_enabled, CONF_TYPE_FLAG, 0, 0, 2, NULL}, - {"nooverlapsub", &suboverlap_enabled, CONF_TYPE_FLAG, 0, 0, 0, NULL}, - {"sub-bg-color", &sub_bg_color, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL}, - {"sub-bg-alpha", &sub_bg_alpha, CONF_TYPE_INT, CONF_RANGE, 0, 255, NULL}, - {"sub-no-text-pp", &sub_no_text_pp, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"sub-fuzziness", &sub_match_fuzziness, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL}, - {"font", &font_name, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"subfont", &sub_font_name, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"ffactor", &font_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 10.0, NULL}, - {"subpos", &sub_pos, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL}, - {"subalign", &sub_alignment, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL}, - {"subwidth", &sub_width_p, CONF_TYPE_INT, CONF_RANGE, 10, 100, NULL}, - {"spualign", &spu_alignment, CONF_TYPE_INT, CONF_RANGE, -1, 2, NULL}, - {"spuaa", &spu_aamode, CONF_TYPE_INT, CONF_RANGE, 0, 31, NULL}, - {"spugauss", &spu_gaussvar, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 3.0, NULL}, -#ifdef CONFIG_FREETYPE - {"subfont-encoding", &subtitle_font_encoding, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"subfont-text-scale", &text_font_scale_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0, 100, NULL}, - {"subfont-osd-scale", &osd_font_scale_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0, 100, NULL}, - {"subfont-blur", &subtitle_font_radius, CONF_TYPE_FLOAT, CONF_RANGE, 0, 8, NULL}, - {"subfont-outline", &subtitle_font_thickness, CONF_TYPE_FLOAT, CONF_RANGE, 0, 8, NULL}, - {"subfont-autoscale", &subtitle_autoscale, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL}, -#endif -#ifdef CONFIG_ASS - {"ass", &ass_enabled, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"noass", &ass_enabled, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"ass-font-scale", &ass_font_scale, CONF_TYPE_FLOAT, CONF_RANGE, 0, 100, NULL}, - {"ass-line-spacing", &ass_line_spacing, CONF_TYPE_FLOAT, CONF_RANGE, -1000, 1000, NULL}, - {"ass-top-margin", &ass_top_margin, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL}, - {"ass-bottom-margin", &ass_bottom_margin, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL}, - {"ass-use-margins", &ass_use_margins, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"noass-use-margins", &ass_use_margins, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"embeddedfonts", &extract_embedded_fonts, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"noembeddedfonts", &extract_embedded_fonts, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"ass-force-style", &ass_force_style_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, - {"ass-color", &ass_color, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"ass-border-color", &ass_border_color, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"ass-styles", &ass_styles_file, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"ass-hinting", &ass_hinting, CONF_TYPE_INT, CONF_RANGE, 0, 7, NULL}, -#endif -#ifdef CONFIG_FONTCONFIG - {"fontconfig", &font_fontconfig, CONF_TYPE_FLAG, 0, -1, 1, NULL}, - {"nofontconfig", &font_fontconfig, CONF_TYPE_FLAG, 0, 1, -1, NULL}, -#else - {"fontconfig", "MPlayer was compiled without fontconfig support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {"nofontconfig", "MPlayer was compiled without fontconfig support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, -#endif /* CONFIG_FONTCONFIG */ - -#endif /* MPLAYER_CFG_COMMON_OPTS_H */ diff -Nru mplayer-1.0~rc3+svn20090426/cfg-mencoder.h mplayer-1.0~rc4.dfsg1/cfg-mencoder.h --- mplayer-1.0~rc3+svn20090426/cfg-mencoder.h 2008-12-03 23:43:58.000000000 +0000 +++ mplayer-1.0~rc4.dfsg1/cfg-mencoder.h 2010-06-28 16:31:11.000000000 +0000 @@ -1,3 +1,21 @@ +/* + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #ifndef MPLAYER_CFG_MENCODER_H #define MPLAYER_CFG_MENCODER_H @@ -5,265 +23,245 @@ * config for cfgparser */ +#include "libmpcodecs/ae_faac.h" +#include "libmpcodecs/ae_lame.h" +#include "libmpcodecs/ae_toolame.h" +#include "libmpcodecs/ae_twolame.h" +#include "libmpcodecs/ve.h" +#include "libmpcodecs/ve_x264.h" +#include "libmpdemux/muxer.h" +#include "libmpdemux/muxer_avi.h" #include "cfg-common.h" -extern int sws_flags; -int readPPOpt(void *, char *arg); -void revertPPOpt(void *conf, char* opt); -extern char *pp_help; - -extern m_option_t lameopts_conf[]; -extern m_option_t lavcopts_conf[]; -extern m_option_t toolameopts_conf[]; -extern m_option_t twolameopts_conf[]; -extern m_option_t faacopts_conf[]; -extern m_option_t vfwopts_conf[]; -extern m_option_t xvidencopts_conf[]; - -void x264enc_set_param(const m_option_t* opt, char* arg); - -extern m_option_t nuvopts_conf[]; -extern m_option_t mpegopts_conf[]; -extern m_option_t lavfopts_conf[]; - const m_option_t ovc_conf[]={ - {"copy", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_COPY, NULL}, - {"frameno", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_FRAMENO, NULL}, - {"lavc", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_LIBAVCODEC, NULL}, -// {"null", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_NULL, NULL}, - {"raw", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_RAW, NULL}, - {"vfw", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_VFW, NULL}, - {"libdv", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_LIBDV, NULL}, - {"xvid", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_XVID, NULL}, - {"qtvideo", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_QTVIDEO, NULL}, - {"nuv", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_NUV, NULL}, - {"x264", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_X264, NULL}, - {"help", "\nAvailable codecs:\n" - " copy - frame copy, without re-encoding. Doesn't work with filters.\n" - " frameno - special audio-only file for 3-pass encoding, see DOCS.\n" - " raw - uncompressed video. Use fourcc option to set format explicitly.\n" + {"copy", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_COPY, NULL}, + {"frameno", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_FRAMENO, NULL}, + {"lavc", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_LIBAVCODEC, NULL}, + {"raw", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_RAW, NULL}, + {"vfw", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_VFW, NULL}, + {"libdv", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_LIBDV, NULL}, + {"xvid", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_XVID, NULL}, + {"qtvideo", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_QTVIDEO, NULL}, + {"nuv", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_NUV, NULL}, + {"x264", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_X264, NULL}, + {"help", "\nAvailable codecs:\n" + " copy - frame copy, without re-encoding. Doesn't work with filters.\n" + " frameno - special audio-only file for 3-pass encoding, see DOCS.\n" + " raw - uncompressed video. Use fourcc option to set format explicitly.\n" #ifdef CONFIG_LIBLZO - " nuv - nuppel video\n" + " nuv - nuppel video\n" #endif #ifdef CONFIG_LIBAVCODEC - " lavc - libavcodec codecs - best quality!\n" + " lavc - libavcodec codecs - best quality!\n" #endif #ifdef CONFIG_WIN32DLL - " vfw - VfW DLLs, read DOCS/HTML/en/encoding-guide.html.\n" - " qtvideo - QuickTime DLLs, currently only SVQ1/3 are supported.\n" + " vfw - VfW DLLs, read DOCS/HTML/en/encoding-guide.html.\n" + " qtvideo - QuickTime DLLs, currently only SVQ1/3 are supported.\n" #endif #ifdef CONFIG_LIBDV095 - " libdv - DV encoding with libdv v0.9.5\n" + " libdv - DV encoding with libdv v0.9.5\n" #endif #ifdef CONFIG_XVID4 - " xvid - XviD encoding\n" + " xvid - XviD encoding\n" #endif #ifdef CONFIG_X264 - " x264 - H.264 encoding\n" + " x264 - H.264 encoding\n" #endif - "\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {NULL, NULL, 0, 0, 0, 0, NULL} + "\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {NULL, NULL, 0, 0, 0, 0, NULL} }; const m_option_t oac_conf[]={ - {"copy", &out_audio_codec, CONF_TYPE_FLAG, 0, 0, ACODEC_COPY, NULL}, - {"pcm", &out_audio_codec, CONF_TYPE_FLAG, 0, 0, ACODEC_PCM, NULL}, + {"copy", &out_audio_codec, CONF_TYPE_FLAG, 0, 0, ACODEC_COPY, NULL}, + {"pcm", &out_audio_codec, CONF_TYPE_FLAG, 0, 0, ACODEC_PCM, NULL}, #ifdef CONFIG_MP3LAME - {"mp3lame", &out_audio_codec, CONF_TYPE_FLAG, 0, 0, ACODEC_VBRMP3, NULL}, + {"mp3lame", &out_audio_codec, CONF_TYPE_FLAG, 0, 0, ACODEC_VBRMP3, NULL}, #else - {"mp3lame", "MPlayer was compiled without libmp3lame support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"mp3lame", "MPlayer was compiled without libmp3lame support.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, #endif /* CONFIG_MP3LAME */ #ifdef CONFIG_LIBAVCODEC - {"lavc", &out_audio_codec, CONF_TYPE_FLAG, 0, 0, ACODEC_LAVC, NULL}, + {"lavc", &out_audio_codec, CONF_TYPE_FLAG, 0, 0, ACODEC_LAVC, NULL}, #else - {"lavc", "MPlayer was compiled without libavcodec. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"lavc", "MPlayer was compiled without libavcodec. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, #endif /* CONFIG_LIBAVCODEC */ #ifdef CONFIG_TOOLAME - {"toolame", &out_audio_codec, CONF_TYPE_FLAG, 0, 0, ACODEC_TOOLAME, NULL}, + {"toolame", &out_audio_codec, CONF_TYPE_FLAG, 0, 0, ACODEC_TOOLAME, NULL}, #else - {"toolame", "MPlayer was compiled without libtoolame. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"toolame", "MPlayer was compiled without libtoolame. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, #endif /* CONFIG_TOOLAME */ #ifdef CONFIG_TWOLAME - {"twolame", &out_audio_codec, CONF_TYPE_FLAG, 0, 0, ACODEC_TWOLAME, NULL}, + {"twolame", &out_audio_codec, CONF_TYPE_FLAG, 0, 0, ACODEC_TWOLAME, NULL}, #else - {"twolame", "MPlayer was compiled without libtwolame. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"twolame", "MPlayer was compiled without libtwolame. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, #endif /* CONFIG_TWOLAME */ #ifdef CONFIG_FAAC - {"faac", &out_audio_codec, CONF_TYPE_FLAG, 0, 0, ACODEC_FAAC, NULL}, + {"faac", &out_audio_codec, CONF_TYPE_FLAG, 0, 0, ACODEC_FAAC, NULL}, #else - {"faac", "MPlayer was compiled without libfaac. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"faac", "MPlayer was compiled without libfaac. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, #endif /* CONFIG_FAAC */ - {"help", "\nAvailable codecs:\n" - " copy - frame copy, without re-encoding (useful for AC3)\n" - " pcm - uncompressed PCM audio\n" + {"help", "\nAvailable codecs:\n" + " copy - frame copy, without re-encoding (useful for AC3)\n" + " pcm - uncompressed PCM audio\n" #ifdef CONFIG_MP3LAME - " mp3lame - cbr/abr/vbr MP3 using libmp3lame\n" + " mp3lame - cbr/abr/vbr MP3 using libmp3lame\n" #endif #ifdef CONFIG_LIBAVCODEC - " lavc - FFmpeg audio encoder (MP2, AC3, ...)\n" + " lavc - FFmpeg audio encoder (MP2, AC3, ...)\n" #endif #ifdef CONFIG_TOOLAME - " toolame - Toolame MP2 audio encoder\n" + " toolame - Toolame MP2 audio encoder\n" #endif #ifdef CONFIG_TWOLAME - " twolame - Twolame MP2 audio encoder\n" + " twolame - Twolame MP2 audio encoder\n" #endif #ifdef CONFIG_FAAC - " faac - FAAC AAC audio encoder\n" + " faac - FAAC AAC audio encoder\n" #endif - "\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {NULL, NULL, 0, 0, 0, 0, NULL} + "\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {NULL, NULL, 0, 0, 0, 0, NULL} }; const m_option_t info_conf[]={ - {"name", &info_name, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"artist", &info_artist, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"genre", &info_genre, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"subject", &info_subject, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"copyright", &info_copyright, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"srcform", &info_sourceform, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"comment", &info_comment, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"help", "\nAvailable INFO fields:\n" - " name - title of the work\n" - " artist - artist or author of the work\n" - " genre - original work category\n" - " subject - contents of the work\n" - " copyright - copyright information\n" - " srcform - original format of the digitzed material\n" - " comment - general comments about the work\n" - "\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {NULL, NULL, 0, 0, 0, 0, NULL} + {"name", &info_name, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"artist", &info_artist, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"genre", &info_genre, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"subject", &info_subject, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"copyright", &info_copyright, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"srcform", &info_sourceform, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"comment", &info_comment, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"help", "\nAvailable INFO fields:\n" + " name - title of the work\n" + " artist - artist or author of the work\n" + " genre - original work category\n" + " subject - contents of the work\n" + " copyright - copyright information\n" + " srcform - original format of the digitzed material\n" + " comment - general comments about the work\n" + "\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {NULL, NULL, 0, 0, 0, 0, NULL} }; const m_option_t of_conf[]={ - {"avi", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_AVI, NULL}, - {"mpeg", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_MPEG, NULL}, + {"avi", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_AVI, NULL}, + {"mpeg", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_MPEG, NULL}, #ifdef CONFIG_LIBAVFORMAT - {"lavf", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_LAVF, NULL}, + {"lavf", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_LAVF, NULL}, #endif - {"rawvideo", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_RAWVIDEO, NULL}, - {"rawaudio", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_RAWAUDIO, NULL}, - {"help", "\nAvailable output formats:\n" - " avi - Microsoft Audio/Video Interleaved\n" - " mpeg - MPEG-1/2 system stream format\n" + {"rawvideo", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_RAWVIDEO, NULL}, + {"rawaudio", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_RAWAUDIO, NULL}, + {"help", "\nAvailable output formats:\n" + " avi - Microsoft Audio/Video Interleaved\n" + " mpeg - MPEG-1/2 system stream format\n" #ifdef CONFIG_LIBAVFORMAT - " lavf - FFmpeg libavformat muxers\n" + " lavf - FFmpeg libavformat muxers\n" #endif - " rawvideo - (video only, one stream only) raw stream, no muxing\n" - " rawaudio - (audio only, one stream only) raw stream, no muxing\n" - "\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {NULL, NULL, 0, 0, 0, 0, NULL} + " rawvideo - (video only, one stream only) raw stream, no muxing\n" + " rawaudio - (audio only, one stream only) raw stream, no muxing\n" + "\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {NULL, NULL, 0, 0, 0, 0, NULL} }; -extern float avi_aspect_override; /* defined in libmpdemux/muxer_avi.c */ -extern int write_odml; /* defined in libmpdemux/muxer_avi.c */ - const m_option_t mencoder_opts[]={ - /* name, pointer, type, flags, min, max */ + /* name, pointer, type, flags, min, max */ + + {"frameno-file", &frameno_filename, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, + + {"hr-edl-seek", &edl_seek_type, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nohr-edl-seek", &edl_seek_type, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + + // set output framerate - recommended for variable-FPS (ASF etc) files + // and for 29.97FPS progressive MPEG2 streams + {"ofps", &force_ofps, CONF_TYPE_DOUBLE, CONF_MIN|CONF_GLOBAL, 0, 0, NULL}, + {"o", &out_filename, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, + + // limit number of skippable frames after a non-skipped one + {"skiplimit", &skip_limit, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"noskiplimit", &skip_limit, CONF_TYPE_FLAG, 0, 0, -1, NULL}, + {"noskip", &skip_limit, CONF_TYPE_FLAG, 0, 0, 0, NULL}, + + {"audio-density", &audio_density, CONF_TYPE_INT, CONF_RANGE|CONF_GLOBAL, 1, 50, NULL}, + {"audio-preload", &audio_preload, CONF_TYPE_FLOAT, CONF_RANGE|CONF_GLOBAL, 0, 2, NULL}, + {"audio-delay", &audio_delay_fix, CONF_TYPE_FLOAT, CONF_GLOBAL, 0, 0, NULL}, - {"frameno-file", &frameno_filename, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, + {"x", "-x has been removed, use -vf scale=w:h for scaling.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"xsize", "-xsize has been removed, use -vf crop=w:h:x:y for cropping.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {"hr-edl-seek", &edl_seek_type, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nohr-edl-seek", &edl_seek_type, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + // output audio/video codec selection + {"oac", oac_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, + {"ovc", ovc_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, - // set output framerate - recommended for variable-FPS (ASF etc) files - // and for 29.97FPS progressive MPEG2 streams - {"ofps", &force_ofps, CONF_TYPE_DOUBLE, CONF_MIN|CONF_GLOBAL, 0, 0, NULL}, - {"o", &out_filename, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, - - // limit number of skippable frames after a non-skipped one - {"skiplimit", &skip_limit, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"noskiplimit", &skip_limit, CONF_TYPE_FLAG, 0, 0, -1, NULL}, - {"noskip", &skip_limit, CONF_TYPE_FLAG, 0, 0, 0, NULL}, - - {"audio-density", &audio_density, CONF_TYPE_INT, CONF_RANGE|CONF_GLOBAL, 1, 50, NULL}, - {"audio-preload", &audio_preload, CONF_TYPE_FLOAT, CONF_RANGE|CONF_GLOBAL, 0, 2, NULL}, - {"audio-delay", &audio_delay_fix, CONF_TYPE_FLOAT, CONF_GLOBAL, 0, 0, NULL}, - - {"x", "-x has been removed, use -vf scale=w:h for scaling.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {"xsize", "-xsize has been removed, use -vf crop=w:h:x:y for cropping.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - - // output audio/video codec selection - {"oac", oac_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, - {"ovc", ovc_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, - - // output file format - {"of", of_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, - - // override audio format tag in output file - {"fafmttag", &force_audiofmttag, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL}, - // override FOURCC in output file - {"ffourcc", &force_fourcc, CONF_TYPE_STRING, CONF_GLOBAL, 4, 4, NULL}, - - // override avi aspect autodetection - {"force-avi-aspect", &avi_aspect_override, CONF_TYPE_FLOAT, CONF_RANGE|CONF_GLOBAL, 0.2, 3.0, NULL}, - - {"pass", "-pass has been removed, use -lavcopts vpass=n, -xvidencopts pass=n\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {"passlogfile", &passtmpfile, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, - - {"vobsubout", &vobsub_out, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, - {"vobsuboutindex", &vobsub_out_index, CONF_TYPE_INT, CONF_RANGE|CONF_GLOBAL, 0, 31, NULL}, - {"vobsuboutid", &vobsub_out_id, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, - - {"autoexpand", &auto_expand, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"noautoexpand", &auto_expand, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - - {"encodedups", &encode_duplicates, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"noencodedups", &encode_duplicates, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - - {"odml", &write_odml, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, - {"noodml", &write_odml, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, - - // info header strings - {"info", info_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, + // output file format + {"of", of_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, + + // override audio format tag in output file + {"fafmttag", &force_audiofmttag, CONF_TYPE_INT, CONF_GLOBAL, 0, 0, NULL}, + // override FOURCC in output file + {"ffourcc", &force_fourcc, CONF_TYPE_STRING, CONF_GLOBAL, 4, 4, NULL}, + + // override avi aspect autodetection + {"force-avi-aspect", &avi_aspect_override, CONF_TYPE_FLOAT, CONF_RANGE|CONF_GLOBAL, 0.2, 3.0, NULL}, + + {"pass", "-pass has been removed, use -lavcopts vpass=n, -xvidencopts pass=n\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"passlogfile", &passtmpfile, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, + + {"vobsubout", &vobsub_out, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, + {"vobsuboutindex", &vobsub_out_index, CONF_TYPE_INT, CONF_RANGE|CONF_GLOBAL, 0, 31, NULL}, + {"vobsuboutid", &vobsub_out_id, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, + + {"autoexpand", &auto_expand, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"noautoexpand", &auto_expand, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + + {"encodedups", &encode_duplicates, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"noencodedups", &encode_duplicates, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + + {"odml", &write_odml, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, + {"noodml", &write_odml, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, + + // info header strings + {"info", info_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, #ifdef CONFIG_MP3LAME - {"lameopts", lameopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, + {"lameopts", lameopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, #endif #ifdef CONFIG_LIBAVCODEC - {"lavcopts", lavcopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, + {"lavcopts", lavcopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, #else - {"lavcopts", "MPlayer was compiled without libavcodec. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"lavcopts", "MPlayer was compiled without libavcodec. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, #endif /* CONFIG_LIBAVCODEC */ #ifdef CONFIG_TOOLAME - {"toolameopts", toolameopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, + {"toolameopts", toolameopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, #else - {"toolameopts", "MPlayer was compiled without libtoolame. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"toolameopts", "MPlayer was compiled without libtoolame. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, #endif /* CONFIG_TOOLAME */ #ifdef CONFIG_TWOLAME - {"twolameopts", twolameopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, + {"twolameopts", twolameopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, #else - {"twolameopts", "MPlayer was compiled without libtwolame. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"twolameopts", "MPlayer was compiled without libtwolame. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, #endif /* CONFIG_TWOLAME */ #ifdef CONFIG_FAAC - {"faacopts", faacopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, + {"faacopts", faacopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, #else - {"faacopts", "MPlayer was compiled without libfaac. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"faacopts", "MPlayer was compiled without libfaac. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, #endif /* CONFIG_FAAC */ #ifdef CONFIG_WIN32DLL - {"xvfwopts", vfwopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, + {"xvfwopts", vfwopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, #endif #ifdef CONFIG_XVID4 - {"xvidencopts", xvidencopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, + {"xvidencopts", xvidencopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, #endif #if defined(CONFIG_X264) - {"x264encopts", &x264enc_set_param, CONF_TYPE_FUNC_PARAM, CONF_GLOBAL, 0, 0, NULL}, + {"x264encopts", &x264enc_set_param, CONF_TYPE_FUNC_PARAM, CONF_GLOBAL, 0, 0, NULL}, #endif #ifdef CONFIG_LIBLZO - {"nuvopts", nuvopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, + {"nuvopts", nuvopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, #endif - {"mpegopts", mpegopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, + {"mpegopts", mpegopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, #ifdef CONFIG_LIBAVFORMAT - {"lavfopts", lavfopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, -#endif - -#include "cfg-common-opts.h" + {"lavfopts", lavfopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, +#endif -// {"-help", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, -// {"help", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, -// {"h", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {NULL, NULL, 0, 0, 0, 0, NULL} + {NULL, NULL, 0, 0, 0, 0, NULL} }; #endif /* MPLAYER_CFG_MENCODER_H */ diff -Nru mplayer-1.0~rc3+svn20090426/cfg-mplayer-def.h mplayer-1.0~rc4.dfsg1/cfg-mplayer-def.h --- mplayer-1.0~rc3+svn20090426/cfg-mplayer-def.h 2001-03-19 03:45:49.000000000 +0000 +++ mplayer-1.0~rc4.dfsg1/cfg-mplayer-def.h 2010-02-20 19:59:50.000000000 +0000 @@ -1,6 +1,28 @@ +/* + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef MPLAYER_CFG_MPLAYER_DEF_H +#define MPLAYER_CFG_MPLAYER_DEF_H + static char* default_config= "# Write your default config options here!\n" "\n" //"nosound=nem" "\n"; +#endif /* MPLAYER_CFG_MPLAYER_DEF_H */ diff -Nru mplayer-1.0~rc3+svn20090426/cfg-mplayer.h mplayer-1.0~rc4.dfsg1/cfg-mplayer.h --- mplayer-1.0~rc3+svn20090426/cfg-mplayer.h 2009-03-02 11:24:20.000000000 +0000 +++ mplayer-1.0~rc4.dfsg1/cfg-mplayer.h 2010-07-08 15:52:47.000000000 +0000 @@ -1,3 +1,21 @@ +/* + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #ifndef MPLAYER_CFG_MPLAYER_H #define MPLAYER_CFG_MPLAYER_H @@ -6,75 +24,36 @@ */ #include "cfg-common.h" +#include "gui/interface.h" +#include "input/lirc.h" +#include "libmpcodecs/vd.h" +#include "libmenu/menu.h" +#include "libvo/aspect.h" +#include "libvo/geometry.h" +#include "libvo/vo_dxr2.h" +#include "libvo/vo_fbdev.h" +#include "libvo/vo_zr.h" +#include "mp_fifo.h" +#include "unrar_exec.h" -extern int key_fifo_size; -extern unsigned doubleclick_time; - -extern char *fb_mode_cfgfile; -extern char *fb_mode_name; -extern char *dfb_params; - -extern char *lirc_configfile; - -extern float vo_panscanrange; -/* only used at startup (setting these values from configfile) */ -extern char *vo_geometry; - -extern int opt_screen_size_x; -extern int opt_screen_size_y; -extern int fullscreen; -extern int vidmode; - -extern char *ao_outputfilename; -extern int ao_pcm_waveheader; - -extern int fs_layer; -extern int stop_xscreensaver; - -extern int menu_startup; -extern int menu_keepdir; -extern char *menu_chroot; -extern char *menu_fribidi_charset; -extern int menu_flip_hebrew; -extern int menu_fribidi_flip_commas; - -extern char *unrar_executable; - -int vo_zr_parseoption(const m_option_t* conf, char *opt, char * param); -void vo_zr_revertoption(const m_option_t* opt,char* pram); - -extern m_option_t dxr2_opts[]; - -extern char * skinName; -extern int guiWinID; - - -/* from libvo/aspect.c */ -extern float force_monitor_aspect; -extern float monitor_pixel_aspect; - -extern int sws_flags; -int readPPOpt(void *conf, char *arg); -void revertPPOpt(void *conf, char* opt); -extern char* pp_help; const m_option_t vd_conf[]={ - {"help", "Use MPlayer with an appropriate video file instead of live partners to avoid vd.\n", CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, - {NULL, NULL, 0, 0, 0, 0, NULL} + {"help", "Use MPlayer with an appropriate video file instead of live partners to avoid vd.\n", CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, + {NULL, NULL, 0, 0, 0, 0, NULL} }; #ifdef CONFIG_TV const m_option_t tvscan_conf[]={ - {"autostart", &stream_tv_defaults.scan, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"threshold", &stream_tv_defaults.scan_threshold, CONF_TYPE_INT, CONF_RANGE, 1, 100, NULL}, - {"period", &stream_tv_defaults.scan_period, CONF_TYPE_FLOAT, CONF_RANGE, 0.1, 2.0, NULL}, - {NULL, NULL, 0, 0, 0, 0, NULL} + {"autostart", &stream_tv_defaults.scan, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"threshold", &stream_tv_defaults.scan_threshold, CONF_TYPE_INT, CONF_RANGE, 1, 100, NULL}, + {"period", &stream_tv_defaults.scan_period, CONF_TYPE_FLOAT, CONF_RANGE, 0.1, 2.0, NULL}, + {NULL, NULL, 0, 0, 0, 0, NULL} }; #endif /* * CONF_TYPE_FUNC_FULL : * allows own implementations for passing the params - * + * * the function receives parameter name and argument (if it does not start with - ) * useful with a conf.name like 'aa*' to parse several parameters to a function * return 0 =ok, but we didn't need the param (could be the filename) @@ -85,287 +64,288 @@ */ const m_option_t mplayer_opts[]={ - /* name, pointer, type, flags, min, max */ + /* name, pointer, type, flags, min, max */ //---------------------- libao/libvo options ------------------------ - {"o", "Option -o has been renamed to -vo (video-out), use -vo.\n", - CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {"vo", &video_driver_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, - {"ao", &audio_driver_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, - {"fixed-vo", &fixed_vo, CONF_TYPE_FLAG,CONF_GLOBAL , 0, 1, NULL}, - {"nofixed-vo", &fixed_vo, CONF_TYPE_FLAG,CONF_GLOBAL, 1, 0, NULL}, - {"ontop", &vo_ontop, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"noontop", &vo_ontop, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"rootwin", &vo_rootwin, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"border", &vo_border, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"noborder", &vo_border, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - - {"aop", "-aop has been removed, use -af instead.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {"dsp", "-dsp has been removed. Use -ao oss:dsp_path instead.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, - {"mixer", &mixer_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"mixer-channel", &mixer_channel, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"softvol", &soft_vol, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nosoftvol", &soft_vol, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"softvol-max", &soft_vol_max, CONF_TYPE_FLOAT, CONF_RANGE, 10, 10000, NULL}, - {"volstep", &volstep, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL}, - {"volume", &start_volume, CONF_TYPE_FLOAT, CONF_RANGE, -1, 10000, NULL}, - {"master", "Option -master has been removed, use -af volume instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, - // override audio buffer size (used only by -ao oss, anyway obsolete...) - {"abs", &ao_data.buffersize, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL}, - - // -ao pcm options: - {"aofile", "-aofile has been removed. Use -ao pcm:file= instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, - {"waveheader", "-waveheader has been removed. Use -ao pcm:waveheader instead.\n", CONF_TYPE_PRINT, 0, 0, 1, NULL}, - {"nowaveheader", "-nowaveheader has been removed. Use -ao pcm:nowaveheader instead.\n", CONF_TYPE_PRINT, 0, 1, 0, NULL}, - - {"alsa", "-alsa has been removed. Remove it from your config file.\n", - CONF_TYPE_PRINT, 0, 0, 0, NULL}, - {"noalsa", "-noalsa has been removed. Remove it from your config file.\n", - CONF_TYPE_PRINT, 0, 0, 0, NULL}, - {"edlout", &edl_output_filename, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"o", "Option -o has been renamed to -vo (video-out), use -vo.\n", + CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"vo", &video_driver_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, + {"ao", &audio_driver_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, + {"fixed-vo", &fixed_vo, CONF_TYPE_FLAG,CONF_GLOBAL , 0, 1, NULL}, + {"nofixed-vo", &fixed_vo, CONF_TYPE_FLAG,CONF_GLOBAL, 1, 0, NULL}, + {"ontop", &vo_ontop, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"noontop", &vo_ontop, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"rootwin", &vo_rootwin, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"border", &vo_border, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"noborder", &vo_border, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + + {"aop", "-aop has been removed, use -af instead.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"dsp", "-dsp has been removed. Use -ao oss:dsp_path instead.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, + {"mixer", &mixer_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"mixer-channel", &mixer_channel, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"softvol", &soft_vol, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nosoftvol", &soft_vol, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"softvol-max", &soft_vol_max, CONF_TYPE_FLOAT, CONF_RANGE, 10, 10000, NULL}, + {"volstep", &volstep, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL}, + {"volume", &start_volume, CONF_TYPE_FLOAT, CONF_RANGE, -1, 10000, NULL}, + {"master", "Option -master has been removed, use -af volume instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + // override audio buffer size (used only by -ao oss, anyway obsolete...) + {"abs", &ao_data.buffersize, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL}, + + // -ao pcm options: + {"aofile", "-aofile has been removed. Use -ao pcm:file= instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"waveheader", "-waveheader has been removed. Use -ao pcm:waveheader instead.\n", CONF_TYPE_PRINT, 0, 0, 1, NULL}, + {"nowaveheader", "-nowaveheader has been removed. Use -ao pcm:nowaveheader instead.\n", CONF_TYPE_PRINT, 0, 1, 0, NULL}, + + {"alsa", "-alsa has been removed. Remove it from your config file.\n", + CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"noalsa", "-noalsa has been removed. Remove it from your config file.\n", + CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"edlout", &edl_output_filename, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"edl-backward-delay", &edl_backward_delay, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL}, #ifdef CONFIG_X11 - {"display", &mDisplayName, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"display", &mDisplayName, CONF_TYPE_STRING, 0, 0, 0, NULL}, #endif - // -vo png only: + // -vo png only: #ifdef CONFIG_PNG - {"z", "-z has been removed. Use -vo png:z=<0-9> instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"z", "-z has been removed. Use -vo png:z=<0-9> instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, #endif - // -vo jpeg only: + // -vo jpeg only: #ifdef CONFIG_JPEG - {"jpeg", "-jpeg has been removed. Use -vo jpeg: instead.\n", - CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"jpeg", "-jpeg has been removed. Use -vo jpeg: instead.\n", + CONF_TYPE_PRINT, 0, 0, 0, NULL}, #endif - // -vo sdl only: - {"sdl", "Use -vo sdl:driver= instead of -vo sdl -sdl driver.\n", - CONF_TYPE_PRINT, 0, 0, 0, NULL}, - {"noxv", "-noxv has been removed. Use -vo sdl:nohwaccel instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, - {"forcexv", "-forcexv has been removed. Use -vo sdl:forcexv instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, - // -ao sdl only: - {"sdla", "Use -ao sdl:driver instead of -ao sdl -sdla driver.\n", - CONF_TYPE_PRINT, 0, 0, 0, NULL}, + // -vo sdl only: + {"sdl", "Use -vo sdl:driver= instead of -vo sdl -sdl driver.\n", + CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"noxv", "-noxv has been removed. Use -vo sdl:nohwaccel instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"forcexv", "-forcexv has been removed. Use -vo sdl:forcexv instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + // -ao sdl only: + {"sdla", "Use -ao sdl:driver instead of -ao sdl -sdla driver.\n", + CONF_TYPE_PRINT, 0, 0, 0, NULL}, #if defined(CONFIG_FBDEV) || defined(CONFIG_VESA) - {"monitor-hfreq", &monitor_hfreq_str, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"monitor-vfreq", &monitor_vfreq_str, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"monitor-dotclock", &monitor_dotclock_str, CONF_TYPE_STRING, 0, 0, 0, NULL}, -#endif + {"monitor-hfreq", &monitor_hfreq_str, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"monitor-vfreq", &monitor_vfreq_str, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"monitor-dotclock", &monitor_dotclock_str, CONF_TYPE_STRING, 0, 0, 0, NULL}, +#endif #ifdef CONFIG_FBDEV - {"fbmode", &fb_mode_name, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"fbmodeconfig", &fb_mode_cfgfile, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"fbmode", &fb_mode_name, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"fbmodeconfig", &fb_mode_cfgfile, CONF_TYPE_STRING, 0, 0, 0, NULL}, #endif #ifdef CONFIG_DIRECTFB #if DIRECTFBVERSION > 912 - {"dfbopts", "-dfbopts has been removed. Use -vf directfb:dfbopts=... instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"dfbopts", "-dfbopts has been removed. Use -vf directfb:dfbopts=... instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, #endif #endif - // force window width/height or resolution (with -vm) - {"x", &opt_screen_size_x, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL}, - {"y", &opt_screen_size_y, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL}, - // set screen dimensions (when not detectable or virtual!=visible) - {"screenw", &vo_screenwidth, CONF_TYPE_INT, CONF_RANGE|CONF_OLD, 0, 4096, NULL}, - {"screenh", &vo_screenheight, CONF_TYPE_INT, CONF_RANGE|CONF_OLD, 0, 4096, NULL}, - // Geometry string - {"geometry", &vo_geometry, CONF_TYPE_STRING, 0, 0, 0, NULL}, - // set aspect ratio of monitor - useful for 16:9 TV-out - {"monitoraspect", &force_monitor_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 9.0, NULL}, - {"monitorpixelaspect", &monitor_pixel_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.2, 9.0, NULL}, - // video mode switching: (x11,xv,dga) - {"vm", &vidmode, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"novm", &vidmode, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - // start in fullscreen mode: - {"fs", &fullscreen, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nofs", &fullscreen, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - // set fullscreen switch method (workaround for buggy WMs) - {"fsmode", "-fsmode is obsolete, avoid it and use -fstype instead.\nIf you really want it, try -fsmode-dontuse, but don't report bugs!\n", CONF_TYPE_PRINT, CONF_RANGE, 0, 31, NULL}, - {"fsmode-dontuse", &vo_fsmode, CONF_TYPE_INT, CONF_RANGE, 0, 31, NULL}, - // set bpp (x11+vm, dga, fbdev, vesa, svga?) - {"bpp", &vo_dbpp, CONF_TYPE_INT, CONF_RANGE, 0, 32, NULL}, - {"colorkey", &vo_colorkey, CONF_TYPE_INT, 0, 0, 0, NULL}, - {"nocolorkey", &vo_colorkey, CONF_TYPE_FLAG, 0, 0, 0x1000000, NULL}, - {"double", &vo_doublebuffering, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nodouble", &vo_doublebuffering, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - // wait for v-sync (vesa) - {"vsync", &vo_vsync, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"novsync", &vo_vsync, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"panscan", &vo_panscan, CONF_TYPE_FLOAT, CONF_RANGE, -1.0, 1.0, NULL}, - {"panscanrange", &vo_panscanrange, CONF_TYPE_FLOAT, CONF_RANGE, -19.0, 99.0, NULL}, - - {"grabpointer", &vo_grabpointer, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nograbpointer", &vo_grabpointer, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - + // force window width/height or resolution (with -vm) + {"x", &opt_screen_size_x, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL}, + {"y", &opt_screen_size_y, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL}, + // set screen dimensions (when not detectable or virtual!=visible) + {"screenw", &vo_screenwidth, CONF_TYPE_INT, CONF_RANGE|CONF_OLD, 0, 4096, NULL}, + {"screenh", &vo_screenheight, CONF_TYPE_INT, CONF_RANGE|CONF_OLD, 0, 4096, NULL}, + // Geometry string + {"geometry", &vo_geometry, CONF_TYPE_STRING, 0, 0, 0, NULL}, + // vo name (X classname) and window title strings + {"name", &vo_winname, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"title", &vo_wintitle, CONF_TYPE_STRING, 0, 0, 0, NULL}, + // set aspect ratio of monitor - useful for 16:9 TV-out + {"monitoraspect", &force_monitor_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 9.0, NULL}, + {"monitorpixelaspect", &monitor_pixel_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.2, 9.0, NULL}, + // video mode switching: (x11,xv,dga) + {"vm", &vidmode, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"novm", &vidmode, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + // start in fullscreen mode: + {"fs", &fullscreen, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nofs", &fullscreen, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + // set fullscreen switch method (workaround for buggy WMs) + {"fsmode", "-fsmode is obsolete, avoid it and use -fstype instead.\nIf you really want it, try -fsmode-dontuse, but don't report bugs!\n", CONF_TYPE_PRINT, CONF_RANGE, 0, 31, NULL}, + {"fsmode-dontuse", &vo_fsmode, CONF_TYPE_INT, CONF_RANGE, 0, 31, NULL}, + // set bpp (x11+vm, dga, fbdev, vesa, svga?) + {"bpp", &vo_dbpp, CONF_TYPE_INT, CONF_RANGE, 0, 32, NULL}, + {"colorkey", &vo_colorkey, CONF_TYPE_INT, 0, 0, 0, NULL}, + {"nocolorkey", &vo_colorkey, CONF_TYPE_FLAG, 0, 0, 0x1000000, NULL}, + {"double", &vo_doublebuffering, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nodouble", &vo_doublebuffering, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + // wait for v-sync (vesa) + {"vsync", &vo_vsync, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"novsync", &vo_vsync, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"panscan", &vo_panscan, CONF_TYPE_FLOAT, CONF_RANGE, -1.0, 1.0, NULL}, + {"panscanrange", &vo_panscanrange, CONF_TYPE_FLOAT, CONF_RANGE, -19.0, 99.0, NULL}, + + {"grabpointer", &vo_grabpointer, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nograbpointer", &vo_grabpointer, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"adapter", &vo_adapter_num, CONF_TYPE_INT, CONF_RANGE, 0, 5, NULL}, {"refreshrate",&vo_refresh_rate,CONF_TYPE_INT,CONF_RANGE, 0,100, NULL}, - {"wid", &WinID, CONF_TYPE_INT64, 0, 0, 0, NULL}, + {"wid", &WinID, CONF_TYPE_INT64, 0, 0, 0, NULL}, #ifdef CONFIG_X11 - // x11,xv,xmga,xvidix - {"icelayer", "-icelayer has been removed. Use -fstype layer: instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, - {"stop-xscreensaver", &stop_xscreensaver, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nostop-xscreensaver", &stop_xscreensaver, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"stop_xscreensaver", "Use -stop-xscreensaver instead, options with _ have been obsoleted.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, - {"fstype", &vo_fstype_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, -#endif - {"heartbeat-cmd", &heartbeat_cmd, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"mouseinput", &vo_nomouse_input, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"nomouseinput", &vo_nomouse_input, CONF_TYPE_FLAG,0, 0, 1, NULL}, - - {"xineramascreen", &xinerama_screen, CONF_TYPE_INT, CONF_RANGE, -2, 32, NULL}, - - {"brightness",&vo_gamma_brightness, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, - {"saturation",&vo_gamma_saturation, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, - {"contrast",&vo_gamma_contrast, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, - {"hue",&vo_gamma_hue, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, - {"keepaspect", &vo_keepaspect, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nokeepaspect", &vo_keepaspect, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - - // direct rendering (decoding to video out buffer) - {"dr", &vo_directrendering, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nodr", &vo_directrendering, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"vaa_dr", "-vaa_dr has been removed, use -dr.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, - {"vaa_nodr", "-vaa_nodr has been removed, use -nodr.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + // x11,xv,xmga,xvidix + {"icelayer", "-icelayer has been removed. Use -fstype layer: instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"stop-xscreensaver", &stop_xscreensaver, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nostop-xscreensaver", &stop_xscreensaver, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"stop_xscreensaver", "Use -stop-xscreensaver instead, options with _ have been obsoleted.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"fstype", &vo_fstype_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, +#endif + {"heartbeat-cmd", &heartbeat_cmd, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"mouseinput", &vo_nomouse_input, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"nomouseinput", &vo_nomouse_input, CONF_TYPE_FLAG,0, 0, 1, NULL}, + + {"xineramascreen", &xinerama_screen, CONF_TYPE_INT, CONF_RANGE, -2, 32, NULL}, + + {"brightness",&vo_gamma_brightness, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, + {"saturation",&vo_gamma_saturation, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, + {"contrast",&vo_gamma_contrast, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, + {"hue",&vo_gamma_hue, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, + {"keepaspect", &vo_keepaspect, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nokeepaspect", &vo_keepaspect, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + + // direct rendering (decoding to video out buffer) + {"dr", &vo_directrendering, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nodr", &vo_directrendering, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"vaa_dr", "-vaa_dr has been removed, use -dr.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"vaa_nodr", "-vaa_nodr has been removed, use -nodr.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, #ifdef CONFIG_AA - // -vo aa - {"aa*", "-aa* has been removed. Use -vo aa:suboption instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + // -vo aa + {"aa*", "-aa* has been removed. Use -vo aa:suboption instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, #endif #ifdef CONFIG_ZR - // -vo zr - {"zr*", vo_zr_parseoption, CONF_TYPE_FUNC_FULL, 0, 0, 0, &vo_zr_revertoption }, + // -vo zr + {"zr*", vo_zr_parseoption, CONF_TYPE_FUNC_FULL, 0, 0, 0, &vo_zr_revertoption }, #endif #ifdef CONFIG_DXR2 - {"dxr2", &dxr2_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, + {"dxr2", &dxr2_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, #endif //---------------------- mplayer-only options ------------------------ - {"use-filedir-conf", &use_filedir_conf, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, - {"nouse-filedir-conf", &use_filedir_conf, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, + {"use-filedir-conf", &use_filedir_conf, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, + {"nouse-filedir-conf", &use_filedir_conf, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, + {"use-filename-title", &use_filename_title, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, + {"nouse-filename-title", &use_filename_title, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, #ifdef CONFIG_CRASH_DEBUG - {"crash-debug", &crash_debug, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, - {"nocrash-debug", &crash_debug, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, + {"crash-debug", &crash_debug, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, + {"nocrash-debug", &crash_debug, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, #endif - {"osdlevel", &osd_level, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL}, - {"osd-duration", &osd_duration, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL}, + {"osdlevel", &osd_level, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL}, + {"osd-duration", &osd_duration, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL}, #ifdef CONFIG_MENU - {"menu", &use_menu, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, - {"nomenu", &use_menu, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, - {"menu-root", &menu_root, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, - {"menu-cfg", &menu_cfg, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, - {"menu-startup", &menu_startup, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, - {"menu-keepdir", &menu_keepdir, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, - {"menu-chroot", &menu_chroot, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"menu", &use_menu, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, + {"nomenu", &use_menu, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, + {"menu-root", &menu_root, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, + {"menu-cfg", &menu_cfg, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, + {"menu-startup", &menu_startup, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, + {"menu-keepdir", &menu_keepdir, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, + {"menu-chroot", &menu_chroot, CONF_TYPE_STRING, 0, 0, 0, NULL}, #ifdef CONFIG_FRIBIDI - {"menu-fribidi-charset", &menu_fribidi_charset, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"menu-flip-hebrew", &menu_flip_hebrew, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"menu-noflip-hebrew", &menu_flip_hebrew, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"menu-flip-hebrew-commas", &menu_fribidi_flip_commas, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"menu-noflip-hebrew-commas", &menu_fribidi_flip_commas, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"menu-fribidi-charset", &menu_fribidi_charset, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"menu-flip-hebrew", &menu_flip_hebrew, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"menu-noflip-hebrew", &menu_flip_hebrew, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"menu-flip-hebrew-commas", &menu_fribidi_flip_commas, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"menu-noflip-hebrew-commas", &menu_fribidi_flip_commas, CONF_TYPE_FLAG, 0, 0, 1, NULL}, #endif /* CONFIG_FRIBIDI */ #else - {"menu", "OSD menu support was not compiled in.\n", CONF_TYPE_PRINT,0, 0, 0, NULL}, + {"menu", "OSD menu support was not compiled in.\n", CONF_TYPE_PRINT,0, 0, 0, NULL}, #endif /* CONFIG_MENU */ - // these should be moved to -common, and supported in MEncoder - {"vobsub", &vobsub_name, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"vobsubid", &vobsub_id, CONF_TYPE_INT, CONF_RANGE, 0, 31, NULL}, + // these should be moved to -common, and supported in MEncoder + {"vobsub", &vobsub_name, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"vobsubid", &vobsub_id, CONF_TYPE_INT, CONF_RANGE, 0, 31, NULL}, #ifdef CONFIG_UNRAR_EXEC - {"unrarexec", &unrar_executable, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"unrarexec", &unrar_executable, CONF_TYPE_STRING, 0, 0, 0, NULL}, #endif - {"sstep", &step_sec, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL}, + {"sstep", &step_sec, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL}, - {"framedrop", &frame_dropping, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"hardframedrop", &frame_dropping, CONF_TYPE_FLAG, 0, 0, 2, NULL}, - {"noframedrop", &frame_dropping, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - - {"autoq", &auto_quality, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL}, - - {"benchmark", &benchmark, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - - // dump some stream out instead of playing the file - // this really should be in MEncoder instead of MPlayer... -> TODO - {"dumpfile", &stream_dump_name, CONF_TYPE_STRING, 0, 0, 0, NULL}, - {"dumpaudio", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"dumpvideo", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 2, NULL}, - {"dumpsub", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 3, NULL}, - {"dumpmpsub", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 4, NULL}, - {"dumpstream", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 5, NULL}, - {"dumpsrtsub", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 6, NULL}, - {"dumpmicrodvdsub", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 7, NULL}, - {"dumpjacosub", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 8, NULL}, - {"dumpsami", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 9, NULL}, + {"framedrop", &frame_dropping, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"hardframedrop", &frame_dropping, CONF_TYPE_FLAG, 0, 0, 2, NULL}, + {"noframedrop", &frame_dropping, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + + {"autoq", &auto_quality, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL}, + + {"benchmark", &benchmark, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + + // dump some stream out instead of playing the file + // this really should be in MEncoder instead of MPlayer... -> TODO + {"dumpfile", &stream_dump_name, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {"dumpaudio", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"dumpvideo", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 2, NULL}, + {"dumpsub", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 3, NULL}, + {"dumpmpsub", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 4, NULL}, + {"dumpstream", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 5, NULL}, + {"dumpsrtsub", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 6, NULL}, + {"dumpmicrodvdsub", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 7, NULL}, + {"dumpjacosub", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 8, NULL}, + {"dumpsami", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 9, NULL}, #ifdef CONFIG_LIRC - {"lircconf", &lirc_configfile, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, + {"lircconf", &lirc_configfile, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, #endif - {"gui", "The -gui option will only work as the first command line argument.\n", CONF_TYPE_PRINT, 0, 0, 0, (void *)1}, - {"nogui", "The -nogui option will only work as the first command line argument.\n", CONF_TYPE_PRINT, 0, 0, 0, (void *)1}, - + {"gui", "The -gui option will only work as the first command line argument.\n", CONF_TYPE_PRINT, 0, 0, 0, (void *)1}, + {"nogui", "The -nogui option will only work as the first command line argument.\n", CONF_TYPE_PRINT, 0, 0, 0, (void *)1}, + #ifdef CONFIG_GUI - {"skin", &skinName, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, - {"enqueue", &enqueue, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"noenqueue", &enqueue, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"guiwid", &guiWinID, CONF_TYPE_INT, 0, 0, 0, NULL}, -#endif - - {"noloop", &mpctx_s.loop_times, CONF_TYPE_FLAG, 0, 0, -1, NULL}, - {"loop", &mpctx_s.loop_times, CONF_TYPE_INT, CONF_RANGE, -1, 10000, NULL}, - {"playlist", NULL, CONF_TYPE_STRING, 0, 0, 0, NULL}, - - // a-v sync stuff: - {"correct-pts", &user_correct_pts, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nocorrect-pts", &user_correct_pts, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"noautosync", &autosync, CONF_TYPE_FLAG, 0, 0, -1, NULL}, - {"autosync", &autosync, CONF_TYPE_INT, CONF_RANGE, 0, 10000, NULL}, -// {"dapsync", &dapsync, CONF_TYPE_FLAG, 0, 0, 1, NULL}, -// {"nodapsync", &dapsync, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"skin", &skinName, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, + {"enqueue", &enqueue, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"noenqueue", &enqueue, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"guiwid", &guiWinID, CONF_TYPE_INT, 0, 0, 0, NULL}, +#endif + + {"noloop", &mpctx_s.loop_times, CONF_TYPE_FLAG, 0, 0, -1, NULL}, + {"loop", &mpctx_s.loop_times, CONF_TYPE_INT, CONF_RANGE, -1, 10000, NULL}, + {"playlist", NULL, CONF_TYPE_STRING, 0, 0, 0, NULL}, + + // a-v sync stuff: + {"correct-pts", &user_correct_pts, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"nocorrect-pts", &user_correct_pts, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"noautosync", &autosync, CONF_TYPE_FLAG, 0, 0, -1, NULL}, + {"autosync", &autosync, CONF_TYPE_INT, CONF_RANGE, 0, 10000, NULL}, - {"softsleep", &softsleep, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"softsleep", &softsleep, CONF_TYPE_FLAG, 0, 0, 1, NULL}, #ifdef HAVE_RTC - {"nortc", &nortc, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"rtc", &nortc, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"rtc-device", &rtc_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, -#endif - - {"term-osd", &term_osd, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"noterm-osd", &term_osd, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"term-osd-esc", &term_osd_esc, CONF_TYPE_STRING, 0, 0, 1, NULL}, - {"playing-msg", &playing_msg, CONF_TYPE_STRING, 0, 0, 0, NULL}, - - {"slave", &slave_mode, CONF_TYPE_FLAG,CONF_GLOBAL , 0, 1, NULL}, - {"idle", &player_idle_mode, CONF_TYPE_FLAG,CONF_GLOBAL , 0, 1, NULL}, - {"noidle", &player_idle_mode, CONF_TYPE_FLAG,CONF_GLOBAL , 1, 0, NULL}, - {"use-stdin", "-use-stdin has been renamed to -noconsolecontrols, use that instead.", CONF_TYPE_PRINT, 0, 0, 0, NULL}, - {"key-fifo-size", &key_fifo_size, CONF_TYPE_INT, CONF_RANGE, 2, 65000, NULL}, - {"noconsolecontrols", &noconsolecontrols, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, - {"consolecontrols", &noconsolecontrols, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, - {"mouse-movements", &enable_mouse_movements, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, - {"nomouse-movements", &enable_mouse_movements, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, - {"doubleclick-time", &doubleclick_time, CONF_TYPE_INT, CONF_RANGE, 0, 1000, NULL}, + {"nortc", &nortc, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"rtc", &nortc, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"rtc-device", &rtc_device, CONF_TYPE_STRING, 0, 0, 0, NULL}, +#endif + + {"term-osd", &term_osd, CONF_TYPE_FLAG, 0, 0, 1, NULL}, + {"noterm-osd", &term_osd, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + {"term-osd-esc", &term_osd_esc, CONF_TYPE_STRING, 0, 0, 1, NULL}, + {"playing-msg", &playing_msg, CONF_TYPE_STRING, 0, 0, 0, NULL}, + + {"slave", &slave_mode, CONF_TYPE_FLAG,CONF_GLOBAL , 0, 1, NULL}, + {"idle", &player_idle_mode, CONF_TYPE_FLAG,CONF_GLOBAL , 0, 1, NULL}, + {"noidle", &player_idle_mode, CONF_TYPE_FLAG,CONF_GLOBAL , 1, 0, NULL}, + {"use-stdin", "-use-stdin has been renamed to -noconsolecontrols, use that instead.", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"key-fifo-size", &key_fifo_size, CONF_TYPE_INT, CONF_RANGE, 2, 65000, NULL}, + {"noconsolecontrols", &noconsolecontrols, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, + {"consolecontrols", &noconsolecontrols, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, + {"mouse-movements", &enable_mouse_movements, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, + {"nomouse-movements", &enable_mouse_movements, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, + {"doubleclick-time", &doubleclick_time, CONF_TYPE_INT, CONF_RANGE, 0, 1000, NULL}, #ifdef CONFIG_TV - {"tvscan", tvscan_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, + {"tvscan", tvscan_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, #else - {"tvscan", "MPlayer was compiled without TV interface support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"tvscan", "MPlayer was compiled without TV interface support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, #endif /* CONFIG_TV */ -#include "cfg-common-opts.h" - - {"list-properties", &list_properties, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, - {"identify", &mp_msg_levels[MSGT_IDENTIFY], CONF_TYPE_FLAG, CONF_GLOBAL, 0, MSGL_V, NULL}, - {"-help", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, - {"help", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, - {"h", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, + {"list-properties", &list_properties, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, + {"identify", &mp_msg_levels[MSGT_IDENTIFY], CONF_TYPE_FLAG, CONF_GLOBAL, 0, MSGL_V, NULL}, + {"-help", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, + {"help", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, + {"h", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, - {"vd", vd_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, - {NULL, NULL, 0, 0, 0, 0, NULL} + {"vd", vd_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, + {NULL, NULL, 0, 0, 0, 0, NULL} }; #endif /* MPLAYER_CFG_MPLAYER_H */ - diff -Nru mplayer-1.0~rc3+svn20090426/Changelog mplayer-1.0~rc4.dfsg1/Changelog --- mplayer-1.0~rc3+svn20090426/Changelog 2009-03-27 19:09:33.000000000 +0000 +++ mplayer-1.0~rc4.dfsg1/Changelog 2010-07-05 19:23:56.000000000 +0000 @@ -1,6 +1,95 @@ MPlayer (1.0) - rc3: "BikeshedCounter" March 27, 2009 + rc4: "Yes We Can" + + GUI: Changes towards removing the GUI + * The GUI will no longer display any error or warning messages. + * Special GUI slave commands (gui_*) were removed, along with + the related key bindings. + + Decoders: + * YUY2 Lossless Codec (YLC0) via binary DLL + * Truemotion RT codec (TR20) via binary DLL + * Nogantech Codec (NTN1 and NTN2) via binary DLL + * add new FourCCs (m1v1, yuvs, VYUY, Y42B, V422, YUNV, UYNV, UYNY, uyv1, + 2Vu1, P422, HDYC, IJLV, MVJP) + TwoCCs (0xA106, 0x6c75, 0xAAC0, 0x55005354) + to existing decoders + * AMR now handled via OpenCORE decoder + * updated Windows Media Screen Codec (MSS1, MSS2) via binary DLL + * CoreAVC H.264 decoder via binary DLL (Windows only) + * Kega Game video codec (KGV1) via binary DLL + * SoftLab-NSK Forward MPEG-2 I-frames (SLIF) via binary DLL + * JPEG 2000 support via OpenJPEG + * internal liba52 copy removed + * CineForm HD (CFHD) via binary DLL + * VP8 en-/decoding through libvpx wrapper and native decoder in FFmpeg + * support for external libmpeg2 added + * hardware MPEG decoder priority lowered + * external libmpg123 support + + Demuxers: + * Mostly fixed timing issues with some H.264 (PAFF) samples + * Matroska and Ogg demuxers switched to use libavformat by default. + Report issues and use -demuxer ogg and -demuxer mkv to work around them. + * support for TrueHD in Blu-ray streams in libmpdemux + * more Blu-ray codec support with lavf + * fix length in ASF/WMV files + * support ISDB-Tb DVB streams + + Filters: + * remove vf_yuy2, functionality is replaced by -vf format=yuv2 + * remove vf_rgb2bgr, functionality is replaced by sws and vf_format + + Streaming: + * Support for unencrypted Blu-ray playback through libbluray. + Use it through: mplayer br:////path/to/disc + + Drivers: + * -vo yuv4mpeg:interlaced no longer does its own interlaced RGB->YUV + conversion. Use -vf scale=::1 to keep the same behavior and report + if there are any issues with that. + * X11: Window manager chooses Window position by default. + Add geometry=50%:50% to your configuration to get the old behavior. + * -vo md5sum md5 calculation changed so output matches FFmpeg's -f framemd5 + * Support for more formats in OpenGL video output drivers (different YUV + subsampling, 16 bit per component) + * Selectable YUV to RGB conversion standard for -vo gl + (-vo gl:colorspace=...:levelconv=...) + * -vo gl now tries to use yuv=2 by default if possible + * -vo gl:stereo=... for experimental stereo (3D) support + * -vo matrixview finally added + * add OS/2 KAI audio driver (-ao kai) + + Other: + * -nosub option for disabling auto-selected subtitles + * support for displaying subs in the terminal (FIXME) + * support for subtitles with audio-only files + * support for right-to-left languages with embedded subtitles + * support for UTF-16 encoded external subtitles + * support for 8 channel audio + * sync dvd:// and dvdnav:// features + * support for MPEG-4 ASP in VDPAU video output (non-B-frame only) + * support for live and non-live DVB teletext with demuxer lavf + * -name, -title and -use-filename-title options for MPlayer + * support for stream handling via FFmpeg, in particular RTMP and RTSP + (use e.g. ffmpeg://http://example.com/test) + * experimental support for external libass, configure with + --disable-ass-internal + * better support for 16-bit-per-component formats and formats + with alpha channel + * better out-of-the-box support for compiling for ARM, IA64, + MinGW32 and MinGW-w64, MinGW has ASLR enabled with recent + enough binutils + * libdvdcss synced with upstream Subversion snapshot + + MEncoder: + * add -tsprog for demuxer lavf + + + + rc3: "BikeshedCounter AKA Godot" May 30, 2010 + Decoders: * support for X8 frames (fixes "J-type picture is not supported" for WMV2) * support for DTS WAV/DTS-CD passthrough by ad_hwac3 @@ -20,7 +109,7 @@ * GeoVision Advanced MPEG-4 (GMP4, GM40) via binary DLL * Xiricam JPEG from Veo PC Camera (XJPG) via binary DLL * WorldConnect Wavelet Video (SMSV) via binary DLL - * VDOWave 3 advanced (VDO3,VDOM,VDOW) via binary DLL + * VDOWave 3 advanced (VDO3, VDOM, VDOW) via binary DLL * VoxWare MetaVoice (format 0x0074) via binary DLL * Ulead DV Audio (0x215,0x216) via binary DLL * GoToMeeting codec (G2M2,G2M3) via binary DLL @@ -29,10 +118,10 @@ * ZDSoft screen recorder (ZDSV) via binary DLL * WebTrain Communication lossless screen recorder (WTVC) via binary DLL * xfire video (XFR1) via binary DLL - * VFAPI rgb transcode (vifp) via binary DLL + * VFAPI RGB transcode (vifp) via binary DLL * ETI CamCorder EYECON (NUB0,NUB1,NUB2) via binary DLL * fox motion (FMVC) via binary DLL - * Trident video (TY2C,TY2N,TY0N) via binary DLL + * Trident video (TY2C, TY2N, TY0N) via binary DLL * 10-bit video (v210) via Cinewave binary DLL * Brooktree YUV 4:1:1 Raw (Y41P) via binary DLL * many rare/obscure fourccs for known formats added @@ -63,7 +152,7 @@ * change vf_screenshot dependency from libpng to lavc * add af_scaletempo which maintains audio pitch when changing playback speed * fix multi-channel reordering - * af_stats, filter to print information about the audio stream + * af_stats filter to print information about the audio stream Streaming: * tv:// support for Windows @@ -181,10 +270,10 @@ Ports: * small crash with vo_macosx fixed * AC3/DTS passthrough for ao_macosx - * fix frozen OSD on Mac OS X + * fix frozen OSD on OS X * vo_gl now works with -wid and nVidia drivers on Windows (this is a hack) * VIDIX on SuperH - * workarounds for AltiVec on Apple gcc 3.3 on Mac OS X dropped + * workarounds for AltiVec on Apple gcc 3.3 on OS X dropped * vo_macosx can now be compiled in 64-bits mode * allow multiple MPlayer instances with vo_macosx using buffer_name * OpenGL support for unmodified MinGW64 @@ -444,7 +533,7 @@ correctly and -subcp must be set for all non-UTF-8 subtitles * more audio-truncation fixes * libavutil mandatory for MPlayer compilation - * more intuitive -edlout behaviour + * more intuitive -edlout behavior * -nortc is now default since -rtc has disadvantages with recent kernels @@ -1257,7 +1346,7 @@ * SSE optimizations enabled under MinGW * SSE support under OpenBSD * AltiVec support under NetBSD - * GCC 3.4 support (due to changed behaviour in ASM code snippets) + * GCC 3.4 support (due to changed behavior in ASM code snippets) Demuxers: * Matroska containing RealVideo works better diff -Nru mplayer-1.0~rc3+svn20090426/codec-cfg.c mplayer-1.0~rc4.dfsg1/codec-cfg.c --- mplayer-1.0~rc3+svn20090426/codec-cfg.c 2009-03-01 15:55:20.000000000 +0000 +++ mplayer-1.0~rc4.dfsg1/codec-cfg.c 2010-06-19 18:44:43.000000000 +0000 @@ -1,7 +1,5 @@ /* * codec.conf parser - * by Szabolcs Berecz - * (C) 2001 * * to compile test application: * cc -I. -DTESTING -o codec-cfg-test codec-cfg.c mp_msg.o osdep/getch2.o -ltermcap @@ -9,12 +7,30 @@ * gcc -DCODECS2HTML -o codecs2html codec-cfg.c mp_msg.o * * TODO: implement informat in CODECS2HTML too + * + * Copyright (C) 2001 Szabolcs Berecz + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #define DEBUG //disable asserts -#define NDEBUG +#define NDEBUG #include #include @@ -43,382 +59,402 @@ #include "libmpcodecs/img_format.h" #include "codec-cfg.h" -#ifndef CODECS2HTML +#ifdef CODECS2HTML +#define CODEC_CFG_MIN 20100000 +#else #include "codecs.conf.h" #endif #define PRINT_LINENUM mp_msg(MSGT_CODECCFG,MSGL_ERR," at line %d\n", line_num) -#define MAX_NR_TOKEN 16 +#define MAX_NR_TOKEN 16 -#define MAX_LINE_LEN 1000 +#define MAX_LINE_LEN 1000 -#define RET_EOF -1 -#define RET_EOL -2 +#define RET_EOF -1 +#define RET_EOL -2 -#define TYPE_VIDEO 0 -#define TYPE_AUDIO 1 +#define TYPE_VIDEO 0 +#define TYPE_AUDIO 1 +static int codecs_conf_release; char * codecs_file = NULL; static int add_to_fourcc(char *s, char *alias, unsigned int *fourcc, - unsigned int *map) + unsigned int *map) { - int i, j, freeslots; - unsigned int tmp; + int i, j, freeslots; + unsigned int tmp; - /* find first unused slot */ - for (i = 0; i < CODECS_MAX_FOURCC && fourcc[i] != 0xffffffff; i++) - /* NOTHING */; - freeslots = CODECS_MAX_FOURCC - i; - if (!freeslots) - goto err_out_too_many; - - do { - tmp = mmioFOURCC(s[0], s[1], s[2], s[3]); - for (j = 0; j < i; j++) - if (tmp == fourcc[j]) - goto err_out_duplicated; - fourcc[i] = tmp; - map[i] = alias ? mmioFOURCC(alias[0], alias[1], alias[2], alias[3]) : tmp; - s += 4; - i++; - } while ((*(s++) == ',') && --freeslots); - - if (!freeslots) - goto err_out_too_many; - if (*(--s) != '\0') - goto err_out_parse_error; - return 1; + /* find first unused slot */ + for (i = 0; i < CODECS_MAX_FOURCC && fourcc[i] != 0xffffffff; i++) + /* NOTHING */; + freeslots = CODECS_MAX_FOURCC - i; + if (!freeslots) + goto err_out_too_many; + + do { + tmp = mmioFOURCC(s[0], s[1], s[2], s[3]); + for (j = 0; j < i; j++) + if (tmp == fourcc[j]) + goto err_out_duplicated; + fourcc[i] = tmp; + map[i] = alias ? mmioFOURCC(alias[0], alias[1], alias[2], alias[3]) : tmp; + s += 4; + i++; + } while ((*(s++) == ',') && --freeslots); + + if (!freeslots) + goto err_out_too_many; + if (*(--s) != '\0') + goto err_out_parse_error; + return 1; err_out_duplicated: - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_DuplicateFourcc); - return 0; + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_DuplicateFourcc); + return 0; err_out_too_many: - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyFourccs); - return 0; + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyFourccs); + return 0; err_out_parse_error: - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError); - return 0; + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError); + return 0; } static int add_to_format(char *s, char *alias,unsigned int *fourcc, unsigned int *fourccmap) { - int i, j; - char *endptr; + int i, j; + char *endptr; - /* find first unused slot */ - for (i = 0; i < CODECS_MAX_FOURCC && fourcc[i] != 0xffffffff; i++) - /* NOTHING */; - if (i == CODECS_MAX_FOURCC) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyFourccs); - return 0; - } - - fourcc[i]=strtoul(s,&endptr,0); - if (*endptr != '\0') { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseErrorFIDNotNumber); - return 0; - } - - if(alias){ - fourccmap[i]=strtoul(alias,&endptr,0); - if (*endptr != '\0') { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseErrorFIDAliasNotNumber); - return 0; - } - } else - fourccmap[i]=fourcc[i]; - - for (j = 0; j < i; j++) - if (fourcc[j] == fourcc[i]) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_DuplicateFID); - return 0; - } - - return 1; -} - - static struct { - const char *name; - const unsigned int num; - } fmt_table[] = { - {"YV12", IMGFMT_YV12}, - {"I420", IMGFMT_I420}, - {"IYUV", IMGFMT_IYUV}, - {"NV12", IMGFMT_NV12}, - {"NV21", IMGFMT_NV21}, - {"YVU9", IMGFMT_YVU9}, - {"IF09", IMGFMT_IF09}, - {"444P", IMGFMT_444P}, - {"422P", IMGFMT_422P}, - {"411P", IMGFMT_411P}, - {"Y800", IMGFMT_Y800}, - {"Y8", IMGFMT_Y8}, - - {"YUY2", IMGFMT_YUY2}, - {"UYVY", IMGFMT_UYVY}, - {"YVYU", IMGFMT_YVYU}, - - {"RGB4", IMGFMT_RGB|4}, - {"RGB8", IMGFMT_RGB|8}, - {"RGB15", IMGFMT_RGB|15}, - {"RGB16", IMGFMT_RGB|16}, - {"RGB24", IMGFMT_RGB|24}, - {"RGB32", IMGFMT_RGB|32}, - {"BGR4", IMGFMT_BGR|4}, - {"BGR8", IMGFMT_BGR|8}, - {"BGR15", IMGFMT_BGR|15}, - {"BGR16", IMGFMT_BGR|16}, - {"BGR24", IMGFMT_BGR|24}, - {"BGR32", IMGFMT_BGR|32}, - {"RGB1", IMGFMT_RGB|1}, - {"BGR1", IMGFMT_BGR|1}, - - {"MPES", IMGFMT_MPEGPES}, - {"ZRMJPEGNI", IMGFMT_ZRMJPEGNI}, - {"ZRMJPEGIT", IMGFMT_ZRMJPEGIT}, - {"ZRMJPEGIB", IMGFMT_ZRMJPEGIB}, - - {"IDCT_MPEG2",IMGFMT_XVMC_IDCT_MPEG2}, - {"MOCO_MPEG2",IMGFMT_XVMC_MOCO_MPEG2}, - - {"VDPAU_MPEG1",IMGFMT_VDPAU_MPEG1}, - {"VDPAU_MPEG2",IMGFMT_VDPAU_MPEG2}, - {"VDPAU_H264",IMGFMT_VDPAU_H264}, - {"VDPAU_WMV3",IMGFMT_VDPAU_WMV3}, - {"VDPAU_VC1",IMGFMT_VDPAU_VC1}, + /* find first unused slot */ + for (i = 0; i < CODECS_MAX_FOURCC && fourcc[i] != 0xffffffff; i++) + /* NOTHING */; + if (i == CODECS_MAX_FOURCC) { + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_TooManyFourccs); + return 0; + } - {NULL, 0} - }; + fourcc[i]=strtoul(s,&endptr,0); + if (*endptr != '\0') { + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseErrorFIDNotNumber); + return 0; + } + + if(alias){ + fourccmap[i]=strtoul(alias,&endptr,0); + if (*endptr != '\0') { + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseErrorFIDAliasNotNumber); + return 0; + } + } else + fourccmap[i]=fourcc[i]; + + for (j = 0; j < i; j++) + if (fourcc[j] == fourcc[i]) { + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_DuplicateFID); + return 0; + } + + return 1; +} + +static const struct { + const char *name; + const unsigned int num; +} fmt_table[] = { + // note: due to parser deficiencies/simplicity, if one format + // name matches the beginning of another, the longer one _must_ + // come first in this list. + {"YV12", IMGFMT_YV12}, + {"I420", IMGFMT_I420}, + {"IYUV", IMGFMT_IYUV}, + {"NV12", IMGFMT_NV12}, + {"NV21", IMGFMT_NV21}, + {"YVU9", IMGFMT_YVU9}, + {"IF09", IMGFMT_IF09}, + {"444P16LE", IMGFMT_444P16_LE}, + {"444P16BE", IMGFMT_444P16_BE}, + {"422P16LE", IMGFMT_422P16_LE}, + {"422P16BE", IMGFMT_422P16_BE}, + {"420P16LE", IMGFMT_420P16_LE}, + {"420P16BE", IMGFMT_420P16_BE}, + {"444P16", IMGFMT_444P16}, + {"422P16", IMGFMT_422P16}, + {"420P16", IMGFMT_420P16}, + {"420A", IMGFMT_420A}, + {"444P", IMGFMT_444P}, + {"422P", IMGFMT_422P}, + {"411P", IMGFMT_411P}, + {"440P", IMGFMT_440P}, + {"Y800", IMGFMT_Y800}, + {"Y8", IMGFMT_Y8}, + + {"YUY2", IMGFMT_YUY2}, + {"UYVY", IMGFMT_UYVY}, + {"YVYU", IMGFMT_YVYU}, + + {"RGB48LE", IMGFMT_RGB48LE}, + {"RGB48BE", IMGFMT_RGB48BE}, + {"RGB4", IMGFMT_RGB4}, + {"RGB8", IMGFMT_RGB8}, + {"RGB15", IMGFMT_RGB15}, + {"RGB16", IMGFMT_RGB16}, + {"RGB24", IMGFMT_RGB24}, + {"RGB32", IMGFMT_RGB32}, + {"BGR4", IMGFMT_BGR4}, + {"BGR8", IMGFMT_BGR8}, + {"BGR15", IMGFMT_BGR15}, + {"BGR16", IMGFMT_BGR16}, + {"BGR24", IMGFMT_BGR24}, + {"BGR32", IMGFMT_BGR32}, + {"RGB1", IMGFMT_RGB1}, + {"BGR1", IMGFMT_BGR1}, + + {"MPES", IMGFMT_MPEGPES}, + {"ZRMJPEGNI", IMGFMT_ZRMJPEGNI}, + {"ZRMJPEGIT", IMGFMT_ZRMJPEGIT}, + {"ZRMJPEGIB", IMGFMT_ZRMJPEGIB}, + + {"IDCT_MPEG2",IMGFMT_XVMC_IDCT_MPEG2}, + {"MOCO_MPEG2",IMGFMT_XVMC_MOCO_MPEG2}, + + {"VDPAU_MPEG1",IMGFMT_VDPAU_MPEG1}, + {"VDPAU_MPEG2",IMGFMT_VDPAU_MPEG2}, + {"VDPAU_H264",IMGFMT_VDPAU_H264}, + {"VDPAU_WMV3",IMGFMT_VDPAU_WMV3}, + {"VDPAU_VC1",IMGFMT_VDPAU_VC1}, + {"VDPAU_MPEG4",IMGFMT_VDPAU_MPEG4}, + + {NULL, 0} +}; static int add_to_inout(char *sfmt, char *sflags, unsigned int *outfmt, - unsigned char *outflags) + unsigned char *outflags) { - static char *flagstr[] = { - "flip", - "noflip", - "yuvhack", - "query", - "static", - NULL - }; - - int i, j, freeslots; - unsigned char flags; - - for (i = 0; i < CODECS_MAX_OUTFMT && outfmt[i] != 0xffffffff; i++) - /* NOTHING */; - freeslots = CODECS_MAX_OUTFMT - i; - if (!freeslots) - goto err_out_too_many; - - flags = 0; - if(sflags) { - do { - for (j = 0; flagstr[j] != NULL; j++) - if (!strncmp(sflags, flagstr[j], - strlen(flagstr[j]))) - break; - if (flagstr[j] == NULL) - goto err_out_parse_error; - flags|=(1<name; + unsigned int i; + char *tmp_name = c->name; - for (i = 0; i < strlen(tmp_name) && isalnum(tmp_name[i]); i++) - /* NOTHING */; + for (i = 0; i < strlen(tmp_name) && isalnum(tmp_name[i]); i++) + /* NOTHING */; - if (i < strlen(tmp_name)) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_InvalidCodecName, c->name); - return 0; - } + if (i < strlen(tmp_name)) { + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_InvalidCodecName, c->name); + return 0; + } - if (!c->info) - c->info = strdup(c->name); + if (!c->info) + c->info = strdup(c->name); #if 0 - if (c->fourcc[0] == 0xffffffff) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecLacksFourcc, c->name); - return 0; - } + if (c->fourcc[0] == 0xffffffff) { + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecLacksFourcc, c->name); + return 0; + } #endif - if (!c->drv) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecLacksDriver, c->name); - return 0; - } + if (!c->drv) { + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecLacksDriver, c->name); + return 0; + } #if 0 #warning codec->driver == 4;... <- this should not be put in here... #warning Where are they defined ???????????? - if (!c->dll && (c->driver == 4 || - (c->driver == 2 && type == TYPE_VIDEO))) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNeedsDLL, c->name); - return 0; - } + if (!c->dll && (c->driver == 4 || + (c->driver == 2 && type == TYPE_VIDEO))) { + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNeedsDLL, c->name); + return 0; + } #warning Can guid.f1 be 0? How does one know that it was not given? -// if (!(codec->flags & CODECS_FLAG_AUDIO) && codec->driver == 4) +// if (!(codec->flags & CODECS_FLAG_AUDIO) && codec->driver == 4) - if (type == TYPE_VIDEO) - if (c->outfmt[0] == 0xffffffff) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNeedsOutfmt, c->name); - return 0; - } + if (type == TYPE_VIDEO) + if (c->outfmt[0] == 0xffffffff) { + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNeedsOutfmt, c->name); + return 0; + } #endif - return 1; + return 1; } static int add_comment(char *s, char **d) { - int pos; + int pos; - if (!*d) - pos = 0; - else { - pos = strlen(*d); - (*d)[pos++] = '\n'; - } - if (!(*d = realloc(*d, pos + strlen(s) + 1))) { - mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantAllocateComment); - return 0; - } - strcpy(*d + pos, s); - return 1; + if (!*d) + pos = 0; + else { + pos = strlen(*d); + (*d)[pos++] = '\n'; + } + if (!(*d = realloc(*d, pos + strlen(s) + 1))) { + mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantAllocateComment); + return 0; + } + strcpy(*d + pos, s); + return 1; } static short get_cpuflags(char *s) { - static char *flagstr[] = { - "mmx", - "sse", - "3dnow", - NULL - }; - int i; - short flags = 0; - - do { - for (i = 0; flagstr[i]; i++) - if (!strncmp(s, flagstr[i], strlen(flagstr[i]))) - break; - if (!flagstr[i]) - goto err_out_parse_error; - flags |= 1<= MAX_NR_TOKEN) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_GetTokenMaxNotLessThanMAX_NR_TOKEN); - goto out_eof; - } - - memset(token, 0x00, sizeof(*token) * max); - - if (read_nextline) { - if (!fgets(line, MAX_LINE_LEN, fp)) - goto out_eof; - line_pos = 0; - ++line_num; - read_nextline = 0; - } - for (i = 0; i < max; i++) { - while (isspace(line[line_pos])) - ++line_pos; - if (line[line_pos] == '\0' || line[line_pos] == '#' || - line[line_pos] == ';') { - read_nextline = 1; - if (i >= min) - goto out_ok; - goto out_eol; - } - token[i] = line + line_pos; - c = line[line_pos]; - if (c == '"' || c == '\'') { - token[i]++; - while (line[++line_pos] != c && line[line_pos]) - /* NOTHING */; - } else { - for (/* NOTHING */; !isspace(line[line_pos]) && - line[line_pos]; line_pos++) - /* NOTHING */; - } - if (!line[line_pos]) { - read_nextline = 1; - if (i >= min - 1) - goto out_ok; - goto out_eol; - } - line[line_pos] = '\0'; - line_pos++; - } + static int line_pos; + int i; + char c; + + if (max >= MAX_NR_TOKEN) { + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_GetTokenMaxNotLessThanMAX_NR_TOKEN); + goto out_eof; + } + + memset(token, 0x00, sizeof(*token) * max); + + if (read_nextline) { + if (!fgets(line, MAX_LINE_LEN, fp)) + goto out_eof; + line_pos = 0; + ++line_num; + read_nextline = 0; + } + for (i = 0; i < max; i++) { + while (isspace(line[line_pos])) + ++line_pos; + if (line[line_pos] == '\0' || line[line_pos] == '#' || + line[line_pos] == ';') { + read_nextline = 1; + if (i >= min) + goto out_ok; + goto out_eol; + } + token[i] = line + line_pos; + c = line[line_pos]; + if (c == '"' || c == '\'') { + token[i]++; + while (line[++line_pos] != c && line[line_pos]) + /* NOTHING */; + } else { + for (/* NOTHING */; !isspace(line[line_pos]) && + line[line_pos]; line_pos++) + /* NOTHING */; + } + if (!line[line_pos]) { + read_nextline = 1; + if (i >= min - 1) + goto out_ok; + goto out_eol; + } + line[line_pos] = '\0'; + line_pos++; + } out_ok: - return i; + return i; out_eof: - read_nextline = 1; - return RET_EOF; + read_nextline = 1; + return RET_EOF; out_eol: - return RET_EOL; + return RET_EOL; } static codecs_t *video_codecs=NULL; @@ -493,400 +529,398 @@ int parse_codec_cfg(const char *cfgfile) { - codecs_t *codec = NULL; // current codec - codecs_t **codecsp = NULL;// points to audio_codecs or to video_codecs - char *endptr; // strtoul()... - int *nr_codecsp; - int codec_type; /* TYPE_VIDEO/TYPE_AUDIO */ - int tmp, i; - - // in case we call it a second time - codecs_uninit_free(); - - nr_vcodecs = 0; - nr_acodecs = 0; + codecs_t *codec = NULL; // current codec + codecs_t **codecsp = NULL;// points to audio_codecs or to video_codecs + char *endptr; // strtoul()... + int *nr_codecsp; + int codec_type; /* TYPE_VIDEO/TYPE_AUDIO */ + int tmp, i; + + // in case we call it a second time + codecs_uninit_free(); - if(cfgfile==NULL) { + nr_vcodecs = 0; + nr_acodecs = 0; + + if(cfgfile==NULL) { #ifdef CODECS2HTML - return 0; + return 0; #else - video_codecs = builtin_video_codecs; - audio_codecs = builtin_audio_codecs; - nr_vcodecs = sizeof(builtin_video_codecs)/sizeof(codecs_t); - nr_acodecs = sizeof(builtin_audio_codecs)/sizeof(codecs_t); - return 1; + video_codecs = builtin_video_codecs; + audio_codecs = builtin_audio_codecs; + nr_vcodecs = sizeof(builtin_video_codecs)/sizeof(codecs_t); + nr_acodecs = sizeof(builtin_audio_codecs)/sizeof(codecs_t); + return 1; #endif - } - - mp_msg(MSGT_CODECCFG,MSGL_V,MSGTR_ReadingFile, cfgfile); - - if ((fp = fopen(cfgfile, "r")) == NULL) { - mp_msg(MSGT_CODECCFG,MSGL_V,MSGTR_CantOpenFileError, cfgfile, strerror(errno)); - return 0; - } - - if ((line = malloc(MAX_LINE_LEN + 1)) == NULL) { - mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantGetMemoryForLine, strerror(errno)); - return 0; - } - read_nextline = 1; - - /* - * this only catches release lines at the start of - * codecs.conf, before audiocodecs and videocodecs. - */ - while ((tmp = get_token(1, 1)) == RET_EOL) - /* NOTHING */; - if (tmp == RET_EOF) - goto out; - if (!strcmp(token[0], "release")) { - if (get_token(1, 2) < 0) - goto err_out_parse_error; - tmp = atoi(token[0]); - if (tmp < CODEC_CFG_MIN) - goto err_out_release_num; - while ((tmp = get_token(1, 1)) == RET_EOL) - /* NOTHING */; - if (tmp == RET_EOF) - goto out; - } else - goto err_out_release_num; - - /* - * check if the next block starts with 'audiocodec' or - * with 'videocodec' - */ - if (!strcmp(token[0], "audiocodec") || !strcmp(token[0], "videocodec")) - goto loop_enter; - goto err_out_parse_error; - - while ((tmp = get_token(1, 1)) != RET_EOF) { - if (tmp == RET_EOL) - continue; - if (!strcmp(token[0], "audiocodec") || - !strcmp(token[0], "videocodec")) { - if (!validate_codec(codec, codec_type)) - goto err_out_not_valid; - loop_enter: - if (*token[0] == 'v') { - codec_type = TYPE_VIDEO; - nr_codecsp = &nr_vcodecs; - codecsp = &video_codecs; - } else if (*token[0] == 'a') { - codec_type = TYPE_AUDIO; - nr_codecsp = &nr_acodecs; - codecsp = &audio_codecs; + } + + mp_msg(MSGT_CODECCFG,MSGL_V,MSGTR_ReadingFile, cfgfile); + + if ((fp = fopen(cfgfile, "r")) == NULL) { + mp_msg(MSGT_CODECCFG,MSGL_V,MSGTR_CantOpenFileError, cfgfile, strerror(errno)); + return 0; + } + + if ((line = malloc(MAX_LINE_LEN + 1)) == NULL) { + mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantGetMemoryForLine, strerror(errno)); + return 0; + } + read_nextline = 1; + + /* + * this only catches release lines at the start of + * codecs.conf, before audiocodecs and videocodecs. + */ + while ((tmp = get_token(1, 1)) == RET_EOL) + /* NOTHING */; + if (tmp == RET_EOF) + goto out; + if (!strcmp(token[0], "release")) { + if (get_token(1, 2) < 0) + goto err_out_parse_error; + tmp = atoi(token[0]); + if (tmp < CODEC_CFG_MIN) + goto err_out_release_num; + codecs_conf_release = tmp; + while ((tmp = get_token(1, 1)) == RET_EOL) + /* NOTHING */; + if (tmp == RET_EOF) + goto out; + } else + goto err_out_release_num; + + /* + * check if the next block starts with 'audiocodec' or + * with 'videocodec' + */ + if (!strcmp(token[0], "audiocodec") || !strcmp(token[0], "videocodec")) + goto loop_enter; + goto err_out_parse_error; + + while ((tmp = get_token(1, 1)) != RET_EOF) { + if (tmp == RET_EOL) + continue; + if (!strcmp(token[0], "audiocodec") || + !strcmp(token[0], "videocodec")) { + if (!validate_codec(codec, codec_type)) + goto err_out_not_valid; + loop_enter: + if (*token[0] == 'v') { + codec_type = TYPE_VIDEO; + nr_codecsp = &nr_vcodecs; + codecsp = &video_codecs; + } else if (*token[0] == 'a') { + codec_type = TYPE_AUDIO; + nr_codecsp = &nr_acodecs; + codecsp = &audio_codecs; #ifdef DEBUG - } else { - mp_msg(MSGT_CODECCFG,MSGL_ERR,"picsba\n"); - goto err_out; + } else { + mp_msg(MSGT_CODECCFG,MSGL_ERR,"picsba\n"); + goto err_out; #endif - } - if (!(*codecsp = realloc(*codecsp, - sizeof(codecs_t) * (*nr_codecsp + 2)))) { - mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantReallocCodecsp, strerror(errno)); - goto err_out; - } - codec=*codecsp + *nr_codecsp; - ++*nr_codecsp; - memset(codec,0,sizeof(codecs_t)); - memset(codec->fourcc, 0xff, sizeof(codec->fourcc)); - memset(codec->outfmt, 0xff, sizeof(codec->outfmt)); - memset(codec->infmt, 0xff, sizeof(codec->infmt)); - - if (get_token(1, 1) < 0) - goto err_out_parse_error; - for (i = 0; i < *nr_codecsp - 1; i++) { - if(( (*codecsp)[i].name!=NULL) && - (!strcmp(token[0], (*codecsp)[i].name)) ) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNameNotUnique, token[0]); - goto err_out_print_linenum; - } - } - if (!(codec->name = strdup(token[0]))) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupName, strerror(errno)); - goto err_out; - } - } else if (!strcmp(token[0], "info")) { - if (codec->info || get_token(1, 1) < 0) - goto err_out_parse_error; - if (!(codec->info = strdup(token[0]))) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupInfo, strerror(errno)); - goto err_out; - } - } else if (!strcmp(token[0], "comment")) { - if (get_token(1, 1) < 0) - goto err_out_parse_error; - add_comment(token[0], &codec->comment); - } else if (!strcmp(token[0], "fourcc")) { - if (get_token(1, 2) < 0) - goto err_out_parse_error; - if (!add_to_fourcc(token[0], token[1], - codec->fourcc, - codec->fourccmap)) - goto err_out_print_linenum; - } else if (!strcmp(token[0], "format")) { - if (get_token(1, 2) < 0) - goto err_out_parse_error; - if (!add_to_format(token[0], token[1], - codec->fourcc,codec->fourccmap)) - goto err_out_print_linenum; - } else if (!strcmp(token[0], "driver")) { - if (get_token(1, 1) < 0) - goto err_out_parse_error; - if (!(codec->drv = strdup(token[0]))) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupDriver, strerror(errno)); - goto err_out; - } - } else if (!strcmp(token[0], "dll")) { - if (get_token(1, 1) < 0) - goto err_out_parse_error; - if (!(codec->dll = strdup(token[0]))) { - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupDLL, strerror(errno)); - goto err_out; - } - } else if (!strcmp(token[0], "guid")) { - if (get_token(11, 11) < 0) - goto err_out_parse_error; - codec->guid.f1=strtoul(token[0],&endptr,0); - if ((*endptr != ',' || *(endptr + 1) != '\0') && - *endptr != '\0') - goto err_out_parse_error; - codec->guid.f2=strtoul(token[1],&endptr,0); - if ((*endptr != ',' || *(endptr + 1) != '\0') && - *endptr != '\0') - goto err_out_parse_error; - codec->guid.f3=strtoul(token[2],&endptr,0); - if ((*endptr != ',' || *(endptr + 1) != '\0') && - *endptr != '\0') - goto err_out_parse_error; - for (i = 0; i < 8; i++) { - codec->guid.f4[i]=strtoul(token[i + 3],&endptr,0); - if ((*endptr != ',' || *(endptr + 1) != '\0') && - *endptr != '\0') - goto err_out_parse_error; - } - } else if (!strcmp(token[0], "out")) { - if (get_token(1, 2) < 0) - goto err_out_parse_error; - if (!add_to_inout(token[0], token[1], codec->outfmt, - codec->outflags)) - goto err_out_print_linenum; - } else if (!strcmp(token[0], "in")) { - if (get_token(1, 2) < 0) - goto err_out_parse_error; - if (!add_to_inout(token[0], token[1], codec->infmt, - codec->inflags)) - goto err_out_print_linenum; - } else if (!strcmp(token[0], "flags")) { - if (get_token(1, 1) < 0) - goto err_out_parse_error; - if (!strcmp(token[0], "seekable")) - codec->flags |= CODECS_FLAG_SEEKABLE; - else - if (!strcmp(token[0], "align16")) - codec->flags |= CODECS_FLAG_ALIGN16; - else - goto err_out_parse_error; - } else if (!strcmp(token[0], "status")) { - if (get_token(1, 1) < 0) - goto err_out_parse_error; - if (!strcasecmp(token[0], "working")) - codec->status = CODECS_STATUS_WORKING; - else if (!strcasecmp(token[0], "crashing")) - codec->status = CODECS_STATUS_NOT_WORKING; - else if (!strcasecmp(token[0], "untested")) - codec->status = CODECS_STATUS_UNTESTED; - else if (!strcasecmp(token[0], "buggy")) - codec->status = CODECS_STATUS_PROBLEMS; - else - goto err_out_parse_error; - } else if (!strcmp(token[0], "cpuflags")) { - if (get_token(1, 1) < 0) - goto err_out_parse_error; - if (!(codec->cpuflags = get_cpuflags(token[0]))) - goto err_out_parse_error; - } else - goto err_out_parse_error; - } - if (!validate_codec(codec, codec_type)) - goto err_out_not_valid; - mp_msg(MSGT_CODECCFG,MSGL_INFO,MSGTR_AudioVideoCodecTotals, nr_acodecs, nr_vcodecs); - if(video_codecs) video_codecs[nr_vcodecs].name = NULL; - if(audio_codecs) audio_codecs[nr_acodecs].name = NULL; + } + if (!(*codecsp = realloc(*codecsp, + sizeof(codecs_t) * (*nr_codecsp + 2)))) { + mp_msg(MSGT_CODECCFG,MSGL_FATAL,MSGTR_CantReallocCodecsp, strerror(errno)); + goto err_out; + } + codec=*codecsp + *nr_codecsp; + ++*nr_codecsp; + memset(codec,0,sizeof(codecs_t)); + memset(codec->fourcc, 0xff, sizeof(codec->fourcc)); + memset(codec->outfmt, 0xff, sizeof(codec->outfmt)); + memset(codec->infmt, 0xff, sizeof(codec->infmt)); + + if (get_token(1, 1) < 0) + goto err_out_parse_error; + for (i = 0; i < *nr_codecsp - 1; i++) { + if(( (*codecsp)[i].name!=NULL) && + (!strcmp(token[0], (*codecsp)[i].name)) ) { + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecNameNotUnique, token[0]); + goto err_out_print_linenum; + } + } + if (!(codec->name = strdup(token[0]))) { + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupName, strerror(errno)); + goto err_out; + } + } else if (!strcmp(token[0], "info")) { + if (codec->info || get_token(1, 1) < 0) + goto err_out_parse_error; + if (!(codec->info = strdup(token[0]))) { + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupInfo, strerror(errno)); + goto err_out; + } + } else if (!strcmp(token[0], "comment")) { + if (get_token(1, 1) < 0) + goto err_out_parse_error; + add_comment(token[0], &codec->comment); + } else if (!strcmp(token[0], "fourcc")) { + if (get_token(1, 2) < 0) + goto err_out_parse_error; + if (!add_to_fourcc(token[0], token[1], + codec->fourcc, + codec->fourccmap)) + goto err_out_print_linenum; + } else if (!strcmp(token[0], "format")) { + if (get_token(1, 2) < 0) + goto err_out_parse_error; + if (!add_to_format(token[0], token[1], + codec->fourcc,codec->fourccmap)) + goto err_out_print_linenum; + } else if (!strcmp(token[0], "driver")) { + if (get_token(1, 1) < 0) + goto err_out_parse_error; + if (!(codec->drv = strdup(token[0]))) { + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupDriver, strerror(errno)); + goto err_out; + } + } else if (!strcmp(token[0], "dll")) { + if (get_token(1, 1) < 0) + goto err_out_parse_error; + if (!(codec->dll = strdup(token[0]))) { + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CantStrdupDLL, strerror(errno)); + goto err_out; + } + } else if (!strcmp(token[0], "guid")) { + if (get_token(11, 11) < 0) + goto err_out_parse_error; + codec->guid.f1=strtoul(token[0],&endptr,0); + if ((*endptr != ',' || *(endptr + 1) != '\0') && + *endptr != '\0') + goto err_out_parse_error; + codec->guid.f2=strtoul(token[1],&endptr,0); + if ((*endptr != ',' || *(endptr + 1) != '\0') && + *endptr != '\0') + goto err_out_parse_error; + codec->guid.f3=strtoul(token[2],&endptr,0); + if ((*endptr != ',' || *(endptr + 1) != '\0') && + *endptr != '\0') + goto err_out_parse_error; + for (i = 0; i < 8; i++) { + codec->guid.f4[i]=strtoul(token[i + 3],&endptr,0); + if ((*endptr != ',' || *(endptr + 1) != '\0') && + *endptr != '\0') + goto err_out_parse_error; + } + } else if (!strcmp(token[0], "out")) { + if (get_token(1, 2) < 0) + goto err_out_parse_error; + if (!add_to_inout(token[0], token[1], codec->outfmt, + codec->outflags)) + goto err_out_print_linenum; + } else if (!strcmp(token[0], "in")) { + if (get_token(1, 2) < 0) + goto err_out_parse_error; + if (!add_to_inout(token[0], token[1], codec->infmt, + codec->inflags)) + goto err_out_print_linenum; + } else if (!strcmp(token[0], "flags")) { + if (get_token(1, 1) < 0) + goto err_out_parse_error; + if (!strcmp(token[0], "seekable")) + codec->flags |= CODECS_FLAG_SEEKABLE; + else + if (!strcmp(token[0], "align16")) + codec->flags |= CODECS_FLAG_ALIGN16; + else + goto err_out_parse_error; + } else if (!strcmp(token[0], "status")) { + if (get_token(1, 1) < 0) + goto err_out_parse_error; + if (!strcasecmp(token[0], "working")) + codec->status = CODECS_STATUS_WORKING; + else if (!strcasecmp(token[0], "crashing")) + codec->status = CODECS_STATUS_NOT_WORKING; + else if (!strcasecmp(token[0], "untested")) + codec->status = CODECS_STATUS_UNTESTED; + else if (!strcasecmp(token[0], "buggy")) + codec->status = CODECS_STATUS_PROBLEMS; + else + goto err_out_parse_error; + } else if (!strcmp(token[0], "cpuflags")) { + if (get_token(1, 1) < 0) + goto err_out_parse_error; + if (!(codec->cpuflags = get_cpuflags(token[0]))) + goto err_out_parse_error; + } else + goto err_out_parse_error; + } + if (!validate_codec(codec, codec_type)) + goto err_out_not_valid; + mp_msg(MSGT_CODECCFG,MSGL_INFO,MSGTR_AudioVideoCodecTotals, nr_acodecs, nr_vcodecs); + if(video_codecs) video_codecs[nr_vcodecs].name = NULL; + if(audio_codecs) audio_codecs[nr_acodecs].name = NULL; out: - free(line); - line=NULL; - fclose(fp); - return 1; + free(line); + line=NULL; + fclose(fp); + return 1; err_out_parse_error: - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError); + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_ParseError); err_out_print_linenum: - PRINT_LINENUM; + PRINT_LINENUM; err_out: - codecs_uninit_free(); + codecs_uninit_free(); - free(line); - line=NULL; - line_num = 0; - fclose(fp); - return 0; + free(line); + line=NULL; + line_num = 0; + fclose(fp); + return 0; err_out_not_valid: - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecDefinitionIncorrect); - goto err_out_print_linenum; + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_CodecDefinitionIncorrect); + goto err_out_print_linenum; err_out_release_num: - mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_OutdatedCodecsConf); - goto err_out_print_linenum; + mp_msg(MSGT_CODECCFG,MSGL_ERR,MSGTR_OutdatedCodecsConf); + goto err_out_print_linenum; } static void codecs_free(codecs_t* codecs,int count) { - int i; - for ( i = 0; i < count; i++) - if ( codecs[i].name ) { - if( codecs[i].name ) - free(codecs[i].name); - if( codecs[i].info ) - free(codecs[i].info); - if( codecs[i].comment ) - free(codecs[i].comment); - if( codecs[i].dll ) - free(codecs[i].dll); - if( codecs[i].drv ) - free(codecs[i].drv); - } - if (codecs) - free(codecs); + int i; + for ( i = 0; i < count; i++) + if ( codecs[i].name ) { + if( codecs[i].name ) + free(codecs[i].name); + if( codecs[i].info ) + free(codecs[i].info); + if( codecs[i].comment ) + free(codecs[i].comment); + if( codecs[i].dll ) + free(codecs[i].dll); + if( codecs[i].drv ) + free(codecs[i].drv); + } + if (codecs) + free(codecs); } void codecs_uninit_free(void) { - if (video_codecs) - codecs_free(video_codecs,nr_vcodecs); - video_codecs=NULL; - if (audio_codecs) - codecs_free(audio_codecs,nr_acodecs); - audio_codecs=NULL; + if (video_codecs) + codecs_free(video_codecs,nr_vcodecs); + video_codecs=NULL; + if (audio_codecs) + codecs_free(audio_codecs,nr_acodecs); + audio_codecs=NULL; } codecs_t *find_audio_codec(unsigned int fourcc, unsigned int *fourccmap, - codecs_t *start, int force) + codecs_t *start, int force) { - return find_codec(fourcc, fourccmap, start, 1, force); + return find_codec(fourcc, fourccmap, start, 1, force); } codecs_t *find_video_codec(unsigned int fourcc, unsigned int *fourccmap, - codecs_t *start, int force) + codecs_t *start, int force) { - return find_codec(fourcc, fourccmap, start, 0, force); + return find_codec(fourcc, fourccmap, start, 0, force); } codecs_t* find_codec(unsigned int fourcc,unsigned int *fourccmap, - codecs_t *start, int audioflag, int force) + codecs_t *start, int audioflag, int force) { - int i, j; - codecs_t *c; + int i, j; + codecs_t *c; #if 0 - if (start) { - for (/* NOTHING */; start->name; start++) { - for (j = 0; j < CODECS_MAX_FOURCC; j++) { - if (start->fourcc[j] == fourcc) { - if (fourccmap) - *fourccmap = start->fourccmap[j]; - return start; - } - } - } - } else + if (start) { + for (/* NOTHING */; start->name; start++) { + for (j = 0; j < CODECS_MAX_FOURCC; j++) { + if (start->fourcc[j] == fourcc) { + if (fourccmap) + *fourccmap = start->fourccmap[j]; + return start; + } + } + } + } else #endif - { - if (audioflag) { - i = nr_acodecs; - c = audio_codecs; - } else { - i = nr_vcodecs; - c = video_codecs; - } - if(!i) return NULL; - for (/* NOTHING */; i--; c++) { - if(start && c<=start) continue; - for (j = 0; j < CODECS_MAX_FOURCC; j++) { - // FIXME: do NOT hardwire 'null' name here: - if (c->fourcc[j]==fourcc || !strcmp(c->drv,"null")) { - if (fourccmap) - *fourccmap = c->fourccmap[j]; - return c; - } - } - if (force) return c; - } - } - return NULL; + { + if (audioflag) { + i = nr_acodecs; + c = audio_codecs; + } else { + i = nr_vcodecs; + c = video_codecs; + } + if(!i) return NULL; + for (/* NOTHING */; i--; c++) { + if(start && c<=start) continue; + for (j = 0; j < CODECS_MAX_FOURCC; j++) { + // FIXME: do NOT hardwire 'null' name here: + if (c->fourcc[j]==fourcc || !strcmp(c->drv,"null")) { + if (fourccmap) + *fourccmap = c->fourccmap[j]; + return c; + } + } + if (force) return c; + } + } + return NULL; } void stringset_init(stringset_t *set) { - *set = calloc(1, sizeof(char *)); + *set = calloc(1, sizeof(char *)); } void stringset_free(stringset_t *set) { - int count = 0; - while ((*set)[count]) free((*set)[count++]); - free(*set); - *set = NULL; + int count = 0; + while ((*set)[count]) free((*set)[count++]); + free(*set); + *set = NULL; } void stringset_add(stringset_t *set, const char *str) { - int count = 0; - while ((*set)[count]) count++; - count++; - *set = realloc(*set, sizeof(char *) * (count + 1)); - (*set)[count - 1] = strdup(str); - (*set)[count] = NULL; + int count = 0; + while ((*set)[count]) count++; + count++; + *set = realloc(*set, sizeof(char *) * (count + 1)); + (*set)[count - 1] = strdup(str); + (*set)[count] = NULL; } int stringset_test(stringset_t *set, const char *str) { - stringset_t s; - for (s = *set; *s; s++) - if (strcmp(*s, str) == 0) - return 1; - return 0; + stringset_t s; + for (s = *set; *s; s++) + if (strcmp(*s, str) == 0) + return 1; + return 0; } void list_codecs(int audioflag){ - int i; - codecs_t *c; - - if (audioflag) { - i = nr_acodecs; - c = audio_codecs; - mp_msg(MSGT_CODECCFG,MSGL_INFO,"ac: afm: status: info: [lib/dll]\n"); - } else { - i = nr_vcodecs; - c = video_codecs; - mp_msg(MSGT_CODECCFG,MSGL_INFO,"vc: vfm: status: info: [lib/dll]\n"); - } - if(!i) return; - for (/* NOTHING */; i--; c++) { - char* s="unknown "; - switch(c->status){ - case CODECS_STATUS_WORKING: s="working ";break; - case CODECS_STATUS_PROBLEMS: s="problems";break; - case CODECS_STATUS_NOT_WORKING: s="crashing";break; - case CODECS_STATUS_UNTESTED: s="untested";break; - } - if(c->dll) - mp_msg(MSGT_CODECCFG,MSGL_INFO,"%-11s %-9s %s %s [%s]\n",c->name,c->drv,s,c->info,c->dll); - else - mp_msg(MSGT_CODECCFG,MSGL_INFO,"%-11s %-9s %s %s\n",c->name,c->drv,s,c->info); - - } + int i; + codecs_t *c; + if (audioflag) { + i = nr_acodecs; + c = audio_codecs; + mp_msg(MSGT_CODECCFG,MSGL_INFO,"ac: afm: status: info: [lib/dll]\n"); + } else { + i = nr_vcodecs; + c = video_codecs; + mp_msg(MSGT_CODECCFG,MSGL_INFO,"vc: vfm: status: info: [lib/dll]\n"); + } + if(!i) return; + for (/* NOTHING */; i--; c++) { + char* s="unknown "; + switch(c->status){ + case CODECS_STATUS_WORKING: s="working ";break; + case CODECS_STATUS_PROBLEMS: s="problems";break; + case CODECS_STATUS_NOT_WORKING: s="crashing";break; + case CODECS_STATUS_UNTESTED: s="untested";break; + } + if(c->dll) + mp_msg(MSGT_CODECCFG,MSGL_INFO,"%-11s %-9s %s %s [%s]\n",c->name,c->drv,s,c->info,c->dll); + else + mp_msg(MSGT_CODECCFG,MSGL_INFO,"%-11s %-9s %s %s\n",c->name,c->drv,s,c->info); + } } - #ifdef CODECS2HTML -void wrapline(FILE *f2,char *s){ +static void wrapline(FILE *f2,char *s){ int c; if(!s){ fprintf(f2,"-"); @@ -897,252 +931,253 @@ } } -void parsehtml(FILE *f1,FILE *f2,codecs_t *codec,int section,int dshow){ - int c,d; - while((c=fgetc(f1))>=0){ - if(c!='%'){ - fputc(c,f2); - continue; - } - d=fgetc(f1); - - switch(d){ - case '.': - return; // end of section - case 'n': - wrapline(f2,codec->name); break; - case 'i': - wrapline(f2,codec->info); break; - case 'c': - wrapline(f2,codec->comment); break; - case 'd': - wrapline(f2,codec->dll); break; - case 'D': - fprintf(f2,"%c",!strcmp(codec->drv,"dshow")?'+':'-'); break; - case 'F': - for(d=0;dfourcc[d]!=0xFFFFFFFF) - fprintf(f2,"%s%.4s",d?"
":"",(codec->fourcc[d]==0xFFFFFFFF || codec->fourcc[d]<0x20202020)?!d?"-":"":(char*) &codec->fourcc[d]); - break; - case 'f': - for(d=0;dfourcc[d]!=0xFFFFFFFF) - fprintf(f2,"%s0x%X",d?"
":"",codec->fourcc[d]); - break; - case 'Y': - for(d=0;doutfmt[d]!=0xFFFFFFFF){ - for (c=0; fmt_table[c].name; c++) - if(fmt_table[c].num==codec->outfmt[d]) break; - if(fmt_table[c].name) - fprintf(f2,"%s%s",d?"
":"",fmt_table[c].name); - } - break; - default: - fputc(c,f2); - fputc(d,f2); - } +static void parsehtml(FILE *f1,FILE *f2,codecs_t *codec){ + int c,d; + while((c=fgetc(f1))>=0){ + if(c!='%'){ + fputc(c,f2); + continue; } + d=fgetc(f1); + switch(d){ + case '.': + return; // end of section + case 'n': + wrapline(f2,codec->name); break; + case 'i': + wrapline(f2,codec->info); break; + case 'c': + wrapline(f2,codec->comment); break; + case 'd': + wrapline(f2,codec->dll); break; + case 'D': + fprintf(f2,"%c",!strcmp(codec->drv,"dshow")?'+':'-'); break; + case 'F': + for(d=0;dfourcc[d]!=0xFFFFFFFF) + fprintf(f2,"%s%.4s",d?"
":"",(codec->fourcc[d]==0xFFFFFFFF || codec->fourcc[d]<0x20202020)?!d?"-":"":(char*) &codec->fourcc[d]); + break; + case 'f': + for(d=0;dfourcc[d]!=0xFFFFFFFF) + fprintf(f2,"%s0x%X",d?"
":"",codec->fourcc[d]); + break; + case 'Y': + for(d=0;doutfmt[d]!=0xFFFFFFFF){ + for (c=0; fmt_table[c].name; c++) + if(fmt_table[c].num==codec->outfmt[d]) break; + if(fmt_table[c].name) + fprintf(f2,"%s%s",d?"
":"",fmt_table[c].name); + } + break; + default: + fputc(c,f2); + fputc(d,f2); + } + } } void skiphtml(FILE *f1){ - int c,d; - while((c=fgetc(f1))>=0){ - if(c!='%'){ - continue; - } - d=fgetc(f1); - if(d=='.') return; // end of section + int c,d; + while((c=fgetc(f1))>=0){ + if(c!='%'){ + continue; } + d=fgetc(f1); + if(d=='.') return; // end of section + } } -static void print_int_array(const int* a, int size) +static void print_int_array(const unsigned int* a, int size) { - printf("{ "); - while (size--) - if(abs(*a)<256) - printf("%d%s", *a++, size?", ":""); - else - printf("0x%X%s", *a++, size?", ":""); - printf(" }"); + printf("{ "); + while (size--) + if(abs(*a)<256) + printf("%d%s", *a++, size?", ":""); + else + printf("0x%X%s", *a++, size?", ":""); + printf(" }"); } static void print_char_array(const unsigned char* a, int size) { - printf("{ "); - while (size--) - if((*a)<10) - printf("%d%s", *a++, size?", ":""); - else - printf("0x%02x%s", *a++, size?", ":""); - printf(" }"); + printf("{ "); + while (size--) + if((*a)<10) + printf("%d%s", *a++, size?", ":""); + else + printf("0x%02x%s", *a++, size?", ":""); + printf(" }"); } static void print_string(const char* s) { - if (!s) printf("NULL"); - else printf("\"%s\"", s); + if (!s) printf("NULL"); + else printf("\"%s\"", s); } int main(int argc, char* argv[]) { - codecs_t *cl; - FILE *f1; - FILE *f2; - int c,d,i; - int pos; - int section=-1; - int nr_codecs; - int win32=-1; - int dshow=-1; - int win32ex=-1; - - /* - * Take path to codecs.conf from command line, or fall back on - * etc/codecs.conf - */ - if (!(nr_codecs = parse_codec_cfg((argc>1)?argv[1]:"etc/codecs.conf"))) - exit(1); - - if (argc > 1) { - int i, j; - const char* nm[2]; - codecs_t* cod[2]; - int nr[2]; - - nm[0] = "builtin_video_codecs"; - cod[0] = video_codecs; - nr[0] = nr_vcodecs; - - nm[1] = "builtin_audio_codecs"; - cod[1] = audio_codecs; - nr[1] = nr_acodecs; - - printf("/* GENERATED FROM %s, DO NOT EDIT! */\n\n",argv[1]); - printf("#include \n",argv[1]); - printf("#include \"codec-cfg.h\"\n\n",argv[1]); - - for (i=0; i<2; i++) { - printf("const codecs_t %s[] = {\n", nm[i]); - for (j = 0; j < nr[i]; j++) { - printf("{"); - - print_int_array(cod[i][j].fourcc, CODECS_MAX_FOURCC); - printf(", /* fourcc */\n"); - - print_int_array(cod[i][j].fourccmap, CODECS_MAX_FOURCC); - printf(", /* fourccmap */\n"); - - print_int_array(cod[i][j].outfmt, CODECS_MAX_OUTFMT); - printf(", /* outfmt */\n"); - - print_char_array(cod[i][j].outflags, CODECS_MAX_OUTFMT); - printf(", /* outflags */\n"); - - print_int_array(cod[i][j].infmt, CODECS_MAX_INFMT); - printf(", /* infmt */\n"); - - print_char_array(cod[i][j].inflags, CODECS_MAX_INFMT); - printf(", /* inflags */\n"); - - print_string(cod[i][j].name); printf(", /* name */\n"); - print_string(cod[i][j].info); printf(", /* info */\n"); - print_string(cod[i][j].comment); printf(", /* comment */\n"); - print_string(cod[i][j].dll); printf(", /* dll */\n"); - print_string(cod[i][j].drv); printf(", /* drv */\n"); - - printf("{ 0x%08lx, %hu, %hu,", - cod[i][j].guid.f1, - cod[i][j].guid.f2, - cod[i][j].guid.f3); - print_char_array(cod[i][j].guid.f4, sizeof(cod[i][j].guid.f4)); - printf(" }, /* GUID */\n"); - printf("%hd /* flags */, %hd /* status */, %hd /* cpuflags */ }\n", - cod[i][j].flags, - cod[i][j].status, - cod[i][j].cpuflags); - if (j < nr[i]) printf(",\n"); - } - printf("};\n\n"); - } - exit(0); - } - - f1=fopen("DOCS/tech/codecs-in.html","rb"); if(!f1) exit(1); - f2=fopen("DOCS/codecs-status.html","wb"); if(!f2) exit(1); - - while((c=fgetc(f1))>=0){ - if(c!='%'){ - fputc(c,f2); - continue; + codecs_t *cl; + FILE *f1; + FILE *f2; + int c,d,i; + int pos; + int section=-1; + int nr_codecs; + int win32=-1; + int dshow=-1; + int win32ex=-1; + + /* + * Take path to codecs.conf from command line, or fall back on + * etc/codecs.conf + */ + if (!(nr_codecs = parse_codec_cfg((argc>1)?argv[1]:"etc/codecs.conf"))) + exit(1); + if (codecs_conf_release < CODEC_CFG_MIN) + exit(1); + + if (argc > 1) { + int i, j; + const char* nm[2]; + codecs_t* cod[2]; + int nr[2]; + + nm[0] = "builtin_video_codecs"; + cod[0] = video_codecs; + nr[0] = nr_vcodecs; + + nm[1] = "builtin_audio_codecs"; + cod[1] = audio_codecs; + nr[1] = nr_acodecs; + + printf("/* GENERATED FROM %s, DO NOT EDIT! */\n\n",argv[1]); + printf("#include \n"); + printf("#include \"codec-cfg.h\"\n\n"); + printf("#define CODEC_CFG_MIN %i\n\n", codecs_conf_release); + + for (i=0; i<2; i++) { + printf("const codecs_t %s[] = {\n", nm[i]); + for (j = 0; j < nr[i]; j++) { + printf("{"); + + print_int_array(cod[i][j].fourcc, CODECS_MAX_FOURCC); + printf(", /* fourcc */\n"); + + print_int_array(cod[i][j].fourccmap, CODECS_MAX_FOURCC); + printf(", /* fourccmap */\n"); + + print_int_array(cod[i][j].outfmt, CODECS_MAX_OUTFMT); + printf(", /* outfmt */\n"); + + print_char_array(cod[i][j].outflags, CODECS_MAX_OUTFMT); + printf(", /* outflags */\n"); + + print_int_array(cod[i][j].infmt, CODECS_MAX_INFMT); + printf(", /* infmt */\n"); + + print_char_array(cod[i][j].inflags, CODECS_MAX_INFMT); + printf(", /* inflags */\n"); + + print_string(cod[i][j].name); printf(", /* name */\n"); + print_string(cod[i][j].info); printf(", /* info */\n"); + print_string(cod[i][j].comment); printf(", /* comment */\n"); + print_string(cod[i][j].dll); printf(", /* dll */\n"); + print_string(cod[i][j].drv); printf(", /* drv */\n"); + + printf("{ 0x%08lx, %hu, %hu,", + cod[i][j].guid.f1, + cod[i][j].guid.f2, + cod[i][j].guid.f3); + print_char_array(cod[i][j].guid.f4, sizeof(cod[i][j].guid.f4)); + printf(" }, /* GUID */\n"); + printf("%hd /* flags */, %hd /* status */, %hd /* cpuflags */ }\n", + cod[i][j].flags, + cod[i][j].status, + cod[i][j].cpuflags); + if (j < nr[i]) printf(",\n"); } - d=fgetc(f1); - if(d>='0' && d<='9'){ - // begin section - section=d-'0'; - //printf("BEGIN %d\n",section); - if(section>=5){ - // audio - cl = audio_codecs; - nr_codecs = nr_acodecs; - dshow=7;win32=4; - } else { - // video - cl = video_codecs; - nr_codecs = nr_vcodecs; - dshow=4;win32=2;win32ex=6; - } - pos=ftell(f1); - for(i=0;i=0){ + if(c!='%'){ + fputc(c,f2); + continue; + } + d=fgetc(f1); + if(d>='0' && d<='9'){ + // begin section + section=d-'0'; + //printf("BEGIN %d\n",section); + if(section>=5){ + // audio + cl = audio_codecs; + nr_codecs = nr_acodecs; + dshow=7;win32=4; + } else { + // video + cl = video_codecs; + nr_codecs = nr_vcodecs; + dshow=4;win32=2;win32ex=6; + } + pos=ftell(f1); + for(i=0;iname); - printf("info='%s'\n",c->info); - printf("comment='%s'\n",c->comment); - printf("dll='%s'\n",c->dll); - /* printf("flags=%X driver=%d status=%d cpuflags=%d\n", - c->flags, c->driver, c->status, c->cpuflags); */ - printf("flags=%X status=%d cpuflags=%d\n", - c->flags, c->status, c->cpuflags); - - for(j=0;jfourcc[j]!=0xFFFFFFFF){ - printf("fourcc %02d: %08X (%.4s) ===> %08X (%.4s)\n",j,c->fourcc[j],(char *) &c->fourcc[j],c->fourccmap[j],(char *) &c->fourccmap[j]); - } - } - - for(j=0;joutfmt[j]!=0xFFFFFFFF){ - printf("outfmt %02d: %08X (%.4s) flags: %d\n",j,c->outfmt[j],(char *) &c->outfmt[j],c->outflags[j]); - } - } - - for(j=0;jinfmt[j]!=0xFFFFFFFF){ - printf("infmt %02d: %08X (%.4s) flags: %d\n",j,c->infmt[j],(char *) &c->infmt[j],c->inflags[j]); - } - } - - printf("GUID: %08lX %04X %04X",c->guid.f1,c->guid.f2,c->guid.f3); - for(j=0;j<8;j++) printf(" %02X",c->guid.f4[j]); - printf("\n"); - - - } - } - if (!state) { - printf("audiocodecs:\n"); - c = audio_codecs; - nr_codecs = nr_acodecs; - state = 1; - goto next; - } - return 0; + if (c) { + printf("number of %scodecs: %d\n", state==0?"video":"audio", + nr_codecs); + for(i=0;iname); + printf("info='%s'\n",c->info); + printf("comment='%s'\n",c->comment); + printf("dll='%s'\n",c->dll); + /* printf("flags=%X driver=%d status=%d cpuflags=%d\n", + c->flags, c->driver, c->status, c->cpuflags); */ + printf("flags=%X status=%d cpuflags=%d\n", + c->flags, c->status, c->cpuflags); + + for(j=0;jfourcc[j]!=0xFFFFFFFF){ + printf("fourcc %02d: %08X (%.4s) ===> %08X (%.4s)\n",j,c->fourcc[j],(char *) &c->fourcc[j],c->fourccmap[j],(char *) &c->fourccmap[j]); + } + } + + for(j=0;joutfmt[j]!=0xFFFFFFFF){ + printf("outfmt %02d: %08X (%.4s) flags: %d\n",j,c->outfmt[j],(char *) &c->outfmt[j],c->outflags[j]); + } + } + + for(j=0;jinfmt[j]!=0xFFFFFFFF){ + printf("infmt %02d: %08X (%.4s) flags: %d\n",j,c->infmt[j],(char *) &c->infmt[j],c->inflags[j]); + } + } + + printf("GUID: %08lX %04X %04X",c->guid.f1,c->guid.f2,c->guid.f3); + for(j=0;j<8;j++) printf(" %02X",c->guid.f4[j]); + printf("\n"); + + + } + } + if (!state) { + printf("audiocodecs:\n"); + c = audio_codecs; + nr_codecs = nr_acodecs; + state = 1; + goto next; + } + return 0; } #endif diff -Nru mplayer-1.0~rc3+svn20090426/codec-cfg.h mplayer-1.0~rc4.dfsg1/codec-cfg.h --- mplayer-1.0~rc3+svn20090426/codec-cfg.h 2008-07-30 03:27:17.000000000 +0000 +++ mplayer-1.0~rc4.dfsg1/codec-cfg.h 2010-06-19 18:31:35.000000000 +0000 @@ -1,60 +1,79 @@ +/* + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #ifndef MPLAYER_CODEC_CFG_H #define MPLAYER_CODEC_CFG_H -#define CODEC_CFG_MIN 20070407 - -#define CODECS_MAX_FOURCC 92 -#define CODECS_MAX_OUTFMT 16 -#define CODECS_MAX_INFMT 16 +#define CODECS_MAX_FOURCC 92 +#define CODECS_MAX_OUTFMT 16 +#define CODECS_MAX_INFMT 16 // Global flags: -#define CODECS_FLAG_SEEKABLE (1<<0) -#define CODECS_FLAG_ALIGN16 (1<<1) +#define CODECS_FLAG_SEEKABLE (1<<0) +#define CODECS_FLAG_ALIGN16 (1<<1) // Outfmt flags: -#define CODECS_FLAG_FLIP (1<<0) -#define CODECS_FLAG_NOFLIP (1<<1) -#define CODECS_FLAG_YUVHACK (1<<2) -#define CODECS_FLAG_QUERY (1<<3) -#define CODECS_FLAG_STATIC (1<<4) - -#define CODECS_STATUS__MIN 0 -#define CODECS_STATUS_NOT_WORKING -1 -#define CODECS_STATUS_PROBLEMS 0 -#define CODECS_STATUS_WORKING 1 -#define CODECS_STATUS_UNTESTED 2 -#define CODECS_STATUS__MAX 2 +#define CODECS_FLAG_FLIP (1<<0) +#define CODECS_FLAG_NOFLIP (1<<1) +#define CODECS_FLAG_YUVHACK (1<<2) +#define CODECS_FLAG_QUERY (1<<3) +#define CODECS_FLAG_STATIC (1<<4) + +#define CODECS_STATUS__MIN 0 +#define CODECS_STATUS_NOT_WORKING -1 +#define CODECS_STATUS_PROBLEMS 0 +#define CODECS_STATUS_WORKING 1 +#define CODECS_STATUS_UNTESTED 2 +#define CODECS_STATUS__MAX 2 + + +extern char *codecs_file; #if !defined(GUID_TYPE) && !defined(GUID_DEFINED) -#define GUID_TYPE 1 +#define GUID_TYPE 1 #define GUID_DEFINED 1 typedef struct { - unsigned long f1; - unsigned short f2; - unsigned short f3; - unsigned char f4[8]; + unsigned long f1; + unsigned short f2; + unsigned short f3; + unsigned char f4[8]; } GUID; #endif -typedef struct codecs_st { - unsigned int fourcc[CODECS_MAX_FOURCC]; - unsigned int fourccmap[CODECS_MAX_FOURCC]; - unsigned int outfmt[CODECS_MAX_OUTFMT]; - unsigned char outflags[CODECS_MAX_OUTFMT]; - unsigned int infmt[CODECS_MAX_INFMT]; - unsigned char inflags[CODECS_MAX_INFMT]; - char *name; - char *info; - char *comment; - char *dll; - char* drv; - GUID guid; -// short driver; - short flags; - short status; - short cpuflags; +typedef struct codecs { + unsigned int fourcc[CODECS_MAX_FOURCC]; + unsigned int fourccmap[CODECS_MAX_FOURCC]; + unsigned int outfmt[CODECS_MAX_OUTFMT]; + unsigned char outflags[CODECS_MAX_OUTFMT]; + unsigned int infmt[CODECS_MAX_INFMT]; + unsigned char inflags[CODECS_MAX_INFMT]; + char *name; + char *info; + char *comment; + char *dll; + char* drv; + GUID guid; +// short driver; + short flags; + short status; + short cpuflags; } codecs_t; int parse_codec_cfg(const char *cfgfile); diff -Nru mplayer-1.0~rc3+svn20090426/command.c mplayer-1.0~rc4.dfsg1/command.c --- mplayer-1.0~rc3+svn20090426/command.c 2009-01-31 01:09:49.000000000 +0000 +++ mplayer-1.0~rc4.dfsg1/command.c 2010-06-13 11:34:14.000000000 +0000 @@ -1,3 +1,21 @@ +/* + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #include #include #include @@ -25,38 +43,24 @@ #include "mpcommon.h" #include "mixer.h" #include "libmpcodecs/dec_video.h" +#include "libmpcodecs/dec_teletext.h" #include "vobsub.h" #include "spudec.h" -#include "get_path.h" -#ifdef CONFIG_TV +#include "path.h" #include "stream/tv.h" -#endif -#ifdef CONFIG_RADIO #include "stream/stream_radio.h" -#endif -#ifdef CONFIG_PVR #include "stream/pvr.h" -#endif #ifdef CONFIG_DVBIN #include "stream/dvbin.h" #endif #ifdef CONFIG_DVDREAD #include "stream/stream_dvd.h" #endif -#ifdef CONFIG_DVDNAV #include "stream/stream_dvdnav.h" -#endif -#ifdef CONFIG_ASS -#include "libass/ass.h" #include "libass/ass_mp.h" -#endif -#ifdef CONFIG_MENU #include "m_struct.h" #include "libmenu/menu.h" -#endif -#ifdef CONFIG_GUI #include "gui/interface.h" -#endif #include "mp_core.h" #include "mp_fifo.h" @@ -69,47 +73,47 @@ static void rescale_input_coordinates(int ix, int iy, double *dx, double *dy) { //remove the borders, if any, and rescale to the range [0,1],[0,1] - if (vo_fs) { //we are in full-screen mode - if (vo_screenwidth > vo_dwidth) //there are borders along the x axis - ix -= (vo_screenwidth - vo_dwidth) / 2; - if (vo_screenheight > vo_dheight) //there are borders along the y axis (usual way) - iy -= (vo_screenheight - vo_dheight) / 2; - - if (ix < 0 || ix > vo_dwidth) { - *dx = *dy = -1.0; - return; - } //we are on one of the borders - if (iy < 0 || iy > vo_dheight) { - *dx = *dy = -1.0; - return; - } //we are on one of the borders + if (vo_fs) { //we are in full-screen mode + if (vo_screenwidth > vo_dwidth) //there are borders along the x axis + ix -= (vo_screenwidth - vo_dwidth) / 2; + if (vo_screenheight > vo_dheight) //there are borders along the y axis (usual way) + iy -= (vo_screenheight - vo_dheight) / 2; + + if (ix < 0 || ix > vo_dwidth) { + *dx = *dy = -1.0; + return; + } //we are on one of the borders + if (iy < 0 || iy > vo_dheight) { + *dx = *dy = -1.0; + return; + } //we are on one of the borders } *dx = (double) ix / (double) vo_dwidth; *dy = (double) iy / (double) vo_dheight; mp_msg(MSGT_CPLAYER, MSGL_V, - "\r\nrescaled coordinates: %.3lf, %.3lf, screen (%d x %d), vodisplay: (%d, %d), fullscreen: %d\r\n", - *dx, *dy, vo_screenwidth, vo_screenheight, vo_dwidth, - vo_dheight, vo_fs); + "\r\nrescaled coordinates: %.3lf, %.3lf, screen (%d x %d), vodisplay: (%d, %d), fullscreen: %d\r\n", + *dx, *dy, vo_screenwidth, vo_screenheight, vo_dwidth, + vo_dheight, vo_fs); } -static int sub_source_by_pos(MPContext * mpctx, int pos) +static int sub_source_by_pos(MPContext *mpctx, int pos) { int source = -1; int top = -1; int i; for (i = 0; i < SUB_SOURCES; i++) { - int j = mpctx->global_sub_indices[i]; - if ((j >= 0) && (j > top) && (pos >= j)) { - source = i; - top = j; - } + int j = mpctx->global_sub_indices[i]; + if ((j >= 0) && (j > top) && (pos >= j)) { + source = i; + top = j; + } } return source; } -static int sub_source(MPContext * mpctx) +static int sub_source(MPContext *mpctx) { return sub_source_by_pos(mpctx, mpctx->global_sub_pos); } @@ -131,26 +135,26 @@ int i; if (subdata == NULL || vo_sub_last == NULL) - return; + return; fname = get_path("subtitle_log"); f = fopen(fname, "a"); if (!f) - return; + return; fprintf(f, "----------------------------------------------------------\n"); if (subdata->sub_uses_time) { - fprintf(f, - "N: %s S: %02ld:%02ld:%02ld.%02ld E: %02ld:%02ld:%02ld.%02ld\n", - filename, vo_sub_last->start / 360000, - (vo_sub_last->start / 6000) % 60, - (vo_sub_last->start / 100) % 60, vo_sub_last->start % 100, - vo_sub_last->end / 360000, (vo_sub_last->end / 6000) % 60, - (vo_sub_last->end / 100) % 60, vo_sub_last->end % 100); + fprintf(f, + "N: %s S: %02ld:%02ld:%02ld.%02ld E: %02ld:%02ld:%02ld.%02ld\n", + filename, vo_sub_last->start / 360000, + (vo_sub_last->start / 6000) % 60, + (vo_sub_last->start / 100) % 60, vo_sub_last->start % 100, + vo_sub_last->end / 360000, (vo_sub_last->end / 6000) % 60, + (vo_sub_last->end / 100) % 60, vo_sub_last->end % 100); } else { - fprintf(f, "N: %s S: %ld E: %ld\n", filename, vo_sub_last->start, - vo_sub_last->end); + fprintf(f, "N: %s S: %ld E: %ld\n", filename, vo_sub_last->start, + vo_sub_last->end); } for (i = 0; i < vo_sub_last->lines; i++) { - fprintf(f, "%s\n", vo_sub_last->text[i]); + fprintf(f, "%s\n", vo_sub_last->text[i]); } fclose(f); } @@ -164,15 +168,15 @@ ///@{ /// OSD level (RW) -static int mp_property_osdlevel(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_osdlevel(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { return m_property_choice(prop, action, arg, &osd_level); } /// Loop (RW) -static int mp_property_loop(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_loop(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { switch (action) { case M_PROPERTY_PRINT: @@ -189,142 +193,142 @@ } /// Playback speed (RW) -static int mp_property_playback_speed(m_option_t * prop, int action, - void *arg, MPContext * mpctx) +static int mp_property_playback_speed(m_option_t *prop, int action, + void *arg, MPContext *mpctx) { switch (action) { case M_PROPERTY_SET: - if (!arg) - return M_PROPERTY_ERROR; - M_PROPERTY_CLAMP(prop, *(float *) arg); - playback_speed = *(float *) arg; - build_afilter_chain(mpctx->sh_audio, &ao_data); - return M_PROPERTY_OK; + if (!arg) + return M_PROPERTY_ERROR; + M_PROPERTY_CLAMP(prop, *(float *) arg); + playback_speed = *(float *) arg; + build_afilter_chain(mpctx->sh_audio, &ao_data); + return M_PROPERTY_OK; case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: - playback_speed += (arg ? *(float *) arg : 0.1) * - (action == M_PROPERTY_STEP_DOWN ? -1 : 1); - M_PROPERTY_CLAMP(prop, playback_speed); - build_afilter_chain(mpctx->sh_audio, &ao_data); - return M_PROPERTY_OK; + playback_speed += (arg ? *(float *) arg : 0.1) * + (action == M_PROPERTY_STEP_DOWN ? -1 : 1); + M_PROPERTY_CLAMP(prop, playback_speed); + build_afilter_chain(mpctx->sh_audio, &ao_data); + return M_PROPERTY_OK; } return m_property_float_range(prop, action, arg, &playback_speed); } /// filename with path (RO) -static int mp_property_path(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_path(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { return m_property_string_ro(prop, action, arg, filename); } /// filename without path (RO) -static int mp_property_filename(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_filename(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { char *f; if (!filename) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; if (((f = strrchr(filename, '/')) || (f = strrchr(filename, '\\'))) && f[1]) - f++; + f++; else - f = filename; + f = filename; return m_property_string_ro(prop, action, arg, f); } /// Demuxer name (RO) -static int mp_property_demuxer(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_demuxer(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { if (!mpctx->demuxer) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; return m_property_string_ro(prop, action, arg, - (char *) mpctx->demuxer->desc->name); + (char *) mpctx->demuxer->desc->name); } /// Position in the stream (RW) -static int mp_property_stream_pos(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_stream_pos(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { if (!mpctx->demuxer || !mpctx->demuxer->stream) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; if (!arg) - return M_PROPERTY_ERROR; + return M_PROPERTY_ERROR; switch (action) { case M_PROPERTY_GET: - *(off_t *) arg = stream_tell(mpctx->demuxer->stream); - return M_PROPERTY_OK; + *(off_t *) arg = stream_tell(mpctx->demuxer->stream); + return M_PROPERTY_OK; case M_PROPERTY_SET: - M_PROPERTY_CLAMP(prop, *(off_t *) arg); - stream_seek(mpctx->demuxer->stream, *(off_t *) arg); - return M_PROPERTY_OK; + M_PROPERTY_CLAMP(prop, *(off_t *) arg); + stream_seek(mpctx->demuxer->stream, *(off_t *) arg); + return M_PROPERTY_OK; } return M_PROPERTY_NOT_IMPLEMENTED; } /// Stream start offset (RO) -static int mp_property_stream_start(m_option_t * prop, int action, - void *arg, MPContext * mpctx) +static int mp_property_stream_start(m_option_t *prop, int action, + void *arg, MPContext *mpctx) { if (!mpctx->demuxer || !mpctx->demuxer->stream) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch (action) { case M_PROPERTY_GET: - *(off_t *) arg = mpctx->demuxer->stream->start_pos; - return M_PROPERTY_OK; + *(off_t *) arg = mpctx->demuxer->stream->start_pos; + return M_PROPERTY_OK; } return M_PROPERTY_NOT_IMPLEMENTED; } /// Stream end offset (RO) -static int mp_property_stream_end(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_stream_end(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { if (!mpctx->demuxer || !mpctx->demuxer->stream) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch (action) { case M_PROPERTY_GET: - *(off_t *) arg = mpctx->demuxer->stream->end_pos; - return M_PROPERTY_OK; + *(off_t *) arg = mpctx->demuxer->stream->end_pos; + return M_PROPERTY_OK; } return M_PROPERTY_NOT_IMPLEMENTED; } /// Stream length (RO) -static int mp_property_stream_length(m_option_t * prop, int action, - void *arg, MPContext * mpctx) +static int mp_property_stream_length(m_option_t *prop, int action, + void *arg, MPContext *mpctx) { if (!mpctx->demuxer || !mpctx->demuxer->stream) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch (action) { case M_PROPERTY_GET: - *(off_t *) arg = - mpctx->demuxer->stream->end_pos - mpctx->demuxer->stream->start_pos; - return M_PROPERTY_OK; + *(off_t *) arg = + mpctx->demuxer->stream->end_pos - mpctx->demuxer->stream->start_pos; + return M_PROPERTY_OK; } return M_PROPERTY_NOT_IMPLEMENTED; } /// Media length in seconds (RO) -static int mp_property_length(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_length(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { double len; if (!mpctx->demuxer || - !(int) (len = demuxer_get_time_length(mpctx->demuxer))) - return M_PROPERTY_UNAVAILABLE; + !(int) (len = demuxer_get_time_length(mpctx->demuxer))) + return M_PROPERTY_UNAVAILABLE; return m_property_time_ro(prop, action, arg, len); } /// Current position in percent (RW) -static int mp_property_percent_pos(m_option_t * prop, int action, - void *arg, MPContext * mpctx) { +static int mp_property_percent_pos(m_option_t *prop, int action, + void *arg, MPContext *mpctx) { int pos; if (!mpctx->demuxer) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch(action) { case M_PROPERTY_SET: @@ -350,8 +354,8 @@ } /// Current position in seconds (RW) -static int mp_property_time_pos(m_option_t * prop, int action, - void *arg, MPContext * mpctx) { +static int mp_property_time_pos(m_option_t *prop, int action, + void *arg, MPContext *mpctx) { if (!(mpctx->sh_video || (mpctx->sh_audio && mpctx->audio_out))) return M_PROPERTY_UNAVAILABLE; @@ -409,7 +413,7 @@ if (!arg) return M_PROPERTY_ERROR; M_PROPERTY_CLAMP(prop, *(int*)arg); - step_all = *(int *)arg - (chapter + 1); + step_all = *(int *)arg - chapter; chapter += step_all; break; case M_PROPERTY_STEP_UP: @@ -521,14 +525,14 @@ } /// Demuxer meta data -static int mp_property_metadata(m_option_t * prop, int action, void *arg, - MPContext * mpctx) { +static int mp_property_metadata(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { m_property_action_t* ka; char* meta; - static m_option_t key_type = + static const m_option_t key_type = { "metadata", NULL, CONF_TYPE_STRING, 0, 0, 0, NULL }; if (!mpctx->demuxer) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch(action) { case M_PROPERTY_GET: @@ -554,8 +558,8 @@ return M_PROPERTY_NOT_IMPLEMENTED; } -static int mp_property_pause(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_pause(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { return m_property_flag_ro(prop, action, arg, mpctx->osd_function == OSD_PAUSE); } @@ -568,156 +572,156 @@ ///@{ /// Volume (RW) -static int mp_property_volume(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_volume(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { if (!mpctx->sh_audio) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch (action) { case M_PROPERTY_GET: - if (!arg) - return M_PROPERTY_ERROR; - mixer_getbothvolume(&mpctx->mixer, arg); - return M_PROPERTY_OK; + if (!arg) + return M_PROPERTY_ERROR; + mixer_getbothvolume(&mpctx->mixer, arg); + return M_PROPERTY_OK; case M_PROPERTY_PRINT:{ - float vol; - if (!arg) - return M_PROPERTY_ERROR; - mixer_getbothvolume(&mpctx->mixer, &vol); - return m_property_float_range(prop, action, arg, &vol); - } + float vol; + if (!arg) + return M_PROPERTY_ERROR; + mixer_getbothvolume(&mpctx->mixer, &vol); + return m_property_float_range(prop, action, arg, &vol); + } case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: case M_PROPERTY_SET: - break; + break; default: - return M_PROPERTY_NOT_IMPLEMENTED; + return M_PROPERTY_NOT_IMPLEMENTED; } if (mpctx->edl_muted) - return M_PROPERTY_DISABLED; + return M_PROPERTY_DISABLED; mpctx->user_muted = 0; switch (action) { case M_PROPERTY_SET: - if (!arg) - return M_PROPERTY_ERROR; - M_PROPERTY_CLAMP(prop, *(float *) arg); - mixer_setvolume(&mpctx->mixer, *(float *) arg, *(float *) arg); - return M_PROPERTY_OK; - case M_PROPERTY_STEP_UP: - if (arg && *(float *) arg <= 0) - mixer_decvolume(&mpctx->mixer); - else - mixer_incvolume(&mpctx->mixer); - return M_PROPERTY_OK; - case M_PROPERTY_STEP_DOWN: - if (arg && *(float *) arg <= 0) - mixer_incvolume(&mpctx->mixer); - else - mixer_decvolume(&mpctx->mixer); - return M_PROPERTY_OK; + if (!arg) + return M_PROPERTY_ERROR; + M_PROPERTY_CLAMP(prop, *(float *) arg); + mixer_setvolume(&mpctx->mixer, *(float *) arg, *(float *) arg); + return M_PROPERTY_OK; + case M_PROPERTY_STEP_UP: + if (arg && *(float *) arg <= 0) + mixer_decvolume(&mpctx->mixer); + else + mixer_incvolume(&mpctx->mixer); + return M_PROPERTY_OK; + case M_PROPERTY_STEP_DOWN: + if (arg && *(float *) arg <= 0) + mixer_incvolume(&mpctx->mixer); + else + mixer_decvolume(&mpctx->mixer); + return M_PROPERTY_OK; } return M_PROPERTY_NOT_IMPLEMENTED; } /// Mute (RW) -static int mp_property_mute(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_mute(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { if (!mpctx->sh_audio) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch (action) { case M_PROPERTY_SET: - if (mpctx->edl_muted) - return M_PROPERTY_DISABLED; - if (!arg) - return M_PROPERTY_ERROR; - if ((!!*(int *) arg) != mpctx->mixer.muted) - mixer_mute(&mpctx->mixer); - mpctx->user_muted = mpctx->mixer.muted; - return M_PROPERTY_OK; + if (mpctx->edl_muted) + return M_PROPERTY_DISABLED; + if (!arg) + return M_PROPERTY_ERROR; + if ((!!*(int *) arg) != mpctx->mixer.muted) + mixer_mute(&mpctx->mixer); + mpctx->user_muted = mpctx->mixer.muted; + return M_PROPERTY_OK; case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: - if (mpctx->edl_muted) - return M_PROPERTY_DISABLED; - mixer_mute(&mpctx->mixer); - mpctx->user_muted = mpctx->mixer.muted; - return M_PROPERTY_OK; + if (mpctx->edl_muted) + return M_PROPERTY_DISABLED; + mixer_mute(&mpctx->mixer); + mpctx->user_muted = mpctx->mixer.muted; + return M_PROPERTY_OK; case M_PROPERTY_PRINT: - if (!arg) - return M_PROPERTY_ERROR; - if (mpctx->edl_muted) { - *(char **) arg = strdup(MSGTR_EnabledEdl); - return M_PROPERTY_OK; - } + if (!arg) + return M_PROPERTY_ERROR; + if (mpctx->edl_muted) { + *(char **) arg = strdup(MSGTR_EnabledEdl); + return M_PROPERTY_OK; + } default: - return m_property_flag(prop, action, arg, &mpctx->mixer.muted); + return m_property_flag(prop, action, arg, &mpctx->mixer.muted); } } /// Audio delay (RW) -static int mp_property_audio_delay(m_option_t * prop, int action, - void *arg, MPContext * mpctx) +static int mp_property_audio_delay(m_option_t *prop, int action, + void *arg, MPContext *mpctx) { if (!(mpctx->sh_audio && mpctx->sh_video)) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch (action) { case M_PROPERTY_SET: case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: { - int ret; - float delay = audio_delay; - ret = m_property_delay(prop, action, arg, &audio_delay); - if (ret != M_PROPERTY_OK) - return ret; - if (mpctx->sh_audio) - mpctx->delay -= audio_delay - delay; - } - return M_PROPERTY_OK; + int ret; + float delay = audio_delay; + ret = m_property_delay(prop, action, arg, &audio_delay); + if (ret != M_PROPERTY_OK) + return ret; + if (mpctx->sh_audio) + mpctx->delay -= audio_delay - delay; + } + return M_PROPERTY_OK; default: - return m_property_delay(prop, action, arg, &audio_delay); + return m_property_delay(prop, action, arg, &audio_delay); } } /// Audio codec tag (RO) -static int mp_property_audio_format(m_option_t * prop, int action, - void *arg, MPContext * mpctx) +static int mp_property_audio_format(m_option_t *prop, int action, + void *arg, MPContext *mpctx) { if (!mpctx->sh_audio) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; return m_property_int_ro(prop, action, arg, mpctx->sh_audio->format); } /// Audio codec name (RO) -static int mp_property_audio_codec(m_option_t * prop, int action, - void *arg, MPContext * mpctx) +static int mp_property_audio_codec(m_option_t *prop, int action, + void *arg, MPContext *mpctx) { if (!mpctx->sh_audio || !mpctx->sh_audio->codec) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; return m_property_string_ro(prop, action, arg, mpctx->sh_audio->codec->name); } /// Audio bitrate (RO) -static int mp_property_audio_bitrate(m_option_t * prop, int action, - void *arg, MPContext * mpctx) +static int mp_property_audio_bitrate(m_option_t *prop, int action, + void *arg, MPContext *mpctx) { if (!mpctx->sh_audio) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; return m_property_bitrate(prop, action, arg, mpctx->sh_audio->i_bps); } /// Samplerate (RO) -static int mp_property_samplerate(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_samplerate(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { if (!mpctx->sh_audio) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch(action) { case M_PROPERTY_PRINT: if(!arg) return M_PROPERTY_ERROR; @@ -729,242 +733,240 @@ } /// Number of channels (RO) -static int mp_property_channels(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_channels(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { if (!mpctx->sh_audio) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch (action) { case M_PROPERTY_PRINT: - if (!arg) - return M_PROPERTY_ERROR; - switch (mpctx->sh_audio->channels) { - case 1: - *(char **) arg = strdup("mono"); - break; - case 2: - *(char **) arg = strdup("stereo"); - break; - default: - *(char **) arg = malloc(32); - sprintf(*(char **) arg, "%d channels", mpctx->sh_audio->channels); - } - return M_PROPERTY_OK; + if (!arg) + return M_PROPERTY_ERROR; + switch (mpctx->sh_audio->channels) { + case 1: + *(char **) arg = strdup("mono"); + break; + case 2: + *(char **) arg = strdup("stereo"); + break; + default: + *(char **) arg = malloc(32); + sprintf(*(char **) arg, "%d channels", mpctx->sh_audio->channels); + } + return M_PROPERTY_OK; } return m_property_int_ro(prop, action, arg, mpctx->sh_audio->channels); } /// Balance (RW) -static int mp_property_balance(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_balance(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { float bal; if (!mpctx->sh_audio || mpctx->sh_audio->channels < 2) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch (action) { case M_PROPERTY_GET: - if (!arg) - return M_PROPERTY_ERROR; - mixer_getbalance(&mpctx->mixer, arg); - return M_PROPERTY_OK; + if (!arg) + return M_PROPERTY_ERROR; + mixer_getbalance(&mpctx->mixer, arg); + return M_PROPERTY_OK; case M_PROPERTY_PRINT: { - char** str = arg; - if (!arg) - return M_PROPERTY_ERROR; - mixer_getbalance(&mpctx->mixer, &bal); - if (bal == 0.f) - *str = strdup("center"); - else if (bal == -1.f) - *str = strdup("left only"); - else if (bal == 1.f) - *str = strdup("right only"); - else { - unsigned right = (bal + 1.f) / 2.f * 100.f; - *str = malloc(sizeof("left xxx%, right xxx%")); - sprintf(*str, "left %d%%, right %d%%", 100 - right, right); - } - return M_PROPERTY_OK; - } - case M_PROPERTY_STEP_UP: - case M_PROPERTY_STEP_DOWN: - mixer_getbalance(&mpctx->mixer, &bal); - bal += (arg ? *(float*)arg : .1f) * - (action == M_PROPERTY_STEP_UP ? 1.f : -1.f); - M_PROPERTY_CLAMP(prop, bal); - mixer_setbalance(&mpctx->mixer, bal); - return M_PROPERTY_OK; - case M_PROPERTY_SET: - if (!arg) - return M_PROPERTY_ERROR; - M_PROPERTY_CLAMP(prop, *(float*)arg); - mixer_setbalance(&mpctx->mixer, *(float*)arg); - return M_PROPERTY_OK; + char** str = arg; + if (!arg) + return M_PROPERTY_ERROR; + mixer_getbalance(&mpctx->mixer, &bal); + if (bal == 0.f) + *str = strdup("center"); + else if (bal == -1.f) + *str = strdup("left only"); + else if (bal == 1.f) + *str = strdup("right only"); + else { + unsigned right = (bal + 1.f) / 2.f * 100.f; + *str = malloc(sizeof("left xxx%, right xxx%")); + sprintf(*str, "left %d%%, right %d%%", 100 - right, right); + } + return M_PROPERTY_OK; + } + case M_PROPERTY_STEP_UP: + case M_PROPERTY_STEP_DOWN: + mixer_getbalance(&mpctx->mixer, &bal); + bal += (arg ? *(float*)arg : .1f) * + (action == M_PROPERTY_STEP_UP ? 1.f : -1.f); + M_PROPERTY_CLAMP(prop, bal); + mixer_setbalance(&mpctx->mixer, bal); + return M_PROPERTY_OK; + case M_PROPERTY_SET: + if (!arg) + return M_PROPERTY_ERROR; + M_PROPERTY_CLAMP(prop, *(float*)arg); + mixer_setbalance(&mpctx->mixer, *(float*)arg); + return M_PROPERTY_OK; } return M_PROPERTY_NOT_IMPLEMENTED; } /// Selected audio id (RW) -static int mp_property_audio(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_audio(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { - int current_id = -1, tmp; + int current_id, tmp; + if (!mpctx->demuxer || !mpctx->demuxer->audio) + return M_PROPERTY_UNAVAILABLE; + current_id = mpctx->demuxer->audio->id; switch (action) { case M_PROPERTY_GET: - if (!mpctx->sh_audio) - return M_PROPERTY_UNAVAILABLE; - if (!arg) - return M_PROPERTY_ERROR; - *(int *) arg = audio_id; - return M_PROPERTY_OK; + if (!arg) + return M_PROPERTY_ERROR; + *(int *) arg = current_id; + return M_PROPERTY_OK; case M_PROPERTY_PRINT: - if (!mpctx->sh_audio) - return M_PROPERTY_UNAVAILABLE; - if (!arg) - return M_PROPERTY_ERROR; - - if (audio_id < 0) - *(char **) arg = strdup(MSGTR_Disabled); - else { - char lang[40] = MSGTR_Unknown; + if (!arg) + return M_PROPERTY_ERROR; + + if (current_id < 0) + *(char **) arg = strdup(MSGTR_Disabled); + else { + char lang[40] = MSGTR_Unknown; sh_audio_t* sh = mpctx->sh_audio; if (sh && sh->lang) av_strlcpy(lang, sh->lang, 40); #ifdef CONFIG_DVDREAD - else if (mpctx->stream->type == STREAMTYPE_DVD) { - int code = dvd_lang_from_aid(mpctx->stream, audio_id); - if (code) { - lang[0] = code >> 8; - lang[1] = code; - lang[2] = 0; - } - } + else if (mpctx->stream->type == STREAMTYPE_DVD) { + int code = dvd_lang_from_aid(mpctx->stream, current_id); + if (code) { + lang[0] = code >> 8; + lang[1] = code; + lang[2] = 0; + } + } #endif #ifdef CONFIG_DVDNAV - else if (mpctx->stream->type == STREAMTYPE_DVDNAV) - mp_dvdnav_lang_from_aid(mpctx->stream, audio_id, lang); + else if (mpctx->stream->type == STREAMTYPE_DVDNAV) + mp_dvdnav_lang_from_aid(mpctx->stream, current_id, lang); #endif - *(char **) arg = malloc(64); - snprintf(*(char **) arg, 64, "(%d) %s", audio_id, lang); - } - return M_PROPERTY_OK; + *(char **) arg = malloc(64); + snprintf(*(char **) arg, 64, "(%d) %s", current_id, lang); + } + return M_PROPERTY_OK; case M_PROPERTY_STEP_UP: case M_PROPERTY_SET: - if (!mpctx->demuxer) - return M_PROPERTY_UNAVAILABLE; - if (action == M_PROPERTY_SET && arg) - tmp = *((int *) arg); - else - tmp = -1; - current_id = mpctx->demuxer->audio->id; - audio_id = demuxer_switch_audio(mpctx->demuxer, tmp); - if (audio_id == -2 - || (audio_id > -1 - && mpctx->demuxer->audio->id != current_id && current_id != -2)) - uninit_player(INITIALIZED_AO | INITIALIZED_ACODEC); - if (audio_id > -1 && mpctx->demuxer->audio->id != current_id) { - sh_audio_t *sh2; - sh2 = mpctx->demuxer->a_streams[mpctx->demuxer->audio->id]; - if (sh2) { - sh2->ds = mpctx->demuxer->audio; - mpctx->sh_audio = sh2; - reinit_audio_chain(); - } - } - mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AUDIO_TRACK=%d\n", audio_id); - return M_PROPERTY_OK; + if (action == M_PROPERTY_SET && arg) + tmp = *((int *) arg); + else + tmp = -1; + audio_id = demuxer_switch_audio(mpctx->demuxer, tmp); + if (audio_id == -2 + || (audio_id > -1 + && mpctx->demuxer->audio->id != current_id && current_id != -2)) + uninit_player(INITIALIZED_AO | INITIALIZED_ACODEC); + if (audio_id > -1 && mpctx->demuxer->audio->id != current_id) { + sh_audio_t *sh2; + sh2 = mpctx->demuxer->a_streams[mpctx->demuxer->audio->id]; + if (sh2) { + sh2->ds = mpctx->demuxer->audio; + mpctx->sh_audio = sh2; + reinit_audio_chain(); + } + } + mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AUDIO_TRACK=%d\n", audio_id); + return M_PROPERTY_OK; default: - return M_PROPERTY_NOT_IMPLEMENTED; + return M_PROPERTY_NOT_IMPLEMENTED; } } /// Selected video id (RW) -static int mp_property_video(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_video(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { - int current_id = -1, tmp; + int current_id, tmp; + if (!mpctx->demuxer || !mpctx->demuxer->video) + return M_PROPERTY_UNAVAILABLE; + current_id = mpctx->demuxer->video->id; switch (action) { case M_PROPERTY_GET: - if (!mpctx->sh_video) - return M_PROPERTY_UNAVAILABLE; - if (!arg) - return M_PROPERTY_ERROR; - *(int *) arg = video_id; - return M_PROPERTY_OK; + if (!arg) + return M_PROPERTY_ERROR; + *(int *) arg = current_id; + return M_PROPERTY_OK; case M_PROPERTY_PRINT: - if (!mpctx->sh_video) - return M_PROPERTY_UNAVAILABLE; - if (!arg) - return M_PROPERTY_ERROR; - - if (video_id < 0) - *(char **) arg = strdup(MSGTR_Disabled); - else { - char lang[40] = MSGTR_Unknown; - *(char **) arg = malloc(64); - snprintf(*(char **) arg, 64, "(%d) %s", video_id, lang); - } - return M_PROPERTY_OK; + if (!arg) + return M_PROPERTY_ERROR; + + if (current_id < 0) + *(char **) arg = strdup(MSGTR_Disabled); + else { + char lang[40] = MSGTR_Unknown; + *(char **) arg = malloc(64); + snprintf(*(char **) arg, 64, "(%d) %s", current_id, lang); + } + return M_PROPERTY_OK; case M_PROPERTY_STEP_UP: case M_PROPERTY_SET: - current_id = mpctx->demuxer->video->id; - if (action == M_PROPERTY_SET && arg) - tmp = *((int *) arg); - else - tmp = -1; - video_id = demuxer_switch_video(mpctx->demuxer, tmp); - if (video_id == -2 - || (video_id > -1 && mpctx->demuxer->video->id != current_id - && current_id != -2)) - uninit_player(INITIALIZED_VCODEC | - (fixed_vo && video_id != -2 ? 0 : INITIALIZED_VO)); - if (video_id > -1 && mpctx->demuxer->video->id != current_id) { - sh_video_t *sh2; - sh2 = mpctx->demuxer->v_streams[mpctx->demuxer->video->id]; - if (sh2) { - sh2->ds = mpctx->demuxer->video; - mpctx->sh_video = sh2; - reinit_video_chain(); - } - } - mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_TRACK=%d\n", video_id); - return M_PROPERTY_OK; + if (action == M_PROPERTY_SET && arg) + tmp = *((int *) arg); + else + tmp = -1; + video_id = demuxer_switch_video(mpctx->demuxer, tmp); + if (video_id == -2 + || (video_id > -1 && mpctx->demuxer->video->id != current_id + && current_id != -2)) + uninit_player(INITIALIZED_VCODEC | + (fixed_vo && video_id != -2 ? 0 : INITIALIZED_VO)); + if (video_id > -1 && mpctx->demuxer->video->id != current_id) { + sh_video_t *sh2; + sh2 = mpctx->demuxer->v_streams[mpctx->demuxer->video->id]; + if (sh2) { + sh2->ds = mpctx->demuxer->video; + mpctx->sh_video = sh2; + reinit_video_chain(); + } + } + mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_TRACK=%d\n", video_id); + return M_PROPERTY_OK; default: - return M_PROPERTY_NOT_IMPLEMENTED; + return M_PROPERTY_NOT_IMPLEMENTED; } } -static int mp_property_program(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_program(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { demux_program_t prog; switch (action) { case M_PROPERTY_STEP_UP: case M_PROPERTY_SET: - if (action == M_PROPERTY_SET && arg) - prog.progid = *((int *) arg); - else - prog.progid = -1; - if (demux_control - (mpctx->demuxer, DEMUXER_CTRL_IDENTIFY_PROGRAM, - &prog) == DEMUXER_CTRL_NOTIMPL) - return M_PROPERTY_ERROR; - - mp_property_do("switch_audio", M_PROPERTY_SET, &prog.aid, mpctx); - mp_property_do("switch_video", M_PROPERTY_SET, &prog.vid, mpctx); - return M_PROPERTY_OK; + if (action == M_PROPERTY_SET && arg) + prog.progid = *((int *) arg); + else + prog.progid = -1; + if (demux_control + (mpctx->demuxer, DEMUXER_CTRL_IDENTIFY_PROGRAM, + &prog) == DEMUXER_CTRL_NOTIMPL) + return M_PROPERTY_ERROR; + + if (prog.aid < 0 && prog.vid < 0) { + mp_msg(MSGT_CPLAYER, MSGL_ERR, "Selected program contains no audio or video streams!\n"); + return M_PROPERTY_ERROR; + } + mp_property_do("switch_audio", M_PROPERTY_SET, &prog.aid, mpctx); + mp_property_do("switch_video", M_PROPERTY_SET, &prog.vid, mpctx); + return M_PROPERTY_OK; default: - return M_PROPERTY_NOT_IMPLEMENTED; + return M_PROPERTY_NOT_IMPLEMENTED; } } @@ -975,220 +977,222 @@ ///@{ /// Fullscreen state (RW) -static int mp_property_fullscreen(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_fullscreen(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { if (!mpctx->video_out) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch (action) { case M_PROPERTY_SET: - if (!arg) - return M_PROPERTY_ERROR; - M_PROPERTY_CLAMP(prop, *(int *) arg); - if (vo_fs == !!*(int *) arg) - return M_PROPERTY_OK; + if (!arg) + return M_PROPERTY_ERROR; + M_PROPERTY_CLAMP(prop, *(int *) arg); + if (vo_fs == !!*(int *) arg) + return M_PROPERTY_OK; case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: #ifdef CONFIG_GUI - if (use_gui) - guiGetEvent(guiIEvent, (char *) MP_CMD_GUI_FULLSCREEN); - else + if (use_gui) + guiGetEvent(guiIEvent, (char *) MP_CMD_VO_FULLSCREEN); + else #endif - if (vo_config_count) - mpctx->video_out->control(VOCTRL_FULLSCREEN, 0); - return M_PROPERTY_OK; + if (vo_config_count) + mpctx->video_out->control(VOCTRL_FULLSCREEN, 0); + return M_PROPERTY_OK; default: - return m_property_flag(prop, action, arg, &vo_fs); + return m_property_flag(prop, action, arg, &vo_fs); } } -static int mp_property_deinterlace(m_option_t * prop, int action, - void *arg, MPContext * mpctx) +static int mp_property_deinterlace(m_option_t *prop, int action, + void *arg, MPContext *mpctx) { int deinterlace; vf_instance_t *vf; if (!mpctx->sh_video || !mpctx->sh_video->vfilter) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; vf = mpctx->sh_video->vfilter; switch (action) { case M_PROPERTY_GET: - if (!arg) - return M_PROPERTY_ERROR; - vf->control(vf, VFCTRL_GET_DEINTERLACE, arg); - return M_PROPERTY_OK; - case M_PROPERTY_SET: - if (!arg) - return M_PROPERTY_ERROR; - M_PROPERTY_CLAMP(prop, *(int *) arg); - vf->control(vf, VFCTRL_SET_DEINTERLACE, arg); - return M_PROPERTY_OK; - case M_PROPERTY_STEP_UP: - case M_PROPERTY_STEP_DOWN: - vf->control(vf, VFCTRL_GET_DEINTERLACE, &deinterlace); - deinterlace = !deinterlace; - vf->control(vf, VFCTRL_SET_DEINTERLACE, &deinterlace); - return M_PROPERTY_OK; + if (!arg) + return M_PROPERTY_ERROR; + vf->control(vf, VFCTRL_GET_DEINTERLACE, arg); + return M_PROPERTY_OK; + case M_PROPERTY_SET: + if (!arg) + return M_PROPERTY_ERROR; + M_PROPERTY_CLAMP(prop, *(int *) arg); + vf->control(vf, VFCTRL_SET_DEINTERLACE, arg); + return M_PROPERTY_OK; + case M_PROPERTY_STEP_UP: + case M_PROPERTY_STEP_DOWN: + vf->control(vf, VFCTRL_GET_DEINTERLACE, &deinterlace); + deinterlace = !deinterlace; + vf->control(vf, VFCTRL_SET_DEINTERLACE, &deinterlace); + set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, MSGTR_OSDDeinterlace, + deinterlace ? MSGTR_Enabled : MSGTR_Disabled); + return M_PROPERTY_OK; } return M_PROPERTY_NOT_IMPLEMENTED; } /// Panscan (RW) -static int mp_property_panscan(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_panscan(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { if (!mpctx->video_out - || mpctx->video_out->control(VOCTRL_GET_PANSCAN, NULL) != VO_TRUE) - return M_PROPERTY_UNAVAILABLE; + || mpctx->video_out->control(VOCTRL_GET_PANSCAN, NULL) != VO_TRUE) + return M_PROPERTY_UNAVAILABLE; switch (action) { case M_PROPERTY_SET: - if (!arg) - return M_PROPERTY_ERROR; - M_PROPERTY_CLAMP(prop, *(float *) arg); - vo_panscan = *(float *) arg; - mpctx->video_out->control(VOCTRL_SET_PANSCAN, NULL); - return M_PROPERTY_OK; + if (!arg) + return M_PROPERTY_ERROR; + M_PROPERTY_CLAMP(prop, *(float *) arg); + vo_panscan = *(float *) arg; + mpctx->video_out->control(VOCTRL_SET_PANSCAN, NULL); + return M_PROPERTY_OK; case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: - vo_panscan += (arg ? *(float *) arg : 0.1) * - (action == M_PROPERTY_STEP_DOWN ? -1 : 1); - if (vo_panscan > 1) - vo_panscan = 1; - else if (vo_panscan < 0) - vo_panscan = 0; - mpctx->video_out->control(VOCTRL_SET_PANSCAN, NULL); - return M_PROPERTY_OK; + vo_panscan += (arg ? *(float *) arg : 0.1) * + (action == M_PROPERTY_STEP_DOWN ? -1 : 1); + if (vo_panscan > 1) + vo_panscan = 1; + else if (vo_panscan < 0) + vo_panscan = 0; + mpctx->video_out->control(VOCTRL_SET_PANSCAN, NULL); + return M_PROPERTY_OK; default: - return m_property_float_range(prop, action, arg, &vo_panscan); + return m_property_float_range(prop, action, arg, &vo_panscan); } } /// Helper to set vo flags. /** \ingroup PropertyImplHelper */ -static int mp_property_vo_flag(m_option_t * prop, int action, void *arg, - int vo_ctrl, int *vo_var, MPContext * mpctx) +static int mp_property_vo_flag(m_option_t *prop, int action, void *arg, + int vo_ctrl, int *vo_var, MPContext *mpctx) { if (!mpctx->video_out) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch (action) { case M_PROPERTY_SET: - if (!arg) - return M_PROPERTY_ERROR; - M_PROPERTY_CLAMP(prop, *(int *) arg); - if (*vo_var == !!*(int *) arg) - return M_PROPERTY_OK; + if (!arg) + return M_PROPERTY_ERROR; + M_PROPERTY_CLAMP(prop, *(int *) arg); + if (*vo_var == !!*(int *) arg) + return M_PROPERTY_OK; case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: - if (vo_config_count) - mpctx->video_out->control(vo_ctrl, 0); - return M_PROPERTY_OK; + if (vo_config_count) + mpctx->video_out->control(vo_ctrl, 0); + return M_PROPERTY_OK; default: - return m_property_flag(prop, action, arg, vo_var); + return m_property_flag(prop, action, arg, vo_var); } } /// Window always on top (RW) -static int mp_property_ontop(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_ontop(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { return mp_property_vo_flag(prop, action, arg, VOCTRL_ONTOP, &vo_ontop, - mpctx); + mpctx); } /// Display in the root window (RW) -static int mp_property_rootwin(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_rootwin(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { return mp_property_vo_flag(prop, action, arg, VOCTRL_ROOTWIN, - &vo_rootwin, mpctx); + &vo_rootwin, mpctx); } /// Show window borders (RW) -static int mp_property_border(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_border(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { return mp_property_vo_flag(prop, action, arg, VOCTRL_BORDER, - &vo_border, mpctx); + &vo_border, mpctx); } /// Framedropping state (RW) -static int mp_property_framedropping(m_option_t * prop, int action, - void *arg, MPContext * mpctx) +static int mp_property_framedropping(m_option_t *prop, int action, + void *arg, MPContext *mpctx) { if (!mpctx->sh_video) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch (action) { case M_PROPERTY_PRINT: - if (!arg) - return M_PROPERTY_ERROR; - *(char **) arg = strdup(frame_dropping == 1 ? MSGTR_Enabled : - (frame_dropping == 2 ? MSGTR_HardFrameDrop : - MSGTR_Disabled)); - return M_PROPERTY_OK; + if (!arg) + return M_PROPERTY_ERROR; + *(char **) arg = strdup(frame_dropping == 1 ? MSGTR_Enabled : + (frame_dropping == 2 ? MSGTR_HardFrameDrop : + MSGTR_Disabled)); + return M_PROPERTY_OK; default: - return m_property_choice(prop, action, arg, &frame_dropping); + return m_property_choice(prop, action, arg, &frame_dropping); } } /// Color settings, try to use vf/vo then fall back on TV. (RW) -static int mp_property_gamma(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_gamma(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { int *gamma = prop->priv, r, val; if (!mpctx->sh_video) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; if (gamma[0] == 1000) { - gamma[0] = 0; - get_video_colors(mpctx->sh_video, prop->name, gamma); + gamma[0] = 0; + get_video_colors(mpctx->sh_video, prop->name, gamma); } switch (action) { case M_PROPERTY_SET: - if (!arg) - return M_PROPERTY_ERROR; - M_PROPERTY_CLAMP(prop, *(int *) arg); - *gamma = *(int *) arg; - r = set_video_colors(mpctx->sh_video, prop->name, *gamma); - if (r <= 0) - break; - return r; + if (!arg) + return M_PROPERTY_ERROR; + M_PROPERTY_CLAMP(prop, *(int *) arg); + *gamma = *(int *) arg; + r = set_video_colors(mpctx->sh_video, prop->name, *gamma); + if (r <= 0) + break; + return r; case M_PROPERTY_GET: - if (get_video_colors(mpctx->sh_video, prop->name, &val) > 0) { - if (!arg) - return M_PROPERTY_ERROR; - *(int *)arg = val; - return M_PROPERTY_OK; - } - break; - case M_PROPERTY_STEP_UP: - case M_PROPERTY_STEP_DOWN: - *gamma += (arg ? *(int *) arg : 1) * - (action == M_PROPERTY_STEP_DOWN ? -1 : 1); - M_PROPERTY_CLAMP(prop, *gamma); - r = set_video_colors(mpctx->sh_video, prop->name, *gamma); - if (r <= 0) - break; - return r; + if (get_video_colors(mpctx->sh_video, prop->name, &val) > 0) { + if (!arg) + return M_PROPERTY_ERROR; + *(int *)arg = val; + return M_PROPERTY_OK; + } + break; + case M_PROPERTY_STEP_UP: + case M_PROPERTY_STEP_DOWN: + *gamma += (arg ? *(int *) arg : 1) * + (action == M_PROPERTY_STEP_DOWN ? -1 : 1); + M_PROPERTY_CLAMP(prop, *gamma); + r = set_video_colors(mpctx->sh_video, prop->name, *gamma); + if (r <= 0) + break; + return r; default: - return M_PROPERTY_NOT_IMPLEMENTED; + return M_PROPERTY_NOT_IMPLEMENTED; } #ifdef CONFIG_TV if (mpctx->demuxer->type == DEMUXER_TYPE_TV) { - int l = strlen(prop->name); - char tv_prop[3 + l + 1]; - sprintf(tv_prop, "tv_%s", prop->name); - return mp_property_do(tv_prop, action, arg, mpctx); + int l = strlen(prop->name); + char tv_prop[3 + l + 1]; + sprintf(tv_prop, "tv_%s", prop->name); + return mp_property_do(tv_prop, action, arg, mpctx); } #endif @@ -1196,23 +1200,23 @@ } /// VSync (RW) -static int mp_property_vsync(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_vsync(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { return m_property_flag(prop, action, arg, &vo_vsync); } /// Video codec tag (RO) -static int mp_property_video_format(m_option_t * prop, int action, - void *arg, MPContext * mpctx) +static int mp_property_video_format(m_option_t *prop, int action, + void *arg, MPContext *mpctx) { char* meta; if (!mpctx->sh_video) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch(action) { case M_PROPERTY_PRINT: if (!arg) - return M_PROPERTY_ERROR; + return M_PROPERTY_ERROR; switch(mpctx->sh_video->format) { case 0x10000001: meta = strdup ("mpeg1"); break; @@ -1238,57 +1242,57 @@ } /// Video codec name (RO) -static int mp_property_video_codec(m_option_t * prop, int action, - void *arg, MPContext * mpctx) +static int mp_property_video_codec(m_option_t *prop, int action, + void *arg, MPContext *mpctx) { if (!mpctx->sh_video || !mpctx->sh_video->codec) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; return m_property_string_ro(prop, action, arg, mpctx->sh_video->codec->name); } /// Video bitrate (RO) -static int mp_property_video_bitrate(m_option_t * prop, int action, - void *arg, MPContext * mpctx) +static int mp_property_video_bitrate(m_option_t *prop, int action, + void *arg, MPContext *mpctx) { if (!mpctx->sh_video) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; return m_property_bitrate(prop, action, arg, mpctx->sh_video->i_bps); } /// Video display width (RO) -static int mp_property_width(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_width(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { if (!mpctx->sh_video) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; return m_property_int_ro(prop, action, arg, mpctx->sh_video->disp_w); } /// Video display height (RO) -static int mp_property_height(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_height(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { if (!mpctx->sh_video) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; return m_property_int_ro(prop, action, arg, mpctx->sh_video->disp_h); } /// Video fps (RO) -static int mp_property_fps(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_fps(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { if (!mpctx->sh_video) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; return m_property_float_ro(prop, action, arg, mpctx->sh_video->fps); } /// Video aspect (RO) -static int mp_property_aspect(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_aspect(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { if (!mpctx->sh_video) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; return m_property_float_ro(prop, action, arg, mpctx->sh_video->aspect); } @@ -1299,148 +1303,146 @@ ///@{ /// Text subtitle position (RW) -static int mp_property_sub_pos(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_sub_pos(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { - if (!mpctx->sh_video) - return M_PROPERTY_UNAVAILABLE; - switch (action) { case M_PROPERTY_SET: - if (!arg) - return M_PROPERTY_ERROR; + if (!arg) + return M_PROPERTY_ERROR; case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: - vo_osd_changed(OSDTYPE_SUBTITLE); + vo_osd_changed(OSDTYPE_SUBTITLE); default: - return m_property_int_range(prop, action, arg, &sub_pos); + return m_property_int_range(prop, action, arg, &sub_pos); } } /// Selected subtitles (RW) -static int mp_property_sub(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_sub(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { demux_stream_t *const d_sub = mpctx->d_sub; const int global_sub_size = mpctx->global_sub_size; int source = -1, reset_spu = 0; + double pts = 0; char *sub_name; if (global_sub_size <= 0) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch (action) { case M_PROPERTY_GET: - if (!arg) - return M_PROPERTY_ERROR; - *(int *) arg = mpctx->global_sub_pos; - return M_PROPERTY_OK; + if (!arg) + return M_PROPERTY_ERROR; + *(int *) arg = mpctx->global_sub_pos; + return M_PROPERTY_OK; case M_PROPERTY_PRINT: - if (!arg) - return M_PROPERTY_ERROR; - *(char **) arg = malloc(64); - (*(char **) arg)[63] = 0; - sub_name = 0; - if (subdata) - sub_name = subdata->filename; + if (!arg) + return M_PROPERTY_ERROR; + *(char **) arg = malloc(64); + (*(char **) arg)[63] = 0; + sub_name = 0; + if (subdata) + sub_name = subdata->filename; #ifdef CONFIG_ASS - if (ass_track && ass_track->name) - sub_name = ass_track->name; + if (ass_track && ass_track->name) + sub_name = ass_track->name; #endif - if (sub_name) { - char *tmp, *tmp2; - tmp = sub_name; - if ((tmp2 = strrchr(tmp, '/'))) - tmp = tmp2 + 1; - - snprintf(*(char **) arg, 63, "(%d) %s%s", - mpctx->set_of_sub_pos + 1, - strlen(tmp) < 20 ? "" : "...", - strlen(tmp) < 20 ? tmp : tmp + strlen(tmp) - 19); - return M_PROPERTY_OK; - } + if (sub_name) { + char *tmp, *tmp2; + tmp = sub_name; + if ((tmp2 = strrchr(tmp, '/'))) + tmp = tmp2 + 1; + + snprintf(*(char **) arg, 63, "(%d) %s%s", + mpctx->set_of_sub_pos + 1, + strlen(tmp) < 20 ? "" : "...", + strlen(tmp) < 20 ? tmp : tmp + strlen(tmp) - 19); + return M_PROPERTY_OK; + } #ifdef CONFIG_DVDNAV - if (mpctx->stream->type == STREAMTYPE_DVDNAV) { - if (vo_spudec && dvdsub_id >= 0) { - unsigned char lang[3]; - if (mp_dvdnav_lang_from_sid(mpctx->stream, dvdsub_id, lang)) { - snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, lang); - return M_PROPERTY_OK; - } - } - } + if (mpctx->stream->type == STREAMTYPE_DVDNAV) { + if (vo_spudec && dvdsub_id >= 0) { + unsigned char lang[3]; + if (mp_dvdnav_lang_from_sid(mpctx->stream, dvdsub_id, lang)) { + snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, lang); + return M_PROPERTY_OK; + } + } + } #endif - if ((mpctx->demuxer->type == DEMUXER_TYPE_MATROSKA + if ((mpctx->demuxer->type == DEMUXER_TYPE_MATROSKA || mpctx->demuxer->type == DEMUXER_TYPE_LAVF || mpctx->demuxer->type == DEMUXER_TYPE_LAVF_PREFERRED || mpctx->demuxer->type == DEMUXER_TYPE_OGG) && d_sub && d_sub->sh && dvdsub_id >= 0) { const char* lang = ((sh_sub_t*)d_sub->sh)->lang; if (!lang) lang = MSGTR_Unknown; - snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, lang); - return M_PROPERTY_OK; - } - - if (vo_vobsub && vobsub_id >= 0) { - const char *language = MSGTR_Unknown; - language = vobsub_get_id(vo_vobsub, (unsigned int) vobsub_id); - snprintf(*(char **) arg, 63, "(%d) %s", - vobsub_id, language ? language : MSGTR_Unknown); - return M_PROPERTY_OK; - } + snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, lang); + return M_PROPERTY_OK; + } + + if (vo_vobsub && vobsub_id >= 0) { + const char *language = MSGTR_Unknown; + language = vobsub_get_id(vo_vobsub, (unsigned int) vobsub_id); + snprintf(*(char **) arg, 63, "(%d) %s", + vobsub_id, language ? language : MSGTR_Unknown); + return M_PROPERTY_OK; + } #ifdef CONFIG_DVDREAD - if (vo_spudec && mpctx->stream->type == STREAMTYPE_DVD - && dvdsub_id >= 0) { - char lang[3]; - int code = dvd_lang_from_sid(mpctx->stream, dvdsub_id); - lang[0] = code >> 8; - lang[1] = code; - lang[2] = 0; - snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, lang); - return M_PROPERTY_OK; - } -#endif - if (dvdsub_id >= 0) { - snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, MSGTR_Unknown); - return M_PROPERTY_OK; - } - snprintf(*(char **) arg, 63, MSGTR_Disabled); - return M_PROPERTY_OK; - - case M_PROPERTY_SET: - if (!arg) - return M_PROPERTY_ERROR; - if (*(int *) arg < -1) - *(int *) arg = -1; - else if (*(int *) arg >= global_sub_size) - *(int *) arg = global_sub_size - 1; - mpctx->global_sub_pos = *(int *) arg; - break; - case M_PROPERTY_STEP_UP: - mpctx->global_sub_pos += 2; - mpctx->global_sub_pos = - (mpctx->global_sub_pos % (global_sub_size + 1)) - 1; - break; - case M_PROPERTY_STEP_DOWN: - mpctx->global_sub_pos += global_sub_size + 1; - mpctx->global_sub_pos = - (mpctx->global_sub_pos % (global_sub_size + 1)) - 1; - break; + if (vo_spudec && mpctx->stream->type == STREAMTYPE_DVD + && dvdsub_id >= 0) { + char lang[3]; + int code = dvd_lang_from_sid(mpctx->stream, dvdsub_id); + lang[0] = code >> 8; + lang[1] = code; + lang[2] = 0; + snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, lang); + return M_PROPERTY_OK; + } +#endif + if (dvdsub_id >= 0) { + snprintf(*(char **) arg, 63, "(%d) %s", dvdsub_id, MSGTR_Unknown); + return M_PROPERTY_OK; + } + snprintf(*(char **) arg, 63, MSGTR_Disabled); + return M_PROPERTY_OK; + + case M_PROPERTY_SET: + if (!arg) + return M_PROPERTY_ERROR; + if (*(int *) arg < -1) + *(int *) arg = -1; + else if (*(int *) arg >= global_sub_size) + *(int *) arg = global_sub_size - 1; + mpctx->global_sub_pos = *(int *) arg; + break; + case M_PROPERTY_STEP_UP: + mpctx->global_sub_pos += 2; + mpctx->global_sub_pos = + (mpctx->global_sub_pos % (global_sub_size + 1)) - 1; + break; + case M_PROPERTY_STEP_DOWN: + mpctx->global_sub_pos += global_sub_size + 1; + mpctx->global_sub_pos = + (mpctx->global_sub_pos % (global_sub_size + 1)) - 1; + break; default: - return M_PROPERTY_NOT_IMPLEMENTED; + return M_PROPERTY_NOT_IMPLEMENTED; } if (mpctx->global_sub_pos >= 0) - source = sub_source(mpctx); + source = sub_source(mpctx); mp_msg(MSGT_CPLAYER, MSGL_DBG3, - "subtitles: %d subs, (v@%d s@%d d@%d), @%d, source @%d\n", - global_sub_size, - mpctx->global_sub_indices[SUB_SOURCE_VOBSUB], - mpctx->global_sub_indices[SUB_SOURCE_SUBS], - mpctx->global_sub_indices[SUB_SOURCE_DEMUX], - mpctx->global_sub_pos, source); + "subtitles: %d subs, (v@%d s@%d d@%d), @%d, source @%d\n", + global_sub_size, + mpctx->global_sub_indices[SUB_SOURCE_VOBSUB], + mpctx->global_sub_indices[SUB_SOURCE_SUBS], + mpctx->global_sub_indices[SUB_SOURCE_DEMUX], + mpctx->global_sub_pos, source); mpctx->set_of_sub_pos = -1; subdata = NULL; @@ -1448,9 +1450,9 @@ vobsub_id = -1; dvdsub_id = -1; if (d_sub) { - if (d_sub->id > -2) - reset_spu = 1; - d_sub->id = -2; + if (d_sub->id > -2) + reset_spu = 1; + d_sub->id = -2; } #ifdef CONFIG_ASS ass_track = 0; @@ -1459,65 +1461,69 @@ if (source == SUB_SOURCE_VOBSUB) { vobsub_id = vobsub_get_id_by_index(vo_vobsub, mpctx->global_sub_pos - mpctx->global_sub_indices[SUB_SOURCE_VOBSUB]); } else if (source == SUB_SOURCE_SUBS) { - mpctx->set_of_sub_pos = - mpctx->global_sub_pos - mpctx->global_sub_indices[SUB_SOURCE_SUBS]; + mpctx->set_of_sub_pos = + mpctx->global_sub_pos - mpctx->global_sub_indices[SUB_SOURCE_SUBS]; #ifdef CONFIG_ASS - if (ass_enabled && mpctx->set_of_ass_tracks[mpctx->set_of_sub_pos]) - ass_track = mpctx->set_of_ass_tracks[mpctx->set_of_sub_pos]; - else -#endif - { - subdata = mpctx->set_of_subtitles[mpctx->set_of_sub_pos]; - vo_osd_changed(OSDTYPE_SUBTITLE); - } + if (ass_enabled && mpctx->set_of_ass_tracks[mpctx->set_of_sub_pos]) + ass_track = mpctx->set_of_ass_tracks[mpctx->set_of_sub_pos]; + else +#endif + { + subdata = mpctx->set_of_subtitles[mpctx->set_of_sub_pos]; + vo_osd_changed(OSDTYPE_SUBTITLE); + } } else if (source == SUB_SOURCE_DEMUX) { - dvdsub_id = - mpctx->global_sub_pos - mpctx->global_sub_indices[SUB_SOURCE_DEMUX]; - if (d_sub && dvdsub_id < MAX_S_STREAMS) { - int i = 0; - // default: assume 1:1 mapping of sid and stream id - d_sub->id = dvdsub_id; - d_sub->sh = mpctx->demuxer->s_streams[d_sub->id]; - ds_free_packs(d_sub); - for (i = 0; i < MAX_S_STREAMS; i++) { - sh_sub_t *sh = mpctx->demuxer->s_streams[i]; - if (sh && sh->sid == dvdsub_id) { - d_sub->id = i; - d_sub->sh = sh; - break; - } - } - if (d_sub->sh && d_sub->id >= 0) { - sh_sub_t *sh = d_sub->sh; - if (sh->type == 'v') - init_vo_spudec(); + dvdsub_id = + mpctx->global_sub_pos - mpctx->global_sub_indices[SUB_SOURCE_DEMUX]; + if (d_sub && dvdsub_id < MAX_S_STREAMS) { + int i = 0; + // default: assume 1:1 mapping of sid and stream id + d_sub->id = dvdsub_id; + d_sub->sh = mpctx->demuxer->s_streams[d_sub->id]; + ds_free_packs(d_sub); + for (i = 0; i < MAX_S_STREAMS; i++) { + sh_sub_t *sh = mpctx->demuxer->s_streams[i]; + if (sh && sh->sid == dvdsub_id) { + d_sub->id = i; + d_sub->sh = sh; + break; + } + } + if (d_sub->sh && d_sub->id >= 0) { + sh_sub_t *sh = d_sub->sh; + if (sh->type == 'v') + init_vo_spudec(); #ifdef CONFIG_ASS - else if (ass_enabled) - ass_track = sh->ass_track; + else if (ass_enabled) + ass_track = sh->ass_track; #endif } else { d_sub->id = -2; d_sub->sh = NULL; - } - } + } + } } #ifdef CONFIG_DVDREAD if (vo_spudec - && (mpctx->stream->type == STREAMTYPE_DVD - || mpctx->stream->type == STREAMTYPE_DVDNAV) - && dvdsub_id < 0 && reset_spu) { - dvdsub_id = -2; - d_sub->id = dvdsub_id; + && (mpctx->stream->type == STREAMTYPE_DVD + || mpctx->stream->type == STREAMTYPE_DVDNAV) + && dvdsub_id < 0 && reset_spu) { + d_sub->id = -2; + d_sub->sh = NULL; } #endif - update_subtitles(mpctx->sh_video, d_sub, 1); + if (mpctx->sh_audio) + pts = mpctx->sh_audio->pts; + if (mpctx->sh_video) + pts = mpctx->sh_video->pts; + update_subtitles(mpctx->sh_video, pts, d_sub, 1); return M_PROPERTY_OK; } /// Selected sub source (RW) -static int mp_property_sub_source(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_sub_source(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { int source; if (!mpctx->sh_video || mpctx->global_sub_size <= 0) @@ -1594,8 +1600,8 @@ } /// Selected subtitles from specific source (RW) -static int mp_property_sub_by_type(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_sub_by_type(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { int source, is_cur_source, offset; if (!mpctx->sh_video || mpctx->global_sub_size <= 0) @@ -1694,110 +1700,110 @@ } /// Subtitle delay (RW) -static int mp_property_sub_delay(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_sub_delay(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { if (!mpctx->sh_video) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; return m_property_delay(prop, action, arg, &sub_delay); } /// Alignment of text subtitles (RW) -static int mp_property_sub_alignment(m_option_t * prop, int action, - void *arg, MPContext * mpctx) +static int mp_property_sub_alignment(m_option_t *prop, int action, + void *arg, MPContext *mpctx) { char *name[] = { MSGTR_Top, MSGTR_Center, MSGTR_Bottom }; if (!mpctx->sh_video || mpctx->global_sub_pos < 0 - || sub_source(mpctx) != SUB_SOURCE_SUBS) - return M_PROPERTY_UNAVAILABLE; + || sub_source(mpctx) != SUB_SOURCE_SUBS) + return M_PROPERTY_UNAVAILABLE; switch (action) { case M_PROPERTY_PRINT: - if (!arg) - return M_PROPERTY_ERROR; - M_PROPERTY_CLAMP(prop, sub_alignment); - *(char **) arg = strdup(name[sub_alignment]); - return M_PROPERTY_OK; + if (!arg) + return M_PROPERTY_ERROR; + M_PROPERTY_CLAMP(prop, sub_alignment); + *(char **) arg = strdup(name[sub_alignment]); + return M_PROPERTY_OK; case M_PROPERTY_SET: - if (!arg) - return M_PROPERTY_ERROR; + if (!arg) + return M_PROPERTY_ERROR; case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: - vo_osd_changed(OSDTYPE_SUBTITLE); + vo_osd_changed(OSDTYPE_SUBTITLE); default: - return m_property_choice(prop, action, arg, &sub_alignment); + return m_property_choice(prop, action, arg, &sub_alignment); } } /// Subtitle visibility (RW) -static int mp_property_sub_visibility(m_option_t * prop, int action, - void *arg, MPContext * mpctx) +static int mp_property_sub_visibility(m_option_t *prop, int action, + void *arg, MPContext *mpctx) { if (!mpctx->sh_video) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch (action) { case M_PROPERTY_SET: - if (!arg) - return M_PROPERTY_ERROR; + if (!arg) + return M_PROPERTY_ERROR; case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: - vo_osd_changed(OSDTYPE_SUBTITLE); - if (vo_spudec) - vo_osd_changed(OSDTYPE_SPU); + vo_osd_changed(OSDTYPE_SUBTITLE); + if (vo_spudec) + vo_osd_changed(OSDTYPE_SPU); default: - return m_property_flag(prop, action, arg, &sub_visibility); + return m_property_flag(prop, action, arg, &sub_visibility); } } #ifdef CONFIG_ASS /// Use margins for libass subtitles (RW) -static int mp_property_ass_use_margins(m_option_t * prop, int action, - void *arg, MPContext * mpctx) +static int mp_property_ass_use_margins(m_option_t *prop, int action, + void *arg, MPContext *mpctx) { if (!mpctx->sh_video) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch (action) { case M_PROPERTY_SET: - if (!arg) - return M_PROPERTY_ERROR; + if (!arg) + return M_PROPERTY_ERROR; case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: - ass_force_reload = 1; + ass_force_reload = 1; default: - return m_property_flag(prop, action, arg, &ass_use_margins); + return m_property_flag(prop, action, arg, &ass_use_margins); } } #endif /// Show only forced subtitles (RW) -static int mp_property_sub_forced_only(m_option_t * prop, int action, - void *arg, MPContext * mpctx) +static int mp_property_sub_forced_only(m_option_t *prop, int action, + void *arg, MPContext *mpctx) { if (!vo_spudec) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch (action) { case M_PROPERTY_SET: - if (!arg) - return M_PROPERTY_ERROR; + if (!arg) + return M_PROPERTY_ERROR; case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: - m_property_flag(prop, action, arg, &forced_subs_only); - spudec_set_forced_subs_only(vo_spudec, forced_subs_only); - return M_PROPERTY_OK; + m_property_flag(prop, action, arg, &forced_subs_only); + spudec_set_forced_subs_only(vo_spudec, forced_subs_only); + return M_PROPERTY_OK; default: - return m_property_flag(prop, action, arg, &forced_subs_only); + return m_property_flag(prop, action, arg, &forced_subs_only); } } #ifdef CONFIG_FREETYPE /// Subtitle scale (RW) -static int mp_property_sub_scale(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_sub_scale(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { switch (action) { @@ -1849,52 +1855,50 @@ #ifdef CONFIG_TV /// TV color settings (RW) -static int mp_property_tv_color(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_tv_color(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { int r, val; tvi_handle_t *tvh = mpctx->demuxer->priv; if (mpctx->demuxer->type != DEMUXER_TYPE_TV || !tvh) - return M_PROPERTY_UNAVAILABLE; + return M_PROPERTY_UNAVAILABLE; switch (action) { case M_PROPERTY_SET: - if (!arg) - return M_PROPERTY_ERROR; - M_PROPERTY_CLAMP(prop, *(int *) arg); - return tv_set_color_options(tvh, (int) prop->priv, *(int *) arg); + if (!arg) + return M_PROPERTY_ERROR; + M_PROPERTY_CLAMP(prop, *(int *) arg); + return tv_set_color_options(tvh, (int) prop->priv, *(int *) arg); case M_PROPERTY_GET: - return tv_get_color_options(tvh, (int) prop->priv, arg); + return tv_get_color_options(tvh, (int) prop->priv, arg); case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: - if ((r = tv_get_color_options(tvh, (int) prop->priv, &val)) >= 0) { - if (!r) - return M_PROPERTY_ERROR; - val += (arg ? *(int *) arg : 1) * - (action == M_PROPERTY_STEP_DOWN ? -1 : 1); - M_PROPERTY_CLAMP(prop, val); - return tv_set_color_options(tvh, (int) prop->priv, val); - } - return M_PROPERTY_ERROR; + if ((r = tv_get_color_options(tvh, (int) prop->priv, &val)) >= 0) { + if (!r) + return M_PROPERTY_ERROR; + val += (arg ? *(int *) arg : 1) * + (action == M_PROPERTY_STEP_DOWN ? -1 : 1); + M_PROPERTY_CLAMP(prop, val); + return tv_set_color_options(tvh, (int) prop->priv, val); + } + return M_PROPERTY_ERROR; } return M_PROPERTY_NOT_IMPLEMENTED; } #endif -#ifdef CONFIG_TV_TELETEXT -static int mp_property_teletext_common(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_teletext_common(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { int val,result; int base_ioctl=(int)prop->priv; - /* + /* for teletext's GET,SET,STEP ioctls this is not 0 SET is GET+1 STEP is GET+2 */ - tvi_handle_t *tvh = mpctx->demuxer->priv; - if (mpctx->demuxer->type != DEMUXER_TYPE_TV || !tvh) + if (!mpctx->demuxer || !mpctx->demuxer->teletext) return M_PROPERTY_UNAVAILABLE; if(!base_ioctl) return M_PROPERTY_ERROR; @@ -1903,31 +1907,30 @@ case M_PROPERTY_GET: if (!arg) return M_PROPERTY_ERROR; - result=tvh->functions->control(tvh->priv, base_ioctl, arg); + result=teletext_control(mpctx->demuxer->teletext, base_ioctl, arg); break; case M_PROPERTY_SET: if (!arg) return M_PROPERTY_ERROR; M_PROPERTY_CLAMP(prop, *(int *) arg); - result=tvh->functions->control(tvh->priv, base_ioctl+1, arg); + result=teletext_control(mpctx->demuxer->teletext, base_ioctl+1, arg); break; case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: - result=tvh->functions->control(tvh->priv, base_ioctl, &val); + result=teletext_control(mpctx->demuxer->teletext, base_ioctl, &val); val += (arg ? *(int *) arg : 1) * (action == M_PROPERTY_STEP_DOWN ? -1 : 1); - result=tvh->functions->control(tvh->priv, base_ioctl+1, &val); + result=teletext_control(mpctx->demuxer->teletext, base_ioctl+1, &val); break; default: return M_PROPERTY_NOT_IMPLEMENTED; } - return result == TVI_CONTROL_TRUE ? M_PROPERTY_OK : M_PROPERTY_ERROR; + return result == VBI_CONTROL_TRUE ? M_PROPERTY_OK : M_PROPERTY_ERROR; } -static int mp_property_teletext_mode(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_teletext_mode(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { - tvi_handle_t *tvh = mpctx->demuxer->priv; int result; int val; @@ -1936,27 +1939,28 @@ if(result!=M_PROPERTY_OK) return result; - if(tvh->functions->control(tvh->priv, prop->priv, &val)==TVI_CONTROL_TRUE && val) + if(teletext_control(mpctx->demuxer->teletext, + (int)prop->priv, &val)==VBI_CONTROL_TRUE && val) mp_input_set_section("teletext"); else mp_input_set_section("tv"); return M_PROPERTY_OK; } -static int mp_property_teletext_page(m_option_t * prop, int action, void *arg, - MPContext * mpctx) +static int mp_property_teletext_page(m_option_t *prop, int action, void *arg, + MPContext *mpctx) { - tvi_handle_t *tvh = mpctx->demuxer->priv; int result; int val; - if (mpctx->demuxer->type != DEMUXER_TYPE_TV || !tvh) + if (!mpctx->demuxer->teletext) return M_PROPERTY_UNAVAILABLE; switch(action){ case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: //This should be handled separately val = (arg ? *(int *) arg : 1) * (action == M_PROPERTY_STEP_DOWN ? -1 : 1); - result=tvh->functions->control(tvh->priv, TV_VBI_CONTROL_STEP_PAGE, &val); + result=teletext_control(mpctx->demuxer->teletext, + TV_VBI_CONTROL_STEP_PAGE, &val); break; default: result=mp_property_teletext_common(prop,action,arg,mpctx); @@ -1964,9 +1968,6 @@ return result; } - -#endif /* CONFIG_TV_TELETEXT */ - ///@} /// All properties available in MPlayer. @@ -2001,7 +2002,7 @@ { "time_pos", mp_property_time_pos, CONF_TYPE_TIME, M_OPT_MIN, 0, 0, NULL }, { "chapter", mp_property_chapter, CONF_TYPE_INT, - M_OPT_MIN, 1, 0, NULL }, + M_OPT_MIN, 0, 0, NULL }, { "chapters", mp_property_chapters, CONF_TYPE_INT, 0, 0, 0, NULL }, { "angle", mp_property_angle, CONF_TYPE_INT, @@ -2029,7 +2030,7 @@ { "channels", mp_property_channels, CONF_TYPE_INT, 0, 0, 0, NULL }, { "switch_audio", mp_property_audio, CONF_TYPE_INT, - CONF_RANGE, -2, MAX_A_STREAMS - 1, NULL }, + CONF_RANGE, -2, 65535, NULL }, { "balance", mp_property_balance, CONF_TYPE_FLOAT, M_OPT_RANGE, -1, 1, NULL }, @@ -2075,7 +2076,7 @@ { "aspect", mp_property_aspect, CONF_TYPE_FLOAT, 0, 0, 0, NULL }, { "switch_video", mp_property_video, CONF_TYPE_INT, - CONF_RANGE, -2, MAX_V_STREAMS - 1, NULL }, + CONF_RANGE, -2, 65535, NULL }, { "switch_program", mp_property_program, CONF_TYPE_INT, CONF_RANGE, -1, 65535, NULL }, @@ -2119,8 +2120,6 @@ { "tv_hue", mp_property_tv_color, CONF_TYPE_INT, M_OPT_RANGE, -100, 100, (void *) TV_COLOR_HUE }, #endif - -#ifdef CONFIG_TV_TELETEXT { "teletext_page", mp_property_teletext_page, CONF_TYPE_INT, M_OPT_RANGE, 100, 899, (void*)TV_VBI_CONTROL_GET_PAGE }, { "teletext_subpage", mp_property_teletext_common, CONF_TYPE_INT, @@ -2131,8 +2130,6 @@ M_OPT_RANGE, 0, 3, (void*)TV_VBI_CONTROL_GET_FORMAT }, { "teletext_half_page", mp_property_teletext_common, CONF_TYPE_INT, M_OPT_RANGE, 0, 2, (void*)TV_VBI_CONTROL_GET_HALF_PAGE }, -#endif - { NULL, NULL, NULL, 0, 0, 0, NULL } }; @@ -2150,7 +2147,7 @@ return ret; } -char *property_expand_string(MPContext * mpctx, char *str) +char *property_expand_string(MPContext *mpctx, char *str) { return m_properties_expand_string(mp_properties, str, mpctx); } @@ -2222,7 +2219,7 @@ { "saturation", MP_CMD_SATURATION, 0, OSD_SATURATION, -1, MSGTR_Saturation }, { "hue", MP_CMD_HUE, 0, OSD_HUE, -1, MSGTR_Hue }, { "vsync", MP_CMD_SWITCH_VSYNC, 1, 0, -1, MSGTR_VSyncStatus }, - // subs + // subs { "sub", MP_CMD_SUB_SELECT, 1, 0, -1, MSGTR_SubSelectStatus }, { "sub_source", MP_CMD_SUB_SOURCE, 1, 0, -1, MSGTR_SubSourceStatus }, { "sub_vob", MP_CMD_SUB_VOB, 1, 0, -1, MSGTR_SubSelectStatus }, @@ -2250,61 +2247,61 @@ /// Handle commands that set a property. -static int set_property_command(MPContext * mpctx, mp_cmd_t * cmd) +static int set_property_command(MPContext *mpctx, mp_cmd_t *cmd) { int i, r; - m_option_t* prop; + m_option_t *prop; const char *pname; // look for the command for (i = 0; set_prop_cmd[i].name; i++) - if (set_prop_cmd[i].cmd == cmd->id) - break; + if (set_prop_cmd[i].cmd == cmd->id) + break; if (!(pname = set_prop_cmd[i].name)) - return 0; + return 0; if (mp_property_do(pname,M_PROPERTY_GET_TYPE,&prop,mpctx) <= 0 || !prop) return 0; // toggle command if (set_prop_cmd[i].toggle) { - // set to value - if (cmd->nargs > 0 && cmd->args[0].v.i >= prop->min) - r = mp_property_do(pname, M_PROPERTY_SET, &cmd->args[0].v.i, mpctx); - else - r = mp_property_do(pname, M_PROPERTY_STEP_UP, NULL, mpctx); - } else if (cmd->args[1].v.i) //set - r = mp_property_do(pname, M_PROPERTY_SET, &cmd->args[0].v, mpctx); - else // adjust - r = mp_property_do(pname, M_PROPERTY_STEP_UP, &cmd->args[0].v, mpctx); + // set to value + if (cmd->nargs > 0 && cmd->args[0].v.i >= prop->min) + r = mp_property_do(pname, M_PROPERTY_SET, &cmd->args[0].v.i, mpctx); + else + r = mp_property_do(pname, M_PROPERTY_STEP_UP, NULL, mpctx); + } else if (cmd->args[1].v.i) //set + r = mp_property_do(pname, M_PROPERTY_SET, &cmd->args[0].v, mpctx); + else // adjust + r = mp_property_do(pname, M_PROPERTY_STEP_UP, &cmd->args[0].v, mpctx); if (r <= 0) - return 1; + return 1; if (set_prop_cmd[i].osd_progbar) { - if (prop->type == CONF_TYPE_INT) { - if (mp_property_do(pname, M_PROPERTY_GET, &r, mpctx) > 0) - set_osd_bar(set_prop_cmd[i].osd_progbar, - set_prop_cmd[i].osd_msg, prop->min, prop->max, r); - } else if (prop->type == CONF_TYPE_FLOAT) { - float f; - if (mp_property_do(pname, M_PROPERTY_GET, &f, mpctx) > 0) - set_osd_bar(set_prop_cmd[i].osd_progbar, - set_prop_cmd[i].osd_msg, prop->min, prop->max, f); - } else - mp_msg(MSGT_CPLAYER, MSGL_ERR, - "Property use an unsupported type.\n"); - return 1; + if (prop->type == CONF_TYPE_INT) { + if (mp_property_do(pname, M_PROPERTY_GET, &r, mpctx) > 0) + set_osd_bar(set_prop_cmd[i].osd_progbar, + set_prop_cmd[i].osd_msg, prop->min, prop->max, r); + } else if (prop->type == CONF_TYPE_FLOAT) { + float f; + if (mp_property_do(pname, M_PROPERTY_GET, &f, mpctx) > 0) + set_osd_bar(set_prop_cmd[i].osd_progbar, + set_prop_cmd[i].osd_msg, prop->min, prop->max, f); + } else + mp_msg(MSGT_CPLAYER, MSGL_ERR, + "Property use an unsupported type.\n"); + return 1; } if (set_prop_cmd[i].osd_msg) { - char *val = mp_property_print(pname, mpctx); - if (val) { - set_osd_msg(set_prop_cmd[i].osd_id >= - 0 ? set_prop_cmd[i].osd_id : OSD_MSG_PROPERTY + i, - 1, osd_duration, set_prop_cmd[i].osd_msg, val); - free(val); - } + char *val = mp_property_print(pname, mpctx); + if (val) { + set_osd_msg(set_prop_cmd[i].osd_id >= + 0 ? set_prop_cmd[i].osd_id : OSD_MSG_PROPERTY + i, + 1, osd_duration, set_prop_cmd[i].osd_msg, val); + free(val); + } } return 1; } @@ -2339,405 +2336,493 @@ }; #endif -int run_command(MPContext * mpctx, mp_cmd_t * cmd) +static const char *property_error_string(int error_value) +{ + switch (error_value) { + case M_PROPERTY_ERROR: + return "ERROR"; + case M_PROPERTY_UNAVAILABLE: + return "PROPERTY_UNAVAILABLE"; + case M_PROPERTY_NOT_IMPLEMENTED: + return "NOT_IMPLEMENTED"; + case M_PROPERTY_UNKNOWN: + return "PROPERTY_UNKNOWN"; + case M_PROPERTY_DISABLED: + return "DISABLED"; + } + return "UNKNOWN"; +} + +static void remove_subtitle_range(MPContext *mpctx, int start, int count) +{ + int idx; + int end = start + count; + int after = mpctx->set_of_sub_size - end; + sub_data **subs = mpctx->set_of_subtitles; +#ifdef CONFIG_ASS + ass_track_t **ass_tracks = mpctx->set_of_ass_tracks; +#endif + if (count < 0 || count > mpctx->set_of_sub_size || + start < 0 || start > mpctx->set_of_sub_size - count) { + mp_msg(MSGT_CPLAYER, MSGL_ERR, + "Cannot remove invalid subtitle range %i +%i\n", start, count); + return; + } + for (idx = start; idx < end; idx++) { + sub_data *subd = subs[idx]; + mp_msg(MSGT_CPLAYER, MSGL_STATUS, + MSGTR_RemovedSubtitleFile, idx + 1, + filename_recode(subd->filename)); + sub_free(subd); + subs[idx] = NULL; +#ifdef CONFIG_ASS + if (ass_tracks[idx]) + ass_free_track(ass_tracks[idx]); + ass_tracks[idx] = NULL; +#endif + } + + mpctx->global_sub_size -= count; + mpctx->set_of_sub_size -= count; + if (mpctx->set_of_sub_size <= 0) + mpctx->global_sub_indices[SUB_SOURCE_SUBS] = -1; + + memmove(subs + start, subs + end, after * sizeof(*subs)); + memset(subs + start + after, 0, count * sizeof(*subs)); +#ifdef CONFIG_ASS + memmove(ass_tracks + start, ass_tracks + end, after * sizeof(*ass_tracks)); + memset(ass_tracks + start + after, 0, count * sizeof(*ass_tracks)); +#endif + + if (mpctx->set_of_sub_pos >= start && mpctx->set_of_sub_pos < end) { + mpctx->global_sub_pos = -2; + subdata = NULL; +#ifdef CONFIG_ASS + ass_track = NULL; +#endif + mp_input_queue_cmd(mp_input_parse_cmd("sub_select")); + } else if (mpctx->set_of_sub_pos >= end) { + mpctx->set_of_sub_pos -= count; + mpctx->global_sub_pos -= count; + } +} + +int run_command(MPContext *mpctx, mp_cmd_t *cmd) { sh_audio_t * const sh_audio = mpctx->sh_audio; sh_video_t * const sh_video = mpctx->sh_video; int brk_cmd = 0; if (!set_property_command(mpctx, cmd)) - switch (cmd->id) { - case MP_CMD_SEEK:{ - float v; - int abs; - if (sh_video) - mpctx->osd_show_percentage = sh_video->fps; - v = cmd->args[0].v.f; - abs = (cmd->nargs > 1) ? cmd->args[1].v.i : 0; - if (abs == 2) { /* Absolute seek to a specific timestamp in seconds */ - abs_seek_pos = SEEK_ABSOLUTE; - if (sh_video) - mpctx->osd_function = - (v > sh_video->pts) ? OSD_FFW : OSD_REW; - rel_seek_secs = v; - } else if (abs) { /* Absolute seek by percentage */ - abs_seek_pos = SEEK_ABSOLUTE | SEEK_FACTOR; - if (sh_video) - mpctx->osd_function = OSD_FFW; // Direction isn't set correctly - rel_seek_secs = v / 100.0; - } else { - rel_seek_secs += v; - mpctx->osd_function = (v > 0) ? OSD_FFW : OSD_REW; - } - brk_cmd = 1; - } - break; - - case MP_CMD_SET_PROPERTY:{ - int r = mp_property_do(cmd->args[0].v.s, M_PROPERTY_PARSE, - cmd->args[1].v.s, mpctx); - if (r == M_PROPERTY_UNKNOWN) - mp_msg(MSGT_CPLAYER, MSGL_WARN, - "Unknown property: '%s'\n", cmd->args[0].v.s); - else if (r <= 0) - mp_msg(MSGT_CPLAYER, MSGL_WARN, - "Failed to set property '%s' to '%s'.\n", - cmd->args[0].v.s, cmd->args[1].v.s); - } - break; - - case MP_CMD_STEP_PROPERTY:{ - void* arg = NULL; - int r,i; - double d; - off_t o; - if (cmd->args[1].v.f) { - m_option_t* prop; - if((r = mp_property_do(cmd->args[0].v.s, - M_PROPERTY_GET_TYPE, - &prop, mpctx)) <= 0) - goto step_prop_err; - if(prop->type == CONF_TYPE_INT || - prop->type == CONF_TYPE_FLAG) - i = cmd->args[1].v.f, arg = &i; - else if(prop->type == CONF_TYPE_FLOAT) - arg = &cmd->args[1].v.f; - else if(prop->type == CONF_TYPE_DOUBLE || - prop->type == CONF_TYPE_TIME) - d = cmd->args[1].v.f, arg = &d; - else if(prop->type == CONF_TYPE_POSITION) - o = cmd->args[1].v.f, arg = &o; - else - mp_msg(MSGT_CPLAYER, MSGL_WARN, - "Ignoring step size stepping property '%s'.\n", - cmd->args[0].v.s); - } - r = mp_property_do(cmd->args[0].v.s, - cmd->args[2].v.i < 0 ? - M_PROPERTY_STEP_DOWN : M_PROPERTY_STEP_UP, - arg, mpctx); - step_prop_err: - if (r == M_PROPERTY_UNKNOWN) - mp_msg(MSGT_CPLAYER, MSGL_WARN, - "Unknown property: '%s'\n", cmd->args[0].v.s); - else if (r <= 0) - mp_msg(MSGT_CPLAYER, MSGL_WARN, - "Failed to increment property '%s' by %f.\n", - cmd->args[0].v.s, cmd->args[1].v.f); - } - break; - - case MP_CMD_GET_PROPERTY:{ - char *tmp; - if (mp_property_do(cmd->args[0].v.s, M_PROPERTY_TO_STRING, - &tmp, mpctx) <= 0) { - mp_msg(MSGT_CPLAYER, MSGL_WARN, - "Failed to get value of property '%s'.\n", - cmd->args[0].v.s); - break; - } - mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_%s=%s\n", - cmd->args[0].v.s, tmp); - free(tmp); - } - break; - - case MP_CMD_EDL_MARK: - if (edl_fd) { - float v = sh_video ? sh_video->pts : - playing_audio_pts(sh_audio, mpctx->d_audio, - mpctx->audio_out); - - if (mpctx->begin_skip == MP_NOPTS_VALUE) { - mpctx->begin_skip = v; - mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_EdloutStartSkip); - } else { - if (mpctx->begin_skip > v) - mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdloutBadStop); - else { - fprintf(edl_fd, "%f %f %d\n", mpctx->begin_skip, v, 0); - mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_EdloutEndSkip); - } - mpctx->begin_skip = MP_NOPTS_VALUE; - } - } - break; + switch (cmd->id) { + case MP_CMD_SEEK:{ + float v; + int abs; + if (sh_video) + mpctx->osd_show_percentage = sh_video->fps; + v = cmd->args[0].v.f; + abs = (cmd->nargs > 1) ? cmd->args[1].v.i : 0; + if (abs == 2) { /* Absolute seek to a specific timestamp in seconds */ + abs_seek_pos = SEEK_ABSOLUTE; + if (sh_video) + mpctx->osd_function = + (v > sh_video->pts) ? OSD_FFW : OSD_REW; + rel_seek_secs = v; + } else if (abs) { /* Absolute seek by percentage */ + abs_seek_pos = SEEK_ABSOLUTE | SEEK_FACTOR; + if (sh_video) + mpctx->osd_function = OSD_FFW; // Direction isn't set correctly + rel_seek_secs = v / 100.0; + } else { + rel_seek_secs += v; + mpctx->osd_function = (v > 0) ? OSD_FFW : OSD_REW; + } + brk_cmd = 1; + } + break; + + case MP_CMD_SET_PROPERTY:{ + int r = mp_property_do(cmd->args[0].v.s, M_PROPERTY_PARSE, + cmd->args[1].v.s, mpctx); + if (r == M_PROPERTY_UNKNOWN) + mp_msg(MSGT_CPLAYER, MSGL_WARN, + "Unknown property: '%s'\n", cmd->args[0].v.s); + else if (r <= 0) + mp_msg(MSGT_CPLAYER, MSGL_WARN, + "Failed to set property '%s' to '%s'.\n", + cmd->args[0].v.s, cmd->args[1].v.s); + if (r <= 0) + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_ERROR=%s\n", property_error_string(r)); + } + break; + + case MP_CMD_STEP_PROPERTY:{ + void* arg = NULL; + int r,i; + double d; + off_t o; + if (cmd->args[1].v.f) { + m_option_t *prop; + if((r = mp_property_do(cmd->args[0].v.s, + M_PROPERTY_GET_TYPE, + &prop, mpctx)) <= 0) + goto step_prop_err; + if(prop->type == CONF_TYPE_INT || + prop->type == CONF_TYPE_FLAG) + i = cmd->args[1].v.f, arg = &i; + else if(prop->type == CONF_TYPE_FLOAT) + arg = &cmd->args[1].v.f; + else if(prop->type == CONF_TYPE_DOUBLE || + prop->type == CONF_TYPE_TIME) + d = cmd->args[1].v.f, arg = &d; + else if(prop->type == CONF_TYPE_POSITION) + o = cmd->args[1].v.f, arg = &o; + else + mp_msg(MSGT_CPLAYER, MSGL_WARN, + "Ignoring step size stepping property '%s'.\n", + cmd->args[0].v.s); + } + r = mp_property_do(cmd->args[0].v.s, + cmd->args[2].v.i < 0 ? + M_PROPERTY_STEP_DOWN : M_PROPERTY_STEP_UP, + arg, mpctx); + step_prop_err: + if (r == M_PROPERTY_UNKNOWN) + mp_msg(MSGT_CPLAYER, MSGL_WARN, + "Unknown property: '%s'\n", cmd->args[0].v.s); + else if (r <= 0) + mp_msg(MSGT_CPLAYER, MSGL_WARN, + "Failed to increment property '%s' by %f.\n", + cmd->args[0].v.s, cmd->args[1].v.f); + if (r <= 0) + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_ERROR=%s\n", property_error_string(r)); + } + break; + + case MP_CMD_GET_PROPERTY:{ + char *tmp; + int r = mp_property_do(cmd->args[0].v.s, M_PROPERTY_TO_STRING, + &tmp, mpctx); + if (r <= 0) { + mp_msg(MSGT_CPLAYER, MSGL_WARN, + "Failed to get value of property '%s'.\n", + cmd->args[0].v.s); + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_ERROR=%s\n", property_error_string(r)); + break; + } + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_%s=%s\n", + cmd->args[0].v.s, tmp); + free(tmp); + } + break; + + case MP_CMD_EDL_MARK: + if (edl_fd) { + float v = sh_video ? sh_video->pts : + playing_audio_pts(sh_audio, mpctx->d_audio, + mpctx->audio_out); + + if (mpctx->begin_skip == MP_NOPTS_VALUE) { + mpctx->begin_skip = v; + mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_EdloutStartSkip); + } else { + if (mpctx->begin_skip > v) + mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_EdloutBadStop); + else { + fprintf(edl_fd, "%f %f %d\n", mpctx->begin_skip, v, 0); + mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_EdloutEndSkip); + } + mpctx->begin_skip = MP_NOPTS_VALUE; + } + } + break; - case MP_CMD_SWITCH_RATIO: + case MP_CMD_SWITCH_RATIO: if (!sh_video) break; - if (cmd->nargs == 0 || cmd->args[0].v.f == -1) - movie_aspect = (float) sh_video->disp_w / sh_video->disp_h; - else - movie_aspect = cmd->args[0].v.f; - mpcodecs_config_vo(sh_video, sh_video->disp_w, sh_video->disp_h, 0); - break; - - case MP_CMD_SPEED_INCR:{ - float v = cmd->args[0].v.f; - playback_speed += v; - build_afilter_chain(sh_audio, &ao_data); - set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, MSGTR_OSDSpeed, - playback_speed); - } break; - - case MP_CMD_SPEED_MULT:{ - float v = cmd->args[0].v.f; - playback_speed *= v; - build_afilter_chain(sh_audio, &ao_data); - set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, MSGTR_OSDSpeed, - playback_speed); - } break; - - case MP_CMD_SPEED_SET:{ - float v = cmd->args[0].v.f; - playback_speed = v; - build_afilter_chain(sh_audio, &ao_data); - set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, MSGTR_OSDSpeed, - playback_speed); - } break; - - case MP_CMD_FRAME_STEP: - case MP_CMD_PAUSE: - cmd->pausing = 1; - brk_cmd = 1; - break; - - case MP_CMD_FILE_FILTER: - file_filter = cmd->args[0].v.i; - break; - - case MP_CMD_QUIT: - exit_player_with_rc(EXIT_QUIT, - (cmd->nargs > 0) ? cmd->args[0].v.i : 0); - - case MP_CMD_PLAY_TREE_STEP:{ - int n = cmd->args[0].v.i == 0 ? 1 : cmd->args[0].v.i; - int force = cmd->args[1].v.i; + if (cmd->nargs == 0 || cmd->args[0].v.f == -1) + movie_aspect = (float) sh_video->disp_w / sh_video->disp_h; + else + movie_aspect = cmd->args[0].v.f; + mpcodecs_config_vo(sh_video, sh_video->disp_w, sh_video->disp_h, 0); + break; + + case MP_CMD_SPEED_INCR:{ + float v = cmd->args[0].v.f; + playback_speed += v; + build_afilter_chain(sh_audio, &ao_data); + set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, MSGTR_OSDSpeed, + playback_speed); + } break; + + case MP_CMD_SPEED_MULT:{ + float v = cmd->args[0].v.f; + playback_speed *= v; + build_afilter_chain(sh_audio, &ao_data); + set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, MSGTR_OSDSpeed, + playback_speed); + } break; + + case MP_CMD_SPEED_SET:{ + float v = cmd->args[0].v.f; + playback_speed = v; + build_afilter_chain(sh_audio, &ao_data); + set_osd_msg(OSD_MSG_SPEED, 1, osd_duration, MSGTR_OSDSpeed, + playback_speed); + } break; + + case MP_CMD_FRAME_STEP: + case MP_CMD_PAUSE: + cmd->pausing = 1; + brk_cmd = 1; + break; + + case MP_CMD_FILE_FILTER: + file_filter = cmd->args[0].v.i; + break; + + case MP_CMD_QUIT: + exit_player_with_rc(EXIT_QUIT, + (cmd->nargs > 0) ? cmd->args[0].v.i : 0); + + case MP_CMD_PLAY_TREE_STEP:{ + int n = cmd->args[0].v.i == 0 ? 1 : cmd->args[0].v.i; + int force = cmd->args[1].v.i; #ifdef CONFIG_GUI - if (use_gui) { - int i = 0; - if (n > 0) - for (i = 0; i < n; i++) - mplNext(); - else - for (i = 0; i < -1 * n; i++) - mplPrev(); - } else -#endif - { - if (!force && mpctx->playtree_iter) { - play_tree_iter_t *i = - play_tree_iter_new_copy(mpctx->playtree_iter); - if (play_tree_iter_step(i, n, 0) == - PLAY_TREE_ITER_ENTRY) - mpctx->eof = - (n > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY; - play_tree_iter_free(i); - } else - mpctx->eof = (n > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY; - if (mpctx->eof) - mpctx->play_tree_step = n; - brk_cmd = 1; - } - } - break; - - case MP_CMD_PLAY_TREE_UP_STEP:{ - int n = cmd->args[0].v.i > 0 ? 1 : -1; - int force = cmd->args[1].v.i; - - if (!force && mpctx->playtree_iter) { - play_tree_iter_t *i = - play_tree_iter_new_copy(mpctx->playtree_iter); - if (play_tree_iter_up_step(i, n, 0) == PLAY_TREE_ITER_ENTRY) - mpctx->eof = (n > 0) ? PT_UP_NEXT : PT_UP_PREV; - play_tree_iter_free(i); - } else - mpctx->eof = (n > 0) ? PT_UP_NEXT : PT_UP_PREV; - brk_cmd = 1; - } - break; - - case MP_CMD_PLAY_ALT_SRC_STEP: - if (mpctx->playtree_iter && mpctx->playtree_iter->num_files > 1) { - int v = cmd->args[0].v.i; - if (v > 0 - && mpctx->playtree_iter->file < - mpctx->playtree_iter->num_files) - mpctx->eof = PT_NEXT_SRC; - else if (v < 0 && mpctx->playtree_iter->file > 1) - mpctx->eof = PT_PREV_SRC; - } - brk_cmd = 1; - break; - - case MP_CMD_SUB_STEP: - if (sh_video) { - int movement = cmd->args[0].v.i; - step_sub(subdata, sh_video->pts, movement); + if (use_gui) { + int i = 0; + if (n > 0) + for (i = 0; i < n; i++) + mplNext(); + else + for (i = 0; i < -1 * n; i++) + mplPrev(); + } else +#endif + { + if (!force && mpctx->playtree_iter) { + play_tree_iter_t *i = + play_tree_iter_new_copy(mpctx->playtree_iter); + if (play_tree_iter_step(i, n, 0) == + PLAY_TREE_ITER_ENTRY) + mpctx->eof = + (n > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY; + play_tree_iter_free(i); + } else + mpctx->eof = (n > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY; + if (mpctx->eof) + mpctx->play_tree_step = n; + brk_cmd = 1; + } + } + break; + + case MP_CMD_PLAY_TREE_UP_STEP:{ + int n = cmd->args[0].v.i > 0 ? 1 : -1; + int force = cmd->args[1].v.i; + + if (!force && mpctx->playtree_iter) { + play_tree_iter_t *i = + play_tree_iter_new_copy(mpctx->playtree_iter); + if (play_tree_iter_up_step(i, n, 0) == PLAY_TREE_ITER_ENTRY) + mpctx->eof = (n > 0) ? PT_UP_NEXT : PT_UP_PREV; + play_tree_iter_free(i); + } else + mpctx->eof = (n > 0) ? PT_UP_NEXT : PT_UP_PREV; + brk_cmd = 1; + } + break; + + case MP_CMD_PLAY_ALT_SRC_STEP: + if (mpctx->playtree_iter && mpctx->playtree_iter->num_files > 1) { + int v = cmd->args[0].v.i; + if (v > 0 + && mpctx->playtree_iter->file < + mpctx->playtree_iter->num_files) + mpctx->eof = PT_NEXT_SRC; + else if (v < 0 && mpctx->playtree_iter->file > 1) + mpctx->eof = PT_PREV_SRC; + } + brk_cmd = 1; + break; + + case MP_CMD_SUB_STEP: + if (sh_video) { + int movement = cmd->args[0].v.i; + step_sub(subdata, sh_video->pts, movement); #ifdef CONFIG_ASS - if (ass_track) - sub_delay += - ass_step_sub(ass_track, - (sh_video->pts + - sub_delay) * 1000 + .5, movement) / 1000.; -#endif - set_osd_msg(OSD_MSG_SUB_DELAY, 1, osd_duration, - MSGTR_OSDSubDelay, ROUND(sub_delay * 1000)); - } - break; - - case MP_CMD_SUB_LOG: - log_sub(); - break; - - case MP_CMD_OSD:{ - int v = cmd->args[0].v.i; - int max = (term_osd - && !sh_video) ? MAX_TERM_OSD_LEVEL : MAX_OSD_LEVEL; - if (osd_level > max) - osd_level = max; - if (v < 0) - osd_level = (osd_level + 1) % (max + 1); - else - osd_level = v > max ? max : v; - /* Show OSD state when disabled, but not when an explicit - argument is given to the OSD command, i.e. in slave mode. */ - if (v == -1 && osd_level <= 1) - set_osd_msg(OSD_MSG_OSD_STATUS, 0, osd_duration, - MSGTR_OSDosd, - osd_level ? MSGTR_OSDenabled : - MSGTR_OSDdisabled); - else - rm_osd_msg(OSD_MSG_OSD_STATUS); - } - break; - - case MP_CMD_OSD_SHOW_TEXT: - set_osd_msg(OSD_MSG_TEXT, cmd->args[2].v.i, - (cmd->args[1].v.i < - 0 ? osd_duration : cmd->args[1].v.i), - "%-.63s", cmd->args[0].v.s); - break; - - case MP_CMD_OSD_SHOW_PROPERTY_TEXT:{ - char *txt = m_properties_expand_string(mp_properties, - cmd->args[0].v.s, - mpctx); - /* if no argument supplied take default osd_duration, else ms. */ - if (txt) { - set_osd_msg(OSD_MSG_TEXT, cmd->args[2].v.i, - (cmd->args[1].v.i < - 0 ? osd_duration : cmd->args[1].v.i), - "%-.63s", txt); - free(txt); - } - } - break; - - case MP_CMD_LOADFILE:{ - play_tree_t *e = play_tree_new(); - play_tree_add_file(e, cmd->args[0].v.s); - - if (cmd->args[1].v.i) // append - play_tree_append_entry(mpctx->playtree->child, e); - else { - // Go back to the starting point. - while (play_tree_iter_up_step - (mpctx->playtree_iter, 0, 1) != PLAY_TREE_ITER_END) - /* NOP */ ; - play_tree_free_list(mpctx->playtree->child, 1); - play_tree_set_child(mpctx->playtree, e); - pt_iter_goto_head(mpctx->playtree_iter); - mpctx->eof = PT_NEXT_SRC; - } - brk_cmd = 1; - } - break; - - case MP_CMD_LOADLIST:{ - play_tree_t *e = parse_playlist_file(cmd->args[0].v.s); - if (!e) - mp_msg(MSGT_CPLAYER, MSGL_ERR, - MSGTR_PlaylistLoadUnable, cmd->args[0].v.s); - else { - if (cmd->args[1].v.i) // append - play_tree_append_entry(mpctx->playtree->child, e); - else { - // Go back to the starting point. - while (play_tree_iter_up_step - (mpctx->playtree_iter, 0, 1) - != PLAY_TREE_ITER_END) - /* NOP */ ; - play_tree_free_list(mpctx->playtree->child, 1); - play_tree_set_child(mpctx->playtree, e); - pt_iter_goto_head(mpctx->playtree_iter); - mpctx->eof = PT_NEXT_SRC; - } - } - brk_cmd = 1; - } - break; - - case MP_CMD_STOP: - // Go back to the starting point. - while (play_tree_iter_up_step - (mpctx->playtree_iter, 0, 1) != PLAY_TREE_ITER_END) - /* NOP */ ; - mpctx->eof = PT_STOP; - brk_cmd = 1; - break; + if (ass_track) + sub_delay += + ass_step_sub(ass_track, + (sh_video->pts + + sub_delay) * 1000 + .5, movement) / 1000.; +#endif + set_osd_msg(OSD_MSG_SUB_DELAY, 1, osd_duration, + MSGTR_OSDSubDelay, ROUND(sub_delay * 1000)); + } + break; + + case MP_CMD_SUB_LOG: + log_sub(); + break; + + case MP_CMD_OSD:{ + int v = cmd->args[0].v.i; + int max = (term_osd + && !sh_video) ? MAX_TERM_OSD_LEVEL : MAX_OSD_LEVEL; + if (osd_level > max) + osd_level = max; + if (v < 0) + osd_level = (osd_level + 1) % (max + 1); + else + osd_level = v > max ? max : v; + /* Show OSD state when disabled, but not when an explicit + argument is given to the OSD command, i.e. in slave mode. */ + if (v == -1 && osd_level <= 1) + set_osd_msg(OSD_MSG_OSD_STATUS, 0, osd_duration, + MSGTR_OSDosd, + osd_level ? MSGTR_OSDenabled : + MSGTR_OSDdisabled); + else + rm_osd_msg(OSD_MSG_OSD_STATUS); + } + break; + + case MP_CMD_OSD_SHOW_TEXT: + set_osd_msg(OSD_MSG_TEXT, cmd->args[2].v.i, + (cmd->args[1].v.i < + 0 ? osd_duration : cmd->args[1].v.i), + "%-.63s", cmd->args[0].v.s); + break; + + case MP_CMD_OSD_SHOW_PROPERTY_TEXT:{ + char *txt = m_properties_expand_string(mp_properties, + cmd->args[0].v.s, + mpctx); + /* if no argument supplied take default osd_duration, else ms. */ + if (txt) { + set_osd_msg(OSD_MSG_TEXT, cmd->args[2].v.i, + (cmd->args[1].v.i < + 0 ? osd_duration : cmd->args[1].v.i), + "%-.63s", txt); + free(txt); + } + } + break; + + case MP_CMD_LOADFILE:{ + play_tree_t *e = play_tree_new(); + play_tree_add_file(e, cmd->args[0].v.s); + + if (cmd->args[1].v.i) // append + play_tree_append_entry(mpctx->playtree->child, e); + else { + // Go back to the starting point. + while (play_tree_iter_up_step + (mpctx->playtree_iter, 0, 1) != PLAY_TREE_ITER_END) + /* NOP */ ; + play_tree_free_list(mpctx->playtree->child, 1); + play_tree_set_child(mpctx->playtree, e); + pt_iter_goto_head(mpctx->playtree_iter); + mpctx->eof = PT_NEXT_SRC; + } + brk_cmd = 1; + } + break; + + case MP_CMD_LOADLIST:{ + play_tree_t *e = parse_playlist_file(cmd->args[0].v.s); + if (!e) + mp_msg(MSGT_CPLAYER, MSGL_ERR, + MSGTR_PlaylistLoadUnable, cmd->args[0].v.s); + else { + if (cmd->args[1].v.i) // append + play_tree_append_entry(mpctx->playtree->child, e); + else { + // Go back to the starting point. + while (play_tree_iter_up_step + (mpctx->playtree_iter, 0, 1) + != PLAY_TREE_ITER_END) + /* NOP */ ; + play_tree_free_list(mpctx->playtree->child, 1); + play_tree_set_child(mpctx->playtree, e); + pt_iter_goto_head(mpctx->playtree_iter); + mpctx->eof = PT_NEXT_SRC; + } + } + brk_cmd = 1; + } + break; + + case MP_CMD_STOP: + // Go back to the starting point. + while (play_tree_iter_up_step + (mpctx->playtree_iter, 0, 1) != PLAY_TREE_ITER_END) + /* NOP */ ; + mpctx->eof = PT_STOP; + brk_cmd = 1; + break; + + case MP_CMD_OSD_SHOW_PROGRESSION:{ + int len = demuxer_get_time_length(mpctx->demuxer); + int pts = demuxer_get_current_time(mpctx->demuxer); + set_osd_bar(0, "Position", 0, 100, demuxer_get_percent_pos(mpctx->demuxer)); + set_osd_msg(OSD_MSG_TEXT, 1, osd_duration, + "%c %02d:%02d:%02d / %02d:%02d:%02d", + mpctx->osd_function, pts/3600, (pts/60)%60, pts%60, + len/3600, (len/60)%60, len%60); + } + break; #ifdef CONFIG_RADIO - case MP_CMD_RADIO_STEP_CHANNEL: - if (mpctx->demuxer->stream->type == STREAMTYPE_RADIO) { - int v = cmd->args[0].v.i; - if (v > 0) - radio_step_channel(mpctx->demuxer->stream, - RADIO_CHANNEL_HIGHER); - else - radio_step_channel(mpctx->demuxer->stream, - RADIO_CHANNEL_LOWER); - if (radio_get_channel_name(mpctx->demuxer->stream)) { - set_osd_msg(OSD_MSG_RADIO_CHANNEL, 1, osd_duration, - MSGTR_OSDChannel, - radio_get_channel_name(mpctx->demuxer->stream)); - } - } - break; - - case MP_CMD_RADIO_SET_CHANNEL: - if (mpctx->demuxer->stream->type == STREAMTYPE_RADIO) { - radio_set_channel(mpctx->demuxer->stream, cmd->args[0].v.s); - if (radio_get_channel_name(mpctx->demuxer->stream)) { - set_osd_msg(OSD_MSG_RADIO_CHANNEL, 1, osd_duration, - MSGTR_OSDChannel, - radio_get_channel_name(mpctx->demuxer->stream)); - } - } - break; - - case MP_CMD_RADIO_SET_FREQ: - if (mpctx->demuxer->stream->type == STREAMTYPE_RADIO) - radio_set_freq(mpctx->demuxer->stream, cmd->args[0].v.f); - break; - - case MP_CMD_RADIO_STEP_FREQ: - if (mpctx->demuxer->stream->type == STREAMTYPE_RADIO) - radio_step_freq(mpctx->demuxer->stream, cmd->args[0].v.f); - break; + case MP_CMD_RADIO_STEP_CHANNEL: + if (mpctx->demuxer->stream->type == STREAMTYPE_RADIO) { + int v = cmd->args[0].v.i; + if (v > 0) + radio_step_channel(mpctx->demuxer->stream, + RADIO_CHANNEL_HIGHER); + else + radio_step_channel(mpctx->demuxer->stream, + RADIO_CHANNEL_LOWER); + if (radio_get_channel_name(mpctx->demuxer->stream)) { + set_osd_msg(OSD_MSG_RADIO_CHANNEL, 1, osd_duration, + MSGTR_OSDChannel, + radio_get_channel_name(mpctx->demuxer->stream)); + } + } + break; + + case MP_CMD_RADIO_SET_CHANNEL: + if (mpctx->demuxer->stream->type == STREAMTYPE_RADIO) { + radio_set_channel(mpctx->demuxer->stream, cmd->args[0].v.s); + if (radio_get_channel_name(mpctx->demuxer->stream)) { + set_osd_msg(OSD_MSG_RADIO_CHANNEL, 1, osd_duration, + MSGTR_OSDChannel, + radio_get_channel_name(mpctx->demuxer->stream)); + } + } + break; + + case MP_CMD_RADIO_SET_FREQ: + if (mpctx->demuxer->stream->type == STREAMTYPE_RADIO) + radio_set_freq(mpctx->demuxer->stream, cmd->args[0].v.f); + break; + + case MP_CMD_RADIO_STEP_FREQ: + if (mpctx->demuxer->stream->type == STREAMTYPE_RADIO) + radio_step_freq(mpctx->demuxer->stream, cmd->args[0].v.f); + break; #endif #ifdef CONFIG_TV - case MP_CMD_TV_START_SCAN: - if (mpctx->file_format == DEMUXER_TYPE_TV) - tv_start_scan((tvi_handle_t *) (mpctx->demuxer->priv),1); - break; - case MP_CMD_TV_SET_FREQ: - if (mpctx->file_format == DEMUXER_TYPE_TV) - tv_set_freq((tvi_handle_t *) (mpctx->demuxer->priv), - cmd->args[0].v.f * 16.0); + case MP_CMD_TV_START_SCAN: + if (mpctx->file_format == DEMUXER_TYPE_TV) + tv_start_scan((tvi_handle_t *) (mpctx->demuxer->priv),1); + break; + case MP_CMD_TV_SET_FREQ: + if (mpctx->file_format == DEMUXER_TYPE_TV) + tv_set_freq((tvi_handle_t *) (mpctx->demuxer->priv), + cmd->args[0].v.f * 16.0); #ifdef CONFIG_PVR else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) { pvr_set_freq (mpctx->stream, ROUND (cmd->args[0].v.f)); @@ -2746,12 +2831,12 @@ pvr_get_current_stationname (mpctx->stream)); } #endif /* CONFIG_PVR */ - break; + break; - case MP_CMD_TV_STEP_FREQ: - if (mpctx->file_format == DEMUXER_TYPE_TV) - tv_step_freq((tvi_handle_t *) (mpctx->demuxer->priv), - cmd->args[0].v.f * 16.0); + case MP_CMD_TV_STEP_FREQ: + if (mpctx->file_format == DEMUXER_TYPE_TV) + tv_step_freq((tvi_handle_t *) (mpctx->demuxer->priv), + cmd->args[0].v.f * 16.0); #ifdef CONFIG_PVR else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) { pvr_force_freq_step (mpctx->stream, ROUND (cmd->args[0].v.f)); @@ -2760,32 +2845,32 @@ pvr_get_current_frequency (mpctx->stream)); } #endif /* CONFIG_PVR */ - break; + break; + + case MP_CMD_TV_SET_NORM: + if (mpctx->file_format == DEMUXER_TYPE_TV) + tv_set_norm((tvi_handle_t *) (mpctx->demuxer->priv), + cmd->args[0].v.s); + break; - case MP_CMD_TV_SET_NORM: - if (mpctx->file_format == DEMUXER_TYPE_TV) - tv_set_norm((tvi_handle_t *) (mpctx->demuxer->priv), - cmd->args[0].v.s); - break; - - case MP_CMD_TV_STEP_CHANNEL:{ - if (mpctx->file_format == DEMUXER_TYPE_TV) { - int v = cmd->args[0].v.i; - if (v > 0) { - tv_step_channel((tvi_handle_t *) (mpctx-> - demuxer->priv), - TV_CHANNEL_HIGHER); - } else { - tv_step_channel((tvi_handle_t *) (mpctx-> - demuxer->priv), - TV_CHANNEL_LOWER); - } - if (tv_channel_list) { - set_osd_msg(OSD_MSG_TV_CHANNEL, 1, osd_duration, - MSGTR_OSDChannel, tv_channel_current->name); - //vo_osd_changed(OSDTYPE_SUBTITLE); - } - } + case MP_CMD_TV_STEP_CHANNEL:{ + if (mpctx->file_format == DEMUXER_TYPE_TV) { + int v = cmd->args[0].v.i; + if (v > 0) { + tv_step_channel((tvi_handle_t *) (mpctx-> + demuxer->priv), + TV_CHANNEL_HIGHER); + } else { + tv_step_channel((tvi_handle_t *) (mpctx-> + demuxer->priv), + TV_CHANNEL_LOWER); + } + if (tv_channel_list) { + set_osd_msg(OSD_MSG_TV_CHANNEL, 1, osd_duration, + MSGTR_OSDChannel, tv_channel_current->name); + //vo_osd_changed(OSDTYPE_SUBTITLE); + } + } #ifdef CONFIG_PVR else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) { @@ -2795,35 +2880,35 @@ pvr_get_current_stationname (mpctx->stream)); } #endif /* CONFIG_PVR */ - } + } #ifdef CONFIG_DVBIN - if (mpctx->stream->type == STREAMTYPE_DVB) { - int dir; - int v = cmd->args[0].v.i; - - mpctx->last_dvb_step = v; - if (v > 0) - dir = DVB_CHANNEL_HIGHER; - else - dir = DVB_CHANNEL_LOWER; + if (mpctx->stream->type == STREAMTYPE_DVB) { + int dir; + int v = cmd->args[0].v.i; + + mpctx->last_dvb_step = v; + if (v > 0) + dir = DVB_CHANNEL_HIGHER; + else + dir = DVB_CHANNEL_LOWER; - if (dvb_step_channel(mpctx->stream, dir)) - mpctx->eof = mpctx->dvbin_reopen = 1; - } + if (dvb_step_channel(mpctx->stream, dir)) + mpctx->eof = mpctx->dvbin_reopen = 1; + } #endif /* CONFIG_DVBIN */ - break; + break; - case MP_CMD_TV_SET_CHANNEL: - if (mpctx->file_format == DEMUXER_TYPE_TV) { - tv_set_channel((tvi_handle_t *) (mpctx->demuxer->priv), - cmd->args[0].v.s); - if (tv_channel_list) { - set_osd_msg(OSD_MSG_TV_CHANNEL, 1, osd_duration, - MSGTR_OSDChannel, tv_channel_current->name); - //vo_osd_changed(OSDTYPE_SUBTITLE); - } - } + case MP_CMD_TV_SET_CHANNEL: + if (mpctx->file_format == DEMUXER_TYPE_TV) { + tv_set_channel((tvi_handle_t *) (mpctx->demuxer->priv), + cmd->args[0].v.s); + if (tv_channel_list) { + set_osd_msg(OSD_MSG_TV_CHANNEL, 1, osd_duration, + MSGTR_OSDChannel, tv_channel_current->name); + //vo_osd_changed(OSDTYPE_SUBTITLE); + } + } #ifdef CONFIG_PVR else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) { pvr_set_channel (mpctx->stream, cmd->args[0].v.s); @@ -2832,29 +2917,29 @@ pvr_get_current_stationname (mpctx->stream)); } #endif /* CONFIG_PVR */ - break; + break; #ifdef CONFIG_DVBIN - case MP_CMD_DVB_SET_CHANNEL: - if (mpctx->stream->type == STREAMTYPE_DVB) { - mpctx->last_dvb_step = 1; - - if (dvb_set_channel - (mpctx->stream, cmd->args[1].v.i, cmd->args[0].v.i)) - mpctx->eof = mpctx->dvbin_reopen = 1; - } - break; + case MP_CMD_DVB_SET_CHANNEL: + if (mpctx->stream->type == STREAMTYPE_DVB) { + mpctx->last_dvb_step = 1; + + if (dvb_set_channel + (mpctx->stream, cmd->args[1].v.i, cmd->args[0].v.i)) + mpctx->eof = mpctx->dvbin_reopen = 1; + } + break; #endif /* CONFIG_DVBIN */ - case MP_CMD_TV_LAST_CHANNEL: - if (mpctx->file_format == DEMUXER_TYPE_TV) { - tv_last_channel((tvi_handle_t *) (mpctx->demuxer->priv)); - if (tv_channel_list) { - set_osd_msg(OSD_MSG_TV_CHANNEL, 1, osd_duration, - MSGTR_OSDChannel, tv_channel_current->name); - //vo_osd_changed(OSDTYPE_SUBTITLE); - } - } + case MP_CMD_TV_LAST_CHANNEL: + if (mpctx->file_format == DEMUXER_TYPE_TV) { + tv_last_channel((tvi_handle_t *) (mpctx->demuxer->priv)); + if (tv_channel_list) { + set_osd_msg(OSD_MSG_TV_CHANNEL, 1, osd_duration, + MSGTR_OSDChannel, tv_channel_current->name); + //vo_osd_changed(OSDTYPE_SUBTITLE); + } + } #ifdef CONFIG_PVR else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) { pvr_set_lastchannel (mpctx->stream); @@ -2863,362 +2948,356 @@ pvr_get_current_stationname (mpctx->stream)); } #endif /* CONFIG_PVR */ - break; + break; - case MP_CMD_TV_STEP_NORM: - if (mpctx->file_format == DEMUXER_TYPE_TV) - tv_step_norm((tvi_handle_t *) (mpctx->demuxer->priv)); - break; - - case MP_CMD_TV_STEP_CHANNEL_LIST: - if (mpctx->file_format == DEMUXER_TYPE_TV) - tv_step_chanlist((tvi_handle_t *) (mpctx->demuxer->priv)); - break; -#ifdef CONFIG_TV_TELETEXT - case MP_CMD_TV_TELETEXT_ADD_DEC: - { - tvi_handle_t* tvh=(tvi_handle_t *)(mpctx->demuxer->priv); - if (mpctx->file_format == DEMUXER_TYPE_TV) - tvh->functions->control(tvh->priv,TV_VBI_CONTROL_ADD_DEC,&(cmd->args[0].v.s)); - break; - } - case MP_CMD_TV_TELETEXT_GO_LINK: - { - tvi_handle_t* tvh=(tvi_handle_t *)(mpctx->demuxer->priv); - if (mpctx->file_format == DEMUXER_TYPE_TV) - tvh->functions->control(tvh->priv,TV_VBI_CONTROL_GO_LINK,&(cmd->args[0].v.i)); - break; - } -#endif /* CONFIG_TV_TELETEXT */ + case MP_CMD_TV_STEP_NORM: + if (mpctx->file_format == DEMUXER_TYPE_TV) + tv_step_norm((tvi_handle_t *) (mpctx->demuxer->priv)); + break; + + case MP_CMD_TV_STEP_CHANNEL_LIST: + if (mpctx->file_format == DEMUXER_TYPE_TV) + tv_step_chanlist((tvi_handle_t *) (mpctx->demuxer->priv)); + break; #endif /* CONFIG_TV */ + case MP_CMD_TV_TELETEXT_ADD_DEC: + { + if (mpctx->demuxer->teletext) + teletext_control(mpctx->demuxer->teletext,TV_VBI_CONTROL_ADD_DEC, + &(cmd->args[0].v.s)); + break; + } + case MP_CMD_TV_TELETEXT_GO_LINK: + { + if (mpctx->demuxer->teletext) + teletext_control(mpctx->demuxer->teletext,TV_VBI_CONTROL_GO_LINK, + &(cmd->args[0].v.i)); + break; + } + + case MP_CMD_SUB_LOAD: + if (sh_video) { + int n = mpctx->set_of_sub_size; + add_subtitles(cmd->args[0].v.s, sh_video->fps, 0); + if (n != mpctx->set_of_sub_size) { + if (mpctx->global_sub_indices[SUB_SOURCE_SUBS] < 0) + mpctx->global_sub_indices[SUB_SOURCE_SUBS] = + mpctx->global_sub_size; + ++mpctx->global_sub_size; + } + } + break; + + case MP_CMD_SUB_REMOVE: + if (sh_video) { + int v = cmd->args[0].v.i; + if (v < 0) { + remove_subtitle_range(mpctx, 0, mpctx->set_of_sub_size); + } else if (v < mpctx->set_of_sub_size) { + remove_subtitle_range(mpctx, v, 1); + } + } + break; + + case MP_CMD_GET_SUB_VISIBILITY: + if (sh_video) { + mp_msg(MSGT_GLOBAL, MSGL_INFO, + "ANS_SUB_VISIBILITY=%d\n", sub_visibility); + } + break; - case MP_CMD_SUB_LOAD: - if (sh_video) { - int n = mpctx->set_of_sub_size; - add_subtitles(cmd->args[0].v.s, sh_video->fps, 0); - if (n != mpctx->set_of_sub_size) { - if (mpctx->global_sub_indices[SUB_SOURCE_SUBS] < 0) - mpctx->global_sub_indices[SUB_SOURCE_SUBS] = - mpctx->global_sub_size; - ++mpctx->global_sub_size; - } - } - break; - - case MP_CMD_SUB_REMOVE: - if (sh_video) { - int v = cmd->args[0].v.i; - sub_data *subd; - if (v < 0) { - for (v = 0; v < mpctx->set_of_sub_size; ++v) { - subd = mpctx->set_of_subtitles[v]; - mp_msg(MSGT_CPLAYER, MSGL_STATUS, - MSGTR_RemovedSubtitleFile, v + 1, - filename_recode(subd->filename)); - sub_free(subd); - mpctx->set_of_subtitles[v] = NULL; - } - mpctx->global_sub_indices[SUB_SOURCE_SUBS] = -1; - mpctx->global_sub_size -= mpctx->set_of_sub_size; - mpctx->set_of_sub_size = 0; - if (mpctx->set_of_sub_pos >= 0) { - mpctx->global_sub_pos = -2; - subdata = NULL; - mp_input_queue_cmd(mp_input_parse_cmd("sub_select")); - } - } else if (v < mpctx->set_of_sub_size) { - subd = mpctx->set_of_subtitles[v]; - mp_msg(MSGT_CPLAYER, MSGL_STATUS, - MSGTR_RemovedSubtitleFile, v + 1, - filename_recode(subd->filename)); - sub_free(subd); - if (mpctx->set_of_sub_pos == v) { - mpctx->global_sub_pos = -2; - subdata = NULL; - mp_input_queue_cmd(mp_input_parse_cmd("sub_select")); - } else if (mpctx->set_of_sub_pos > v) { - --mpctx->set_of_sub_pos; - --mpctx->global_sub_pos; - } - while (++v < mpctx->set_of_sub_size) - mpctx->set_of_subtitles[v - 1] = - mpctx->set_of_subtitles[v]; - --mpctx->set_of_sub_size; - --mpctx->global_sub_size; - if (mpctx->set_of_sub_size <= 0) - mpctx->global_sub_indices[SUB_SOURCE_SUBS] = -1; - mpctx->set_of_subtitles[mpctx->set_of_sub_size] = NULL; - } - } - break; - - case MP_CMD_GET_SUB_VISIBILITY: - if (sh_video) { - mp_msg(MSGT_GLOBAL, MSGL_INFO, - "ANS_SUB_VISIBILITY=%d\n", sub_visibility); - } - break; - - case MP_CMD_SCREENSHOT: - if (vo_config_count) { - mp_msg(MSGT_CPLAYER, MSGL_INFO, "sending VFCTRL_SCREENSHOT!\n"); - if (CONTROL_OK != - ((vf_instance_t *) sh_video->vfilter)-> - control(sh_video->vfilter, VFCTRL_SCREENSHOT, - &cmd->args[0].v.i)) - mp_msg(MSGT_CPLAYER, MSGL_INFO, "failed (forgot -vf screenshot?)\n"); - } - break; + case MP_CMD_SCREENSHOT: + if (vo_config_count) { + mp_msg(MSGT_CPLAYER, MSGL_INFO, "sending VFCTRL_SCREENSHOT!\n"); + if (CONTROL_OK != + ((vf_instance_t *) sh_video->vfilter)-> + control(sh_video->vfilter, VFCTRL_SCREENSHOT, + &cmd->args[0].v.i)) + mp_msg(MSGT_CPLAYER, MSGL_INFO, "failed (forgot -vf screenshot?)\n"); + } + break; - case MP_CMD_VF_CHANGE_RECTANGLE: + case MP_CMD_VF_CHANGE_RECTANGLE: if (!sh_video) break; - set_rectangle(sh_video, cmd->args[0].v.i, cmd->args[1].v.i); - break; + set_rectangle(sh_video, cmd->args[0].v.i, cmd->args[1].v.i); + break; - case MP_CMD_GET_TIME_LENGTH:{ - mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_LENGTH=%.2lf\n", - demuxer_get_time_length(mpctx->demuxer)); - } - break; - - case MP_CMD_GET_FILENAME:{ - mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_FILENAME='%s'\n", - get_metadata(META_NAME)); - } - break; - - case MP_CMD_GET_VIDEO_CODEC:{ - char *inf = get_metadata(META_VIDEO_CODEC); - if (!inf) - inf = strdup(""); - mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_VIDEO_CODEC='%s'\n", inf); - free(inf); - } - break; - - case MP_CMD_GET_VIDEO_BITRATE:{ - char *inf = get_metadata(META_VIDEO_BITRATE); - if (!inf) - inf = strdup(""); - mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_VIDEO_BITRATE='%s'\n", inf); - free(inf); - } - break; - - case MP_CMD_GET_VIDEO_RESOLUTION:{ - char *inf = get_metadata(META_VIDEO_RESOLUTION); - if (!inf) - inf = strdup(""); - mp_msg(MSGT_GLOBAL, MSGL_INFO, - "ANS_VIDEO_RESOLUTION='%s'\n", inf); - free(inf); - } - break; - - case MP_CMD_GET_AUDIO_CODEC:{ - char *inf = get_metadata(META_AUDIO_CODEC); - if (!inf) - inf = strdup(""); - mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_AUDIO_CODEC='%s'\n", inf); - free(inf); - } - break; - - case MP_CMD_GET_AUDIO_BITRATE:{ - char *inf = get_metadata(META_AUDIO_BITRATE); - if (!inf) - inf = strdup(""); - mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_AUDIO_BITRATE='%s'\n", inf); - free(inf); - } - break; - - case MP_CMD_GET_AUDIO_SAMPLES:{ - char *inf = get_metadata(META_AUDIO_SAMPLES); - if (!inf) - inf = strdup(""); - mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_AUDIO_SAMPLES='%s'\n", inf); - free(inf); - } - break; - - case MP_CMD_GET_META_TITLE:{ - char *inf = get_metadata(META_INFO_TITLE); - if (!inf) - inf = strdup(""); - mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_TITLE='%s'\n", inf); - free(inf); - } - break; - - case MP_CMD_GET_META_ARTIST:{ - char *inf = get_metadata(META_INFO_ARTIST); - if (!inf) - inf = strdup(""); - mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_ARTIST='%s'\n", inf); - free(inf); - } - break; - - case MP_CMD_GET_META_ALBUM:{ - char *inf = get_metadata(META_INFO_ALBUM); - if (!inf) - inf = strdup(""); - mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_ALBUM='%s'\n", inf); - free(inf); - } - break; - - case MP_CMD_GET_META_YEAR:{ - char *inf = get_metadata(META_INFO_YEAR); - if (!inf) - inf = strdup(""); - mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_YEAR='%s'\n", inf); - free(inf); - } - break; - - case MP_CMD_GET_META_COMMENT:{ - char *inf = get_metadata(META_INFO_COMMENT); - if (!inf) - inf = strdup(""); - mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_COMMENT='%s'\n", inf); - free(inf); - } - break; - - case MP_CMD_GET_META_TRACK:{ - char *inf = get_metadata(META_INFO_TRACK); - if (!inf) - inf = strdup(""); - mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_TRACK='%s'\n", inf); - free(inf); - } - break; - - case MP_CMD_GET_META_GENRE:{ - char *inf = get_metadata(META_INFO_GENRE); - if (!inf) - inf = strdup(""); - mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_GENRE='%s'\n", inf); - free(inf); - } - break; - - case MP_CMD_GET_VO_FULLSCREEN: - if (mpctx->video_out && vo_config_count) - mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_VO_FULLSCREEN=%d\n", vo_fs); - break; - - case MP_CMD_GET_PERCENT_POS: - mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_PERCENT_POSITION=%d\n", - demuxer_get_percent_pos(mpctx->demuxer)); - break; - - case MP_CMD_GET_TIME_POS:{ - float pos = 0; - if (sh_video) - pos = sh_video->pts; - else if (sh_audio && mpctx->audio_out) - pos = - playing_audio_pts(sh_audio, mpctx->d_audio, - mpctx->audio_out); - mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_TIME_POSITION=%.1f\n", pos); - } - break; + case MP_CMD_GET_TIME_LENGTH:{ + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_LENGTH=%.2lf\n", + demuxer_get_time_length(mpctx->demuxer)); + } + break; - case MP_CMD_RUN: + case MP_CMD_GET_FILENAME:{ + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_FILENAME='%s'\n", + get_metadata(META_NAME)); + } + break; + + case MP_CMD_GET_VIDEO_CODEC:{ + char *inf = get_metadata(META_VIDEO_CODEC); + if (!inf) + inf = strdup(""); + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_VIDEO_CODEC='%s'\n", inf); + free(inf); + } + break; + + case MP_CMD_GET_VIDEO_BITRATE:{ + char *inf = get_metadata(META_VIDEO_BITRATE); + if (!inf) + inf = strdup(""); + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_VIDEO_BITRATE='%s'\n", inf); + free(inf); + } + break; + + case MP_CMD_GET_VIDEO_RESOLUTION:{ + char *inf = get_metadata(META_VIDEO_RESOLUTION); + if (!inf) + inf = strdup(""); + mp_msg(MSGT_GLOBAL, MSGL_INFO, + "ANS_VIDEO_RESOLUTION='%s'\n", inf); + free(inf); + } + break; + + case MP_CMD_GET_AUDIO_CODEC:{ + char *inf = get_metadata(META_AUDIO_CODEC); + if (!inf) + inf = strdup(""); + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_AUDIO_CODEC='%s'\n", inf); + free(inf); + } + break; + + case MP_CMD_GET_AUDIO_BITRATE:{ + char *inf = get_metadata(META_AUDIO_BITRATE); + if (!inf) + inf = strdup(""); + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_AUDIO_BITRATE='%s'\n", inf); + free(inf); + } + break; + + case MP_CMD_GET_AUDIO_SAMPLES:{ + char *inf = get_metadata(META_AUDIO_SAMPLES); + if (!inf) + inf = strdup(""); + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_AUDIO_SAMPLES='%s'\n", inf); + free(inf); + } + break; + + case MP_CMD_GET_META_TITLE:{ + char *inf = get_metadata(META_INFO_TITLE); + if (!inf) + inf = strdup(""); + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_TITLE='%s'\n", inf); + free(inf); + } + break; + + case MP_CMD_GET_META_ARTIST:{ + char *inf = get_metadata(META_INFO_ARTIST); + if (!inf) + inf = strdup(""); + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_ARTIST='%s'\n", inf); + free(inf); + } + break; + + case MP_CMD_GET_META_ALBUM:{ + char *inf = get_metadata(META_INFO_ALBUM); + if (!inf) + inf = strdup(""); + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_ALBUM='%s'\n", inf); + free(inf); + } + break; + + case MP_CMD_GET_META_YEAR:{ + char *inf = get_metadata(META_INFO_YEAR); + if (!inf) + inf = strdup(""); + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_YEAR='%s'\n", inf); + free(inf); + } + break; + + case MP_CMD_GET_META_COMMENT:{ + char *inf = get_metadata(META_INFO_COMMENT); + if (!inf) + inf = strdup(""); + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_COMMENT='%s'\n", inf); + free(inf); + } + break; + + case MP_CMD_GET_META_TRACK:{ + char *inf = get_metadata(META_INFO_TRACK); + if (!inf) + inf = strdup(""); + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_TRACK='%s'\n", inf); + free(inf); + } + break; + + case MP_CMD_GET_META_GENRE:{ + char *inf = get_metadata(META_INFO_GENRE); + if (!inf) + inf = strdup(""); + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_META_GENRE='%s'\n", inf); + free(inf); + } + break; + + case MP_CMD_GET_VO_FULLSCREEN: + if (mpctx->video_out && vo_config_count) + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_VO_FULLSCREEN=%d\n", vo_fs); + break; + + case MP_CMD_GET_PERCENT_POS: + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_PERCENT_POSITION=%d\n", + demuxer_get_percent_pos(mpctx->demuxer)); + break; + + case MP_CMD_GET_TIME_POS:{ + float pos = 0; + if (sh_video) + pos = sh_video->pts; + else if (sh_audio && mpctx->audio_out) + pos = + playing_audio_pts(sh_audio, mpctx->d_audio, + mpctx->audio_out); + mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_TIME_POSITION=%.1f\n", pos); + } + break; + + case MP_CMD_RUN: #ifndef __MINGW32__ - if (!fork()) { - execl("/bin/sh", "sh", "-c", cmd->args[0].v.s, NULL); - exit(0); - } -#endif - break; - - case MP_CMD_KEYDOWN_EVENTS: - mplayer_put_key(cmd->args[0].v.i); - break; - - case MP_CMD_SET_MOUSE_POS:{ - int pointer_x, pointer_y; - double dx, dy; - pointer_x = cmd->args[0].v.i; - pointer_y = cmd->args[1].v.i; - rescale_input_coordinates(pointer_x, pointer_y, &dx, &dy); + if (!fork()) { + execl("/bin/sh", "sh", "-c", cmd->args[0].v.s, NULL); + exit(0); + } +#endif + break; + + case MP_CMD_KEYDOWN_EVENTS: + mplayer_put_key(cmd->args[0].v.i); + break; + + case MP_CMD_SET_MOUSE_POS:{ + int pointer_x, pointer_y; + double dx, dy; + pointer_x = cmd->args[0].v.i; + pointer_y = cmd->args[1].v.i; + rescale_input_coordinates(pointer_x, pointer_y, &dx, &dy); #ifdef CONFIG_DVDNAV - if (mpctx->stream->type == STREAMTYPE_DVDNAV - && dx > 0.0 && dy > 0.0) { - int button = -1; - pointer_x = (int) (dx * (double) sh_video->disp_w); - pointer_y = (int) (dy * (double) sh_video->disp_h); - mp_dvdnav_update_mouse_pos(mpctx->stream, - pointer_x, pointer_y, &button); - if (osd_level > 1 && button > 0) - set_osd_msg(OSD_MSG_TEXT, 1, osd_duration, - "Selected button number %d", button); - } + if (mpctx->stream->type == STREAMTYPE_DVDNAV + && dx > 0.0 && dy > 0.0) { + int button = -1; + pointer_x = (int) (dx * (double) sh_video->disp_w); + pointer_y = (int) (dy * (double) sh_video->disp_h); + mp_dvdnav_update_mouse_pos(mpctx->stream, + pointer_x, pointer_y, &button); + if (osd_level > 1 && button > 0) + set_osd_msg(OSD_MSG_TEXT, 1, osd_duration, + "Selected button number %d", button); + } #endif #ifdef CONFIG_MENU - if (use_menu && dx >= 0.0 && dy >= 0.0) - menu_update_mouse_pos(dx, dy); + if (use_menu && dx >= 0.0 && dy >= 0.0) + menu_update_mouse_pos(dx, dy); #endif - } - break; + } + break; #ifdef CONFIG_DVDNAV - case MP_CMD_DVDNAV:{ - int button = -1; - int i; - mp_command_type command = 0; - if (mpctx->stream->type != STREAMTYPE_DVDNAV) - break; - - for (i = 0; mp_dvdnav_bindings[i].name; i++) - if (cmd->args[0].v.s && - !strcasecmp (cmd->args[0].v.s, - mp_dvdnav_bindings[i].name)) - command = mp_dvdnav_bindings[i].cmd; - - mp_dvdnav_handle_input(mpctx->stream,command,&button); - if (osd_level > 1 && button > 0) - set_osd_msg(OSD_MSG_TEXT, 1, osd_duration, - "Selected button number %d", button); - } - break; - - case MP_CMD_SWITCH_TITLE: - if (mpctx->stream->type == STREAMTYPE_DVDNAV) - mp_dvdnav_switch_title(mpctx->stream, cmd->args[0].v.i); - break; + case MP_CMD_DVDNAV:{ + int button = -1; + int i; + mp_command_type command = 0; + if (mpctx->stream->type != STREAMTYPE_DVDNAV) + break; + + for (i = 0; mp_dvdnav_bindings[i].name; i++) + if (cmd->args[0].v.s && + !strcasecmp (cmd->args[0].v.s, + mp_dvdnav_bindings[i].name)) + command = mp_dvdnav_bindings[i].cmd; + + mp_dvdnav_handle_input(mpctx->stream,command,&button); + if (osd_level > 1 && button > 0) + set_osd_msg(OSD_MSG_TEXT, 1, osd_duration, + "Selected button number %d", button); + } + break; + + case MP_CMD_SWITCH_TITLE: + if (mpctx->stream->type == STREAMTYPE_DVDNAV) + mp_dvdnav_switch_title(mpctx->stream, cmd->args[0].v.i); + break; #endif - default: -#ifdef CONFIG_GUI - if ((use_gui) && (cmd->id > MP_CMD_GUI_EVENTS)) - guiGetEvent(guiIEvent, (char *) cmd->id); - else -#endif - mp_msg(MSGT_CPLAYER, MSGL_V, - "Received unknown cmd %s\n", cmd->name); - } + case MP_CMD_AF_SWITCH: + if (sh_audio) + { + af_uninit(mpctx->mixer.afilter); + af_init(mpctx->mixer.afilter); + } + case MP_CMD_AF_ADD: + case MP_CMD_AF_DEL: + if (!sh_audio) + break; + { + char* af_args = strdup(cmd->args[0].v.s); + char* af_commands = af_args; + char* af_command; + af_instance_t* af; + while ((af_command = strsep(&af_commands, ",")) != NULL) + { + if (cmd->id == MP_CMD_AF_DEL) + { + af = af_get(mpctx->mixer.afilter, af_command); + if (af != NULL) + af_remove(mpctx->mixer.afilter, af); + } + else + af_add(mpctx->mixer.afilter, af_command); + } + build_afilter_chain(sh_audio, &ao_data); + free(af_args); + } + break; + case MP_CMD_AF_CLR: + if (!sh_audio) + break; + af_uninit(mpctx->mixer.afilter); + af_init(mpctx->mixer.afilter); + build_afilter_chain(sh_audio, &ao_data); + break; + default: + mp_msg(MSGT_CPLAYER, MSGL_V, + "Received unknown cmd %s\n", cmd->name); + } switch (cmd->pausing) { - case 1: // "pausing" - mpctx->osd_function = OSD_PAUSE; - break; - case 3: // "pausing_toggle" - mpctx->was_paused = !mpctx->was_paused; - if (mpctx->was_paused) - mpctx->osd_function = OSD_PAUSE; - else if (mpctx->osd_function == OSD_PAUSE) - mpctx->osd_function = OSD_PLAY; - break; - case 2: // "pausing_keep" - if (mpctx->was_paused) - mpctx->osd_function = OSD_PAUSE; + case 1: // "pausing" + mpctx->osd_function = OSD_PAUSE; + break; + case 3: // "pausing_toggle" + mpctx->was_paused = !mpctx->was_paused; + if (mpctx->was_paused) + mpctx->osd_function = OSD_PAUSE; + else if (mpctx->osd_function == OSD_PAUSE) + mpctx->osd_function = OSD_PLAY; + break; + case 2: // "pausing_keep" + if (mpctx->was_paused) + mpctx->osd_function = OSD_PAUSE; } return brk_cmd; } diff -Nru mplayer-1.0~rc3+svn20090426/command.h mplayer-1.0~rc4.dfsg1/command.h --- mplayer-1.0~rc3+svn20090426/command.h 2008-03-31 04:10:54.000000000 +0000 +++ mplayer-1.0~rc4.dfsg1/command.h 2010-01-30 23:24:23.000000000 +0000 @@ -1,3 +1,21 @@ +/* + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + #ifndef MPLAYER_COMMAND_H #define MPLAYER_COMMAND_H diff -Nru mplayer-1.0~rc3+svn20090426/common.mak mplayer-1.0~rc4.dfsg1/common.mak --- mplayer-1.0~rc3+svn20090426/common.mak 2009-02-07 15:40:07.000000000 +0000 +++ mplayer-1.0~rc4.dfsg1/common.mak 2010-06-06 15:41:37.000000000 +0000 @@ -2,13 +2,15 @@ # common bits used by all libraries # -all: # make "all" default target +# first so "all" becomes default target +all: all-yes ifndef SUBDIR -vpath %.c $(SRC_DIR) -vpath %.h $(SRC_DIR) -vpath %.S $(SRC_DIR) +vpath %.c $(SRC_DIR) +vpath %.h $(SRC_DIR) +vpath %.S $(SRC_DIR) vpath %.asm $(SRC_DIR) +vpath %.v $(SRC_DIR) ifeq ($(SRC_DIR),$(SRC_PATH_BARE)) BUILD_ROOT_REL = . @@ -16,98 +18,92 @@ BUILD_ROOT_REL = .. endif +ifndef V +Q = @ +ECHO = printf "$(1)\t%s\n" $(2) +BRIEF = CC AS YASM AR LD HOSTCC STRIP CP +SILENT = DEPCC YASMDEP RM RANLIB +MSG = $@ +M = @$(call ECHO,$(TAG),$@); +$(foreach VAR,$(BRIEF), \ + $(eval $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR)))) +$(foreach VAR,$(SILENT),$(eval $(VAR) = @$($(VAR)))) +$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_DIR)/%=%)); $(INSTALL)) +endif + ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale -CFLAGS := -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \ - -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(OPTFLAGS) +CPPFLAGS := -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(CPPFLAGS) +CFLAGS += $(ECFLAGS) %.o: %.c - $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $< + $(CCDEP) + $(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $< %.o: %.S - $(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $< + $(ASDEP) + $(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) -c -o $@ $< %.ho: %.h - $(CC) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $< - -%.d: %.c - $(DEPEND_CMD) > $@ - -%.d: %.S - $(DEPEND_CMD) > $@ - -%.d: %.cpp - $(DEPEND_CMD) > $@ - -%.o: %.d + $(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $< %$(EXESUF): %.c -SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries -ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES)) -$(BUILD_ROOT_REL)/version.h: $(SVN_ENTRIES) -endif +%.ver: %.v + $(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@ -$(BUILD_ROOT_REL)/version.h: $(SRC_PATH_BARE)/version.sh - $< $(SRC_PATH) $@ $(EXTRA_VERSION) +%.c %.h: TAG = GEN install: install-libs install-headers +install-libs: install-libs-yes uninstall: uninstall-libs uninstall-headers -.PHONY: all depend dep clean distclean install* uninstall* tests -endif - -CFLAGS += $(CFLAGS-yes) -OBJS += $(OBJS-yes) -FFLIBS := $(FFLIBS-yes) $(FFLIBS) -TESTS += $(TESTS-yes) - -FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS) -FFLDFLAGS := $(addprefix -L$(BUILD_ROOT)/lib,$(FFLIBS)) $(LDFLAGS) +.PHONY: all depend dep *clean install* uninstall* examples testprogs -OBJS := $(addprefix $(SUBDIR),$(OBJS)) -TESTS := $(addprefix $(SUBDIR),$(TESTS)) +# Disable suffix rules. Most of the builtin rules are suffix rules, +# so this saves some time on slow systems. +.SUFFIXES: -DEP_LIBS:=$(foreach NAME,$(FFLIBS),lib$(NAME)/$($(BUILD_SHARED:yes=S)LIBNAME)) - -ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h)) -checkheaders: $(filter-out %_template.ho,$(ALLHEADERS:.h=.ho)) - -DEPS := $(OBJS:.o=.d) -depend dep: $(DEPS) +# Do not delete intermediate files from chains of implicit rules +$(OBJS): +endif -CLEANSUFFIXES = *.o *~ *.ho -LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp *.map -DISTCLEANSUFFIXES = *.d *.pc +OBJS-$(HAVE_MMX) += $(MMX-OBJS-yes) -define RULES -$(SUBDIR)%$(EXESUF): $(SUBDIR)%.o - $(CC) $(FFLDFLAGS) -o $$@ $$^ $(SUBDIR)$(LIBNAME) $(FFEXTRALIBS) +CFLAGS += $(CFLAGS-yes) +OBJS += $(OBJS-yes) +FFLIBS := $(FFLIBS-yes) $(FFLIBS) +TESTPROGS += $(TESTPROGS-yes) -$(SUBDIR)%-test.o: $(SUBDIR)%.c - $(CC) $(CFLAGS) -DTEST -c -o $$@ $$^ +FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS) +FFLDFLAGS := $(addprefix -L$(BUILD_ROOT)/lib,$(ALLFFLIBS)) $(LDFLAGS) -$(SUBDIR)%-test.o: $(SUBDIR)%-test.c - $(CC) $(CFLAGS) -DTEST -c -o $$@ $$^ +EXAMPLES := $(addprefix $(SUBDIR),$(addsuffix -example$(EXESUF),$(EXAMPLES))) +OBJS := $(addprefix $(SUBDIR),$(sort $(OBJS))) +TESTOBJS := $(addprefix $(SUBDIR),$(TESTOBJS)) +TESTPROGS := $(addprefix $(SUBDIR),$(addsuffix -test$(EXESUF),$(TESTPROGS))) +HOSTOBJS := $(addprefix $(SUBDIR),$(addsuffix .o,$(HOSTPROGS))) +HOSTPROGS := $(addprefix $(SUBDIR),$(addsuffix $(HOSTEXESUF),$(HOSTPROGS))) -$(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm - $(YASM) $(YASMFLAGS) -I $$( $$@ +ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h)) +SKIPHEADERS += $(addprefix $(ARCH)/,$(ARCH_HEADERS)) +SKIPHEADERS := $(addprefix $(SUBDIR),$(SKIPHEADERS-) $(SKIPHEADERS)) +checkheaders: $(filter-out $(SKIPHEADERS:.h=.ho),$(ALLHEADERS:.h=.ho)) -clean:: - rm -f $(TESTS) $(addprefix $(SUBDIR),$(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \ - $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS)))) +$(HOSTOBJS): %.o: %.c + $(HOSTCC) $(HOSTCFLAGS) -c -o $@ $< -distclean:: clean - rm -f $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \ - $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS)))) -endef +$(HOSTPROGS): %$(HOSTEXESUF): %.o + $(HOSTCC) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS) -$(eval $(RULES)) +DEPS := $(OBJS:.o=.d) +depend dep: $(DEPS) -tests: $(TESTS) +CLEANSUFFIXES = *.d *.o *~ *.ho *.map *.ver +DISTCLEANSUFFIXES = *.pc +LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp --include $(DEPS) +-include $(wildcard $(DEPS)) diff -Nru mplayer-1.0~rc3+svn20090426/configure mplayer-1.0~rc4.dfsg1/configure --- mplayer-1.0~rc3+svn20090426/configure 2009-04-04 14:25:47.000000000 +0000 +++ mplayer-1.0~rc4.dfsg1/configure 2010-07-29 00:31:57.000000000 +0000 @@ -22,13 +22,14 @@ # If you want to add a new check for $feature, here is a simple skeleton: # # echocheck "$feature" -# if "$_feature" = auto; then +# if test "$_feature" = auto; then # cat > $TMPC << EOF # #include # int main(void) { return 0; } # EOF # _feature=no # cc_check && _feature=yes +# fi # if test "$_feature" = yes ; then # def_feature='#define CONFIG_FEATURE 1' # else @@ -53,17 +54,19 @@ export LC_ALL=C # Store the configure line that was used -_configuration="$*" +configuration="$*" # Prefer these macros to full length text ! # These macros only return an error code - NO display is done compile_check() { + source="$1" + shift echo >> "$TMPLOG" - cat "$1" >> "$TMPLOG" + cat "$source" >> "$TMPLOG" echo >> "$TMPLOG" - echo "$_cc $CFLAGS $extra_cflags $_ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o $TMPEXE $@" >> "$TMPLOG" + echo "$_cc $source $CFLAGS $extra_cflags $_ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o $TMPEXE $@" >> "$TMPLOG" rm -f "$TMPEXE" - $_cc $CFLAGS $extra_cflags $_ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1 + $_cc $CFLAGS "$source" $extra_cflags $_ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1 TMPRES="$?" echo >> "$TMPLOG" echo >> "$TMPLOG" @@ -78,6 +81,31 @@ compile_check $TMPCPP $@ -lstdc++ } +cflag_check() { + cat > $TMPC << EOF +int main(void) { return 0; } +EOF + compile_check $TMPC $@ +} + +function_check() { + cat > $TMPC << EOF +#include <$1> +int main(void) { $2; return 0; } +EOF + shift + compile_check $TMPC $@ +} + +header_check() { + cat > $TMPC << EOF +#include <$1> +int main(void) { return 0; } +EOF + shift + compile_check $TMPC $@ +} + yasm_check() { echo >> "$TMPLOG" cat "$TMPS" >> "$TMPLOG" @@ -107,28 +135,28 @@ # OS test booleans functions issystem() { - test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`" + test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)" } -linux() { issystem "Linux" || issystem "uClinux" ; return "$?" ; } -sunos() { issystem "SunOS" ; return "$?" ; } -hpux() { issystem "HP-UX" ; return "$?" ; } -irix() { issystem "IRIX" ; return "$?" ; } -aix() { issystem "AIX" ; return "$?" ; } -cygwin() { issystem "CYGWIN" ; return "$?" ; } -freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; return "$?" ; } -netbsd() { issystem "NetBSD" ; return "$?" ; } -bsdos() { issystem "BSD/OS" ; return "$?" ; } -openbsd() { issystem "OpenBSD" ; return "$?" ; } -dragonfly() { issystem "DragonFly" ; return "$?" ; } -qnx() { issystem "QNX" ; return "$?" ; } -darwin() { issystem "Darwin" ; return "$?" ; } -gnu() { issystem "GNU" ; return "$?" ; } -mingw32() { issystem "MINGW32" ; return "$?" ; } -morphos() { issystem "MorphOS" ; return "$?" ; } -amigaos() { issystem "AmigaOS" ; return "$?" ; } -win32() { cygwin || mingw32 ; return "$?" ; } -beos() { issystem "BEOS" ; return "$?" ; } -os2() { issystem "OS/2" ; return "$?" ; } +aix() { issystem "AIX"; } +amigaos() { issystem "AmigaOS"; } +beos() { issystem "BEOS"; } +bsdos() { issystem "BSD/OS"; } +cygwin() { issystem "CYGWIN"; } +darwin() { issystem "Darwin"; } +dragonfly() { issystem "DragonFly"; } +freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; } +gnu() { issystem "GNU"; } +hpux() { issystem "HP-UX"; } +irix() { issystem "IRIX"; } +linux() { issystem "Linux"; } +mingw32() { issystem "MINGW32"; } +morphos() { issystem "MorphOS"; } +netbsd() { issystem "NetBSD"; } +openbsd() { issystem "OpenBSD"; } +os2() { issystem "OS/2"; } +qnx() { issystem "QNX"; } +sunos() { issystem "SunOS"; } +win32() { cygwin || mingw32; } # arch test boolean functions # x86/x86pc is used by QNX @@ -166,7 +194,7 @@ arm() { case "$host_arch" in - arm) return 0;; + arm*) return 0;; *) return 1;; esac } @@ -179,26 +207,26 @@ # Use this to echo the results of a check echores() { - if test "$_res_comment" ; then - _res_comment="($_res_comment)" + if test "$res_comment" ; then + res_comment="($res_comment)" fi - echo "Result is: $@ $_res_comment" >> "$TMPLOG" + echo "Result is: $@ $res_comment" >> "$TMPLOG" echo "##########################################" >> "$TMPLOG" echo "" >> "$TMPLOG" - echo "$@ $_res_comment" - _res_comment="" + echo "$@ $res_comment" + res_comment="" } ############################################################################# # Check how echo works in this /bin/sh -case `echo -n` in - -n) _echo_n= _echo_c='\c' ;; # SysV echo - *) _echo_n='-n ' _echo_c= ;; # BSD echo +case $(echo -n) in + -n) _echo_n= _echo_c='\c' ;; # SysV echo + *) _echo_n='-n ' _echo_c= ;; # BSD echo esac -msg_lang_all=`echo help/help_mp-??.h help/help_mp-??_??.h | sed -e "s:help/help_mp-\(..\).h:\1:g" -e "s:help/help_mp-\(.....\).h:\1:g"` -man_lang_all=`echo DOCS/man/??/mplayer.1 DOCS/man/??_??/mplayer.1 | sed -e "s:DOCS/man/\(..\)/mplayer.1:\1:g" -e "s:DOCS/man/\(.._..\)/mplayer.1:\1:g"` -doc_lang_all=`echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g"` +msg_lang_all=$(echo help/help_mp-??.h help/help_mp-??_??.h | sed -e "s:help/help_mp-\(..\).h:\1:g" -e "s:help/help_mp-\(.....\).h:\1:g") +man_lang_all=$(echo DOCS/man/??/mplayer.1 DOCS/man/??_??/mplayer.1 | sed -e "s:DOCS/man/\(..\)/mplayer.1:\1:g" -e "s:DOCS/man/\(.._..\)/mplayer.1:\1:g") +doc_lang_all=$(echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g") show_help(){ cat << EOF @@ -217,9 +245,6 @@ [PREFIX/etc/mplayer] --libdir=DIR directory for object code libraries [PREFIX/lib] --codecsdir=DIR directory for binary codecs [LIBDIR/codecs] - --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs] - --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs] - --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs] Optional features: --disable-mencoder disable MEncoder (A/V encoder) compilation [enable] @@ -227,7 +252,6 @@ --enable-gui enable GMPlayer compilation (GTK+ GUI) [disable] --enable-gtk1 force using GTK 1.2 for the GUI [disable] --disable-largefiles disable support for files > 2GB [enable] - --enable-linux-devfs set default devices to devfs [disable] --enable-termcap use termcap database for key codes [autodetect] --enable-termios use termios database for key codes [autodetect] --disable-iconv disable iconv for encoding conversion [autodetect] @@ -247,7 +271,6 @@ --disable-tv-v4l1 disable Video4Linux TV interface [autodetect] --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect] --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect] - --disable-tv-teletext disable TV teletext interface [autodetect] --disable-pvr disable Video4Linux2 MPEG PVR [autodetect] --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect] --disable-network disable networking [enable] @@ -255,6 +278,9 @@ --enable-smb enable Samba (SMB) input [autodetect] --enable-live enable LIVE555 Streaming Media [autodetect] --enable-nemesi enable Nemesi Streaming Media [autodetect] + --enable-librtmp enable RTMPDump Streaming Media [autodetect] + --disable-vcd disable VCD support [autodetect] + --disable-bluray disable Blu-ray support [autodetect] --disable-dvdnav disable libdvdnav [autodetect] --disable-dvdread disable libdvdread [autodetect] --disable-dvdread-internal disable internal libdvdread [autodetect] @@ -269,7 +295,6 @@ --disable-sortsub disable subtitle sorting [enabled] --enable-fribidi enable the FriBiDi libs [autodetect] --disable-enca disable ENCA charset oracle library [autodetect] - --disable-macosx disable Mac OS X specific features [autodetect] --disable-maemo disable maemo specific features [autodetect] --enable-macosx-finder enable Mac OS X Finder invocation parameter parsing [disabled] @@ -280,17 +305,18 @@ --disable-vstream disable TiVo vstream client support [autodetect] --disable-pthreads disable Posix threads support [autodetect] --disable-w32threads disable Win32 threads support [autodetect] - --disable-ass disable internal SSA/ASS subtitle support [autodetect] + --disable-ass-internal disable internal SSA/ASS subtitle support [autodetect] + --disable-ass disable SSA/ASS subtitle support [autodetect] --enable-rpath enable runtime linker path for extra libs [disabled] Codecs: - --enable-gif enable GIF support [autodetect] - --enable-png enable PNG input/output support [autodetect] - --enable-mng enable MNG input support [autodetect] - --enable-jpeg enable JPEG input/output support [autodetect] - --enable-libcdio enable libcdio support [autodetect] - --enable-liblzo enable liblzo support [autodetect] - --disable-win32dll disable Win32 DLL support [enabled] + --enable-gif enable GIF support [autodetect] + --enable-png enable PNG input/output support [autodetect] + --enable-mng enable MNG input support [autodetect] + --enable-jpeg enable JPEG input/output support [autodetect] + --enable-libcdio enable libcdio support [autodetect] + --enable-liblzo enable liblzo support [autodetect] + --disable-win32dll disable Win32 DLL support [autodetect] --disable-qtx disable QuickTime codecs support [enabled] --disable-xanim disable XAnim codecs support [enabled] --disable-real disable RealPlayer codecs support [enabled] @@ -301,6 +327,7 @@ --disable-libdirac-lavc disable Dirac in libavcodec [autodetect] --disable-libschroedinger-lavc disable Dirac in libavcodec (Schroedinger decoder) [autodetect] + --disable-libvpx-lavc disable libvpx in libavcodec [autodetect] --disable-libnut disable libnut [autodetect] --disable-libavutil_a disable static libavutil [autodetect] --disable-libavcodec_a disable static libavcodec [autodetect] @@ -319,6 +346,7 @@ --enable-tremor enable external Tremor [autodetect] --disable-libvorbis disable libvorbis support [autodetect] --disable-speex disable Speex support [autodetect] + --disable-libgsm disable libgsm support [autodetect] --enable-theora enable OggTheora libraries [autodetect] --enable-faad enable external FAAD2 (AAC) [autodetect] --disable-faad-internal disable internal FAAD2 (AAC) [autodetect] @@ -326,7 +354,9 @@ --disable-faac disable support for FAAC (AAC encoder) [autodetect] --disable-faac-lavc disable support for FAAC in libavcodec [autodetect] --disable-ladspa disable LADSPA plugin support [autodetect] + --disable-libbs2b disable libbs2b audio filter support [autodetect] --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect] + --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect] --disable-mad disable libmad (MPEG audio) support [autodetect] --disable-mp3lame disable LAME MP3 encoding support [autodetect] --disable-mp3lame-lavc disable LAME in libavcodec [autodetect] @@ -335,18 +365,21 @@ --enable-xmms enable XMMS input plugin support [disabled] --enable-libdca enable libdca support [autodetect] --disable-mp3lib disable builtin mp3lib [autodetect] - --disable-liba52 disable liba52 [autodetect] - --disable-liba52-internal disable builtin liba52 [autodetect] - --disable-libmpeg2 disable builtin libmpeg2 [autodetect] + --disable-liba52 disable liba52 [autodetect] + --disable-libmpeg2 disable libmpeg2 [autodetect] + --disable-libmpeg2-internal disable builtin libmpeg2 [autodetect] --disable-musepack disable musepack support [autodetect] - --disable-libamr_nb disable libamr narrowband [autodetect] - --disable-libamr_wb disable libamr wideband [autodetect] + --disable-libopencore_amrnb disable libopencore_amr narrowband [autodetect] + --disable-libopencore_amrwb disable libopencore_amr wideband [autodetect] + --disable-libopenjpeg disable OpenJPEG (JPEG2000) input/output support [autodetect] --disable-decoder=DECODER disable specified FFmpeg decoder --enable-decoder=DECODER enable specified FFmpeg decoder --disable-encoder=ENCODER disable specified FFmpeg encoder --enable-encoder=ENCODER enable specified FFmpeg encoder --disable-parser=PARSER disable specified FFmpeg parser --enable-parser=PARSER enable specified FFmpeg parser + --disable-protocol=PROTO disable specified FFmpeg protocol + --enable-protocol=PROTO enable specified FFmpeg protocol --disable-demuxer=DEMUXER disable specified FFmpeg demuxer --enable-demuxer=DEMUXER enable specified FFmpeg demuxer --disable-muxer=MUXER disable specified FFmpeg muxer @@ -361,6 +394,7 @@ --enable-dhahelper enable VIDIX dhahelper support --enable-svgalib_helper enable VIDIX svgalib_helper support --enable-gl enable OpenGL video output [autodetect] + --disable-matrixview disable OpenGL MatrixView video output [autodetect] --enable-dga2 enable DGA 2 support [autodetect] --enable-dga1 enable DGA 1 support [autodetect] --enable-vesa enable VESA video output [autodetect] @@ -378,7 +412,6 @@ --enable-ivtv enable IVTV TV-Out video output [autodetect] --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect] --enable-dvb enable DVB video output [autodetect] - --enable-dvbhead enable DVB video output (HEAD version) [autodetect] --enable-mga enable mga_vid video output [autodetect] --enable-xmga enable mga_vid X11 video output [autodetect] --enable-xv enable Xv video output [autodetect] @@ -397,13 +430,15 @@ --enable-wii enable Nintendo Wii/GameCube video output [disable] --enable-directfb enable DirectFB video output [autodetect] --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect] - --enable-bl enable Blinkenlights video output [disable] + --enable-bl enable Blinkenlights video output [disable] --enable-tdfxvid enable tdfx_vid video output [disable] --enable-xvr100 enable SUN XVR-100 video output [autodetect] --disable-tga disable Targa video output [enable] - --disable-pnm disable PNM video output [enable] - --disable-md5sum disable md5sum video output [enable] - --disable-yuv4mpeg disable yuv4mpeg video output [enable] + --disable-pnm disable PNM video output [enable] + --disable-md5sum disable md5sum video output [enable] + --disable-yuv4mpeg disable yuv4mpeg video output [enable] + --disable-corevideo disable CoreVideo video output [autodetect] + --disable-quartz disable Quartz video output [autodetect] Audio output: --disable-alsa disable ALSA audio output [autodetect] @@ -416,10 +451,26 @@ --disable-nas disable NAS audio output [autodetect] --disable-sgiaudio disable SGI audio output [autodetect] --disable-sunaudio disable Sun audio output [autodetect] + --disable-kai disable KAI audio output [autodetect] --disable-dart disable DART audio output [autodetect] --disable-win32waveout disable Windows waveout audio output [autodetect] + --disable-coreaudio disable CoreAudio audio output [autodetect] --disable-select disable using select() on the audio device [enable] +Language options: + --charset=charset convert the console messages to this character set + --language-doc=lang language to use for the documentation [en] + --language-man=lang language to use for the man pages [en] + --language-msg=lang language to use for the messages and the GUI [en] + --language=lang default language to use [en] +Specific options override --language. You can pass a list of languages separated +by whitespace or commas instead of a single language. Nonexisting translations +will be dropped from each list. All documentation and man page translations +available in the list will be installed, for the messages the first available +translation will be used. The value "all" will activate all translations. The +LINGUAS environment variable is honored. In all cases the fallback is English. +Available values are: all $msg_lang_all + Miscellaneous options: --enable-runtime-cpudetection enable runtime CPU detection [disable] --enable-cross-compile enable cross-compilation [autodetect] @@ -433,12 +484,6 @@ --windres=WINDRES windres to build MPlayer [windres] --target=PLATFORM target platform (i386-linux, arm-linux, etc) --enable-static build a statically linked binary - --charset=charset convert the console messages to this character set - --language=list a white space or comma separated list of languages for - translated man pages, the first language is used for - messages and the GUI (the environment variable - \$LINGUAS is also honored) [en] - (Available: all $msg_lang_all) --with-install=PATH path to a custom install program Advanced options: @@ -455,8 +500,10 @@ --enable-armv6 enable ARMv6 (ARM) [autodetect] --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect] --enable-armvfp enable ARM VFP (ARM) [autodetect] + --enable-neon enable NEON (ARM) [autodetect] --enable-iwmmxt enable iWMMXt (ARM) [autodetect] --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable] + --enable-hardcoded-tables put tables in binary instead of calculating them at startup [disable] --enable-big-endian force byte order to big-endian [autodetect] --enable-debug[=1-3] compile-in debugging information [disable] --enable-profile compile-in profiling information [disable] @@ -473,12 +520,11 @@ --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA) --with-freetype-config=PATH path to freetype-config - --with-fribidi-config=PATH path to fribidi-config --with-glib-config=PATH path to glib*-config --with-gtk-config=PATH path to gtk*-config --with-sdl-config=PATH path to sdl*-config --with-dvdnav-config=PATH path to dvdnav-config - --with-dvdread-config=PATH path to dvdread-config + --with-dvdread-config=PATH path to dvdread-config This configure script is NOT autoconf-based, even though its output is similar. It will try to autodetect all configuration options. If you --enable an option @@ -500,10 +546,12 @@ _ssse3=auto _cmov=auto _fast_cmov=auto +_fast_clz=auto _armv5te=auto _armv6=auto _armv6t2=auto _armvfp=auto +neon=auto _iwmmxt=auto _mtrr=auto _altivec=auto @@ -522,21 +570,26 @@ _libavutil_a=auto _libavutil_so=auto _libavcodec_a=auto -_libamr_nb=auto -_libamr_wb=auto -_libavdecoders_all=`sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'` -_libavdecoders=` echo $_libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g' -e s/MPEG4AAC_DECODER//` -_libavencoders_all=`sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'` -_libavencoders=` echo $_libavencoders_all | sed 's/ LIB[A-Z0-9_]*_ENCODER//g'` -_libavparsers_all=`sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'` -_libavparsers=$_libavparsers_all -_libavbsfs_all=`sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]'` -_libavbsfs=$_libavbsfs_all -_libavdemuxers_all=`sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'` -_libavdemuxers=`echo $_libavdemuxers_all | sed -e 's/ LIB[A-Z0-9_]*_DEMUXER//g' -e s/REDIR_DEMUXER// -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER// -e s/AVISYNTH_DEMUXER// ` -_libavmuxers_all=`sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'` -_libavmuxers=`echo $_libavmuxers_all | sed -e 's/ LIB[A-Z0-9_]*_MUXER//g' -e s/RTP_MUXER// ` -_libavprotocols_all=`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]'` +_libopencore_amrnb=auto +_libopencore_amrwb=auto +libopenjpeg=auto +libavdecoders_all=$(sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]') +libavdecoders=$(echo $libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g' -e s/MPEG4AAC_DECODER//) +libavencoders_all=$(sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]') +libavencoders=$(echo $libavencoders_all | sed -e 's/ LIB[A-Z0-9_]*_ENCODER//g' -e s/AAC_ENCODER//) +libavparsers_all=$(sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]') +libavparsers=$libavparsers_all +libavbsfs_all=$(sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]') +libavbsfs=$libavbsfs_all +libavhwaccels_all=$(sed -n 's/^[^#]*HWACCEL.*(.*, *\(.*\)).*/\1_hwaccel/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]') +# Disable all hardware accelerators for now. +libavhwaccels= +libavdemuxers_all=$(sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]') +libavdemuxers=$(echo $libavdemuxers_all | sed -e 's/ LIB[A-Z0-9_]*_DEMUXER//g' -e s/REDIR_DEMUXER// -e s/AVISYNTH_DEMUXER//) +libavmuxers_all=$(sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]') +libavmuxers=$(echo $libavmuxers_all | sed -e 's/ LIB[A-Z0-9_]*_MUXER//g' -e s/RTP_MUXER// -e s/RTSP_MUXER//) +libavprotocols_all=$(sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]') +libavprotocols=$libavprotocols_all _libavcodec_so=auto _libavformat_a=auto _libavformat_so=auto @@ -569,6 +622,7 @@ _yuv4mpeg=yes _gif=auto _gl=auto +matrixview=yes _ggi=auto _ggiwmh=auto _aa=auto @@ -577,7 +631,6 @@ _vesa=auto _fbdev=auto _dvb=auto -_dvbhead=auto _dxr2=auto _dxr3=auto _ivtv=auto @@ -590,6 +643,7 @@ _esd=auto _pulse=auto _jack=auto +_kai=auto _dart=auto _openal=auto _libcdio=auto @@ -604,19 +658,24 @@ _tremor_low=no _libvorbis=auto _speex=auto +_libgsm=auto _theora=auto +_mpg123=auto _mp3lib=auto _liba52=auto -_liba52_internal=auto _libdca=auto _libmpeg2=auto +_libmpeg2_internal=auto _faad=auto _faad_internal=auto _faad_fixed=no _faac=auto _faac_lavc=auto _ladspa=auto +_libbs2b=auto _xmms=no +_vcd=auto +_bluray=auto _dvdnav=auto _dvdnavconfig=dvdnav-config _dvdreadconfig=dvdread-config @@ -627,6 +686,7 @@ _real=auto _live=auto _nemesi=auto +_librtmp=auto _native_rtsp=yes _xinerama=auto _mga=auto @@ -638,6 +698,7 @@ _sunaudio=auto _alsa=auto _fastmemcpy=yes +hardcoded_tables=no _unrar_exec=auto _win32dll=auto _select=yes @@ -651,10 +712,12 @@ _tv_v4l2=auto _tv_bsdbt848=auto _tv_dshow=auto -_tv_teletext=auto _pvr=auto _network=yes _winsock2_h=auto +_struct_addrinfo=auto +_getaddrinfo=auto +_struct_sockaddr_storage=auto _smb=auto _vidix=auto _vidix_pcidb=yes @@ -667,6 +730,7 @@ _x264_lavc=auto _libdirac_lavc=auto _libschroedinger_lavc=auto +_libvpx_lavc=auto _libnut=auto _lirc=auto _lircc=auto @@ -687,9 +751,8 @@ _zr=auto _bl=no _largefiles=yes -#_language=en +#language=en _shm=auto -_linux_devfs=no _charset="UTF-8" _dynamic_plugins=no _crash_debug=no @@ -703,14 +766,16 @@ _fontconfig=auto _menu=no _qtx=auto -_macosx=auto _maemo=auto +_coreaudio=auto +_corevideo=auto +_quartz=auto +quicktime=auto _macosx_finder=no _macosx_bundle=auto _sortsub=yes _freetypeconfig='freetype-config' _fribidi=auto -_fribidiconfig='fribidi-config' _enca=auto _inet6=auto _gethostbyname2=auto @@ -720,6 +785,7 @@ _pthreads=auto _w32threads=auto _ass=auto +ass_internal=yes _rpath=no _asmalign_pot=auto _stream_cache=yes @@ -735,113 +801,110 @@ show_help ;; --prefix=*) - _prefix=`echo $ac_option | cut -d '=' -f 2` + _prefix=$(echo $ac_option | cut -d '=' -f 2) ;; --bindir=*) - _bindir=`echo $ac_option | cut -d '=' -f 2` + _bindir=$(echo $ac_option | cut -d '=' -f 2) ;; --datadir=*) - _datadir=`echo $ac_option | cut -d '=' -f 2` + _datadir=$(echo $ac_option | cut -d '=' -f 2) ;; --mandir=*) - _mandir=`echo $ac_option | cut -d '=' -f 2` + _mandir=$(echo $ac_option | cut -d '=' -f 2) ;; --confdir=*) - _confdir=`echo $ac_option | cut -d '=' -f 2` + _confdir=$(echo $ac_option | cut -d '=' -f 2) ;; --libdir=*) - _libdir=`echo $ac_option | cut -d '=' -f 2` + _libdir=$(echo $ac_option | cut -d '=' -f 2) ;; --codecsdir=*) - _codecsdir=`echo $ac_option | cut -d '=' -f 2` - ;; - --win32codecsdir=*) - _win32codecsdir=`echo $ac_option | cut -d '=' -f 2` - ;; - --xanimcodecsdir=*) - _xanimcodecsdir=`echo $ac_option | cut -d '=' -f 2` - ;; - --realcodecsdir=*) - _realcodecsdir=`echo $ac_option | cut -d '=' -f 2` + _codecsdir=$(echo $ac_option | cut -d '=' -f 2) ;; --with-install=*) - _install=`echo $ac_option | cut -d '=' -f 2 ` + _install=$(echo $ac_option | cut -d '=' -f 2 ) ;; --with-xvmclib=*) - _xvmclib=`echo $ac_option | cut -d '=' -f 2` + _xvmclib=$(echo $ac_option | cut -d '=' -f 2) ;; --with-sdl-config=*) - _sdlconfig=`echo $ac_option | cut -d '=' -f 2` + _sdlconfig=$(echo $ac_option | cut -d '=' -f 2) ;; --with-freetype-config=*) - _freetypeconfig=`echo $ac_option | cut -d '=' -f 2` - ;; - --with-fribidi-config=*) - _fribidiconfig=`echo $ac_option | cut -d '=' -f 2` + _freetypeconfig=$(echo $ac_option | cut -d '=' -f 2) ;; --with-gtk-config=*) - _gtkconfig=`echo $ac_option | cut -d '=' -f 2` + _gtkconfig=$(echo $ac_option | cut -d '=' -f 2) ;; --with-glib-config=*) - _glibconfig=`echo $ac_option | cut -d '=' -f 2` + _glibconfig=$(echo $ac_option | cut -d '=' -f 2) ;; --with-dvdnav-config=*) - _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2` + _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2) ;; --with-dvdread-config=*) - _dvdreadconfig=`echo $ac_option | cut -d '=' -f 2` + _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2) ;; --extra-cflags=*) - extra_cflags=`echo $ac_option | cut -d '=' -f 2-` + extra_cflags=$(echo $ac_option | cut -d '=' -f 2-) ;; --extra-ldflags=*) - extra_ldflags=`echo $ac_option | cut -d '=' -f 2-` + extra_ldflags=$(echo $ac_option | cut -d '=' -f 2-) ;; --extra-libs=*) - extra_libs=`echo $ac_option | cut -d '=' -f 2` + extra_libs=$(echo $ac_option | cut -d '=' -f 2) ;; --extra-libs-mplayer=*) - libs_mplayer=`echo $ac_option | cut -d '=' -f 2` + libs_mplayer=$(echo $ac_option | cut -d '=' -f 2) ;; --extra-libs-mencoder=*) - libs_mencoder=`echo $ac_option | cut -d '=' -f 2` + libs_mencoder=$(echo $ac_option | cut -d '=' -f 2) ;; --target=*) - _target=`echo $ac_option | cut -d '=' -f 2` + _target=$(echo $ac_option | cut -d '=' -f 2) ;; --cc=*) - _cc=`echo $ac_option | cut -d '=' -f 2` + _cc=$(echo $ac_option | cut -d '=' -f 2) ;; --host-cc=*) - _host_cc=`echo $ac_option | cut -d '=' -f 2` + _host_cc=$(echo $ac_option | cut -d '=' -f 2) ;; --as=*) - _as=`echo $ac_option | cut -d '=' -f 2` + _as=$(echo $ac_option | cut -d '=' -f 2) ;; --nm=*) - _nm=`echo $ac_option | cut -d '=' -f 2` + _nm=$(echo $ac_option | cut -d '=' -f 2) ;; --yasm=*) - _yasm=`echo $ac_option | cut -d '=' -f 2` + _yasm=$(echo $ac_option | cut -d '=' -f 2) ;; --ar=*) - _ar=`echo $ac_option | cut -d '=' -f 2` + _ar=$(echo $ac_option | cut -d '=' -f 2) ;; --ranlib=*) - _ranlib=`echo $ac_option | cut -d '=' -f 2` + _ranlib=$(echo $ac_option | cut -d '=' -f 2) ;; --windres=*) - _windres=`echo $ac_option | cut -d '=' -f 2` + _windres=$(echo $ac_option | cut -d '=' -f 2) ;; --charset=*) - _charset=`echo $ac_option | cut -d '=' -f 2` + _charset=$(echo $ac_option | cut -d '=' -f 2) + ;; + --language-doc=*) + language_doc=$(echo $ac_option | cut -d '=' -f 2) + ;; + --language-man=*) + language_man=$(echo $ac_option | cut -d '=' -f 2) + ;; + --language-msg=*) + language_msg=$(echo $ac_option | cut -d '=' -f 2) ;; --language=*) - _language=`echo $ac_option | cut -d '=' -f 2` + language=$(echo $ac_option | cut -d '=' -f 2) ;; --enable-static) @@ -860,7 +923,7 @@ _debug='-g' ;; --enable-debug=*) - _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2` + _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2) ;; --disable-debug) _debug= @@ -869,234 +932,250 @@ --disable-runtime-cpudetection) _runtime_cpudetection=no ;; --enable-cross-compile) _cross_compile=yes ;; --disable-cross-compile) _cross_compile=no ;; - --enable-mencoder) _mencoder=yes ;; - --disable-mencoder) _mencoder=no ;; - --enable-mplayer) _mplayer=yes ;; - --disable-mplayer) _mplayer=no ;; + --enable-mencoder) _mencoder=yes ;; + --disable-mencoder) _mencoder=no ;; + --enable-mplayer) _mplayer=yes ;; + --disable-mplayer) _mplayer=no ;; --enable-dynamic-plugins) _dynamic_plugins=yes ;; --disable-dynamic-plugins) _dynamic_plugins=no ;; - --enable-x11) _x11=yes ;; - --disable-x11) _x11=no ;; - --enable-xshape) _xshape=yes ;; - --disable-xshape) _xshape=no ;; - --enable-xss) _xss=yes ;; - --disable-xss) _xss=no ;; - --enable-xv) _xv=yes ;; - --disable-xv) _xv=no ;; + --enable-x11) _x11=yes ;; + --disable-x11) _x11=no ;; + --enable-xshape) _xshape=yes ;; + --disable-xshape) _xshape=no ;; + --enable-xss) _xss=yes ;; + --disable-xss) _xss=no ;; + --enable-xv) _xv=yes ;; + --disable-xv) _xv=no ;; --enable-xvmc) _xvmc=yes ;; --disable-xvmc) _xvmc=no ;; --enable-vdpau) _vdpau=yes ;; --disable-vdpau) _vdpau=no ;; - --enable-sdl) _sdl=yes ;; - --disable-sdl) _sdl=no ;; - --enable-kva) _kva=yes ;; - --disable-kva) _kva=no ;; + --enable-sdl) _sdl=yes ;; + --disable-sdl) _sdl=no ;; + --enable-kva) _kva=yes ;; + --disable-kva) _kva=no ;; --enable-direct3d) _direct3d=yes ;; --disable-direct3d) _direct3d=no ;; --enable-directx) _directx=yes ;; --disable-directx) _directx=no ;; --enable-win32waveout) _win32waveout=yes ;; --disable-win32waveout) _win32waveout=no ;; - --enable-nas) _nas=yes ;; - --disable-nas) _nas=no ;; - --enable-png) _png=yes ;; - --disable-png) _png=no ;; - --enable-mng) _mng=yes ;; - --disable-mng) _mng=no ;; - --enable-jpeg) _jpeg=yes ;; - --disable-jpeg) _jpeg=no ;; - --enable-pnm) _pnm=yes ;; - --disable-pnm) _pnm=no ;; - --enable-md5sum) _md5sum=yes ;; - --disable-md5sum) _md5sum=no ;; - --enable-yuv4mpeg) _yuv4mpeg=yes ;; - --disable-yuv4mpeg) _yuv4mpeg=no ;; - --enable-gif) _gif=yes ;; - --disable-gif) _gif=no ;; - --enable-gl) _gl=yes ;; - --disable-gl) _gl=no ;; - --enable-ggi) _ggi=yes ;; - --disable-ggi) _ggi=no ;; - --enable-ggiwmh) _ggiwmh=yes ;; - --disable-ggiwmh) _ggiwmh=no ;; - --enable-aa) _aa=yes ;; - --disable-aa) _aa=no ;; - --enable-caca) _caca=yes ;; - --disable-caca) _caca=no ;; - --enable-svga) _svga=yes ;; - --disable-svga) _svga=no ;; - --enable-vesa) _vesa=yes ;; - --disable-vesa) _vesa=no ;; - --enable-fbdev) _fbdev=yes ;; - --disable-fbdev) _fbdev=no ;; - --enable-dvb) _dvb=yes ;; - --disable-dvb) _dvb=no ;; - --enable-dvbhead) _dvbhead=yes ;; - --disable-dvbhead) _dvbhead=no ;; - --enable-dxr2) _dxr2=yes ;; - --disable-dxr2) _dxr2=no ;; - --enable-dxr3) _dxr3=yes ;; - --disable-dxr3) _dxr3=no ;; + --enable-nas) _nas=yes ;; + --disable-nas) _nas=no ;; + --enable-png) _png=yes ;; + --disable-png) _png=no ;; + --enable-mng) _mng=yes ;; + --disable-mng) _mng=no ;; + --enable-jpeg) _jpeg=yes ;; + --disable-jpeg) _jpeg=no ;; + --enable-libopenjpeg) libopenjpeg=yes ;; + --disable-libopenjpeg)libopenjpeg=no ;; + --enable-pnm) _pnm=yes ;; + --disable-pnm) _pnm=no ;; + --enable-md5sum) _md5sum=yes ;; + --disable-md5sum) _md5sum=no ;; + --enable-yuv4mpeg) _yuv4mpeg=yes ;; + --disable-yuv4mpeg) _yuv4mpeg=no ;; + --enable-gif) _gif=yes ;; + --disable-gif) _gif=no ;; + --enable-gl) _gl=yes ;; + --disable-gl) _gl=no ;; + --enable-matrixview) matrixview=yes ;; + --disable-matrixview) matrixview=no ;; + --enable-ggi) _ggi=yes ;; + --disable-ggi) _ggi=no ;; + --enable-ggiwmh) _ggiwmh=yes ;; + --disable-ggiwmh) _ggiwmh=no ;; + --enable-aa) _aa=yes ;; + --disable-aa) _aa=no ;; + --enable-caca) _caca=yes ;; + --disable-caca) _caca=no ;; + --enable-svga) _svga=yes ;; + --disable-svga) _svga=no ;; + --enable-vesa) _vesa=yes ;; + --disable-vesa) _vesa=no ;; + --enable-fbdev) _fbdev=yes ;; + --disable-fbdev) _fbdev=no ;; + --enable-dvb) _dvb=yes ;; + --disable-dvb) _dvb=no ;; + --enable-dxr2) _dxr2=yes ;; + --disable-dxr2) _dxr2=no ;; + --enable-dxr3) _dxr3=yes ;; + --disable-dxr3) _dxr3=no ;; --enable-ivtv) _ivtv=yes ;; --disable-ivtv) _ivtv=no ;; --enable-v4l2) _v4l2=yes ;; --disable-v4l2) _v4l2=no ;; - --enable-iconv) _iconv=yes ;; - --disable-iconv) _iconv=no ;; - --enable-langinfo) _langinfo=yes ;; - --disable-langinfo) _langinfo=no ;; - --enable-rtc) _rtc=yes ;; - --disable-rtc) _rtc=no ;; - --enable-libdv) _libdv=yes ;; - --disable-libdv) _libdv=no ;; - --enable-ossaudio) _ossaudio=yes ;; - --disable-ossaudio) _ossaudio=no ;; - --enable-arts) _arts=yes ;; - --disable-arts) _arts=no ;; - --enable-esd) _esd=yes ;; - --disable-esd) _esd=no ;; - --enable-pulse) _pulse=yes ;; - --disable-pulse) _pulse=no ;; - --enable-jack) _jack=yes ;; - --disable-jack) _jack=no ;; - --enable-openal) _openal=yes ;; - --disable-openal) _openal=no ;; - --enable-dart) _dart=yes ;; - --disable-dart) _dart=no ;; - --enable-mad) _mad=yes ;; - --disable-mad) _mad=no ;; - --enable-mp3lame) _mp3lame=yes ;; - --disable-mp3lame) _mp3lame=no ;; - --enable-mp3lame-lavc) _mp3lame_lavc=yes ;; - --disable-mp3lame-lavc) _mp3lame_lavc=no ;; - --enable-toolame) _toolame=yes ;; - --disable-toolame) _toolame=no ;; - --enable-twolame) _twolame=yes ;; - --disable-twolame) _twolame=no ;; - --enable-libcdio) _libcdio=yes ;; - --disable-libcdio) _libcdio=no ;; - --enable-liblzo) _liblzo=yes ;; - --disable-liblzo) _liblzo=no ;; - --enable-libvorbis) _libvorbis=yes ;; - --disable-libvorbis) _libvorbis=no ;; - --enable-speex) _speex=yes ;; - --disable-speex) _speex=no ;; - --enable-tremor) _tremor=yes ;; - --disable-tremor) _tremor=no ;; - --enable-tremor-internal) _tremor_internal=yes ;; - --disable-tremor-internal) _tremor_internal=no ;; - --enable-tremor-low) _tremor_low=yes ;; - --disable-tremor-low) _tremor_low=no ;; - --enable-theora) _theora=yes ;; - --disable-theora) _theora=no ;; - --enable-mp3lib) _mp3lib=yes ;; - --disable-mp3lib) _mp3lib=no ;; - --enable-liba52-internal) _liba52_internal=yes ;; - --disable-liba52-internal) _liba52_internal=no ;; - --enable-liba52) _liba52=yes ;; - --disable-liba52) _liba52=no ;; - --enable-libdca) _libdca=yes ;; - --disable-libdca) _libdca=no ;; - --enable-libmpeg2) _libmpeg2=yes ;; - --disable-libmpeg2) _libmpeg2=no ;; - --enable-musepack) _musepack=yes ;; - --disable-musepack) _musepack=no ;; - --enable-faad) _faad=yes ;; - --disable-faad) _faad=no ;; - --enable-faad-internal) _faad_internal=yes ;; - --disable-faad-internal) _faad_internal=no ;; - --enable-faad-fixed) _faad_fixed=yes ;; - --disable-faad-fixed) _faad_fixed=no ;; - --enable-faac) _faac=yes ;; - --disable-faac) _faac=no ;; - --enable-faac-lavc) _faac_lavc=yes ;; - --disable-faac-lavc) _faac_lavc=no ;; - --enable-ladspa) _ladspa=yes ;; - --disable-ladspa) _ladspa=no ;; - --enable-xmms) _xmms=yes ;; - --disable-xmms) _xmms=no ;; - --enable-dvdread) _dvdread=yes ;; - --disable-dvdread) _dvdread=no ;; - --enable-dvdread-internal) _dvdread_internal=yes ;; - --disable-dvdread-internal) _dvdread_internal=no ;; - --enable-libdvdcss-internal) _libdvdcss_internal=yes ;; - --disable-libdvdcss-internal) _libdvdcss_internal=no ;; - --enable-dvdnav) _dvdnav=yes ;; - --disable-dvdnav) _dvdnav=no ;; - --enable-xanim) _xanim=yes ;; - --disable-xanim) _xanim=no ;; - --enable-real) _real=yes ;; - --disable-real) _real=no ;; - --enable-live) _live=yes ;; - --disable-live) _live=no ;; - --enable-nemesi) _nemesi=yes ;; - --disable-nemesi) _nemesi=no ;; - --enable-xinerama) _xinerama=yes ;; - --disable-xinerama) _xinerama=no ;; - --enable-mga) _mga=yes ;; - --disable-mga) _mga=no ;; - --enable-xmga) _xmga=yes ;; - --disable-xmga) _xmga=no ;; - --enable-vm) _vm=yes ;; - --disable-vm) _vm=no ;; - --enable-xf86keysym) _xf86keysym=yes ;; - --disable-xf86keysym) _xf86keysym=no ;; - --enable-mlib) _mlib=yes ;; - --disable-mlib) _mlib=no ;; - --enable-sunaudio) _sunaudio=yes ;; - --disable-sunaudio) _sunaudio=no ;; - --enable-sgiaudio) _sgiaudio=yes ;; - --disable-sgiaudio) _sgiaudio=no ;; - --enable-alsa) _alsa=yes ;; - --disable-alsa) _alsa=no ;; - --enable-tv) _tv=yes ;; - --disable-tv) _tv=no ;; - --enable-tv-bsdbt848) _tv_bsdbt848=yes ;; - --disable-tv-bsdbt848) _tv_bsdbt848=no ;; - --enable-tv-v4l1) _tv_v4l1=yes ;; - --disable-tv-v4l1) _tv_v4l1=no ;; - --enable-tv-v4l2) _tv_v4l2=yes ;; - --disable-tv-v4l2) _tv_v4l2=no ;; - --enable-tv-dshow) _tv_dshow=yes ;; - --disable-tv-dshow) _tv_dshow=no ;; - --enable-tv-teletext) _tv_teletext=yes ;; - --disable-tv-teletext) _tv_teletext=no ;; - --enable-radio) _radio=yes ;; - --enable-radio-capture) _radio_capture=yes ;; - --disable-radio-capture) _radio_capture=no ;; - --disable-radio) _radio=no ;; - --enable-radio-v4l) _radio_v4l=yes ;; - --disable-radio-v4l) _radio_v4l=no ;; - --enable-radio-v4l2) _radio_v4l2=yes ;; - --disable-radio-v4l2) _radio_v4l2=no ;; - --enable-radio-bsdbt848) _radio_bsdbt848=yes ;; - --disable-radio-bsdbt848) _radio_bsdbt848=no ;; - --enable-pvr) _pvr=yes ;; - --disable-pvr) _pvr=no ;; - --enable-fastmemcpy) _fastmemcpy=yes ;; - --disable-fastmemcpy) _fastmemcpy=no ;; - --enable-network) _network=yes ;; - --disable-network) _network=no ;; - --enable-winsock2_h) _winsock2_h=yes ;; - --disable-winsock2_h) _winsock2_h=no ;; - --enable-smb) _smb=yes ;; - --disable-smb) _smb=no ;; - --enable-vidix) _vidix=yes ;; - --disable-vidix) _vidix=no ;; + --enable-iconv) _iconv=yes ;; + --disable-iconv) _iconv=no ;; + --enable-langinfo) _langinfo=yes ;; + --disable-langinfo) _langinfo=no ;; + --enable-rtc) _rtc=yes ;; + --disable-rtc) _rtc=no ;; + --enable-libdv) _libdv=yes ;; + --disable-libdv) _libdv=no ;; + --enable-ossaudio) _ossaudio=yes ;; + --disable-ossaudio) _ossaudio=no ;; + --enable-arts) _arts=yes ;; + --disable-arts) _arts=no ;; + --enable-esd) _esd=yes ;; + --disable-esd) _esd=no ;; + --enable-pulse) _pulse=yes ;; + --disable-pulse) _pulse=no ;; + --enable-jack) _jack=yes ;; + --disable-jack) _jack=no ;; + --enable-openal) _openal=yes ;; + --disable-openal) _openal=no ;; + --enable-kai) _kai=yes ;; + --disable-kai) _kai=no ;; + --enable-dart) _dart=yes ;; + --disable-dart) _dart=no ;; + --enable-mad) _mad=yes ;; + --disable-mad) _mad=no ;; + --enable-mp3lame) _mp3lame=yes ;; + --disable-mp3lame) _mp3lame=no ;; + --enable-mp3lame-lavc) _mp3lame_lavc=yes ;; + --disable-mp3lame-lavc) _mp3lame_lavc=no ;; + --enable-toolame) _toolame=yes ;; + --disable-toolame) _toolame=no ;; + --enable-twolame) _twolame=yes ;; + --disable-twolame) _twolame=no ;; + --enable-libcdio) _libcdio=yes ;; + --disable-libcdio) _libcdio=no ;; + --enable-liblzo) _liblzo=yes ;; + --disable-liblzo) _liblzo=no ;; + --enable-libvorbis) _libvorbis=yes ;; + --disable-libvorbis) _libvorbis=no ;; + --enable-speex) _speex=yes ;; + --disable-speex) _speex=no ;; + --enable-libgsm) _libgsm=yes ;; + --disable-libgsm) _libgsm=no ;; + --enable-tremor) _tremor=yes ;; + --disable-tremor) _tremor=no ;; + --enable-tremor-internal) _tremor_internal=yes ;; + --disable-tremor-internal) _tremor_internal=no ;; + --enable-tremor-low) _tremor_low=yes ;; + --disable-tremor-low) _tremor_low=no ;; + --enable-theora) _theora=yes ;; + --disable-theora) _theora=no ;; + --enable-mpg123) _mpg123=yes ;; + --disable-mpg123) _mpg123=no ;; + --enable-mp3lib) _mp3lib=yes ;; + --disable-mp3lib) _mp3lib=no ;; + --enable-liba52) _liba52=yes ;; + --disable-liba52) _liba52=no ;; + --enable-libdca) _libdca=yes ;; + --disable-libdca) _libdca=no ;; + --enable-libmpeg2) _libmpeg2=yes ;; + --disable-libmpeg2) _libmpeg2=no ;; + --enable-libmpeg2-internal) _libmpeg2_internal=yes ;; + --disable-libmpeg2-internal) _libmpeg2_internal=no ;; + --enable-musepack) _musepack=yes ;; + --disable-musepack) _musepack=no ;; + --enable-faad) _faad=yes ;; + --disable-faad) _faad=no ;; + --enable-faad-internal) _faad_internal=yes ;; + --disable-faad-internal) _faad_internal=no ;; + --enable-faad-fixed) _faad_fixed=yes ;; + --disable-faad-fixed) _faad_fixed=no ;; + --enable-faac) _faac=yes ;; + --disable-faac) _faac=no ;; + --enable-faac-lavc) _faac_lavc=yes ;; + --disable-faac-lavc) _faac_lavc=no ;; + --enable-ladspa) _ladspa=yes ;; + --disable-ladspa) _ladspa=no ;; + --enable-libbs2b) _libbs2b=yes ;; + --disable-libbs2b) _libbs2b=no ;; + --enable-xmms) _xmms=yes ;; + --disable-xmms) _xmms=no ;; + --enable-vcd) _vcd=yes ;; + --disable-vcd) _vcd=no ;; + --enable-bluray) _bluray=yes ;; + --disable-bluray) _bluray=no ;; + --enable-dvdread) _dvdread=yes ;; + --disable-dvdread) _dvdread=no ;; + --enable-dvdread-internal) _dvdread_internal=yes ;; + --disable-dvdread-internal) _dvdread_internal=no ;; + --enable-libdvdcss-internal) _libdvdcss_internal=yes ;; + --disable-libdvdcss-internal) _libdvdcss_internal=no ;; + --enable-dvdnav) _dvdnav=yes ;; + --disable-dvdnav) _dvdnav=no ;; + --enable-xanim) _xanim=yes ;; + --disable-xanim) _xanim=no ;; + --enable-real) _real=yes ;; + --disable-real) _real=no ;; + --enable-live) _live=yes ;; + --disable-live) _live=no ;; + --enable-nemesi) _nemesi=yes ;; + --disable-nemesi) _nemesi=no ;; + --enable-librtmp) _librtmp=yes ;; + --disable-librtmp) _librtmp=no ;; + --enable-xinerama) _xinerama=yes ;; + --disable-xinerama) _xinerama=no ;; + --enable-mga) _mga=yes ;; + --disable-mga) _mga=no ;; + --enable-xmga) _xmga=yes ;; + --disable-xmga) _xmga=no ;; + --enable-vm) _vm=yes ;; + --disable-vm) _vm=no ;; + --enable-xf86keysym) _xf86keysym=yes ;; + --disable-xf86keysym) _xf86keysym=no ;; + --enable-mlib) _mlib=yes ;; + --disable-mlib) _mlib=no ;; + --enable-sunaudio) _sunaudio=yes ;; + --disable-sunaudio) _sunaudio=no ;; + --enable-sgiaudio) _sgiaudio=yes ;; + --disable-sgiaudio) _sgiaudio=no ;; + --enable-alsa) _alsa=yes ;; + --disable-alsa) _alsa=no ;; + --enable-tv) _tv=yes ;; + --disable-tv) _tv=no ;; + --enable-tv-bsdbt848) _tv_bsdbt848=yes ;; + --disable-tv-bsdbt848) _tv_bsdbt848=no ;; + --enable-tv-v4l1) _tv_v4l1=yes ;; + --disable-tv-v4l1) _tv_v4l1=no ;; + --enable-tv-v4l2) _tv_v4l2=yes ;; + --disable-tv-v4l2) _tv_v4l2=no ;; + --enable-tv-dshow) _tv_dshow=yes ;; + --disable-tv-dshow) _tv_dshow=no ;; + --enable-radio) _radio=yes ;; + --enable-radio-capture) _radio_capture=yes ;; + --disable-radio-capture) _radio_capture=no ;; + --disable-radio) _radio=no ;; + --enable-radio-v4l) _radio_v4l=yes ;; + --disable-radio-v4l) _radio_v4l=no ;; + --enable-radio-v4l2) _radio_v4l2=yes ;; + --disable-radio-v4l2) _radio_v4l2=no ;; + --enable-radio-bsdbt848) _radio_bsdbt848=yes ;; + --disable-radio-bsdbt848) _radio_bsdbt848=no ;; + --enable-pvr) _pvr=yes ;; + --disable-pvr) _pvr=no ;; + --enable-fastmemcpy) _fastmemcpy=yes ;; + --disable-fastmemcpy) _fastmemcpy=no ;; + --enable-hardcoded-tables) hardcoded_tables=yes ;; + --disable-hardcoded-tables) hardcoded_tables=no ;; + --enable-network) _network=yes ;; + --disable-network) _network=no ;; + --enable-winsock2_h) _winsock2_h=yes ;; + --disable-winsock2_h) _winsock2_h=no ;; + --enable-smb) _smb=yes ;; + --disable-smb) _smb=no ;; + --enable-vidix) _vidix=yes ;; + --disable-vidix) _vidix=no ;; --with-vidix-drivers=*) - _vidix_drivers=`echo $ac_option | cut -d '=' -f 2` + _vidix_drivers=$(echo $ac_option | cut -d '=' -f 2) ;; - --disable-vidix-pcidb) _vidix_pcidb=no ;; - --enable-dhahelper) _dhahelper=yes ;; - --disable-dhahelper) _dhahelper=no ;; - --enable-svgalib_helper) _svgalib_helper=yes ;; - --disable-svgalib_helper) _svgalib_helper=no ;; - --enable-joystick) _joystick=yes ;; - --disable-joystick) _joystick=no ;; - --enable-xvid) _xvid=yes ;; - --disable-xvid) _xvid=no ;; - --enable-xvid-lavc) _xvid_lavc=yes ;; - --disable-xvid-lavc) _xvid_lavc=no ;; + --disable-vidix-pcidb) _vidix_pcidb=no ;; + --enable-dhahelper) _dhahelper=yes ;; + --disable-dhahelper) _dhahelper=no ;; + --enable-svgalib_helper) _svgalib_helper=yes ;; + --disable-svgalib_helper) _svgalib_helper=no ;; + --enable-joystick) _joystick=yes ;; + --disable-joystick) _joystick=no ;; + --enable-xvid) _xvid=yes ;; + --disable-xvid) _xvid=no ;; + --enable-xvid-lavc) _xvid_lavc=yes ;; + --disable-xvid-lavc) _xvid_lavc=no ;; --enable-x264) _x264=yes ;; --disable-x264) _x264=no ;; --enable-x264-lavc) _x264_lavc=yes ;; @@ -1105,95 +1184,97 @@ --disable-libdirac-lavc) _libdirac_lavc=no ;; --enable-libschroedinger-lavc) _libschroedinger_lavc=yes ;; --disable-libschroedinger-lavc) _libschroedinger_lavc=no ;; - --enable-libnut) _libnut=yes ;; - --disable-libnut) _libnut=no ;; - --enable-libavutil_a) _libavutil_a=yes ;; - --disable-libavutil_a) _libavutil_a=no ;; - --enable-libavutil_so) _libavutil_so=yes ;; - --disable-libavutil_so) _libavutil_so=no ;; - --enable-libavcodec_a) _libavcodec_a=yes ;; - --disable-libavcodec_a) _libavcodec_a=no ;; - --enable-libavcodec_so) _libavcodec_so=yes ;; - --disable-libavcodec_so) _libavcodec_so=no ;; - --enable-libamr_nb) _libamr_nb=yes ;; - --disable-libamr_nb) _libamr_nb=no ;; - --enable-libamr_wb) _libamr_wb=yes ;; - --disable-libamr_wb) _libamr_wb=no ;; - --enable-decoder=*) _libavdecoders="$_libavdecoders `echo $ac_option | cut -d '=' -f 2`" ;; - --disable-decoder=*) _libavdecoders=`echo $_libavdecoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;; - --enable-encoder=*) _libavencoders="$_libavencoders `echo $ac_option | cut -d '=' -f 2`" ;; - --disable-encoder=*) _libavencoders=`echo $_libavencoders | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;; - --enable-parser=*) _libavparsers="$_libavparsers `echo $ac_option | cut -d '=' -f 2`" ;; - --disable-parser=*) _libavparsers=`echo $_libavparsers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;; - --enable-demuxer=*) _libavdemuxers="$_libavdemuxers `echo $ac_option | cut -d '=' -f 2`" ;; - --disable-demuxer=*) _libavdemuxers=`echo $_libavdemuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;; - --enable-muxer=*) _libavmuxers="$_libavmuxers `echo $ac_option | cut -d '=' -f 2`" ;; - --disable-muxer=*) _libavmuxers=`echo $_libavmuxers | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;; - --enable-libavformat_a) _libavformat_a=yes ;; - --disable-libavformat_a) _libavformat_a=no ;; - --enable-libavformat_so) _libavformat_so=yes ;; - --disable-libavformat_so) _libavformat_so=no ;; - --enable-libpostproc_a) _libpostproc_a=yes ;; - --disable-libpostproc_a) _libpostproc_a=no ;; - --enable-libpostproc_so) _libpostproc_so=yes ;; - --disable-libpostproc_so) _libpostproc_so=no ;; - --enable-libswscale_a) _libswscale_a=yes ;; - --disable-libswscale_a) _libswscale_a=no ;; - --enable-libswscale_so) _libswscale_so=yes ;; - --disable-libswscale_so) _libswscale_so=no ;; - --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;; - --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;; - - --enable-lirc) _lirc=yes ;; - --disable-lirc) _lirc=no ;; - --enable-lircc) _lircc=yes ;; - --disable-lircc) _lircc=no ;; - --enable-apple-remote) _apple_remote=yes ;; - --disable-apple-remote) _apple_remote=no ;; + --enable-libvpx-lavc) _libvpx_lavc=yes ;; + --disable-libvpx-lavc) _libvpx_lavc=no ;; + --enable-libnut) _libnut=yes ;; + --disable-libnut) _libnut=no ;; + --enable-libavutil_a) _libavutil_a=yes ;; + --disable-libavutil_a) _libavutil_a=no ;; + --enable-libavutil_so) _libavutil_so=yes ;; + --disable-libavutil_so) _libavutil_so=no ;; + --enable-libavcodec_a) _libavcodec_a=yes ;; + --disable-libavcodec_a) _libavcodec_a=no ;; + --enable-libavcodec_so) _libavcodec_so=yes ;; + --disable-libavcodec_so) _libavcodec_so=no ;; + --enable-libopencore_amrnb) _libopencore_amrnb=yes ;; + --disable-libopencore_amrnb) _libopencore_amrnb=no ;; + --enable-libopencore_amrwb) _libopencore_amrwb=yes ;; + --disable-libopencore_amrwb) _libopencore_amrwb=no ;; + --enable-decoder=*) libavdecoders="$libavdecoders $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;; + --disable-decoder=*) libavdecoders=$(echo $libavdecoders | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;; + --enable-encoder=*) libavencoders="$libavencoders $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;; + --disable-encoder=*) libavencoders=$(echo $libavencoders | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;; + --enable-parser=*) libavparsers="$libavparsers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;; + --disable-parser=*) libavparsers=$(echo $libavparsers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;; + --enable-protocol=*) libavprotocols="$libavprotocols $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;; + --disable-protocol=*) libavprotocols=$(echo $libavprotocols | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;; + --enable-demuxer=*) libavdemuxers="$libavdemuxers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;; + --disable-demuxer=*) libavdemuxers=$(echo $libavdemuxers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;; + --enable-muxer=*) libavmuxers="$libavmuxers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;; + --disable-muxer=*) libavmuxers=$(echo $libavmuxers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;; + --enable-libavformat_a) _libavformat_a=yes ;; + --disable-libavformat_a) _libavformat_a=no ;; + --enable-libavformat_so) _libavformat_so=yes ;; + --disable-libavformat_so) _libavformat_so=no ;; + --enable-libpostproc_a) _libpostproc_a=yes ;; + --disable-libpostproc_a) _libpostproc_a=no ;; + --enable-libpostproc_so) _libpostproc_so=yes ;; + --disable-libpostproc_so) _libpostproc_so=no ;; + --enable-libswscale_a) _libswscale_a=yes ;; + --disable-libswscale_a) _libswscale_a=no ;; + --enable-libswscale_so) _libswscale_so=yes ;; + --disable-libswscale_so) _libswscale_so=no ;; + --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;; + --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;; + + --enable-lirc) _lirc=yes ;; + --disable-lirc) _lirc=no ;; + --enable-lircc) _lircc=yes ;; + --disable-lircc) _lircc=no ;; + --enable-apple-remote) _apple_remote=yes ;; + --disable-apple-remote) _apple_remote=no ;; --enable-apple-ir) _apple_ir=yes ;; --disable-apple-ir) _apple_ir=no ;; - --enable-gui) _gui=yes ;; - --disable-gui) _gui=no ;; - --enable-gtk1) _gtk1=yes ;; - --disable-gtk1) _gtk1=no ;; - --enable-termcap) _termcap=yes ;; - --disable-termcap) _termcap=no ;; - --enable-termios) _termios=yes ;; + --enable-gui) _gui=yes ;; + --disable-gui) _gui=no ;; + --enable-gtk1) _gtk1=yes ;; + --disable-gtk1) _gtk1=no ;; + --enable-termcap) _termcap=yes ;; + --disable-termcap) _termcap=no ;; + --enable-termios) _termios=yes ;; --disable-termios) _termios=no ;; - --enable-3dfx) _3dfx=yes ;; - --disable-3dfx) _3dfx=no ;; - --enable-s3fb) _s3fb=yes ;; - --disable-s3fb) _s3fb=no ;; - --enable-wii) _wii=yes ;; - --disable-wii) _wii=no ;; - --enable-tdfxfb) _tdfxfb=yes ;; - --disable-tdfxfb) _tdfxfb=no ;; - --disable-tdfxvid) _tdfxvid=no ;; - --enable-tdfxvid) _tdfxvid=yes ;; - --disable-xvr100) _xvr100=no ;; - --enable-xvr100) _xvr100=yes ;; - --disable-tga) _tga=no ;; - --enable-tga) _tga=yes ;; - --enable-directfb) _directfb=yes ;; - --disable-directfb) _directfb=no ;; - --enable-zr) _zr=yes ;; - --disable-zr) _zr=no ;; - --enable-bl) _bl=yes ;; - --disable-bl) _bl=no ;; - --enable-mtrr) _mtrr=yes ;; - --disable-mtrr) _mtrr=no ;; - --enable-largefiles) _largefiles=yes ;; - --disable-largefiles) _largefiles=no ;; - --enable-shm) _shm=yes ;; - --disable-shm) _shm=no ;; - --enable-select) _select=yes ;; - --disable-select) _select=no ;; - --enable-linux-devfs) _linux_devfs=yes ;; - --disable-linux-devfs) _linux_devfs=no ;; - --enable-cdparanoia) _cdparanoia=yes ;; - --disable-cdparanoia) _cdparanoia=no ;; - --enable-cddb) _cddb=yes ;; - --disable-cddb) _cddb=no ;; + --enable-3dfx) _3dfx=yes ;; + --disable-3dfx) _3dfx=no ;; + --enable-s3fb) _s3fb=yes ;; + --disable-s3fb) _s3fb=no ;; + --enable-wii) _wii=yes ;; + --disable-wii) _wii=no ;; + --enable-tdfxfb) _tdfxfb=yes ;; + --disable-tdfxfb) _tdfxfb=no ;; + --disable-tdfxvid) _tdfxvid=no ;; + --enable-tdfxvid) _tdfxvid=yes ;; + --disable-xvr100) _xvr100=no ;; + --enable-xvr100) _xvr100=yes ;; + --disable-tga) _tga=no ;; + --enable-tga) _tga=yes ;; + --enable-directfb) _directfb=yes ;; + --disable-directfb) _directfb=no ;; + --enable-zr) _zr=yes ;; + --disable-zr) _zr=no ;; + --enable-bl) _bl=yes ;; + --disable-bl) _bl=no ;; + --enable-mtrr) _mtrr=yes ;; + --disable-mtrr) _mtrr=no ;; + --enable-largefiles) _largefiles=yes ;; + --disable-largefiles) _largefiles=no ;; + --enable-shm) _shm=yes ;; + --disable-shm) _shm=no ;; + --enable-select) _select=yes ;; + --disable-select) _select=no ;; + --enable-cdparanoia) _cdparanoia=yes ;; + --disable-cdparanoia) _cdparanoia=no ;; + --enable-cddb) _cddb=yes ;; + --disable-cddb) _cddb=no ;; --enable-big-endian) _big_endian=yes ;; --disable-big-endian) _big_endian=no ;; --enable-bitmap-font) _bitmap_font=yes ;; @@ -1214,20 +1295,22 @@ --disable-w32threads) _w32threads=no ;; --enable-ass) _ass=yes ;; --disable-ass) _ass=no ;; + --enable-ass-internal) ass_internal=yes ;; + --disable-ass-internal) ass_internal=no ;; --enable-rpath) _rpath=yes ;; --disable-rpath) _rpath=no ;; --enable-fribidi) _fribidi=yes ;; --disable-fribidi) _fribidi=no ;; - --enable-enca) _enca=yes ;; - --disable-enca) _enca=no ;; + --enable-enca) _enca=yes ;; + --disable-enca) _enca=no ;; - --enable-inet6) _inet6=yes ;; - --disable-inet6) _inet6=no ;; + --enable-inet6) _inet6=yes ;; + --disable-inet6) _inet6=no ;; - --enable-gethostbyname2) _gethostbyname2=yes ;; - --disable-gethostbyname2) _gethostbyname2=no ;; + --enable-gethostbyname2) _gethostbyname2=yes ;; + --disable-gethostbyname2) _gethostbyname2=no ;; --enable-dga1) _dga1=yes ;; --disable-dga1) _dga1=no ;; @@ -1240,12 +1323,16 @@ --enable-qtx) _qtx=yes ;; --disable-qtx) _qtx=no ;; - --enable-macosx) _macosx=yes ;; - --disable-macosx) _macosx=no ;; + --enable-coreaudio) _coreaudio=yes ;; + --disable-coreaudio) _coreaudio=no ;; + --enable-corevideo) _corevideo=yes ;; + --disable-corevideo) _corevideo=no ;; + --enable-quartz) _quartz=yes ;; + --disable-quartz) _quartz=no ;; --enable-macosx-finder) _macosx_finder=yes ;; --disable-macosx-finder) _macosx_finder=no ;; - --enable-macosx-bundle) _macosx_bundle=yes;; - --disable-macosx-bundle) _macosx_bundle=no;; + --enable-macosx-bundle) _macosx_bundle=yes ;; + --disable-macosx-bundle) _macosx_bundle=no ;; --enable-maemo) _maemo=yes ;; --disable-maemo) _maemo=no ;; @@ -1253,14 +1340,14 @@ --enable-sortsub) _sortsub=yes ;; --disable-sortsub) _sortsub=no ;; - --enable-crash-debug) _crash_debug=yes ;; + --enable-crash-debug) _crash_debug=yes ;; --disable-crash-debug) _crash_debug=no ;; --enable-sighandler) _sighandler=yes ;; --disable-sighandler) _sighandler=no ;; --enable-win32dll) _win32dll=yes ;; --disable-win32dll) _win32dll=no ;; - --enable-sse) _sse=yes ;; + --enable-sse) _sse=yes ;; --disable-sse) _sse=no ;; --enable-sse2) _sse2=yes ;; --disable-sse2) _sse2=no ;; @@ -1276,6 +1363,8 @@ --disable-cmov) _cmov=no ;; --enable-fast-cmov) _fast_cmov=yes ;; --disable-fast-cmov) _fast_cmov=no ;; + --enable-fast-clz) _fast_clz=yes ;; + --disable-fast-clz) _fast_clz=no ;; --enable-altivec) _altivec=yes ;; --disable-altivec) _altivec=no ;; --enable-armv5te) _armv5te=yes ;; @@ -1286,9 +1375,11 @@ --disable-armv6t2) _armv6t2=no ;; --enable-armvfp) _armvfp=yes ;; --disable-armvfp) _armvfp=no ;; + --enable-neon) neon=yes ;; + --disable-neon) neon=no ;; --enable-iwmmxt) _iwmmxt=yes ;; --disable-iwmmxt) _iwmmxt=no ;; - --enable-mmx) _mmx=yes ;; + --enable-mmx) _mmx=yes ;; --disable-mmx) # 3Dnow! and MMX2 require MMX _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;; @@ -1301,19 +1392,22 @@ done # Atmos: moved this here, to be correct, if --prefix is specified -test -z "$_bindir" && _bindir="$_prefix/bin" +test -z "$_bindir" && _bindir="$_prefix/bin" test -z "$_datadir" && _datadir="$_prefix/share/mplayer" -test -z "$_mandir" && _mandir="$_prefix/share/man" +test -z "$_mandir" && _mandir="$_prefix/share/man" test -z "$_confdir" && _confdir="$_prefix/etc/mplayer" -test -z "$_libdir" && _libdir="$_prefix/lib" +test -z "$_libdir" && _libdir="$_prefix/lib" # Determine our OS name and CPU architecture if test -z "$_target" ; then # OS name - system_name=`uname -s 2>&1` + system_name=$(uname -s 2>&1) case "$system_name" in Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS) ;; + Haiku) + system_name=BeOS + ;; IRIX*) system_name=IRIX ;; @@ -1339,7 +1433,7 @@ # host's CPU/instruction set - host_arch=`uname -p 2>&1` + host_arch=$(uname -p 2>&1) case "$host_arch" in i386|sparc|ppc|alpha|arm|mips|vax) ;; @@ -1353,18 +1447,11 @@ # recognize. # x86/x86pc is used by QNX - case "`uname -m 2>&1`" in - i[3-9]86*|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686|BePC) host_arch=i386 ;; + case "$(uname -m 2>&1)" in + x86_64|amd64|i[3-9]86*|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686|BePC) host_arch=i386 ;; ia64) host_arch=ia64 ;; - x86_64|amd64) - if [ -n "$($_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p')" -a \ - -z "$(echo $CFLAGS $_cc | grep -- -m32)" ]; then - host_arch=x86_64 - else - host_arch=i386 - fi - ;; - macppc|ppc|ppc64) host_arch=ppc ;; + macppc|ppc) host_arch=ppc ;; + ppc64) host_arch=ppc64 ;; alpha) host_arch=alpha ;; sparc) host_arch=sparc ;; sparc64) host_arch=sparc64 ;; @@ -1373,7 +1460,7 @@ sh3|sh4|sh4a) host_arch=sh ;; s390) host_arch=s390 ;; s390x) host_arch=s390x ;; - mips*) host_arch=mips ;; + *mips*) host_arch=mips ;; vax) host_arch=vax ;; xtensa*) host_arch=xtensa ;; *) host_arch=UNKNOWN ;; @@ -1381,8 +1468,8 @@ ;; esac else # if test -z "$_target" - system_name=`echo $_target | cut -d '-' -f 2` - case "`echo $system_name | tr A-Z a-z`" in + system_name=$(echo $_target | cut -d '-' -f 2) + case "$(echo $system_name | tr A-Z a-z)" in linux) system_name=Linux ;; freebsd) system_name=FreeBSD ;; gnu/kfreebsd) system_name=FreeBSD ;; @@ -1394,23 +1481,15 @@ qnx) system_name=QNX ;; morphos) system_name=MorphOS ;; amigaos) system_name=AmigaOS ;; - mingw32msvc) system_name=MINGW32 ;; + mingw32*) system_name=MINGW32 ;; esac # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed - host_arch=`echo $_target | cut -d '-' -f 1` - if test `echo $host_arch` != "x86_64" ; then - host_arch=`echo $host_arch | tr '_' '-'` + host_arch=$(echo $_target | cut -d '-' -f 1) + if test $(echo $host_arch) != "x86_64" ; then + host_arch=$(echo $host_arch | tr '_' '-') fi fi -echo "Detected operating system: $system_name" -echo "Detected host architecture: $host_arch" - -if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then - die "Runtime CPU detection only works for x86, x86-64 and PPC!" -fi - - extra_cflags="-I. $extra_cflags" _timer=timer-linux.c _getch=getch2.c @@ -1425,8 +1504,7 @@ fi if darwin; then - extra_ldflags="$extra_ldflags -L/usr/local/lib" - extra_cflags="$extra_cflags -I/usr/local/include" + extra_cflags="-mdynamic-no-pic -falign-loops=16 -shared-libgcc $extra_cflags" _timer=timer-darwin.c fi @@ -1442,6 +1520,7 @@ if win32 ; then _exesuf=".exe" + extra_cflags="$extra_cflags -fno-common" # -lwinmm is always needed for osdep/timer-win2.c extra_ldflags="$extra_ldflags -lwinmm" _pe_executable=yes @@ -1461,6 +1540,7 @@ _sighandler=no _stream_cache=no def_stream_cache="#undef CONFIG_STREAM_CACHE" + extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags" fi if qnx ; then @@ -1476,46 +1556,39 @@ def_priority="#define CONFIG_PRIORITY 1" fi -for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do - test "$I" && break +for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do + test "$tmpdir" && break done +mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$" +mkdir $mplayer_tmpdir || die "Unable to create tmpdir." -TMPLOG="configure.log" -TMPC="$I/mplayer-conf-$RANDOM-$$.c" -TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp" -TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf" -TMPH="$I/mplayer-conf-$RANDOM-$$.h" -TMPS="$I/mplayer-conf-$RANDOM-$$.S" +TMPLOG="config.log" +TMPC="$mplayer_tmpdir/tmp.c" +TMPCPP="$mplayer_tmpdir/tmp.cpp" +TMPEXE="$mplayer_tmpdir/tmp$_exesuf" +TMPH="$mplayer_tmpdir/tmp.h" +TMPS="$mplayer_tmpdir/tmp.S" rm -f "$TMPLOG" -echo configuration: $_configuration > "$TMPLOG" +echo configuration: $configuration > "$TMPLOG" echo >> "$TMPLOG" -# Check how to call 'head' and 'tail'. Newer versions spit out warnings -# if used as 'head -1' instead of 'head -n 1', but older versions don't -# know about '-n'. -if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then - _head() { head -$1 2>/dev/null ; } -else - _head() { head -n $1 2>/dev/null ; } -fi -if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then - _tail() { tail -$1 2>/dev/null ; } -else - _tail() { tail -n $1 2>/dev/null ; } +if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then + die "Runtime CPU detection only works for x86, x86-64 and PPC!" fi + # Checking CC version... # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure) -if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then +if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then echocheck "$_cc version" cc_vendor=intel - cc_name=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 1` - cc_version=`$_cc -V 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3` - _cc_major=`echo $cc_version | cut -d '.' -f 1` - _cc_minor=`echo $cc_version | cut -d '.' -f 2` + cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1) + cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3) + _cc_major=$(echo $cc_version | cut -d '.' -f 1) + _cc_minor=$(echo $cc_version | cut -d '.' -f 2) # TODO verify older icc/ecc compatibility case $cc_version in '') @@ -1532,41 +1605,69 @@ esac echores "$cc_version" else - for _cc in "$_cc" cc gcc ; do - cc_name_tmp=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1` + for _cc in "$_cc" gcc cc ; do + cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1) if test "$cc_name_tmp" = "gcc"; then - cc_name=$cc_name_tmp - echocheck "$_cc version" - cc_vendor=gnu - cc_version=`$_cc -dumpversion 2>&1` - case $cc_version in - 2.96*) - cc_fail=yes - ;; - *) - _cc_major=`echo $cc_version | cut -d '.' -f 1` - _cc_minor=`echo $cc_version | cut -d '.' -f 2` - _cc_mini=`echo $cc_version | cut -d '.' -f 3` - ;; - esac - echores "$cc_version" - break + cc_name=$cc_name_tmp + echocheck "$_cc version" + cc_vendor=gnu + cc_version=$($_cc -dumpversion 2>&1) + case $cc_version in + 2.96*) + cc_fail=yes + ;; + *) + _cc_major=$(echo $cc_version | cut -d '.' -f 1) + _cc_minor=$(echo $cc_version | cut -d '.' -f 2) + _cc_mini=$(echo $cc_version | cut -d '.' -f 3) + ;; + esac + echores "$cc_version" + break + fi + cc_name_tmp=$($_cc -v 2>&1 | head -n 1 | cut -d ' ' -f 1) + if test "$cc_name_tmp" = "clang"; then + echocheck "$_cc version" + cc_vendor=clang + cc_version=$($_cc -dumpversion 2>&1) + res_comment="experimental support only" + echores "clang $cc_version" + break + fi + cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3) + if test "$cc_name_tmp" = "Sun C"; then + echocheck "$_cc version" + cc_vendor=sun + cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4) + res_comment="experimental support only" + echores "Sun C $cc_version" + break fi done fi # icc test "$cc_fail" = yes && die "unsupported compiler version" +if test -z "$_target" && x86 ; then + cat > $TMPC << EOF +int main(void) { + int test[(int)sizeof(char *)-7]; + return 0; +} +EOF + cc_check && host_arch=x86_64 || host_arch=i386 +fi + +echo "Detected operating system: $system_name" +echo "Detected host architecture: $host_arch" + echocheck "host cc" test "$_host_cc" || _host_cc=$_cc echores $_host_cc echocheck "cross compilation" if test $_cross_compile = auto ; then - cat > $TMPC << EOF -int main(void) { return 0; } -EOF _cross_compile=yes - cc_check && "$TMPEXE" && _cross_compile=no + cflag_check "" && "$TMPEXE" && _cross_compile=no fi echores $_cross_compile @@ -1581,12 +1682,12 @@ # now that we know what compiler should be used for compilation, try to find # out which assembler is used by the $_cc compiler if test "$_as" = auto ; then - _as=`$_cc -print-prog-name=as` + _as=$($_cc -print-prog-name=as) test -z "$_as" && _as=as fi if test "$_nm" = auto ; then - _nm=`$_cc -print-prog-name=nm` + _nm=$($_cc -print-prog-name=nm) test -z "$_nm" && _nm=nm fi @@ -1600,9 +1701,10 @@ if test -r /proc/cpuinfo && ! cygwin; then # Linux with /proc mounted, extract CPU information from it _cpuinfo="cat /proc/cpuinfo" -elif test -r /compat/linux/proc/cpuinfo && ! x86_32 ; then +elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then # FreeBSD with Linux emulation /proc mounted, # extract CPU information from it + # Don't use it on x86 though, it never reports 3Dnow _cpuinfo="cat /compat/linux/proc/cpuinfo" elif darwin && ! x86 ; then # use hostinfo on Darwin @@ -1617,18 +1719,24 @@ _cpuinfo="./cpuinfo$_exesuf" fi +if [ "$cc_vendor" = "gnu" ] && [ "$_cc_major" = 2 ] ; then + test $_sse = auto && _sse=no + test $_win32dll = auto && _win32dll=no + ass_internal=no +fi + if x86 ; then # gather more CPU information - pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1` - pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1` - pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1` - pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1` - pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1` + pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1) + pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1) + pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1) + pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1) + pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1) - exts=`$_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | _head 1` + exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1) - pparam=`echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \ - -e s/xmm/sse/ -e s/kni/sse/` + pparam=$(echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \ + -e s/xmm/sse/ -e s/kni/sse/) for ext in $pparam ; do eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check @@ -1653,7 +1761,7 @@ cat > $TMPC < #include -void catch() { exit(1); } +void catch(void) { exit(1); } int main(void) { signal(SIGILL, catch); __asm__ volatile ("$3":::"memory"); return 0; @@ -1663,14 +1771,14 @@ if cc_check && tmp_run ; then eval _$2=yes echores "yes" - _optimizing="$_optimizing $2" + _optimizing="$_optimizing $2" return 0 else eval _$2=no echores "failed" echo "It seems that your kernel does not correctly support $2." echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!" - return 1 + return 1 fi fi return 0 @@ -1696,10 +1804,7 @@ # if we had to disable sse/sse2 because the active kernel does not # support this instruction set extension, we also have to tell # gcc3 to not generate sse/sse2 instructions for normal C code - cat > $TMPC << EOF -int main(void) { return 0; } -EOF - cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext" + cflag_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext" fi fi @@ -1707,13 +1812,17 @@ def_fast_64bit='#define HAVE_FAST_64BIT 0' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0' -_arch_all='X86 X86_32 X86_64 IA64 SPARC ARM AVR32 SH4 PPC ALPHA SGI_MIPS PA_RISC S390 S390X VAX BFIN XTENSA GENERIC' +def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 0' +def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 0' +arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC' +subarch_all='X86_32 X86_64 PPC64' case "$host_arch" in i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) - _arch='X86 X86_32' - _target_arch_x86="ARCH_X86 = yes" - _target_arch="ARCH_X86_32 = yes" + arch='x86' + subarch='x86_32' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' + def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 1' + def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 1' iproc=486 proc=i486 @@ -1725,38 +1834,40 @@ 3) proc=i386 iproc=386 ;; 4) proc=i486 iproc=486 ;; 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3 - # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size. - if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then - proc=k6-3 - elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then - proc=geode - elif test "$pmodel" -ge 8; then - proc=k6-2 - elif test "$pmodel" -ge 6; then - proc=k6 - else - proc=i586 - fi - ;; + # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size. + if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then + proc=k6-3 + elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then + proc=geode + elif test "$pmodel" -ge 8; then + proc=k6-2 + elif test "$pmodel" -ge 6; then + proc=k6 + else + proc=i586 + fi + ;; 6) iproc=686 - # It's a bit difficult to determine the correct type of Family 6 - # AMD CPUs just from their signature. Instead, we check directly - # whether it supports SSE. - if test "$_sse" = yes; then - # gcc treats athlon-xp, athlon-4 and athlon-mp similarly. - proc=athlon-xp - else - # Again, gcc treats athlon and athlon-tbird similarly. - proc=athlon - fi - ;; + # It's a bit difficult to determine the correct type of Family 6 + # AMD CPUs just from their signature. Instead, we check directly + # whether it supports SSE. + if test "$_sse" = yes; then + # gcc treats athlon-xp, athlon-4 and athlon-mp similarly. + proc=athlon-xp + else + # Again, gcc treats athlon and athlon-tbird similarly. + proc=athlon + fi + ;; 15) iproc=686 - # k8 cpu-type only supported in gcc >= 3.4.0, but that will be - # caught and remedied in the optimization tests below. - proc=k8 - ;; + # k8 cpu-type only supported in gcc >= 3.4.0, but that will be + # caught and remedied in the optimization tests below. + proc=k8 + ;; - *) proc=k8 iproc=686 ;; + *) proc=amdfam10 iproc=686 + test $_fast_clz = "auto" && _fast_clz=yes + ;; esac ;; GenuineIntel) @@ -1764,56 +1875,58 @@ 3) proc=i386 iproc=386 ;; 4) proc=i486 iproc=486 ;; 5) iproc=586 - if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then - proc=pentium-mmx # 4 is desktop, 8 is mobile - else - proc=i586 - fi - ;; + if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then + proc=pentium-mmx # 4 is desktop, 8 is mobile + else + proc=i586 + fi + ;; 6) iproc=686 - if test "$pmodel" -ge 15; then - proc=core2 - elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then - proc=pentium-m - elif test "$pmodel" -ge 7; then - proc=pentium3 - elif test "$pmodel" -ge 3; then - proc=pentium2 - else - proc=i686 - fi - ;; + if test "$pmodel" -ge 15; then + proc=core2 + elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then + proc=pentium-m + elif test "$pmodel" -ge 7; then + proc=pentium3 + elif test "$pmodel" -ge 3; then + proc=pentium2 + else + proc=i686 + fi + test $_fast_clz = "auto" && _fast_clz=yes + ;; 15) iproc=686 - # A nocona in 32-bit mode has no more capabilities than a prescott. - if test "$pmodel" -ge 3; then - proc=prescott - else - proc=pentium4 - fi - test $_fast_cmov = "auto" && _fast_cmov=no - ;; + # A nocona in 32-bit mode has no more capabilities than a prescott. + if test "$pmodel" -ge 3; then + proc=prescott + else + proc=pentium4 + test $_fast_clz = "auto" && _fast_clz=yes + fi + test $_fast_cmov = "auto" && _fast_cmov=no + ;; *) proc=prescott iproc=686 ;; esac ;; CentaurHauls) case "$pfamily" in 5) iproc=586 - if test "$pmodel" -ge 8; then - proc=winchip2 - elif test "$pmodel" -ge 4; then - proc=winchip-c6 - else - proc=i586 - fi - ;; + if test "$pmodel" -ge 8; then + proc=winchip2 + elif test "$pmodel" -ge 4; then + proc=winchip-c6 + else + proc=i586 + fi + ;; 6) iproc=686 - if test "$pmodel" -ge 9; then - proc=c3-2 - else - proc=c3 - iproc=586 - fi - ;; + if test "$pmodel" -ge 9; then + proc=c3-2 + else + proc=c3 + iproc=586 + fi + ;; *) proc=i686 iproc=i686 ;; esac ;; @@ -1827,6 +1940,7 @@ *) proc=i586 iproc=586 ;; esac + test $_fast_clz = "auto" && _fast_clz=no fi # test "$_runtime_cpudetection" = no @@ -1837,55 +1951,57 @@ # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then - cpuopt=-mtune + cpuopt=-mtune else - cpuopt=-mcpu + cpuopt=-mcpu fi echocheck "GCC & CPU optimization abilities" -cat > $TMPC << EOF -int main(void) { return 0; } -EOF if test "$_runtime_cpudetection" = no ; then - cc_check -march=native && proc=native + if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then + cflag_check -march=native && proc=native + fi + if test "$proc" = "amdfam10"; then + cflag_check -march=$proc $cpuopt=$proc || proc=k8 + fi if test "$proc" = "k8"; then - cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp + cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp fi if test "$proc" = "athlon-xp"; then - cc_check -march=$proc $cpuopt=$proc || proc=athlon + cflag_check -march=$proc $cpuopt=$proc || proc=athlon fi if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then - cc_check -march=$proc $cpuopt=$proc || proc=k6 + cflag_check -march=$proc $cpuopt=$proc || proc=k6 fi if test "$proc" = "k6" || test "$proc" = "c3"; then - if ! cc_check -march=$proc $cpuopt=$proc; then - if cc_check -march=i586 $cpuopt=i686; then + if ! cflag_check -march=$proc $cpuopt=$proc; then + if cflag_check -march=i586 $cpuopt=i686; then proc=i586-i686 else proc=i586 - fi + fi fi fi if test "$proc" = "prescott" ; then - cc_check -march=$proc $cpuopt=$proc || proc=pentium4 + cflag_check -march=$proc $cpuopt=$proc || proc=pentium4 fi if test "$proc" = "core2" ; then - cc_check -march=$proc $cpuopt=$proc || proc=pentium-m + cflag_check -march=$proc $cpuopt=$proc || proc=pentium-m fi if test "$proc" = "pentium4" || test "$proc" = "pentium-m" || test "$proc" = "pentium3" || test "$proc" = "pentium2" || test "$proc" = "athlon" || test "$proc" = "c3-2" || test "$proc" = "geode"; then - cc_check -march=$proc $cpuopt=$proc || proc=i686 + cflag_check -march=$proc $cpuopt=$proc || proc=i686 fi if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then - cc_check -march=$proc $cpuopt=$proc || proc=i586 + cflag_check -march=$proc $cpuopt=$proc || proc=i586 fi if test "$proc" = "i586"; then - cc_check -march=$proc $cpuopt=$proc || proc=i486 + cflag_check -march=$proc $cpuopt=$proc || proc=i486 fi if test "$proc" = "i486" ; then - cc_check -march=$proc $cpuopt=$proc || proc=i386 + cflag_check -march=$proc $cpuopt=$proc || proc=i386 fi if test "$proc" = "i386" ; then - cc_check -march=$proc $cpuopt=$proc || proc=error + cflag_check -march=$proc $cpuopt=$proc || proc=error fi if test "$proc" = "error" ; then echores "CPU optimization disabled. CPU not recognized or your compiler is too old." @@ -1905,9 +2021,9 @@ _mcpu="$cpuopt=generic" # at least i486 required, for bswap instruction _march="-march=i486" - cc_check $_mcpu || _mcpu="$cpuopt=i686" - cc_check $_mcpu || _mcpu="" - cc_check $_march $_mcpu || _march="" + cflag_check $_mcpu || _mcpu="$cpuopt=i686" + cflag_check $_mcpu || _mcpu="" + cflag_check $_march $_mcpu || _march="" fi ## Gabucino : --target takes effect here (hopefully...) by overwriting @@ -1938,36 +2054,40 @@ else _fast_cmov="no" fi + test $_fast_clz = "auto" && _fast_clz=yes echores "$proc" ;; ia64) - _arch='IA64' - _target_arch='ARCH_IA64 = yes' + arch='ia64' def_fast_64bit='#define HAVE_FAST_64BIT 1' iproc='ia64' ;; x86_64|amd64) - _arch='X86 X86_64' - _target_arch='ARCH_X86_64 = yes' - _target_arch_x86="ARCH_X86 = yes" + arch='x86' + subarch='x86_64' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' def_fast_64bit='#define HAVE_FAST_64BIT 1' iproc='x86_64' # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then - cpuopt=-mtune + cpuopt=-mtune else - cpuopt=-mcpu + cpuopt=-mcpu fi - test $_fast_cmov = "auto" && _fast_cmov=yes if test "$_runtime_cpudetection" = no ; then case "$pvendor" in AuthenticAMD) - proc=k8;; + case "$pfamily" in + 15) proc=k8 + test $_fast_clz = "auto" && _fast_clz=no + ;; + *) proc=amdfam10;; + esac + ;; GenuineIntel) case "$pfamily" in 6) proc=core2;; @@ -1975,6 +2095,8 @@ # 64-bit prescotts exist, but as far as GCC is concerned they # have the same capabilities as a nocona. proc=nocona + test $_fast_cmov = "auto" && _fast_cmov=no + test $_fast_clz = "auto" && _fast_clz=no ;; esac ;; @@ -1984,31 +2106,36 @@ fi # test "$_runtime_cpudetection" = no echocheck "GCC & CPU optimization abilities" -cat > $TMPC << EOF -int main(void) { return 0; } -EOF # This is a stripped-down version of the i386 fallback. if test "$_runtime_cpudetection" = no ; then - cc_check -march=native && proc=native + if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then + cflag_check -march=native && proc=native + fi # --- AMD processors --- + if test "$proc" = "amdfam10"; then + cflag_check -march=$proc $cpuopt=$proc || proc=k8 + fi if test "$proc" = "k8"; then - cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp + cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp fi # This will fail if gcc version < 3.3, which is ok because earlier # versions don't really support 64-bit on amd64. # Is this a valid assumption? -Corey if test "$proc" = "athlon-xp"; then - cc_check -march=$proc $cpuopt=$proc || proc=error + cflag_check -march=$proc $cpuopt=$proc || proc=error fi # --- Intel processors --- if test "$proc" = "core2"; then - cc_check -march=$proc $cpuopt=$proc || proc=nocona + cflag_check -march=$proc $cpuopt=$proc || proc=x86-64 + fi + if test "$proc" = "x86-64"; then + cflag_check -march=$proc $cpuopt=$proc || proc=nocona fi if test "$proc" = "nocona"; then - cc_check -march=$proc $cpuopt=$proc || proc=pentium4 + cflag_check -march=$proc $cpuopt=$proc || proc=pentium4 fi if test "$proc" = "pentium4"; then - cc_check -march=$proc $cpuopt=$proc || proc=error + cflag_check -march=$proc $cpuopt=$proc || proc=error fi _march="-march=$proc" @@ -2022,103 +2149,104 @@ # x86-64 is an undocumented option, an intersection of k8 and nocona. _march="-march=x86-64" _mcpu="$cpuopt=generic" - cc_check $_mcpu || _mcpu="x86-64" - cc_check $_mcpu || _mcpu="" - cc_check $_march $_mcpu || _march="" + cflag_check $_mcpu || _mcpu="x86-64" + cflag_check $_mcpu || _mcpu="" + cflag_check $_march $_mcpu || _march="" fi - _optimizing="" + _optimizing="$proc" + test $_fast_cmov = "auto" && _fast_cmov=yes + test $_fast_clz = "auto" && _fast_clz=yes echores "$proc" ;; sparc|sparc64) - _arch='SPARC' - _target_arch='ARCH_SPARC = yes' + arch='sparc' iproc='sparc' if test "$host_arch" = "sparc64" ; then _vis='yes' proc='ultrasparc' def_fast_64bit='#define HAVE_FAST_64BIT 1' elif sunos ; then - echocheck "CPU type" - karch=`uname -m` - case "`echo $karch`" in - sun4) proc=v7 ;; - sun4c) proc=v7 ;; - sun4d) proc=v8 ;; - sun4m) proc=v8 ;; - sun4u) proc=ultrasparc _vis='yes' ;; - sun4v) proc=v9 ;; - *) proc=v8 ;; - esac - echores "$proc" + echocheck "CPU type" + karch=$(uname -m) + case "$(echo $karch)" in + sun4) proc=v7 ;; + sun4c) proc=v7 ;; + sun4d) proc=v8 ;; + sun4m) proc=v8 ;; + sun4u) proc=ultrasparc _vis='yes' ;; + sun4v) proc=v9 ;; + *) proc=v8 ;; + esac + echores "$proc" else - proc=v8 + proc=v8 fi _mcpu="-mcpu=$proc" _optimizing="$proc" ;; - arm|armv4l|armv5tel) - _arch='ARM' - _target_arch='ARCH_ARM = yes' + arm*) + arch='arm' iproc='arm' ;; avr32) - _arch='AVR32' - _target_arch='ARCH_AVR32 = yes' + arch='avr32' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' iproc='avr32' + test $_fast_clz = "auto" && _fast_clz=yes ;; sh|sh4) - _arch='SH4' - _target_arch='ARCH_SH4 = yes' + arch='sh4' iproc='sh4' ;; ppc|ppc64|powerpc|powerpc64) - _arch='PPC' + arch='ppc' def_dcbzl='#define HAVE_DCBZL 0' - _target_arch='ARCH_PPC = yes' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' + def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 1' + def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 1' iproc='ppc' if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then + subarch='ppc64' def_fast_64bit='#define HAVE_FAST_64BIT 1' fi echocheck "CPU type" case $system_name in Linux) - proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1` - if test -n "`$_cpuinfo | grep altivec`"; then - test $_altivec = auto && _altivec=yes - fi + proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1) + if test -n "$($_cpuinfo | grep altivec)"; then + test $_altivec = auto && _altivec=yes + fi ;; Darwin) - proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'` - if [ `sysctl -n hw.vectorunit` -eq 1 -o \ - "`sysctl -n hw.optional.altivec 2> /dev/null`" = "1" ]; then - test $_altivec = auto && _altivec=yes - fi + proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//') + if [ $(sysctl -n hw.vectorunit) -eq 1 -o \ + "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then + test $_altivec = auto && _altivec=yes + fi ;; NetBSD) # only gcc 3.4 works reliably with AltiVec code under NetBSD - case $cc_version in - 2*|3.0*|3.1*|3.2*|3.3*) - ;; - *) - if [ `sysctl -n machdep.altivec` -eq 1 ]; then - test $_altivec = auto && _altivec=yes - fi - ;; - esac + case $cc_version in + 2*|3.0*|3.1*|3.2*|3.3*) + ;; + *) + if [ $(sysctl -n machdep.altivec) -eq 1 ]; then + test $_altivec = auto && _altivec=yes + fi + ;; + esac ;; AIX) - proc=`$_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//'` - ;; + proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//') + ;; esac if test "$_altivec" = yes; then echores "$proc altivec" @@ -2131,69 +2259,70 @@ if test -n "$proc"; then case "$proc" in - 601) _march='-mcpu=601' _mcpu='-mtune=601' ;; - 603) _march='-mcpu=603' _mcpu='-mtune=603' ;; - 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;; - 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;; - 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;; - 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;; - POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;; - POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;; - POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;; - *) ;; + 601) _march='-mcpu=601' _mcpu='-mtune=601' ;; + 603) _march='-mcpu=603' _mcpu='-mtune=603' ;; + 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;; + 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;; + 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;; + 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;; + POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;; + POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;; + POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;; + *) ;; esac - # gcc 3.1(.1) and up supports 7400 and 7450 - if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then - case "$proc" in - 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;; - 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;; - *) ;; - esac - fi - # gcc 3.2 and up supports 970 - if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then - case "$proc" in - 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970' + # gcc 3.1(.1) and up supports 7400 and 7450 + if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then + case "$proc" in + 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;; + 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;; + *) ;; + esac + fi + # gcc 3.2 and up supports 970 + if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then + case "$proc" in + 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970' def_dcbzl='#define HAVE_DCBZL 1' ;; - *) ;; - esac - fi - # gcc 3.3 and up supports POWER4 - if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then - case "$proc" in - POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;; - *) ;; - esac - fi - # gcc 3.4 and up supports 440* - if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then - case "$proc" in + *) ;; + esac + fi + # gcc 3.3 and up supports POWER4 + if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then + case "$proc" in + POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;; + *) ;; + esac + fi + # gcc 3.4 and up supports 440* + if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then + case "$proc" in 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;; 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;; - *) ;; - esac - fi - # gcc 4.0 and up supports POWER5 - if test "$_cc_major" -ge "4"; then - case "$proc" in - POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;; - *) ;; - esac - fi + *) ;; + esac + fi + # gcc 4.0 and up supports POWER5 + if test "$_cc_major" -ge "4"; then + case "$proc" in + POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;; + *) ;; + esac + fi fi if test -n "$_mcpu"; then - _optimizing=`echo $_mcpu | cut -c 8-` + _optimizing=$(echo $_mcpu | cut -c 8-) echores "$_optimizing" else echores "none" fi + test $_fast_clz = "auto" && _fast_clz=yes + ;; alpha*) - _arch='ALPHA' - _target_arch='ARCH_ALPHA = yes' + arch='alpha' iproc='alpha' echocheck "CPU type" @@ -2207,7 +2336,7 @@ } EOF $_cc -o "$TMPEXE" "$TMPC" - case `"$TMPEXE"` in + case $("$TMPEXE") in 0-0) proc="ev4"; _mvi="0";; 1-0) proc="ev5"; _mvi="0";; @@ -2229,67 +2358,64 @@ _mcpu="-mcpu=$proc" echores "$proc" + test $_fast_clz = "auto" && _fast_clz=yes + _optimizing="$proc" ;; mips) - _arch='SGI_MIPS' - _target_arch='ARCH_SGI_MIPS = yes' - iproc='sgi-mips' + arch='mips' + iproc='mips' if irix ; then - echocheck "CPU type" - proc=`hinv -c processor | grep CPU | cut -d " " -f3` - case "`echo $proc`" in - R3000) _march='-mips1' _mcpu='-mtune=r2000' ;; - R4000) _march='-mips3' _mcpu='-mtune=r4000' ;; - R4400) _march='-mips3' _mcpu='-mtune=r4400' ;; - R4600) _march='-mips3' _mcpu='-mtune=r4600' ;; - R5000) _march='-mips4' _mcpu='-mtune=r5000' ;; - R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;; - esac - # gcc < 3.x does not support -mtune. - if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then - _mcpu='' - fi + echocheck "CPU type" + proc=$(hinv -c processor | grep CPU | cut -d " " -f3) + case "$(echo $proc)" in + R3000) _march='-mips1' _mcpu='-mtune=r2000' ;; + R4000) _march='-mips3' _mcpu='-mtune=r4000' ;; + R4400) _march='-mips3' _mcpu='-mtune=r4400' ;; + R4600) _march='-mips3' _mcpu='-mtune=r4600' ;; + R5000) _march='-mips4' _mcpu='-mtune=r5000' ;; + R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;; + esac + # gcc < 3.x does not support -mtune. + if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then + _mcpu='' + fi echores "$proc" fi + test $_fast_clz = "auto" && _fast_clz=yes + ;; hppa) - _arch='PA_RISC' - _target_arch='ARCH_PA_RISC = yes' + arch='pa_risc' iproc='PA-RISC' ;; s390) - _arch='S390' - _target_arch='ARCH_S390 = yes' + arch='s390' iproc='390' ;; s390x) - _arch='S390X' - _target_arch='ARCH_S390X = yes' + arch='s390x' iproc='390x' ;; vax) - _arch='VAX' - _target_arch='ARCH_VAX = yes' + arch='vax' iproc='vax' ;; xtensa) - _arch='XTENSA' - _target_arch='ARCH_XTENSA = yes' + arch='xtensa' iproc='xtensa' ;; generic) - _arch='GENERIC' - _target_arch='ARCH_GENERIC = yes' + arch='generic' ;; *) @@ -2339,9 +2465,13 @@ if test "$_big_endian" = yes ; then _byte_order='big-endian' def_words_endian='#define WORDS_BIGENDIAN 1' + def_bigendian='#define HAVE_BIGENDIAN 1' + def_av_bigendian='#define AV_HAVE_BIGENDIAN 1' else _byte_order='little-endian' def_words_endian='#undef WORDS_BIGENDIAN' + def_bigendian='#define HAVE_BIGENDIAN 0' + def_av_bigendian='#define AV_HAVE_BIGENDIAN 0' fi echores "$_byte_order" @@ -2353,15 +2483,14 @@ cc_check -c || die "Symbol mangling check failed." sym=$($_nm -P -g $TMPEXE) extern_prefix=${sym%%ff_extern*} +def_extern_asm="#define EXTERN_ASM $extern_prefix" def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\"" echores $extern_prefix echocheck "assembler support of -pipe option" -cat > $TMPC << EOF -int main(void) { return 0; } -EOF -cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no" +# -I. helps to detect compilers that just misunderstand -pipe like Sun C +cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no" echocheck "compiler support of named assembler arguments" @@ -2402,6 +2531,8 @@ elif test -z "$CFLAGS" ; then if test "$cc_vendor" = "intel" ; then CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144" + elif test "$cc_vendor" = "sun" ; then + CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr" elif test "$cc_vendor" != "gnu" ; then CFLAGS="-O2 $_march $_mcpu $_pipe" else @@ -2409,17 +2540,34 @@ extra_ldflags="$extra_ldflags -ffast-math" fi else - _warn_CFLAGS=yes + warn_cflags=yes +fi + +if test "$cc_vendor" = "gnu" ; then + cflag_check -std=gnu99 && CFLAGS="-std=gnu99 $CFLAGS" + cflag_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS" + cflag_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS" + cflag_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS" + cflag_check -Wundef && CFLAGS="-Wundef $CFLAGS" + cflag_check -Wmissing-prototypes && CFLAGS="-Wmissing-prototypes $CFLAGS" + cflag_check -Wstrict-prototypes && CFLAGS="-Wstrict-prototypes $CFLAGS" +else + CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS" fi + +cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer" +cflag_check -MD -MP && DEPFLAGS="-MD -MP $CFLAGS" + + if test -n "$LDFLAGS" ; then extra_ldflags="$extra_ldflags $LDFLAGS" - _warn_CFLAGS=yes + warn_cflags=yes elif test "$cc_vendor" = "intel" ; then extra_ldflags="$extra_ldflags -i-static" fi if test -n "$CPPFLAGS" ; then extra_cflags="$extra_cflags $CPPFLAGS" - _warn_CFLAGS=yes + warn_cflags=yes fi @@ -2427,7 +2575,7 @@ if x86_32 ; then # Checking assembler (_as) compatibility... # Added workaround for older as that reads from stdin by default - atmos - as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'` + as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p') echocheck "assembler ($_as $as_version)" _pref_as_version='2.9.1' @@ -2441,11 +2589,11 @@ fi if test "$_3dnowext" = yes ; then _pref_as_version='2.10.1' - echo 'pswapd %mm0, %mm0' >> $TMPS + echo 'pswapd %mm0, %mm0' >> $TMPS fi if test "$_mmxext" = yes ; then _pref_as_version='2.10.1' - echo 'movntq %mm0, (%eax)' >> $TMPS + echo 'movntq %mm0, (%eax)' >> $TMPS fi if test "$_sse" = yes ; then _pref_as_version='2.10.1' @@ -2468,7 +2616,7 @@ if test "$as_verc_fail" != yes ; then echores "ok" else - _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc." + res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc." echores "failed" die "obsolete binutils version" fi @@ -2507,38 +2655,69 @@ cc_check && ten_operands=yes && def_ten_operands='#define HAVE_TEN_OPERANDS 1' echores $ten_operands +echocheck "ebx availability" +ebx_available=no +def_ebx_available='#define HAVE_EBX_AVAILABLE 0' +cat > $TMPC << EOF +int main(void) { + int x; + __asm__ volatile( + "xor %0, %0" + :"=b"(x) + // just adding ebx to clobber list seems unreliable with some + // compilers, e.g. Haiku's gcc 2.95 + ); + // and the above check does not work for OSX 64 bit... + __asm__ volatile("":::"%ebx"); + return 0; +} +EOF +cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1' +echores $ebx_available + +echocheck "PIC" +pic=no +cat > $TMPC << EOF +int main(void) { +#if !(defined(__PIC__) || defined(__pic__) || defined(PIC)) +#error PIC not enabled +#endif + return 0; +} +EOF +cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC" +echores $pic + echocheck "yasm" if test -z "$YASMFLAGS" ; then if darwin ; then x86_64 && objformat="macho64" || objformat="macho" elif win32 ; then objformat="win32" - else + else objformat="elf" fi # currently tested for Linux x86, x86_64 YASMFLAGS="-f $objformat" x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64" + test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC" case "$objformat" in elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;; - macho64) YASMFLAGS="$YASMFLAGS -DPIC -DPREFIX" ;; *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;; esac else - _warn_CFLAGS=yes + warn_cflags=yes fi echo "pabsw xmm0, xmm0" > $TMPS yasm_check || _yasm="" if test $_yasm ; then - test "$_mmx" = "yes" && fft_mmx="yes" def_yasm='#define HAVE_YASM 1' - _have_yasm="yes" + have_yasm="yes" echores "$_yasm" else def_yasm='#define HAVE_YASM 0' - fft_mmx="no" - _have_yasm="no" + have_yasm="no" echores "no" fi @@ -2556,24 +2735,14 @@ # check if AltiVec is supported by the compiler, and how to enable it echocheck "GCC AltiVec flags" - cat > $TMPC << EOF -int main(void) { return 0; } -EOF - if $(cc_check -maltivec -mabi=altivec) ; then + if $(cflag_check -maltivec -mabi=altivec) ; then _altivec_gcc_flags="-maltivec -mabi=altivec" # check if should be included - cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF - if $(cc_check $_altivec_gcc_flags) ; then + if $(header_check altivec.h $_altivec_gcc_flags) ; then def_altivec_h='#define HAVE_ALTIVEC_H 1' inc_altivec_h='#include ' else - cat > $TMPC << EOF -int main(void) { return 0; } -EOF - if $(cc_check -faltivec) ; then + if $(cflag_check -faltivec) ; then _altivec_gcc_flags="-faltivec" else _altivec=no @@ -2603,6 +2772,17 @@ test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags" fi +if ppc ; then +def_xform_asm='#define HAVE_XFORM_ASM 0' +xform_asm=no +echocheck "XFORM ASM support" + cat > $TMPC << EOF +int main(void) { __asm__ volatile ("lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)); return 0; } +EOF +cc_check && xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1' +echores "$xform_asm" +fi + if arm ; then echocheck "ARM pld instruction" cat > $TMPC << EOF @@ -2622,6 +2802,8 @@ fi echores "$_armv5te" + test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes + echocheck "ARMv6 (SIMD instructions)" if test $_armv6 = "auto" ; then cat > $TMPC << EOF @@ -2652,6 +2834,16 @@ fi echores "$_armvfp" + echocheck "ARM NEON" + if test $neon = "auto" ; then + cat > $TMPC << EOF +int main(void) { __asm__ volatile ("vadd.i16 q0, q0, q0"); return 0; } +EOF + neon=no + cc_check && neon=yes + fi + echores "$neon" + echocheck "iWMMXt (Intel XScale SIMD instructions)" if test $_iwmmxt = "auto" ; then cat > $TMPC << EOF @@ -2663,30 +2855,32 @@ echores "$_iwmmxt" fi -_cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP IWMMXT MMI VIS MVI' -test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts" -test "$_mmx" = yes && _cpuexts="MMX $_cpuexts" -test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts" -test "$_3dnow" = yes && _cpuexts="AMD3DNOW $_cpuexts" -test "$_3dnowext" = yes && _cpuexts="AMD3DNOWEXT $_cpuexts" -test "$_sse" = yes && _cpuexts="SSE $_cpuexts" -test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts" -test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts" -test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts" -test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts" -test "$pld" = yes && _cpuexts="PLD $_cpuexts" -test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts" -test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts" -test "$_armv6t2" = yes && _cpuexts="ARMV6T2 $_cpuexts" -test "$_armvfp" = yes && _cpuexts="ARMVFP $_cpuexts" -test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts" -test "$_vis" = yes && _cpuexts="VIS $_cpuexts" -test "$_mvi" = yes && _cpuexts="MVI $_cpuexts" +cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI' +test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts" +test "$_mmx" = yes && cpuexts="MMX $cpuexts" +test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts" +test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts" +test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts" +test "$_sse" = yes && cpuexts="SSE $cpuexts" +test "$_sse2" = yes && cpuexts="SSE2 $cpuexts" +test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts" +test "$_cmov" = yes && cpuexts="CMOV $cpuexts" +test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts" +test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts" +test "$pld" = yes && cpuexts="PLD $cpuexts" +test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts" +test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts" +test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts" +test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts" +test "$neon" = yes && cpuexts="NEON $cpuexts" +test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts" +test "$_vis" = yes && cpuexts="VIS $cpuexts" +test "$_mvi" = yes && cpuexts="MVI $cpuexts" # Checking kernel version... if x86_32 && linux ; then _k_verc_problem=no - kernel_version=`uname -r 2>&1` + kernel_version=$(uname -r 2>&1) echocheck "$system_name kernel version" case "$kernel_version" in '') kernel_version="?.??"; _k_verc_fail=yes;; @@ -2715,10 +2909,7 @@ echocheck "-lposix" -cat > $TMPC < $TMPC < $TMPC << EOF #include @@ -2888,10 +3077,10 @@ eval _$func=no cc_check -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes if eval test "x\$_$func" = "xyes"; then - eval def_$func="\"#define HAVE_`echo $func | tr '[a-z]' '[A-Z]'` 1\"" + eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\"" echores yes else - eval def_$func="\"#define HAVE_`echo $func | tr '[a-z]' '[A-Z]'` 0\"" + eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\"" echores no fi done @@ -2940,7 +3129,8 @@ for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break done -if test $_winsock2_h = auto && ! cygwin ; then +test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no +if test $_winsock2_h = auto ; then _winsock2_h=no cat > $TMPC << EOF #include @@ -2948,73 +3138,188 @@ EOF cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes fi -test "$_ld_sock" && _res_comment="using $_ld_sock" +test "$_ld_sock" && res_comment="using $_ld_sock" echores "$_socklib" if test $_winsock2_h = yes ; then _ld_sock="-lws2_32" def_winsock2_h='#define HAVE_WINSOCK2_H 1' + cc_check_winsock2_h='-DHAVE_WINSOCK2_H=1' else def_winsock2_h='#define HAVE_WINSOCK2_H 0' + cc_check_winsock2_h='-DHAVE_WINSOCK2_H=0' fi -echocheck "arpa/inet.h" -arpa_inet_h=no -def_arpa_inet_h='#define HAVE_ARPA_INET_H 0' -cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF -cc_check && arpa_inet_h=yes && def_arpa_inet_h='#define HAVE_ARPA_INET_H 1' -echores "$arpa_inet_h" - - -echocheck "inet_pton()" -def_inet_pton='#define HAVE_INET_PTON 0' -inet_pton=no -cat > $TMPC << EOF +echocheck "netdb.h, struct addrinfo" +if test "$_struct_addrinfo" = auto; then + _struct_addrinfo=no + cat > $TMPC << EOF +#if HAVE_WINSOCK2_H +#include +#include +#else #include #include -#include -int main(void) { (void) inet_pton(0, 0, 0); return 0; } +#include +#endif +int main(void) { struct addrinfo ai; return 0; } EOF -for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do - cc_check $_ld_tmp && inet_pton=yes && break -done -if test $inet_pton = yes ; then - test $_ld_tmp && _res_comment="using $_ld_tmp" - def_inet_pton='#define HAVE_INET_PTON 1' + cc_check $cc_check_winsock2_h && _struct_addrinfo=yes fi -echores "$inet_pton" +echores "$_struct_addrinfo" +if test "$_struct_addrinfo" = yes; then + def_addrinfo="#define HAVE_STRUCT_ADDRINFO 1" +else + def_addrinfo="#define HAVE_STRUCT_ADDRINFO 0" +fi -echocheck "inet_aton()" -def_inet_aton='#define HAVE_INET_ATON 0' -inet_aton=no -cat > $TMPC << EOF + +echocheck "netdb.h, getaddrinfo()" +if test "$_getaddrinfo" = auto; then + _getaddrinfo=no + cat > $TMPC << EOF +#if HAVE_WINSOCK2_H +#include +#else #include #include -#include -int main(void) { (void) inet_aton(0, 0); return 0; } +#include +#endif +int main(void) { (void) getaddrinfo(0, 0, 0, 0); return 0; } EOF -for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do - cc_check $_ld_tmp && inet_aton=yes && break -done -if test $inet_aton = yes ; then - test $_ld_tmp && _res_comment="using $_ld_tmp" - def_inet_aton='#define HAVE_INET_ATON 1' + cc_check $cc_check_winsock2_h && _getaddrinfo=yes fi -echores "$inet_aton" +echores "$_getaddrinfo" +if test "$_getaddrinfo" = yes; then + def_getaddrinfo="#define HAVE_GETADDRINFO 1" +else + def_getaddrinfo="#define HAVE_GETADDRINFO 0" +fi -echocheck "socklen_t" -_socklen_t=no -for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do + +echocheck "sockaddr_storage" +if test "$_struct_sockaddr_storage" = auto; then + _struct_sockaddr_storage=no cat > $TMPC << EOF -#include <$header> -int main(void) { socklen_t v = 0; return v; } +#if HAVE_WINSOCK2_H +#include +#else +#include +#endif +int main(void) { struct sockaddr_storage sas; return 0; } +EOF + cc_check $cc_check_winsock2_h && _struct_sockaddr_storage=yes +fi +echores "$_struct_sockaddr_storage" + +if test "$_struct_sockaddr_storage" = yes; then + def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 1" +else + def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 0" +fi + + +echocheck "struct ipv6_mreq" +_struct_ipv6_mreq=no +def_struct_ipv6_mreq="#define HAVE_STRUCT_IPV6_MREQ 0" +for header in "netinet/in.h" "ws2tcpip.h" ; do + cat > $TMPC << EOF +#include <$header> +int main(void) { struct ipv6_mreq mreq6; return 0; } +EOF + cc_check && _struct_ipv6_mreq=yes && \ + def_struct_ipv6_mreq="#define HAVE_STRUCT_IPV6_MREQ 1" && break +done +echores "$_struct_ipv6_mreq" + + +echocheck "struct sockaddr_in6" +_struct_sockaddr_in6=no +def_struct_sockaddr_in6="#define HAVE_STRUCT_SOCKADDR_IN6 0" +for header in "netinet/in.h" "ws2tcpip.h" ; do + cat > $TMPC << EOF +#include <$header> +int main(void) { struct sockaddr_in6 addr; return 0; } +EOF + cc_check && _struct_sockaddr_in6=yes && \ + def_struct_sockaddr_in6="#define HAVE_STRUCT_SOCKADDR_IN6 1" && break +done +echores "$_struct_sockaddr_in6" + + +echocheck "struct sockaddr sa_len" +_struct_sockaddr_sa_len=no +def_struct_sockaddr_sa_len="#define HAVE_STRUCT_SOCKADDR_SA_LEN 0" +cat > $TMPC << EOF +#if HAVE_WINSOCK2_H +#include +#else +#include +#include +#endif +int main(void) { const void *p = &((struct sockaddr *)0)->sa_len; return 0; } +EOF +cc_check $cc_check_winsock2_h && _struct_sockaddr_sa_len=yes && \ + def_struct_sockaddr_sa_len="#define HAVE_STRUCT_SOCKADDR_SA_LEN 1" +echores "$_struct_sockaddr_sa_len" + + +echocheck "arpa/inet.h" +arpa_inet_h=no +def_arpa_inet_h='#define HAVE_ARPA_INET_H 0' +header_check arpa/inet.h && arpa_inet_h=yes && + def_arpa_inet_h='#define HAVE_ARPA_INET_H 1' +echores "$arpa_inet_h" + + +echocheck "inet_pton()" +def_inet_pton='#define HAVE_INET_PTON 0' +inet_pton=no +cat > $TMPC << EOF +#include +#include +#include +int main(void) { (void) inet_pton(0, 0, 0); return 0; } +EOF +for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do + cc_check $_ld_tmp && inet_pton=yes && break +done +if test $inet_pton = yes ; then + test "$_ld_tmp" && res_comment="using $_ld_tmp" + def_inet_pton='#define HAVE_INET_PTON 1' +fi +echores "$inet_pton" + + +echocheck "inet_aton()" +def_inet_aton='#define HAVE_INET_ATON 0' +inet_aton=no +cat > $TMPC << EOF +#include +#include +#include +int main(void) { (void) inet_aton(0, 0); return 0; } +EOF +for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do + cc_check $_ld_tmp && inet_aton=yes && break +done +if test $inet_aton = yes ; then + test "$_ld_tmp" && res_comment="using $_ld_tmp" + def_inet_aton='#define HAVE_INET_ATON 1' +fi +echores "$inet_aton" + + +echocheck "socklen_t" +_socklen_t=no +for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do + cat > $TMPC << EOF +#include <$header> +int main(void) { socklen_t v = 0; return v; } EOF cc_check && _socklen_t=yes && break done @@ -3047,11 +3352,13 @@ if test "$_network" = yes ; then def_network='#define CONFIG_NETWORK 1' extra_ldflags="$extra_ldflags $_ld_sock" - _inputmodules="network $_inputmodules" + inputmodules="network $inputmodules" else - _noinputmodules="network $_noinputmodules" + noinputmodules="network $noinputmodules" def_network='#undef CONFIG_NETWORK' _ftp=no + libavprotocols=$(echo $libavprotocols | sed -e s/GOPHER_PROTOCOL// -e s/HTTP_PROTOCOL// -e s/RTMP_PROTOCOL// -e s/RTP_PROTOCOL// -e s/TCP_PROTOCOL// -e s/UDP_PROTOCOL//) + libavdemuxers=$(echo $libavdemuxers | sed -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER//) fi echores "$_network" @@ -3103,21 +3410,13 @@ echocheck "inttypes.h (required)" -cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF _inttypes=no -cc_check && _inttypes=yes +header_check inttypes.h && _inttypes=yes echores "$_inttypes" if test "$_inttypes" = no ; then - echocheck "bitypes.h (inttypes.h predecessor)" - cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF - cc_check && _inttypes=yes + echocheck "sys/bitypes.h (inttypes.h predecessor)" + header_check sys/bitypes.h && _inttypes=yes if test "$_inttypes" = yes ; then die "You don't have inttypes.h, but sys/bitypes.h is present. Please copy etc/inttypes.h into the include path, and re-run configure." else @@ -3150,19 +3449,13 @@ echocheck "malloc.h" -cat > $TMPC << EOF -#include -int main(void) { (void) malloc(0); return 0; } -EOF _malloc=no -cc_check && _malloc=yes +header_check malloc.h && _malloc=yes if test "$_malloc" = yes ; then def_malloc_h='#define HAVE_MALLOC_H 1' else def_malloc_h='#define HAVE_MALLOC_H 0' fi -# malloc.h emits a warning in FreeBSD and OpenBSD -freebsd || openbsd || dragonfly && def_malloc_h='#define HAVE_MALLOC_H 0' echores "$_malloc" @@ -3221,6 +3514,16 @@ echores "$_fastmemcpy" +echocheck "hard-coded tables" +if test "$hardcoded_tables" = yes ; then + def_hardcoded_tables='#define CONFIG_HARDCODED_TABLES 1' + mak_hardcoded_tables='CONFIG_HARDCODED_TABLES = yes' +else + def_hardcoded_tables='#define CONFIG_HARDCODED_TABLES 0' +fi +echores "$hardcoded_tables" + + echocheck "mman.h" cat > $TMPC << EOF #include @@ -3254,7 +3557,7 @@ cat > $TMPC << EOF #include #include -int main(void) { dlopen(NULL, 0); dlclose(NULL); dlsym(NULL, NULL); return 0; } +int main(void) { dlopen("", 0); dlclose(NULL); dlsym(NULL, ""); return 0; } EOF _dl=no for _ld_tmp in "" "-ldl" ; do @@ -3283,6 +3586,11 @@ def_threads='#define HAVE_THREADS 0' echocheck "pthread" +if linux ; then + THREAD_CFLAGS=-D_REENTRANT +elif freebsd || netbsd || openbsd || bsdos ; then + THREAD_CFLAGS=-D_THREAD_SAFE +fi if test "$_pthreads" = auto ; then cat > $TMPC << EOF #include @@ -3293,16 +3601,17 @@ if ! hpux ; then for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do # for crosscompilation, we cannot execute the program, be happy if we can link statically - cc_check $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break + cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break done fi fi if test "$_pthreads" = yes ; then - test $_ld_pthread && _res_comment="using $_ld_pthread" + test $_ld_pthread && res_comment="using $_ld_pthread" def_pthreads='#define HAVE_PTHREADS 1' def_threads='#define HAVE_THREADS 1' + extra_cflags="$extra_cflags $THREAD_CFLAGS" else - _res_comment="v4l, v4l2, ao_nas, win32 loader disabled" + res_comment="v4l, v4l2, ao_nas, win32 loader disabled" def_pthreads='#undef HAVE_PTHREADS' _nas=no ; _tv_v4l1=no ; _tv_v4l2=no mingw32 || _win32dll=no @@ -3320,7 +3629,7 @@ echocheck "w32threads" if test "$_pthreads" = yes ; then - _res_comment="using pthread instead" + res_comment="using pthread instead" _w32threads=no fi if test "$_w32threads" = auto ; then @@ -3333,8 +3642,8 @@ echocheck "rpath" netbsd &&_rpath=yes if test "$_rpath" = yes ; then - for I in `echo $extra_ldflags | sed 's/-L//g'` ; do - tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`" + for I in $(echo $extra_ldflags | sed 's/-L//g') ; do + tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')" done extra_ldflags=$tmp fi @@ -3393,11 +3702,8 @@ def_soundcard_h='#undef HAVE_SOUNDCARD_H' def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H' for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do - cat > $TMPC << EOF -#include <$_soundcard_header> -int main(void) { return 0; } -EOF - cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break + header_check $_soundcard_header && _soundcard_h=yes && + res_comment="$_soundcard_header" && break done if test "$_soundcard_h" = yes ; then @@ -3411,13 +3717,8 @@ echocheck "sys/dvdio.h" -cat > $TMPC << EOF -#include -#include -int main(void) { return 0; } -EOF _dvdio=no -cc_check && _dvdio=yes +header_check sys/dvdio.h && _dvdio=yes if test "$_dvdio" = yes ; then def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1' else @@ -3427,13 +3728,8 @@ echocheck "sys/cdio.h" -cat > $TMPC << EOF -#include -#include -int main(void) { return 0; } -EOF _cdio=no -cc_check && _cdio=yes +header_check sys/cdio.h && _cdio=yes if test "$_cdio" = yes ; then def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1' else @@ -3443,13 +3739,8 @@ echocheck "linux/cdrom.h" -cat > $TMPC << EOF -#include -#include -int main(void) { return 0; } -EOF _cdrom=no -cc_check && _cdrom=yes +header_check linux/cdrom.h && _cdrom=yes if test "$_cdrom" = yes ; then def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1' else @@ -3459,12 +3750,8 @@ echocheck "dvd.h" -cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF _dvd=no -cc_check && _dvd=yes +header_check dvd.h && _dvd=yes if test "$_dvd" = yes ; then def_dvd='#define DVD_STRUCT_IN_DVD_H 1' else @@ -3475,12 +3762,8 @@ if bsdos; then echocheck "BSDI dvd.h" -cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF _bsdi_dvd=no -cc_check && _bsdi_dvd=yes +header_check dvd.h && _bsdi_dvd=yes if test "$_bsdi_dvd" = yes ; then def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1' else @@ -3493,12 +3776,8 @@ if hpux; then # also used by AIX, but AIX does not support VCD and/or libdvdread echocheck "HP-UX SCSI header" -cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF _hpux_scsi_h=no -cc_check && _hpux_scsi_h=yes +header_check sys/scsi.h && _hpux_scsi_h=yes if test "$_hpux_scsi_h" = yes ; then def_hpux_scsi_h='#define HPUX_SCTL_IO 1' else @@ -3510,15 +3789,9 @@ if sunos; then echocheck "userspace SCSI headers (Solaris)" -cat > $TMPC << EOF -#include -#include -#include -#include -int main(void) { return 0; } -EOF _sol_scsi_h=no -cc_check && _sol_scsi_h=yes +header_check sys/scsi/scsi_types.h && header_check sys/scsi/impl/uscsi.h && + _sol_scsi_h=yes if test "$_sol_scsi_h" = yes ; then def_sol_scsi_h='#define SOLARIS_USCSI 1' else @@ -3543,7 +3816,7 @@ fi if test "$_termcap" = yes ; then def_termcap='#define HAVE_TERMCAP 1' - test $_ld_tmp && _res_comment="using $_ld_tmp" + test $_ld_tmp && res_comment="using $_ld_tmp" else def_termcap='#undef HAVE_TERMCAP' fi @@ -3556,12 +3829,9 @@ def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H' if test "$_termios" = auto ; then _termios=no - for _termios_header in "sys/termios.h" "termios.h"; do - cat > $TMPC < -int main(void) { return 0; } -EOF - cc_check && _termios=yes && _res_comment="using $_termios_header" && break + for _termios_header in "termios.h" "sys/termios.h"; do + header_check $_termios_header && _termios=yes && + res_comment="using $_termios_header" && break done fi @@ -3616,7 +3886,7 @@ #define _ISOC99_SOURCE #include #include -int main(void) { vsscanf(0, 0, 0); return 0; } +int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; } EOF _vsscanf=no cc_check && _vsscanf=yes @@ -3676,9 +3946,8 @@ echocheck "gettimeofday()" cat > $TMPC << EOF -#include #include -int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; } +int main(void) {struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz); return 0; } EOF _gettimeofday=no cc_check && _gettimeofday=yes @@ -3727,6 +3996,17 @@ echores "$_setenv" +echocheck "setmode()" +_setmode=no +def_setmode='#define HAVE_SETMODE 0' +cat > $TMPC << EOF +#include +int main(void) { setmode(0, 0); return 0; } +EOF +cc_check && _setmode=yes && def_setmode='#define HAVE_SETMODE 1' +echores "$_setmode" + + if sunos; then echocheck "sysi86()" cat > $TMPC << EOF @@ -3770,95 +4050,20 @@ if darwin; then -echocheck "Mac OS X APIs" -if test "$_macosx" = auto ; then - productName=`/usr/bin/sw_vers -productName` - if test "$productName" = "Mac OS X" || - test "$productName" = "Mac OS X Server" ; then - _macosx=yes - else - _macosx=no - _noaomodules="macosx $_noaomodules" - _novomodules="macosx quartz $_novomodules" - fi -fi -if test "$_macosx" = yes ; then - cat > $TMPC < -int main(void) { return 0; } -EOF - if cc_check -framework CoreAudio; then - extra_ldflags="$extra_ldflags -framework CoreAudio -framework AudioUnit -framework AudioToolbox" - _coreaudio=yes - def_coreaudio='#define CONFIG_COREAUDIO 1' - _aomodules="macosx $_aomodules" - else - _coreaudio=no - def_coreaudio='#undef CONFIG_COREAUDIO' - _noaomodules="macosx $_noaomodules" - fi - cat > $TMPC < -#include -int main(void) { - EnterMovies(); - ExitMovies(); - CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false); - return 0; -} -EOF - if cc_check -framework Carbon -framework QuickTime; then - extra_ldflags="$extra_ldflags -framework Carbon -framework QuickTime" - _quartz=yes - def_quartz='#define CONFIG_QUARTZ 1' - _vomodules="quartz $_vomodules" - def_quicktime='#define CONFIG_QUICKTIME 1' - else - _quartz=no - def_quartz='#undef CONFIG_QUARTZ' - _novomodules="quartz $_novomodules" - def_quicktime='#undef CONFIG_QUICKTIME' - fi -cat > $TMPC < -#include -int main(void) { return 0; } -EOF - if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then - _vomodules="macosx $_vomodules" - extra_ldflags="$extra_ldflags -framework Cocoa -framework QuartzCore -framework OpenGL" - def_corevideo='#define CONFIG_COREVIDEO 1' - _corevideo=yes - else - _novomodules="macosx $_novomodules" - def_corevideo='#undef CONFIG_COREVIDEO' - _corevideo=no - fi -fi -echores "$_macosx" - echocheck "Mac OS X Finder Support" -if test "$_macosx_finder" = auto ; then - _macosx_finder=$_macosx -fi -if test "$_macosx_finder" = yes; then +def_macosx_finder='#undef CONFIG_MACOSX_FINDER' +if test "$_macosx_finder" = yes ; then def_macosx_finder='#define CONFIG_MACOSX_FINDER 1' - _macosx_finder=yes -else - def_macosx_finder='#undef CONFIG_MACOSX_FINDER' - _macosx_finder=no + extra_ldflags="$extra_ldflags -framework Carbon" fi echores "$_macosx_finder" echocheck "Mac OS X Bundle file locations" -if test "$_macosx_bundle" = auto ; then - _macosx_bundle=$_macosx_finder -fi -if test "$_macosx_bundle" = yes; then +def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE' +test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder +if test "$_macosx_bundle" = yes ; then def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1' -else - def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE' - _macosx_bundle=no + extra_ldflags="$extra_ldflags -framework Carbon" fi echores "$_macosx_bundle" @@ -3893,7 +4098,7 @@ fi if test "$_apple_remote" = yes ; then def_apple_remote='#define CONFIG_APPLE_REMOTE 1' - extra_ldflags="$extra_ldflags -framework IOKit" + libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa" else def_apple_remote='#undef CONFIG_APPLE_REMOTE' fi @@ -3915,7 +4120,7 @@ return 0; } EOF - cc_check && tmp_run && _apple_ir=yes + cc_check && _apple_ir=yes fi if test "$_apple_ir" = yes ; then def_apple_ir='#define CONFIG_APPLE_IR 1' @@ -3927,7 +4132,7 @@ echocheck "pkg-config" _pkg_config=pkg-config -if `$_pkg_config --version > /dev/null 2>&1`; then +if $($_pkg_config --version > /dev/null 2>&1); then if test "$_ld_static"; then _pkg_config="$_pkg_config --static" fi @@ -3955,11 +4160,11 @@ fi if test "$_smb" = yes; then - def_smb="#define CONFIG_LIBSMBCLIENT" - _inputmodules="smb $_inputmodules" + def_smb="#define CONFIG_LIBSMBCLIENT 1" + inputmodules="smb $inputmodules" else def_smb="#undef CONFIG_LIBSMBCLIENT" - _noinputmodules="smb $_noinputmodules" + noinputmodules="smb $noinputmodules" fi echores "$_smb" @@ -3972,40 +4177,40 @@ echocheck "tdfxfb" if test "$_tdfxfb" = yes ; then def_tdfxfb='#define CONFIG_TDFXFB 1' - _vomodules="tdfxfb $_vomodules" + vomodules="tdfxfb $vomodules" else def_tdfxfb='#undef CONFIG_TDFXFB' - _novomodules="tdfxfb $_novomodules" + novomodules="tdfxfb $novomodules" fi echores "$_tdfxfb" echocheck "s3fb" if test "$_s3fb" = yes ; then def_s3fb='#define CONFIG_S3FB 1' - _vomodules="s3fb $_vomodules" + vomodules="s3fb $vomodules" else def_s3fb='#undef CONFIG_S3FB' - _novomodules="s3fb $_novomodules" + novomodules="s3fb $novomodules" fi echores "$_s3fb" echocheck "wii" if test "$_wii" = yes ; then def_wii='#define CONFIG_WII 1' - _vomodules="wii $_vomodules" + vomodules="wii $vomodules" else def_wii='#undef CONFIG_WII' - _novomodules="wii $_novomodules" + novomodules="wii $novomodules" fi echores "$_wii" echocheck "tdfxvid" if test "$_tdfxvid" = yes ; then def_tdfxvid='#define CONFIG_TDFX_VID 1' - _vomodules="tdfx_vid $_vomodules" + vomodules="tdfx_vid $vomodules" else def_tdfxvid='#undef CONFIG_TDFX_VID' - _novomodules="tdfx_vid $_novomodules" + novomodules="tdfx_vid $novomodules" fi echores "$_tdfxvid" @@ -4028,42 +4233,42 @@ fi if test "$_xvr100" = yes ; then def_xvr100='#define CONFIG_XVR100 1' - _vomodules="xvr100 $_vomodules" + vomodules="xvr100 $vomodules" else def_tdfxvid='#undef CONFIG_XVR100' - _novomodules="xvr100 $_novomodules" + novomodules="xvr100 $novomodules" fi echores "$_xvr100" echocheck "tga" if test "$_tga" = yes ; then def_tga='#define CONFIG_TGA 1' - _vomodules="tga $_vomodules" + vomodules="tga $vomodules" else def_tga='#undef CONFIG_TGA' - _novomodules="tga $_novomodules" + novomodules="tga $novomodules" fi echores "$_tga" echocheck "md5sum support" if test "$_md5sum" = yes; then - def_md5sum="#define CONFIG_MD5SUM" - _vomodules="md5sum $_vomodules" + def_md5sum="#define CONFIG_MD5SUM 1" + vomodules="md5sum $vomodules" else def_md5sum="#undef CONFIG_MD5SUM" - _novomodules="md5sum $_novomodules" + novomodules="md5sum $novomodules" fi echores "$_md5sum" echocheck "yuv4mpeg support" if test "$_yuv4mpeg" = yes; then - def_yuv4mpeg="#define CONFIG_YUV4MPEG" - _vomodules="yuv4mpeg $_vomodules" + def_yuv4mpeg="#define CONFIG_YUV4MPEG 1" + vomodules="yuv4mpeg $vomodules" else def_yuv4mpeg="#undef CONFIG_YUV4MPEG" - _novomodules="yuv4mpeg $_novomodules" + novomodules="yuv4mpeg $novomodules" fi echores "$_yuv4mpeg" @@ -4071,10 +4276,10 @@ echocheck "bl" if test "$_bl" = yes ; then def_bl='#define CONFIG_BL 1' - _vomodules="bl $_vomodules" + vomodules="bl $vomodules" else def_bl='#undef CONFIG_BL' - _novomodules="bl $_novomodules" + novomodules="bl $novomodules" fi echores "$_bl" @@ -4084,7 +4289,7 @@ _directfb=no cat > $TMPC < -int main(void) { IDirectFB *foo; DirectFBInit(0,0); return 0; } +int main(void) { DirectFBInit(0, 0); return 0; } EOF for _inc_tmp in "" -I/usr/local/include/directfb \ -I/usr/include/directfb -I/usr/local/include; do @@ -4105,61 +4310,61 @@ ; EOF if $_cc -E $TMPC $extra_cflags > "$TMPEXE"; then - _directfb_version=`sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()'` - _dfb_major=`echo $_directfb_version | cut -d . -f 1` - _dfb_minor=`echo $_directfb_version | cut -d . -f 2` - _dfb_micro=`echo $_directfb_version | cut -d . -f 3` - _dfb_version=`dfb_version $_dfb_major $_dfb_minor $_dfb_micro` - if test "$_dfb_version" -ge `dfb_version 0 9 13`; then + _directfb_version=$(sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()') + _dfb_major=$(echo $_directfb_version | cut -d . -f 1) + _dfb_minor=$(echo $_directfb_version | cut -d . -f 2) + _dfb_micro=$(echo $_directfb_version | cut -d . -f 3) + _dfb_version=$(dfb_version $_dfb_major $_dfb_minor $_dfb_micro) + if test "$_dfb_version" -ge $(dfb_version 0 9 13); then def_directfb_version="#define DIRECTFBVERSION $_dfb_version" - _res_comment="$_directfb_version" - test "$_dfb_version" -ge `dfb_version 0 9 15` && _dfbmga=yes + res_comment="$_directfb_version" + test "$_dfb_version" -ge $(dfb_version 0 9 15) && _dfbmga=yes else def_directfb_version='#undef DIRECTFBVERSION' _directfb=no - _res_comment="version >=0.9.13 required" + res_comment="version >=0.9.13 required" fi else _directfb=no - _res_comment="failed to get version" + res_comment="failed to get version" fi fi echores "$_directfb" if test "$_directfb" = yes ; then def_directfb='#define CONFIG_DIRECTFB 1' - _vomodules="directfb $_vomodules" + vomodules="directfb $vomodules" libs_mplayer="$libs_mplayer -ldirectfb" else def_directfb='#undef CONFIG_DIRECTFB' - _novomodules="directfb $_novomodules" + novomodules="directfb $novomodules" fi if test "$_dfbmga" = yes; then - _vomodules="dfbmga $_vomodules" + vomodules="dfbmga $vomodules" def_dfbmga='#define CONFIG_DFBMGA 1' else - _novomodules="dfbmga $_novomodules" + novomodules="dfbmga $novomodules" def_dfbmga='#undef CONFIG_DFBMGA' fi echocheck "X11 headers presence" _x11_headers="no" - _res_comment="check if the dev(el) packages are installed" - for I in `echo $extra_cflags | sed s/-I//g` /usr/include ; do + res_comment="check if the dev(el) packages are installed" + for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do if test -f "$I/X11/Xlib.h" ; then _x11_headers="yes" - _res_comment="" + res_comment="" break fi done if test $_cross_compile = no; then - for I in /usr/X11/include /usr/X11R7/include /usr/X11R6/include \ + for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \ /usr/include/X11R6 /usr/openwin/include ; do if test -f "$I/X11/Xlib.h" ; then extra_cflags="$extra_cflags -I$I" _x11_headers="yes" - _res_comment="using $I" + res_comment="using $I" break fi done @@ -4174,11 +4379,11 @@ #include int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; } EOF - for I in "" -L/usr/X11R7/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \ - -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 \ + for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \ + -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \ -L/usr/lib ; do if netbsd; then - _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R`echo $I | sed s/^-L//`" + _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)" else _ld_tmp="$I -lXext -lX11 $_ld_pthread" fi @@ -4188,12 +4393,12 @@ fi if test "$_x11" = yes ; then def_x11='#define CONFIG_X11 1' - _vomodules="x11 xover $_vomodules" + vomodules="x11 xover $vomodules" else _x11=no def_x11='#undef CONFIG_X11' - _novomodules="x11 $_novomodules" - _res_comment="check if the dev(el) packages are installed" + novomodules="x11 $novomodules" + res_comment="check if the dev(el) packages are installed" # disable stuff that depends on X _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _vdpau=no fi @@ -4239,12 +4444,12 @@ fi if test "$_xdpms4" = yes ; then def_xdpms='#define CONFIG_XDPMS 1' - _res_comment="using Xdpms 4" + res_comment="using Xdpms 4" echores "yes" elif test "$_xdpms3" = yes ; then def_xdpms='#define CONFIG_XDPMS 1' libs_mplayer="$libs_mplayer -lXdpms" - _res_comment="using Xdpms 3" + res_comment="using Xdpms 3" echores "yes" else def_xdpms='#undef CONFIG_XDPMS' @@ -4269,10 +4474,10 @@ if test "$_xv" = yes ; then def_xv='#define CONFIG_XV 1' libs_mplayer="$libs_mplayer -lXv" - _vomodules="xv $_vomodules" + vomodules="xv $vomodules" else def_xv='#undef CONFIG_XV' - _novomodules="xv $_novomodules" + novomodules="xv $novomodules" fi echores "$_xv" @@ -4296,12 +4501,12 @@ if test "$_xvmc" = yes ; then def_xvmc='#define CONFIG_XVMC 1' libs_mplayer="$libs_mplayer -lXvMC -l$_xvmclib" - _vomodules="xvmc $_vomodules" - _res_comment="using $_xvmclib" + vomodules="xvmc $vomodules" + res_comment="using $_xvmclib" else def_xvmc='#define CONFIG_XVMC 0' - _novomodules="xvmc $_novomodules" - _libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// ` + novomodules="xvmc $novomodules" + libavdecoders=$(echo $libavdecoders | sed -e s/MPEG_XVMC_DECODER//) fi echores "$_xvmc" @@ -4312,18 +4517,21 @@ if test "$_dl" = yes ; then cat > $TMPC < -int main(void) {return VDP_VIDEO_MIXER_ATTRIBUTE_SKIP_CHROMA_DEINTERLACE;} +int main(void) { + (void) vdp_device_create_x11(0, 0, 0, 0); + return VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1; } EOF - cc_check && _vdpau=yes + cc_check -lvdpau && _vdpau=yes fi fi if test "$_vdpau" = yes ; then def_vdpau='#define CONFIG_VDPAU 1' - _vomodules="vdpau $_vomodules" + libs_mplayer="$libs_mplayer -lvdpau" + vomodules="vdpau $vomodules" else def_vdpau='#define CONFIG_VDPAU 0' - _novomodules="vdpau $_novomodules" - _libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_VDPAU_DECODER// -e s/MPEG1_VDPAU_DECODER// -e s/H264_VDPAU_DECODER// -e s/WMV3_VDPAU_DECODER// -e s/VC1_VDPAU_DECODER//` + novomodules="vdpau $novomodules" + libavdecoders=$(echo $libavdecoders | sed -e s/MPEG_VDPAU_DECODER// -e s/MPEG1_VDPAU_DECODER// -e s/H264_VDPAU_DECODER// -e s/WMV3_VDPAU_DECODER// -e s/VC1_VDPAU_DECODER// -e s/MPEG4_VDPAU_DECODER//) fi echores "$_vdpau" @@ -4419,18 +4627,18 @@ if test "$_dga1" = yes ; then _dga=yes def_dga1='#define CONFIG_DGA1 1' - _res_comment="using DGA 1.0" + res_comment="using DGA 1.0" elif test "$_dga2" = yes ; then _dga=yes def_dga2='#define CONFIG_DGA2 1' - _res_comment="using DGA 2.0" + res_comment="using DGA 2.0" fi if test "$_dga" = yes ; then def_dga='#define CONFIG_DGA 1' libs_mplayer="$libs_mplayer -lXxf86dga" - _vomodules="dga $_vomodules" + vomodules="dga $vomodules" else - _novomodules="dga $_novomodules" + novomodules="dga $novomodules" fi echores "$_dga" @@ -4438,75 +4646,20 @@ echocheck "3dfx" if test "$_3dfx" = yes && test "$_dga" = yes ; then def_3dfx='#define CONFIG_3DFX 1' - _vomodules="3dfx $_vomodules" + vomodules="3dfx $vomodules" else def_3dfx='#undef CONFIG_3DFX' - _novomodules="3dfx $_novomodules" + novomodules="3dfx $novomodules" fi echores "$_3dfx" -echocheck "OpenGL" -#Note: this test is run even with --enable-gl since we autodetect linker flags -if (test "$_x11" = yes || win32) && test "$_gl" != no ; then - cat > $TMPC << EOF -#ifdef GL_WIN32 -#include -#include -#else -#include -#include -#include -#endif -int main(void) { -#ifdef GL_WIN32 - HDC dc; - wglCreateContext(dc); -#else - glXCreateContext(NULL, NULL, NULL, True); -#endif - glFinish(); - return 0; -} -EOF - _gl=no - if cc_check -lGL $_ld_lm ; then - _gl=yes - libs_mplayer="$libs_mplayer -lGL $_ld_dl" - elif cc_check -lGL $_ld_lm $_ld_pthread ; then - _gl=yes - libs_mplayer="$libs_mplayer -lGL $_ld_pthread $_ld_dl" - elif cc_check -DGL_WIN32 -lopengl32 ; then - _gl=yes - _gl_win32=yes - libs_mplayer="$libs_mplayer -lopengl32 -lgdi32" - fi -else - _gl=no -fi -if test "$_gl" = yes ; then - def_gl='#define CONFIG_GL 1' - if test "$_gl_win32" = yes ; then - def_gl_win32='#define GL_WIN32 1' - _res_comment="win32 version" - fi - _vomodules="opengl $_vomodules" -else - def_gl='#undef CONFIG_GL' - def_gl_win32='#undef GL_WIN32' - _novomodules="opengl $_novomodules" -fi -echores "$_gl" - - echocheck "VIDIX" def_vidix='#undef CONFIG_VIDIX' def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE' _vidix_drv_cyberblade=no def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV' _vidix_drv_ivtv=no -def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV' -_vidix_drv_ivtv=no def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64' _vidix_drv_mach64=no def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA' @@ -4535,22 +4688,24 @@ _vidix=no x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \ && _vidix=yes + x86_64 && ! linux && _vidix=no (ppc || alpha) && linux && _vidix=yes fi echores "$_vidix" if test "$_vidix" = yes ; then def_vidix='#define CONFIG_VIDIX 1' - _vomodules="cvidix $_vomodules" - test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome" - test $_ivtv = "yes" || _vidix_drivers=`echo $_vidix_drivers | sed s/ivtv//` + vomodules="cvidix $vomodules" + # FIXME: ivtv driver temporarily disabled until we have a proper test + #test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome" + test "$_vidix_drivers" || _vidix_drivers="cyberblade mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome" # some vidix drivers are architecture and os specific, discard them elsewhere - x86 || _vidix_drivers=`echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//` - (test $host_arch = "sh" && linux) || _vidix_drivers=`echo $_vidix_drivers | sed s/sh_veu//` + x86 || _vidix_drivers=$(echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//) + (test $host_arch = "sh" && linux) || _vidix_drivers=$(echo $_vidix_drivers | sed s/sh_veu//) for driver in $_vidix_drivers ; do - uc_driver=`echo $driver | tr '[a-z]' '[A-Z]'` + uc_driver=$(echo $driver | tr '[a-z]' '[A-Z]') eval _vidix_drv_${driver}=yes eval def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\" done @@ -4572,52 +4727,23 @@ echores "$_svgalib_helper" else - _novomodules="cvidix $_novomodules" + novomodules="cvidix $novomodules" fi if test "$_vidix" = yes && win32; then winvidix=yes - _vomodules="winvidix $_vomodules" + vomodules="winvidix $vomodules" libs_mplayer="$libs_mplayer -lgdi32" else - _novomodules="winvidix $_novomodules" + novomodules="winvidix $novomodules" fi if test "$_vidix" = yes && test "$_x11" = yes; then xvidix=yes - _vomodules="xvidix $_vomodules" + vomodules="xvidix $vomodules" else - _novomodules="xvidix $_novomodules" + novomodules="xvidix $novomodules" fi -echocheck "/dev/mga_vid" -if test "$_mga" = auto ; then - _mga=no - test -c /dev/mga_vid && _mga=yes -fi -if test "$_mga" = yes ; then - def_mga='#define CONFIG_MGA 1' - _vomodules="mga $_vomodules" -else - def_mga='#undef CONFIG_MGA' - _novomodules="mga $_novomodules" -fi -echores "$_mga" - - -echocheck "xmga" -if test "$_xmga" = auto ; then - _xmga=no - test "$_x11" = yes && test "$_mga" = yes && _xmga=yes -fi -if test "$_xmga" = yes ; then - def_xmga='#define CONFIG_XMGA 1' - _vomodules="xmga $_vomodules" -else - def_xmga='#undef CONFIG_XMGA' - _novomodules="xmga $_novomodules" -fi -echores "$_xmga" - echocheck "GGI" if test "$_ggi" = auto ; then @@ -4631,10 +4757,10 @@ if test "$_ggi" = yes ; then def_ggi='#define CONFIG_GGI 1' libs_mplayer="$libs_mplayer -lggi" - _vomodules="ggi $_vomodules" + vomodules="ggi $vomodules" else def_ggi='#undef CONFIG_GGI' - _novomodules="ggi $_novomodules" + novomodules="ggi $novomodules" fi echores "$_ggi" @@ -4683,12 +4809,12 @@ if test "$_aa" = yes ; then def_aa='#define CONFIG_AA 1' if cygwin ; then - libs_mplayer="$libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`" + libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)" fi - _vomodules="aa $_vomodules" + vomodules="aa $vomodules" else def_aa='#undef CONFIG_AA' - _novomodules="aa $_novomodules" + novomodules="aa $novomodules" fi echores "$_aa" @@ -4704,37 +4830,33 @@ #endif int main(void) { (void) caca_init(); return 0; } EOF - cc_check `caca-config --libs` && _caca=yes + cc_check $(caca-config --libs) && _caca=yes fi fi if test "$_caca" = yes ; then def_caca='#define CONFIG_CACA 1' - extra_cflags="$extra_cflags `caca-config --cflags`" - libs_mplayer="$libs_mplayer `caca-config --libs`" - _vomodules="caca $_vomodules" + extra_cflags="$extra_cflags $(caca-config --cflags)" + libs_mplayer="$libs_mplayer $(caca-config --libs)" + vomodules="caca $vomodules" else def_caca='#undef CONFIG_CACA' - _novomodules="caca $_novomodules" + novomodules="caca $novomodules" fi echores "$_caca" echocheck "SVGAlib" if test "$_svga" = auto ; then - cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF _svga=no - cc_check -lvga $_ld_lm && _svga=yes + header_check vga.h -lvga $_ld_lm && _svga=yes fi if test "$_svga" = yes ; then def_svga='#define CONFIG_SVGALIB 1' libs_mplayer="$libs_mplayer -lvga" - _vomodules="svga $_vomodules" + vomodules="svga $vomodules" else def_svga='#undef CONFIG_SVGALIB' - _novomodules="svga $_novomodules" + novomodules="svga $novomodules" fi echores "$_svga" @@ -4746,10 +4868,10 @@ fi if test "$_fbdev" = yes ; then def_fbdev='#define CONFIG_FBDEV 1' - _vomodules="fbdev $_vomodules" + vomodules="fbdev $vomodules" else def_fbdev='#undef CONFIG_FBDEV' - _novomodules="fbdev $_novomodules" + novomodules="fbdev $novomodules" fi echores "$_fbdev" @@ -4764,73 +4886,105 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include int main(void) {return 0;} EOF - for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do + for _inc_tmp in "" "-I/usr/src/DVB/include" ; do cc_check $_inc_tmp && _dvb=yes && \ - extra_cflags="$extra_cflags $_inc_tmp" && break + extra_cflags="$extra_cflags $_inc_tmp" && break done fi echores "$_dvb" if test "$_dvb" = yes ; then + _dvbin=yes + inputmodules="dvb $inputmodules" def_dvb='#define CONFIG_DVB 1' def_dvbin='#define CONFIG_DVBIN 1' - _aomodules="mpegpes(dvb) $_aomodules" - _vomodules="mpegpes(dvb) $_vomodules" + aomodules="mpegpes(dvb) $aomodules" + vomodules="mpegpes(dvb) $vomodules" +else + _dvbin=no + noinputmodules="dvb $noinputmodules" + def_dvb='#undef CONFIG_DVB' + def_dvbin='#undef CONFIG_DVBIN ' + aomodules="mpegpes(file) $aomodules" + vomodules="mpegpes(file) $vomodules" fi -echocheck "DVB HEAD" -if test "$_dvbhead" = auto ; then - _dvbhead=no -cat >$TMPC << EOF -#include -#include -#include -#include -#include -#include -#include -#include -#include -int main(void) {return 0;} +if darwin; then + +echocheck "QuickTime" +if test "$quicktime" = auto ; then + cat > $TMPC < +int main(void) { + ImageDescription *desc; + EnterMovies(); + ExitMovies(); + return 0; +} EOF - for _inc_tmp in "" "-I/usr/src/DVB/include" ; do - cc_check $_inc_tmp && _dvbhead=yes && \ - extra_cflags="$extra_cflags $_inc_tmp" && break - done + quicktime=no + cc_check -framework QuickTime && quicktime=yes fi -echores "$_dvbhead" -if test "$_dvbhead" = yes ; then - def_dvb='#define CONFIG_DVB 1' - def_dvb_head='#define CONFIG_DVB_HEAD 1' - def_dvbin='#define CONFIG_DVBIN 1' - _aomodules="mpegpes(dvb) $_aomodules" - _vomodules="mpegpes(dvb) $_vomodules" +if test "$quicktime" = yes ; then + extra_ldflags="$extra_ldflags -framework QuickTime" + def_quicktime='#define CONFIG_QUICKTIME 1' +else + def_quicktime='#undef CONFIG_QUICKTIME' + _quartz=no fi +echores $quicktime -if test "$_dvbhead" = no && test "$_dvb" = no ; then - def_dvb='#undef CONFIG_DVB' - def_dvb_head='#undef CONFIG_DVB_HEAD' - def_dvbin='#undef CONFIG_DVBIN ' - _aomodules="mpegpes(file) $_aomodules" - _vomodules="mpegpes(file) $_vomodules" +echocheck "Quartz" +if test "$_quartz" = auto ; then + cat > $TMPC < +int main(void) { + CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false); + return 0; +} +EOF + _quartz=no + cc_check -framework Carbon && _quartz=yes fi - -if test "$_dvb" = yes || test "$_dvbhead" = yes ; then - _dvbin=yes - _inputmodules="dvb $_inputmodules" +if test "$_quartz" = yes ; then + libs_mplayer="$libs_mplayer -framework Carbon" + def_quartz='#define CONFIG_QUARTZ 1' + vomodules="quartz $vomodules" else - _dvbin=no - _noinputmodules="dvb $_noinputmodules" + def_quartz='#undef CONFIG_QUARTZ' + novomodules="quartz $novomodules" fi +echores $_quartz +echocheck "CoreVideo" +if test "$_corevideo" = auto ; then + cat > $TMPC < +#include +#include +#include +int main(void) { return 0; } +EOF + _corevideo=no + cc_check -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes +fi +if test "$_corevideo" = yes ; then + vomodules="corevideo $vomodules" + libs_mplayer="$libs_mplayer -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL" + def_corevideo='#define CONFIG_COREVIDEO 1' +else + novomodules="corevideo $novomodules" + def_corevideo='#undef CONFIG_COREVIDEO' +fi +echores "$_corevideo" +fi #if darwin echocheck "PNG support" @@ -4839,7 +4993,7 @@ if irix ; then # Don't check for -lpng on irix since it has its own libpng # incompatible with the GNU libpng - _res_comment="disabled on irix (not GNU libpng)" + res_comment="disabled on irix (not GNU libpng)" else cat > $TMPC << EOF #include @@ -4850,23 +5004,15 @@ return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver); } EOF - if cc_check -lpng -lz $_ld_lm ; then - if tmp_run ; then - _png=yes - else - _res_comment="mismatch of library and header versions" - fi - fi + cc_check -lpng -lz $_ld_lm && _png=yes fi fi echores "$_png" if test "$_png" = yes ; then def_png='#define CONFIG_PNG 1' extra_ldflags="$extra_ldflags -lpng -lz" - _vomodules="png $_vomodules" else def_png='#undef CONFIG_PNG' - _novomodules="png $_novomodules" fi echocheck "MNG support" @@ -4902,32 +5048,50 @@ #include int main(void) { return 0; } EOF - if cc_check -ljpeg $_ld_lm ; then - if tmp_run ; then - _jpeg=yes - fi - fi + cc_check -ljpeg $_ld_lm && _jpeg=yes fi echores "$_jpeg" if test "$_jpeg" = yes ; then def_jpeg='#define CONFIG_JPEG 1' - _vomodules="jpeg $_vomodules" + vomodules="jpeg $vomodules" extra_ldflags="$extra_ldflags -ljpeg" else def_jpeg='#undef CONFIG_JPEG' - _novomodules="jpeg $_novomodules" + novomodules="jpeg $novomodules" fi +echocheck "OpenJPEG (JPEG2000) support" +if test "$libopenjpeg" = auto ; then + libopenjpeg=no +cat > $TMPC << EOF +#define OPJ_STATIC +#include +int main(void) { opj_dparameters_t dec_params; opj_set_default_decoder_parameters(&dec_params); return 0; } +EOF + cc_check -lopenjpeg $_ld_lm && libopenjpeg=yes +fi +echores "$libopenjpeg" +if test "$libopenjpeg" = yes ; then + def_libopenjpeg='#define CONFIG_LIBOPENJPEG 1' + extra_ldflags="$extra_ldflags -lopenjpeg" + libavdecoders="$libavdecoders LIBOPENJPEG_DECODER" + libavencoders="$libavencoders LIBOPENJPEG_ENCODER" + codecmodules="OpenJPEG $codecmodules" +else + def_libopenjpeg='#define CONFIG_LIBOPENJPEG 0' + nocodecmodules="OpenJPEG $nocodecmodules" +fi + echocheck "PNM support" if test "$_pnm" = yes; then def_pnm="#define CONFIG_PNM 1" - _vomodules="pnm $_vomodules" + vomodules="pnm $vomodules" else def_pnm="#undef CONFIG_PNM" - _novomodules="pnm $_novomodules" + novomodules="pnm $novomodules" fi echores "$_pnm" @@ -4946,10 +5110,10 @@ _gif=no cat > $TMPC << EOF #include -int main(void) { return 0; } +int main(void) { QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0); return 0; } EOF for _ld_gif in "-lungif" "-lgif" ; do - cc_check $_ld_gif && tmp_run && _gif=yes && break + cc_check $_ld_gif && _gif=yes && break done fi @@ -4969,16 +5133,16 @@ if test "$_gif" = yes ; then def_gif='#define CONFIG_GIF 1' - _codecmodules="gif $_codecmodules" - _vomodules="gif89a $_vomodules" - _res_comment="old version, some encoding functions disabled" + codecmodules="gif $codecmodules" + vomodules="gif89a $vomodules" + res_comment="old version, some encoding functions disabled" def_gif_4='#undef CONFIG_GIF_4' extra_ldflags="$extra_ldflags $_ld_gif" cat > $TMPC << EOF #include #include -void catch() { exit(1); } +void catch(void) { exit(1); } int main(void) { signal(SIGSEGV, catch); // catch segfault printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst); @@ -4986,15 +5150,15 @@ return 0; } EOF - if cc_check "$_ld_gif" && tmp_run ; then + if cc_check "$_ld_gif" ; then def_gif_4='#define CONFIG_GIF_4 1' - _res_comment="" + res_comment="" fi else def_gif='#undef CONFIG_GIF' def_gif_4='#undef CONFIG_GIF_4' - _novomodules="gif89a $_novomodules" - _nocodecmodules="gif $_nocodecmodules" + novomodules="gif89a $novomodules" + nocodecmodules="gif $nocodecmodules" fi echores "$_gif" @@ -5011,7 +5175,7 @@ return 0; } EOF - if cc_check "$_ld_gif" && tmp_run ; then + if cc_check "$_ld_gif" ; then def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK' echores "disabled" else @@ -5033,10 +5197,10 @@ if test "$_vesa" = yes ; then def_vesa='#define CONFIG_VESA 1' libs_mplayer="$libs_mplayer -lvbe -llrmi" - _vomodules="vesa $_vomodules" + vomodules="vesa $vomodules" else def_vesa='#undef CONFIG_VESA' - _novomodules="vesa $_novomodules" + novomodules="vesa $novomodules" fi echores "$_vesa" @@ -5046,6 +5210,9 @@ echocheck "SDL" +_inc_tmp="" +_ld_tmp="" +def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H" if test -z "$_sdlconfig" ; then if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then _sdlconfig="sdl-config" @@ -5057,57 +5224,174 @@ fi if test "$_sdl" = auto || test "$_sdl" = yes ; then cat > $TMPC << EOF +#ifdef CONFIG_SDL_SDL_H +#include +#else #include -int main(void) { +#endif +#ifndef __APPLE__ +// we allow SDL hacking our main() only on OSX +#undef main +#endif +int main(int argc, char *argv[]) { SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE); return 0; } EOF _sdl=no - if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then - if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then - _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'` - if test "$_sdlversion" -gt 116 ; then - if test "$_sdlversion" -lt 121 ; then - def_sdlbuggy='#define BUGGY_SDL' - else - def_sdlbuggy='#undef BUGGY_SDL' - fi + for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do + if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then + _sdl=yes + def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1" + break + fi + done + if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then + res_comment="using $_sdlconfig" + if cygwin ; then + _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)" + _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)" + elif mingw32 ; then + _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//) + _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//) + else + _inc_tmp="$($_sdlconfig --cflags)" + _ld_tmp="$($_sdlconfig --libs)" + fi + if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then _sdl=yes - fi fi fi fi if test "$_sdl" = yes ; then def_sdl='#define CONFIG_SDL 1' - if cygwin ; then - libs_mplayer="$libs_mplayer `$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`" - extra_cflags="$extra_cflags `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`" - elif mingw32 ; then - libs_mplayer="$libs_mplayer `$_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//`" - extra_cflags="$extra_cflags `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`" - else - libs_mplayer="$libs_mplayer `$_sdlconfig --libs`" - extra_cflags="$extra_cflags `$_sdlconfig --cflags | sed s/-D_GNU_SOURCE=1//`" - fi - _vomodules="sdl $_vomodules" - _aomodules="sdl $_aomodules" - _res_comment="using $_sdlconfig" + extra_cflags="$extra_cflags $_inc_tmp" + libs_mplayer="$libs_mplayer $_ld_tmp" + vomodules="sdl $vomodules" + aomodules="sdl $aomodules" else def_sdl='#undef CONFIG_SDL' - _novomodules="sdl $_novomodules" - _noaomodules="sdl $_noaomodules" + novomodules="sdl $novomodules" + noaomodules="sdl $noaomodules" fi echores "$_sdl" +# make sure this stays below CoreVideo to avoid issues due to namespace +# conflicts between -lGL and -framework OpenGL +echocheck "OpenGL" +#Note: this test is run even with --enable-gl since we autodetect linker flags +if (test "$_x11" = yes || test "$_sdl" = yes || win32) && test "$_gl" != no ; then + cat > $TMPC << EOF +#ifdef GL_WIN32 +#include +#include +#elif defined(GL_SDL) +#include +#ifdef CONFIG_SDL_SDL_H +#include +#else +#include +#endif +#ifndef __APPLE__ +// we allow SDL hacking our main() only on OSX +#undef main +#endif +#else +#include +#include +#include +#endif +int main(int argc, char *argv[]) { +#ifdef GL_WIN32 + HDC dc; + wglCreateContext(dc); +#elif defined(GL_SDL) + SDL_GL_SwapBuffers(); +#else + glXCreateContext(NULL, NULL, NULL, True); +#endif + glFinish(); + return 0; +} +EOF + _gl=no + for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do + if cc_check $_ld_tmp $_ld_lm ; then + _gl=yes + _gl_x11=yes + libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl" + break + fi + done + if cc_check -DGL_WIN32 -lopengl32 ; then + _gl=yes + _gl_win32=yes + libs_mplayer="$libs_mplayer -lopengl32 -lgdi32" + fi + # last so it can reuse any linker etc. flags detected before + if test "$_sdl" = yes ; then + if cc_check -DGL_SDL || + cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then + _gl=yes + _gl_sdl=yes + elif cc_check -DGL_SDL -lGL || + cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then + _gl=yes + _gl_sdl=yes + libs_mplayer="$libs_mplayer -lGL" + fi + fi +else + _gl=no +fi +if test "$_gl" = yes ; then + def_gl='#define CONFIG_GL 1' + res_comment="backends:" + if test "$_gl_win32" = yes ; then + def_gl_win32='#define CONFIG_GL_WIN32 1' + res_comment="$res_comment win32" + fi + if test "$_gl_x11" = yes ; then + def_gl_x11='#define CONFIG_GL_X11 1' + res_comment="$res_comment x11" + fi + if test "$_gl_sdl" = yes ; then + def_gl_sdl='#define CONFIG_GL_SDL 1' + res_comment="$res_comment sdl" + fi + vomodules="opengl $vomodules" +else + def_gl='#undef CONFIG_GL' + def_gl_win32='#undef CONFIG_GL_WIN32' + def_gl_x11='#undef CONFIG_GL_X11' + def_gl_sdl='#undef CONFIG_GL_SDL' + novomodules="opengl $novomodules" +fi +echores "$_gl" + + +echocheck "MatrixView" +if test "$_gl" = no ; then + matrixview=no +fi +if test "$matrixview" = yes ; then + vomodules="matrixview $vomodules" + def_matrixview='#define CONFIG_MATRIXVIEW 1' +else + novomodules="matrixview $novomodules" + def_matrixview='#undef CONFIG_MATRIXVIEW' +fi +echores "$matrixview" + + if os2 ; then echocheck "KVA (SNAP/WarpOverlay!/DIVE)" if test "$_kva" = auto; then cat > $TMPC << EOF #include #include -int main( void ) { return 0; } +int main(void) { return 0; } EOF _kva=no; cc_check -lkva && _kva=yes @@ -5115,10 +5399,10 @@ if test "$_kva" = yes ; then def_kva='#define CONFIG_KVA 1' libs_mplayer="$libs_mplayer -lkva" - _vomodules="kva $_vomodules" + vomodules="kva $vomodules" else def_kva='#undef CONFIG_KVA' - _novomodules="kva $_novomodules" + novomodules="kva $novomodules" fi echores "$_kva" fi #if os2 @@ -5139,10 +5423,10 @@ if test "$_win32waveout" = yes ; then def_win32waveout='#define CONFIG_WIN32WAVEOUT 1' libs_mplayer="$libs_mplayer -lwinmm" - _aomodules="win32 $_aomodules" + aomodules="win32 $aomodules" else def_win32waveout='#undef CONFIG_WIN32WAVEOUT' - _noaomodules="win32 $_noaomodules" + noaomodules="win32 $noaomodules" fi echores "$_win32waveout" @@ -5154,15 +5438,14 @@ int main(void) { return 0; } EOF _direct3d=no - cc_check -ld3d9 && _direct3d=yes + cc_check && _direct3d=yes fi if test "$_direct3d" = yes ; then def_direct3d='#define CONFIG_DIRECT3D 1' - libs_mplayer="$libs_mplayer -ld3d9" - _vomodules="direct3d $_vomodules" + vomodules="direct3d $vomodules" else def_direct3d='#undef CONFIG_DIRECT3D' - _novomodules="direct3d $_novomodules" + novomodules="direct3d $novomodules" fi echores "$_direct3d" @@ -5180,12 +5463,12 @@ if test "$_directx" = yes ; then def_directx='#define CONFIG_DIRECTX 1' libs_mplayer="$libs_mplayer -lgdi32" - _vomodules="directx $_vomodules" - _aomodules="dsound $_aomodules" + vomodules="directx $vomodules" + aomodules="dsound $aomodules" else def_directx='#undef CONFIG_DIRECTX' - _novomodules="directx $_novomodules" - _noaomodules="dsound $_noaomodules" + novomodules="directx $novomodules" + noaomodules="dsound $noaomodules" fi echores "$_directx" @@ -5195,41 +5478,33 @@ echocheck "DXR2" if test "$_dxr2" = auto; then _dxr2=no - cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do - cc_check $_inc_tmp && _dxr2=yes && \ - extra_cflags="$extra_cflags $_inc_tmp" && break + header_check dxr2ioctl.h $_inc_tmp && _dxr2=yes && + extra_cflags="$extra_cflags $_inc_tmp" && break done fi if test "$_dxr2" = yes; then def_dxr2='#define CONFIG_DXR2 1' - _aomodules="dxr2 $_aomodules" - _vomodules="dxr2 $_vomodules" + aomodules="dxr2 $aomodules" + vomodules="dxr2 $vomodules" else def_dxr2='#undef CONFIG_DXR2' - _noaomodules="dxr2 $_noaomodules" - _novomodules="dxr2 $_novomodules" + noaomodules="dxr2 $noaomodules" + novomodules="dxr2 $novomodules" fi echores "$_dxr2" echocheck "DXR3/H+" if test "$_dxr3" = auto ; then - cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF _dxr3=no - cc_check && _dxr3=yes + header_check linux/em8300.h && _dxr3=yes fi if test "$_dxr3" = yes ; then def_dxr3='#define CONFIG_DXR3 1' - _vomodules="dxr3 $_vomodules" + vomodules="dxr3 $vomodules" else def_dxr3='#undef CONFIG_DXR3' - _novomodules="dxr3 $_novomodules" + novomodules="dxr3 $novomodules" fi echores "$_dxr3" @@ -5255,12 +5530,12 @@ fi if test "$_ivtv" = yes ; then def_ivtv='#define CONFIG_IVTV 1' - _vomodules="ivtv $_vomodules" - _aomodules="ivtv $_aomodules" + vomodules="ivtv $vomodules" + aomodules="ivtv $aomodules" else def_ivtv='#undef CONFIG_IVTV' - _novomodules="ivtv $_novomodules" - _noaomodules="ivtv $_noaomodules" + novomodules="ivtv $novomodules" + noaomodules="ivtv $noaomodules" fi echores "$_ivtv" @@ -5276,7 +5551,6 @@ int main(void) { #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) #error kernel headers too old, need 2.6.22 - bad_kernel_version(); #endif struct v4l2_ext_controls ctrls; ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG; @@ -5288,12 +5562,12 @@ fi if test "$_v4l2" = yes ; then def_v4l2='#define CONFIG_V4L2_DECODER 1' - _vomodules="v4l2 $_vomodules" - _aomodules="v4l2 $_aomodules" + vomodules="v4l2 $vomodules" + aomodules="v4l2 $aomodules" else def_v4l2='#undef CONFIG_V4L2_DECODER' - _novomodules="v4l2 $_novomodules" - _noaomodules="v4l2 $_noaomodules" + novomodules="v4l2 $novomodules" + noaomodules="v4l2 $noaomodules" fi echores "$_v4l2" @@ -5316,12 +5590,8 @@ fi if test "$_ossaudio" = yes ; then def_ossaudio='#define CONFIG_OSS_AUDIO 1' - _aomodules="oss $_aomodules" - if test "$_linux_devfs" = yes; then - def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"' - def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"' - else - cat > $TMPC << EOF + aomodules="oss $aomodules" + cat > $TMPC << EOF #include #include <$_soundcard_header> #ifdef OPEN_SOUND_SYSTEM @@ -5330,23 +5600,22 @@ #error Not the real thing #endif EOF - _real_ossaudio=no - cc_check && _real_ossaudio=yes - if test "$_real_ossaudio" = yes; then - def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"' - elif netbsd || openbsd ; then - def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"' - extra_ldflags="$extra_ldflags -lossaudio" - else - def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"' - fi - def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"' + _real_ossaudio=no + cc_check && _real_ossaudio=yes + if test "$_real_ossaudio" = yes; then + def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"' + elif netbsd || openbsd ; then + def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"' + extra_ldflags="$extra_ldflags -lossaudio" + else + def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"' fi + def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"' else def_ossaudio='#undef CONFIG_OSS_AUDIO' def_ossaudio_devdsp='#define PATH_DEV_DSP ""' def_ossaudio_devmixer='#define PATH_DEV_MIXER ""' - _noaomodules="oss $_noaomodules" + noaomodules="oss $noaomodules" fi echores "$_ossaudio" @@ -5355,23 +5624,18 @@ if test "$_arts" = auto ; then _arts=no if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then - -cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF -cc_check `artsc-config --libs` `artsc-config --cflags` && tmp_run && _arts=yes - + header_check artsc.h $(artsc-config --libs) $(artsc-config --cflags) && + _arts=yes fi fi if test "$_arts" = yes ; then def_arts='#define CONFIG_ARTS 1' - _aomodules="arts $_aomodules" - libs_mplayer="$libs_mplayer `artsc-config --libs`" - extra_cflags="$extra_cflags `artsc-config --cflags`" + aomodules="arts $aomodules" + libs_mplayer="$libs_mplayer $(artsc-config --libs)" + extra_cflags="$extra_cflags $(artsc-config --cflags)" else - _noaomodules="arts $_noaomodules" + noaomodules="arts $noaomodules" fi echores "$_arts" @@ -5385,7 +5649,7 @@ #include int main(void) { int fd = esd_open_sound("test"); return fd; } EOF -cc_check `esd-config --libs` `esd-config --cflags` && _esd=yes +cc_check $(esd-config --libs) $(esd-config --cflags) && _esd=yes fi fi @@ -5393,39 +5657,35 @@ if test "$_esd" = yes ; then def_esd='#define CONFIG_ESD 1' - _aomodules="esd $_aomodules" - libs_mplayer="$libs_mplayer `esd-config --libs`" - extra_cflags="$extra_cflags `esd-config --cflags`" + aomodules="esd $aomodules" + libs_mplayer="$libs_mplayer $(esd-config --libs)" + extra_cflags="$extra_cflags $(esd-config --cflags)" echocheck "esd_get_latency()" cat > $TMPC << EOF #include int main(void) { return esd_get_latency(0); } EOF - cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY' + cc_check $(esd-config --libs) $(esd-config --cflags) && _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1' echores "$_esd_latency" else def_esd='#undef CONFIG_ESD' def_esd_latency='#undef CONFIG_ESD_LATENCY' - _noaomodules="esd $_noaomodules" + noaomodules="esd $noaomodules" fi echocheck "NAS" if test "$_nas" = auto ; then - cat > $TMPC << EOF -#include