aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Uoti Urpala <uau@glyph.nonexistent.invalid>2010-05-07 22:02:47 +0300
committerGravatar Uoti Urpala <uau@glyph.nonexistent.invalid>2010-05-07 22:03:48 +0300
commit4c6e3ac01bb158ddaa5603dc93fc7efb91b367b1 (patch)
tree16662a6828f11f852ee4e0437ad03309d994caef
parenteee666c3b57870b7610acc846858814ce8498385 (diff)
parenta535f7bfca1bec440cec45f4201494755ed2440b (diff)
Merge svn change r31134
Fix some search/replace errors introduced in the svn commit.
-rw-r--r--LICENSE14
-rw-r--r--asxparser.c156
-rw-r--r--asxparser.h2
-rw-r--r--cfg-common-opts.h466
-rw-r--r--cfg-common.h360
-rw-r--r--cfg-mencoder.h272
-rw-r--r--cfg-mplayer.h418
-rw-r--r--codec-cfg.c1989
-rw-r--r--codec-cfg.h76
-rw-r--r--command.c2632
-rw-r--r--cpudetect.c599
-rw-r--r--cpudetect.h38
-rw-r--r--cpuinfo.c514
-rw-r--r--edl.h12
14 files changed, 3769 insertions, 3779 deletions
diff --git a/LICENSE b/LICENSE
index 983f982a1f..7b845eec88 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,12 +1,12 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
- Preamble
+ Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
- GNU GENERAL PUBLIC LICENSE
+ GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
- NO WARRANTY
+ NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
- END OF TERMS AND CONDITIONS
+ END OF TERMS AND CONDITIONS
- How to Apply These Terms to Your New Programs
+ How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
diff --git a/asxparser.c b/asxparser.c
index 2d4677629d..56820a0e7f 100644
--- a/asxparser.c
+++ b/asxparser.c
@@ -112,8 +112,8 @@ asx_parse_attribs(ASX_Parser_t* parser,char* buffer,char*** _attribs) {
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);
@@ -159,7 +159,7 @@ asx_parse_attribs(ASX_Parser_t* parser,char* buffer,char*** _attribs) {
*/
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;
@@ -183,21 +183,21 @@ asx_get_element(ASX_Parser_t* parser,char** _buffer,
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));
+ 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 = 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;
}
}
}
@@ -206,8 +206,8 @@ asx_get_element(ASX_Parser_t* parser,char** _buffer,
while(1) {
for( ; ptr1[0] != '<' ; ptr1++) {
if(ptr1[0] == '\0') {
- ptr1 = NULL;
- break;
+ ptr1 = NULL;
+ break;
}
if(ptr1[0] == '\n') parser->line++;
}
@@ -216,16 +216,16 @@ asx_get_element(ASX_Parser_t* parser,char** _buffer,
if(strncmp(ptr1,"<!--",4) == 0) { // Comments
for( ; 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;
@@ -288,10 +288,10 @@ asx_get_element(ASX_Parser_t* parser,char** _buffer,
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++;
}
@@ -299,52 +299,52 @@ asx_get_element(ASX_Parser_t* parser,char** _buffer,
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,"<!--",4) == 0) { // Comments
- for( ; strncmp(ptr4,"-->",3) != 0 ; ptr4++) {
- if(ptr4[0] == '\0') {
- ptr4 = NULL;
- break;
- }
- if(ptr1[0] == '\n') parser->line++;
- }
- continue;
+ 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;
+ 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 {
@@ -543,23 +543,23 @@ asx_parse_repeat(ASX_Parser_t* parser,char* buffer,char** _attribs) {
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);
@@ -630,23 +630,23 @@ asx_parser_build_tree(struct m_config *mconfig, char* buffer,int deep) {
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);
diff --git a/asxparser.h b/asxparser.h
index 5060c331ae..57577101fb 100644
--- a/asxparser.h
+++ b/asxparser.h
@@ -49,7 +49,7 @@ asx_parser_free(ASX_Parser_t* parser);
*/
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);
diff --git a/cfg-common-opts.h b/cfg-common-opts.h
index 32395ad1c2..e969acd8ee 100644
--- a/cfg-common-opts.h
+++ b/cfg-common-opts.h
@@ -17,349 +17,345 @@
*/
// ------------------------- 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},
+ {"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", (void *) 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},
+ {"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},
+ {"msgcharset", &mp_msg_charset, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL},
#endif
#ifdef CONFIG_PRIORITY
- {"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL},
+ {"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL},
#endif
- {"codecpath", &codec_path, CONF_TYPE_STRING, 0, 0, 0, NULL},
- {"noconfig", (void *) noconfig_opts, CONF_TYPE_SUBCONFIG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 0, NULL},
+ {"codecpath", &codec_path, CONF_TYPE_STRING, 0, 0, 0, NULL},
+ {"noconfig", (void *) 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},
+ {"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},
+ {"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},
+ {"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},
+ {"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},
#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},
+ {"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 */
- OPT_INTPAIR("chapter", chapterrange, 0),
- OPT_INTRANGE("edition", edition_id, 0, -1, 8190),
- {"alang", &audio_lang, CONF_TYPE_STRING, 0, 0, 0, NULL},
- {"slang", &dvdsub_lang, CONF_TYPE_STRING, 0, 0, 0, NULL},
+ OPT_INTPAIR("chapter", chapterrange, 0),
+ OPT_INTRANGE("edition", edition_id, 0, -1, 8190),
+ {"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},
+ {"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},
+ {"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},
+ {"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},
+ {"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},
+ {"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},
+ {"sdp", "-sdp has been removed, use sdp://file instead.\n", CONF_TYPE_PRINT, 0, 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},
+ // -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},
+ {"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},
+ {"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},
+ {"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},
+ {"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},
+ {"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},
+ // 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},
+ // 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},
+ // 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},
+ {"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 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},
+ // 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
- OPT_INTRANGE("aid", audio_id, 0, -2, 8190),
- {"ausid", &audio_substream_id, CONF_TYPE_INT, 0, 0, 0, NULL},
- OPT_INTRANGE("vid", video_id, 0, -2, 8190),
- OPT_INTRANGE("sid", sub_id, 0, -2, 8190),
- OPT_FLAG_CONSTANTS("nosub", sub_id, 0, -1, -2),
- OPT_FLAG_CONSTANTS("novideo", video_id, 0, -1, -2),
+ // select audio/video/subtitle stream
+ OPT_INTRANGE("aid", audio_id, 0, -2, 8190),
+ {"ausid", &audio_substream_id, CONF_TYPE_INT, 0, 0, 0, NULL},
+ OPT_INTRANGE("vid", video_id, 0, -2, 8190),
+ OPT_INTRANGE("sid", sub_id, 0, -2, 8190),
+ OPT_FLAG_CONSTANTS("nosub", sub_id, 0, -1, -2),
+ OPT_FLAG_CONSTANTS("novideo", video_id, 0, -1, -2),
- { "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},
+ { "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},
+ { "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},
+ { "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", (void *) mfopts_conf, CONF_TYPE_SUBCONFIG, 0,0,0, NULL},
+ // 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", (void *) mfopts_conf, CONF_TYPE_SUBCONFIG, 0,0,0, NULL},
#ifdef CONFIG_RADIO
- {"radio", radioopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ {"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},
+ {"radio", "MPlayer was compiled without Radio interface support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
#endif /* CONFIG_RADIO */
#ifdef CONFIG_TV
- {"tv", (void *) tvopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ {"tv", (void *) 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},
+ {"tv", "MPlayer was compiled without TV interface support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
#endif /* CONFIG_TV */
#ifdef CONFIG_PVR
- {"pvr", (void *) pvropts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ {"pvr", (void *) 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},
+ {"pvr", "MPlayer was compiled without V4L2/PVR interface support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
#endif /* CONFIG_PVR */
- {"vivo", (void *) vivoopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ {"vivo", (void *) vivoopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
#ifdef CONFIG_DVBIN
- {"dvbin", (void *) dvbin_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ {"dvbin", (void *) 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},
+ // 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},
+ // 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},
- OPT_FLOATRANGE("speed", playback_speed, 0, 0.01, 100.0),
+ // 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},
+ OPT_FLOATRANGE("speed", playback_speed, 0, 0.01, 100.0),
- // set a-v distance
- {"delay", &audio_delay, CONF_TYPE_FLOAT, CONF_RANGE, -100.0, 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},
+ // 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},
+ {"a52drc", &a52_drc_level, CONF_TYPE_FLOAT, CONF_RANGE, 0, 1, NULL},
#endif
// ------------------------- codec/vfilter options --------------------
- // MP3-only: select stereo/left/right
+ // MP3-only: select stereo/left/right
#ifdef CONFIG_FAKE_MONO
- {"stereo", &fakemono, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL},
+ {"stereo", &fakemono, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL},
#endif
- // disable audio
- OPT_FLAG_CONSTANTS("sound", audio_id, 0, -2, -1),
- OPT_FLAG_CONSTANTS("nosound", audio_id, 0, -1, -2),
+ // disable audio
+ OPT_FLAG_CONSTANTS("sound", audio_id, 0, -2, -1),
+ OPT_FLAG_CONSTANTS("nosound", audio_id, 0, -1, -2),
- {"af*", &af_cfg.list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
- {"af-adv", (void *) audio_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ {"af*", &af_cfg.list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
+ {"af-adv", (void *) 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},
+ {"vop", "-vop has been removed, use -vf instead.\n", CONF_TYPE_PRINT, CONF_NOCFG ,0,0, NULL},
OPT_SETTINGSLIST("vf*", vf_settings, 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},
+ // 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},
+ {"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},
+ {"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", (void *) scaler_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
- OPT_FLAG_ON("zoom", softzoom, 0),
- OPT_FLAG_OFF("nozoom", softzoom, 0),
- OPT_FLOATRANGE("aspect", movie_aspect, 0, 0.2, 3.0),
- OPT_FLAG_CONSTANTS("noaspect", movie_aspect, 0, 0, 0),
- OPT_FLOATRANGE("xy", screen_size_xy, 0, 0.001, 4096),
-
- OPT_FLAG_CONSTANTS("flip", flip, 0, -1, 1),
- OPT_FLAG_CONSTANTS("noflip", flip, 0, -1, 0),
- {"tsfastparse", "-tsfastparse is no longer a valid option.\n", CONF_TYPE_PRINT, CONF_NOCFG ,0,0, NULL
+ // scaling:
+ {"sws", &sws_flags, CONF_TYPE_INT, 0, 0, 2, NULL},
+ {"ssf", (void *) scaler_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ OPT_FLAG_ON("zoom", softzoom, 0),
+ OPT_FLAG_OFF("nozoom", softzoom, 0),
+ OPT_FLOATRANGE("aspect", movie_aspect, 0, 0.2, 3.0),
+ OPT_FLAG_CONSTANTS("noaspect", movie_aspect, 0, 0, 0),
+ OPT_FLOATRANGE("xy", screen_size_xy, 0, 0.001, 4096),
+
+ OPT_FLAG_CONSTANTS("flip", flip, 0, -1, 1),
+ OPT_FLAG_CONSTANTS("noflip", flip, 0, -1, 0),
+ {"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},
+ {"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},
+ {"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)
- OPT_FLAG_ON("slices", vd_use_slices, 0),
- OPT_FLAG_OFF("noslices", vd_use_slices, 0),
- {"field-dominance", &field_dominance, CONF_TYPE_INT, CONF_RANGE, -1, 1, NULL},
+ // draw by slices or whole frame (useful with libmpeg2/libavcodec)
+ OPT_FLAG_ON("slices", vd_use_slices, 0),
+ OPT_FLAG_OFF("noslices", vd_use_slices, 0),
+ {"field-dominance", &field_dominance, CONF_TYPE_INT, CONF_RANGE, -1, 1, NULL},
#ifdef CONFIG_LIBAVCODEC
- {"lavdopts", (void *) lavc_decode_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ {"lavdopts", (void *) lavc_decode_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
#endif
#ifdef CONFIG_LIBAVFORMAT
- {"lavfdopts", (void *) lavfdopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
+ {"lavfdopts", (void *) 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},
+ {"xvidopts", xvid_dec_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
#endif
- {"codecs-file", &codecs_file, CONF_TYPE_STRING, 0, 0, 0, NULL},
+ {"codecs-file", &codecs_file, CONF_TYPE_STRING, 0, 0, 0, NULL},
// ------------------------- subtitles options --------------------
- {"sub", &sub_name, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
+ {"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},
+ {"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},
+ {"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},
+ {"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},
+ {"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},
+ {"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
- OPT_FLAG_ON("ass", ass_enabled, 0),
- OPT_FLAG_OFF("noass", ass_enabled, 0),
- {"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", &use_embedded_fonts, CONF_TYPE_FLAG, 0, 0, 1, NULL},
- {"noembeddedfonts", &use_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},
+ OPT_FLAG_ON("ass", ass_enabled, 0),
+ OPT_FLAG_OFF("noass", ass_enabled, 0),
+ {"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", &use_embedded_fonts, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+ {"noembeddedfonts", &use_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},
+ {"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},
+ {"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 */
diff --git a/cfg-common.h b/cfg-common.h
index 744b6bc459..b6e4654e8f 100644
--- a/cfg-common.h
+++ b/cfg-common.h
@@ -92,67 +92,67 @@ const m_option_t radioopts_conf[]={
#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},
- {"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},
+ {"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 */
@@ -168,16 +168,16 @@ 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 */
@@ -201,13 +201,13 @@ 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: */
@@ -222,17 +222,17 @@ 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;
@@ -242,118 +242,118 @@ extern char * mf_type;
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}
+ {"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},
-
- { "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 },
- { "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"
- " 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}
+ { "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 },
+ { "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"
+ " 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}
};
diff --git a/cfg-mencoder.h b/cfg-mencoder.h
index c067bcc8d7..e8220d04ad 100644
--- a/cfg-mencoder.h
+++ b/cfg-mencoder.h
@@ -41,243 +41,243 @@ extern const m_option_t vfwopts_conf[];
extern const m_option_t xvidencopts_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},
+// {"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"
#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},
+ {"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},
+ {"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},
+ // 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},
+ // 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},
+ {"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},
+ {"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", (void *) oac_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
- {"ovc", (void *) ovc_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
+ // output audio/video codec selection
+ {"oac", (void *) oac_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
+ {"ovc", (void *) ovc_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
- // output file format
- {"of", (void *) of_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
+ // output file format
+ {"of", (void *) 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 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},
+ // 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},
+ {"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},
+ {"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},
+ {"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},
+ {"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},
+ {"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", (void *) info_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
+ // info header strings
+ {"info", (void *) 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},
+ {"lavfopts", lavfopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
#endif
#include "cfg-common-opts.h"
-// {"-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}
+// {"-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}
};
#endif /* MPLAYER_CFG_MENCODER_H */
diff --git a/cfg-mplayer.h b/cfg-mplayer.h
index a4efdca106..136296576d 100644
--- a/cfg-mplayer.h
+++ b/cfg-mplayer.h
@@ -59,16 +59,16 @@ extern int sws_flags;
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
/*
@@ -85,289 +85,289 @@ const m_option_t tvscan_conf[]={
*/
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},
- OPT_STRINGLIST("vo", video_driver_list, 0),
- OPT_STRINGLIST("ao", audio_driver_list, 0),
- OPT_FLAG_ON("fixed-vo", fixed_vo, CONF_GLOBAL),
- OPT_FLAG_OFF("nofixed-vo", fixed_vo, CONF_GLOBAL),
- OPT_FLAG_ON("ontop", vo_ontop, 0),
- OPT_FLAG_OFF("noontop", vo_ontop, 0),
- {"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=<filename> 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",
+ {"o", "Option -o has been renamed to -vo (video-out), use -vo.\n",
+ CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
+ OPT_STRINGLIST("vo", video_driver_list, 0),
+ OPT_STRINGLIST("ao", audio_driver_list, 0),
+ OPT_FLAG_ON("fixed-vo", fixed_vo, CONF_GLOBAL),
+ OPT_FLAG_OFF("nofixed-vo", fixed_vo, CONF_GLOBAL),
+ OPT_FLAG_ON("ontop", vo_ontop, 0),
+ OPT_FLAG_OFF("noontop", vo_ontop, 0),
+ {"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=<filename> 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",
+ {"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},
+ {"edlout", &edl_output_filename, CONF_TYPE_STRING, 0, 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:<options> instead.\n",
- CONF_TYPE_PRINT, 0, 0, 0, NULL},
+ {"jpeg", "-jpeg has been removed. Use -vo jpeg:<options> instead.\n",
+ CONF_TYPE_PRINT, 0, 0, 0, NULL},
#endif
- // -vo sdl only:
- {"sdl", "Use -vo sdl:driver=<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=<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},
+ {"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)
- OPT_INTRANGE("x", screen_size_x, 0, 0, 4096),
- OPT_INTRANGE("y", screen_size_y, 0, 0, 4096),
- // set screen dimensions (when not detectable or virtual!=visible)
- OPT_INTRANGE("screenw", vo_screenwidth, CONF_OLD, 0, 4096),
- OPT_INTRANGE("screenh", vo_screenheight, CONF_OLD, 0, 4096),
- // Geometry string
- {"geometry", &vo_geometry, CONF_TYPE_STRING, 0, 0, 0, NULL},
- OPT_FLAG_ON("force-window-position", force_window_position, 0),
- OPT_FLAG_OFF("noforce-window-position", force_window_position, 0),
- // 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
- OPT_FLOATRANGE("monitoraspect", force_monitor_aspect, 0, 0.0, 9.0),
- OPT_FLOATRANGE("monitorpixelaspect", monitor_pixel_aspect, 0, 0.2, 9.0),
- // video mode switching: (x11,xv,dga)
- OPT_FLAG_ON("vm", vidmode, 0),
- OPT_FLAG_OFF("novm", vidmode, 0),
- // start in fullscreen mode:
- OPT_FLAG_ON("fs", fullscreen, 0),
- OPT_FLAG_OFF("nofs", fullscreen, 0),
- // 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?)
- OPT_INTRANGE("bpp", vo_dbpp, 0, 0, 32),
- {"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},
- OPT_FLOATRANGE("panscanrange", vo_panscanrange, 0, -19.0, 99.0),
-
- {"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)
+ OPT_INTRANGE("x", screen_size_x, 0, 0, 4096),
+ OPT_INTRANGE("y", screen_size_y, 0, 0, 4096),
+ // set screen dimensions (when not detectable or virtual!=visible)
+ OPT_INTRANGE("screenw", vo_screenwidth, CONF_OLD, 0, 4096),
+ OPT_INTRANGE("screenh", vo_screenheight, CONF_OLD, 0, 4096),
+ // Geometry string
+ {"geometry", &vo_geometry, CONF_TYPE_STRING, 0, 0, 0, NULL},
+ OPT_FLAG_ON("force-window-position", force_window_position, 0),
+ OPT_FLAG_OFF("noforce-window-position", force_window_position, 0),
+ // 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
+ OPT_FLOATRANGE("monitoraspect", force_monitor_aspect, 0, 0.0, 9.0),
+ OPT_FLOATRANGE("monitorpixelaspect", monitor_pixel_aspect, 0, 0.2, 9.0),
+ // video mode switching: (x11,xv,dga)
+ OPT_FLAG_ON("vm", vidmode, 0),
+ OPT_FLAG_OFF("novm", vidmode, 0),
+ // start in fullscreen mode:
+ OPT_FLAG_ON("fs", fullscreen, 0),
+ OPT_FLAG_OFF("nofs", fullscreen, 0),
+ // 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?)
+ OPT_INTRANGE("bpp", vo_dbpp, 0, 0, 32),
+ {"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},
+ OPT_FLOATRANGE("panscanrange", vo_panscanrange, 0, -19.0, 99.0),
+
+ {"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:<number> 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},
+ // x11,xv,xmga,xvidix
+ {"icelayer", "-icelayer has been removed. Use -fstype layer:<number> 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},
+ {"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},
+ {"xineramascreen", &xinerama_screen, CONF_TYPE_INT, CONF_RANGE, -2, 32, NULL},
- OPT_INTRANGE("brightness", vo_gamma_brightness, 0, -100, 100),
- OPT_INTRANGE("saturation", vo_gamma_saturation, 0, -100, 100),
- OPT_INTRANGE("contrast", vo_gamma_contrast, 0, -100, 100),
- OPT_INTRANGE("hue", vo_gamma_hue, 0, -100, 100),
- {"keepaspect", &vo_keepaspect, CONF_TYPE_FLAG, 0, 0, 1, NULL},
- {"nokeepaspect", &vo_keepaspect, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+ OPT_INTRANGE("brightness", vo_gamma_brightness, 0, -100, 100),
+ OPT_INTRANGE("saturation", vo_gamma_saturation, 0, -100, 100),
+ OPT_INTRANGE("contrast", vo_gamma_contrast, 0, -100, 100),
+ OPT_INTRANGE("hue", vo_gamma_hue, 0, -100, 100),
+ {"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},
+ // 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-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},
+ {"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
- OPT_INTRANGE("osdlevel", osd_level, 0, 0, 3),
- OPT_INTRANGE("osd-duration", osd_duration, 0, 0, 3600000),
+ OPT_INTRANGE("osdlevel", osd_level, 0, 0, 3),
+ OPT_INTRANGE("osd-duration", osd_duration, 0, 0, 3600000),
#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},
+ {"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},
+ {"autoq", &auto_quality, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL},
- {"benchmark", &benchmark, CONF_TYPE_FLAG, 0, 0, 1, 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},
+ // 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
// these should be removed when gmplayer is forgotten
{"gui", "Internal GUI was removed. Use some other frontend instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
{"nogui", "Internal GUI was removed, -nogui is no longer valid.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL},
- OPT_FLAG_CONSTANTS("noloop", loop_times, 0, 0, -1),
- OPT_INTRANGE("loop", loop_times, 0, -1, 10000),
- {"playlist", NULL, CONF_TYPE_STRING, 0, 0, 0, NULL},
+ OPT_FLAG_CONSTANTS("noloop", loop_times, 0, 0, -1),
+ OPT_INTRANGE("loop", loop_times, 0, -1, 10000),
+ {"playlist", NULL, CONF_TYPE_STRING, 0, 0, 0, NULL},
- OPT_FLAG_ON("ordered-chapters", ordered_chapters, 0),
- OPT_FLAG_OFF("noordered-chapters", ordered_chapters, 0),
+ OPT_FLAG_ON("ordered-chapters", ordered_chapters, 0),
+ OPT_FLAG_OFF("noordered-chapters", ordered_chapters, 0),
- // a-v sync stuff:
- OPT_FLAG_ON("correct-pts", user_correct_pts, 0),
- OPT_FLAG_OFF("nocorrect-pts", user_correct_pts, 0),
- OPT_INTRANGE("pts-association-mode", user_pts_assoc_mode, 0, 0, 2),
- {"noautosync", &autosync, CONF_TYPE_FLAG, 0, 0, -1, NULL},
- {"autosync", &autosync, CONF_TYPE_INT, CONF_RANGE, 0, 10000, NULL},
+ // a-v sync stuff:
+ OPT_FLAG_ON("correct-pts", user_correct_pts, 0),
+ OPT_FLAG_OFF("nocorrect-pts", user_correct_pts, 0),
+ OPT_INTRANGE("pts-association-mode", user_pts_assoc_mode, 0, 0, 2),
+ {"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},
+ {"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},
- OPT_INTRANGE("key-fifo-size", key_fifo_size, CONF_GLOBAL, 2, 65000),
- {"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},
- OPT_INTRANGE("doubleclick-time", doubleclick_time, 0, 0, 1000),
+ {"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},
+ OPT_INTRANGE("key-fifo-size", key_fifo_size, CONF_GLOBAL, 2, 65000),
+ {"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},
+ OPT_INTRANGE("doubleclick-time", doubleclick_time, 0, 0, 1000),
#ifdef CONFIG_TV
- {"tvscan", (void *) tvscan_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ {"tvscan", (void *) 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", (void *) help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
- {"help", (void *) help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
- {"h", (void *) 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", (void *) help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
+ {"help", (void *) help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
+ {"h", (void *) help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
- {"vd", (void *) vd_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
- {NULL, NULL, 0, 0, 0, 0, NULL}
+ {"vd", (void *) vd_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+ {NULL, NULL, 0, 0, 0, 0, NULL}
};
#endif /* MPLAYER_CFG_MPLAYER_H */
diff --git a/codec-cfg.c b/codec-cfg.c
index 39a2f59a09..168529fd8c 100644
--- a/codec-cfg.c
+++ b/codec-cfg.c
@@ -67,393 +67,393 @@
#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
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;
-
- /* 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;
+ 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;
err_out_duplicated:
- mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"duplicated FourCC");
- return 0;
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"duplicated FourCC");
+ return 0;
err_out_too_many:
- mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"too many FourCCs/formats...");
- return 0;
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"too many FourCCs/formats...");
+ return 0;
err_out_parse_error:
- mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error");
- return 0;
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error");
+ return 0;
}
static int add_to_format(char *s, char *alias,unsigned int *fourcc, unsigned int *fourccmap)
{
- 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_tmsg(MSGT_CODECCFG,MSGL_ERR,"too many FourCCs/formats...");
- return 0;
- }
-
- fourcc[i]=strtoul(s,&endptr,0);
- if (*endptr != '\0') {
- mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error (format ID not a number?)");
- return 0;
- }
-
- if(alias){
- fourccmap[i]=strtoul(alias,&endptr,0);
- if (*endptr != '\0') {
- mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error (format ID alias not a number?)");
- return 0;
- }
- } else
- fourccmap[i]=fourcc[i];
-
- for (j = 0; j < i; j++)
- if (fourcc[j] == fourcc[i]) {
- mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"duplicated format ID");
- return 0;
- }
-
- return 1;
+ 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_tmsg(MSGT_CODECCFG,MSGL_ERR,"too many FourCCs/formats...");
+ return 0;
+ }
+
+ fourcc[i]=strtoul(s,&endptr,0);
+ if (*endptr != '\0') {
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error (format ID not a number?)");
+ return 0;
+ }
+
+ if(alias){
+ fourccmap[i]=strtoul(alias,&endptr,0);
+ if (*endptr != '\0') {
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error (format ID alias not a number?)");
+ return 0;
+ }
+ } else
+ fourccmap[i]=fourcc[i];
+
+ for (j = 0; j < i; j++)
+ if (fourcc[j] == fourcc[i]) {
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"duplicated format ID");
+ 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 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<<j);
- sflags+=strlen(flagstr[j]);
- } while (*(sflags++) == ',');
-
- if (*(--sflags) != '\0')
- goto err_out_parse_error;
- }
-
- do {
- for (j = 0; fmt_table[j].name != NULL; j++)
- if (!strncmp(sfmt, fmt_table[j].name, strlen(fmt_table[j].name)))
- break;
- if (fmt_table[j].name == NULL)
- goto err_out_parse_error;
- outfmt[i] = fmt_table[j].num;
- outflags[i] = flags;
- ++i;
- sfmt+=strlen(fmt_table[j].name);
- } while ((*(sfmt++) == ',') && --freeslots);
-
- if (!freeslots)
- goto err_out_too_many;
-
- if (*(--sfmt) != '\0')
- goto err_out_parse_error;
-
- return 1;
+ 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<<j);
+ sflags+=strlen(flagstr[j]);
+ } while (*(sflags++) == ',');
+
+ if (*(--sflags) != '\0')
+ goto err_out_parse_error;
+ }
+
+ do {
+ for (j = 0; fmt_table[j].name != NULL; j++)
+ if (!strncmp(sfmt, fmt_table[j].name, strlen(fmt_table[j].name)))
+ break;
+ if (fmt_table[j].name == NULL)
+ goto err_out_parse_error;
+ outfmt[i] = fmt_table[j].num;
+ outflags[i] = flags;
+ ++i;
+ sfmt+=strlen(fmt_table[j].name);
+ } while ((*(sfmt++) == ',') && --freeslots);
+
+ if (!freeslots)
+ goto err_out_too_many;
+
+ if (*(--sfmt) != '\0')
+ goto err_out_parse_error;
+
+ return 1;
err_out_too_many:
- mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"too many out...");
- return 0;
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"too many out...");
+ return 0;
err_out_parse_error:
- mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error");
- return 0;
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error");
+ return 0;
}
#if 0
static short get_driver(char *s,int audioflag)
{
- static char *audiodrv[] = {
- "null",
- "mp3lib",
- "pcm",
- "libac3",
- "acm",
- "alaw",
- "msgsm",
- "dshow",
- "dvdpcm",
- "hwac3",
- "libvorbis",
- "ffmpeg",
- "libmad",
- "msadpcm",
- "liba52",
- "g72x",
- "imaadpcm",
- "dk4adpcm",
- "dk3adpcm",
- "roqaudio",
- "faad",
- "realaud",
- "libdv",
- NULL
- };
- static char *videodrv[] = {
- "null",
- "libmpeg2",
- "vfw",
- "dshow",
- "ffmpeg",
- "vfwex",
- "raw",
- "msrle",
- "xanim",
- "msvidc",
- "fli",
- "cinepak",
- "qtrle",
- "nuv",
- "cyuv",
- "qtsmc",
- "ducktm1",
- "roqvideo",
- "qtrpza",
- "mpng",
- "ijpg",
- "zlib",
- "mpegpes",
- "zrmjpeg",
- "realvid",
- "xvid",
- "libdv",
- NULL
- };
- char **drv=audioflag?audiodrv:videodrv;
- int i;
-
- for(i=0;drv[i];i++) if(!strcmp(s,drv[i])) return i;
-
- return -1;
+ static char *audiodrv[] = {
+ "null",
+ "mp3lib",
+ "pcm",
+ "libac3",
+ "acm",
+ "alaw",
+ "msgsm",
+ "dshow",
+ "dvdpcm",
+ "hwac3",
+ "libvorbis",
+ "ffmpeg",
+ "libmad",
+ "msadpcm",
+ "liba52",
+ "g72x",
+ "imaadpcm",
+ "dk4adpcm",
+ "dk3adpcm",
+ "roqaudio",
+ "faad",
+ "realaud",
+ "libdv",
+ NULL
+ };
+ static char *videodrv[] = {
+ "null",
+ "libmpeg2",
+ "vfw",
+ "dshow",
+ "ffmpeg",
+ "vfwex",
+ "raw",
+ "msrle",
+ "xanim",
+ "msvidc",
+ "fli",
+ "cinepak",
+ "qtrle",
+ "nuv",
+ "cyuv",
+ "qtsmc",
+ "ducktm1",
+ "roqvideo",
+ "qtrpza",
+ "mpng",
+ "ijpg",
+ "zlib",
+ "mpegpes",
+ "zrmjpeg",
+ "realvid",
+ "xvid",
+ "libdv",
+ NULL
+ };
+ char **drv=audioflag?audiodrv:videodrv;
+ int i;
+
+ for(i=0;drv[i];i++) if(!strcmp(s,drv[i])) return i;
+
+ return -1;
}
#endif
static int validate_codec(codecs_t *c, int type)
{
- unsigned int i;
- char *tmp_name = c->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_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) name is not valid!\n", c->name);
- return 0;
- }
+ if (i < strlen(tmp_name)) {
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) name is not valid!\n", 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_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) does not have FourCC/format!\n", c->name);
- return 0;
- }
+ if (c->fourcc[0] == 0xffffffff) {
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) does not have FourCC/format!\n", c->name);
+ return 0;
+ }
#endif
- if (!c->drv) {
- mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) does not have a driver!\n", c->name);
- return 0;
- }
+ if (!c->drv) {
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) does not have a driver!\n", 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_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) needs a 'dll'!\n", c->name);
- return 0;
- }
+ if (!c->dll && (c->driver == 4 ||
+ (c->driver == 2 && type == TYPE_VIDEO))) {
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) needs a 'dll'!\n", 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_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) needs an 'outfmt'!\n", c->name);
- return 0;
- }
+ if (type == TYPE_VIDEO)
+ if (c->outfmt[0] == 0xffffffff) {
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"\ncodec(%s) needs an 'outfmt'!\n", c->name);
+ return 0;
+ }
#endif
- return 1;
+ return 1;
}
static int add_comment(char *s, char **d)
{
- int pos;
-
- if (!*d)
- pos = 0;
- else {
- pos = strlen(*d);
- (*d)[pos++] = '\n';
- }
- if (!(*d = realloc(*d, pos + strlen(s) + 1))) {
- mp_tmsg(MSGT_CODECCFG,MSGL_FATAL,"Can't allocate memory for comment. ");
- return 0;
- }
- strcpy(*d + pos, s);
- return 1;
+ int pos;
+
+ if (!*d)
+ pos = 0;
+ else {
+ pos = strlen(*d);
+ (*d)[pos++] = '\n';
+ }
+ if (!(*d = realloc(*d, pos + strlen(s) + 1))) {
+ mp_tmsg(MSGT_CODECCFG,MSGL_FATAL,"Can't allocate memory for comment. ");
+ 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<<i;
- s += strlen(flagstr[i]);
- } while (*(s++) == ',');
-
- if (*(--s) != '\0')
- goto err_out_parse_error;
-
- return flags;
+ 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<<i;
+ s += strlen(flagstr[i]);
+ } while (*(s++) == ',');
+
+ if (*(--s) != '\0')
+ goto err_out_parse_error;
+
+ return flags;
err_out_parse_error:
- return 0;
+ return 0;
}
static FILE *fp;
@@ -464,61 +464,61 @@ static int read_nextline = 1;
static int get_token(int min, int max)
{
- static int line_pos;
- int i;
- char c;
-
- if (max >= MAX_NR_TOKEN) {
- mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"get_token(): max >= MAX_MR_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_tmsg(MSGT_CODECCFG,MSGL_ERR,"get_token(): max >= MAX_MR_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;
@@ -528,398 +528,394 @@ static int nr_acodecs = 0;
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;
+ 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();
+ // in case we call it a second time
+ codecs_uninit_free();
- nr_vcodecs = 0;
- nr_acodecs = 0;
+ nr_vcodecs = 0;
+ nr_acodecs = 0;
- if(cfgfile==NULL) {
+ 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_tmsg(MSGT_CODECCFG,MSGL_V,"Reading %s: ", cfgfile);
-
- if ((fp = fopen(cfgfile, "r")) == NULL) {
- mp_tmsg(MSGT_CODECCFG,MSGL_V,"Can't open '%s': %s\n", cfgfile, strerror(errno));
- return 0;
- }
-
- if ((line = malloc(MAX_LINE_LEN + 1)) == NULL) {
- mp_tmsg(MSGT_CODECCFG,MSGL_FATAL,"Can't get memory for 'line': %s\n", 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_tmsg(MSGT_CODECCFG,MSGL_V,"Reading %s: ", cfgfile);
+
+ if ((fp = fopen(cfgfile, "r")) == NULL) {
+ mp_tmsg(MSGT_CODECCFG,MSGL_V,"Can't open '%s': %s\n", cfgfile, strerror(errno));
+ return 0;
+ }
+
+ if ((line = malloc(MAX_LINE_LEN + 1)) == NULL) {
+ mp_tmsg(MSGT_CODECCFG,MSGL_FATAL,"Can't get memory for 'line': %s\n", 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;
#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_tmsg(MSGT_CODECCFG,MSGL_FATAL,"Can't realloc '*codecsp': %s\n", 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_tmsg(MSGT_CODECCFG,MSGL_ERR,"Codec name '%s' isn't unique.", token[0]);
- goto err_out_print_linenum;
- }
- }
- if (!(codec->name = strdup(token[0]))) {
- mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'name': %s\n", 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_tmsg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'info': %s\n", 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_tmsg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'driver': %s\n", 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_tmsg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'dll': %s", 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_tmsg(MSGT_CODECCFG,MSGL_INFO,"%d audio & %d video codecs\n", 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_tmsg(MSGT_CODECCFG,MSGL_FATAL,"Can't realloc '*codecsp': %s\n", 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_tmsg(MSGT_CODECCFG,MSGL_ERR,"Codec name '%s' isn't unique.", token[0]);
+ goto err_out_print_linenum;
+ }
+ }
+ if (!(codec->name = strdup(token[0]))) {
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'name': %s\n", 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_tmsg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'info': %s\n", 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_tmsg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'driver': %s\n", 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_tmsg(MSGT_CODECCFG,MSGL_ERR,"Can't strdup -> 'dll': %s", 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_tmsg(MSGT_CODECCFG,MSGL_INFO,"%d audio & %d video codecs\n", 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_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error");
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"parse error");
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_tmsg(MSGT_CODECCFG,MSGL_ERR,"Codec is not defined correctly.");
- goto err_out_print_linenum;
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"Codec is not defined correctly.");
+ goto err_out_print_linenum;
err_out_release_num:
- mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"This codecs.conf is too old and incompatible with this MPlayer release!");
- goto err_out_print_linenum;
+ mp_tmsg(MSGT_CODECCFG,MSGL_ERR,"This codecs.conf is too old and incompatible with this MPlayer release!");
+ 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){
int c;
@@ -933,251 +929,250 @@ void wrapline(FILE *f2,char *s){
}
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;d<CODECS_MAX_FOURCC;d++)
- if(!d || codec->fourcc[d]!=0xFFFFFFFF)
- fprintf(f2,"%s%.4s",d?"<br>":"",(codec->fourcc[d]==0xFFFFFFFF || codec->fourcc[d]<0x20202020)?!d?"-":"":(char*) &codec->fourcc[d]);
- break;
- case 'f':
- for(d=0;d<CODECS_MAX_FOURCC;d++)
- if(codec->fourcc[d]!=0xFFFFFFFF)
- fprintf(f2,"%s0x%X",d?"<br>":"",codec->fourcc[d]);
- break;
- case 'Y':
- for(d=0;d<CODECS_MAX_OUTFMT;d++)
- if(codec->outfmt[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?"<br>":"",fmt_table[c].name);
- }
- break;
- default:
- fputc(c,f2);
- fputc(d,f2);
- }
+ 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;d<CODECS_MAX_FOURCC;d++)
+ if(!d || codec->fourcc[d]!=0xFFFFFFFF)
+ fprintf(f2,"%s%.4s",d?"<br>":"",(codec->fourcc[d]==0xFFFFFFFF || codec->fourcc[d]<0x20202020)?!d?"-":"":(char*) &codec->fourcc[d]);
+ break;
+ case 'f':
+ for(d=0;d<CODECS_MAX_FOURCC;d++)
+ if(codec->fourcc[d]!=0xFFFFFFFF)
+ fprintf(f2,"%s0x%X",d?"<br>":"",codec->fourcc[d]);
+ break;
+ case 'Y':
+ for(d=0;d<CODECS_MAX_OUTFMT;d++)
+ if(codec->outfmt[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?"<br>":"",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 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 <stddef.h>\n");
- printf("#include \"codec-cfg.h\"\n\n");
-
- 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 (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 <stddef.h>\n");
+ printf("#include \"codec-cfg.h\"\n\n");
+
+ 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<nr_codecs;i++){
- fseek(f1,pos,SEEK_SET);
- switch(section){
- case 0:
- case 5:
- if(cl[i].status==CODECS_STATUS_WORKING)
-// if(!(!strcmp(cl[i].drv,"vfw") || !strcmp(cl[i].drv,"dshow") || !strcmp(cl[i].drv,"vfwex") || !strcmp(cl[i].drv,"acm")))
- parsehtml(f1,f2,&cl[i],section,dshow);
- break;
+ 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;
+ }
+ 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<nr_codecs;i++){
+ fseek(f1,pos,SEEK_SET);
+ switch(section){
+ case 0:
+ case 5:
+ if(cl[i].status==CODECS_STATUS_WORKING)
+// if(!(!strcmp(cl[i].drv,"vfw") || !strcmp(cl[i].drv,"dshow") || !strcmp(cl[i].drv,"vfwex") || !strcmp(cl[i].drv,"acm")))
+ parsehtml(f1,f2,&cl[i],section,dshow);
+ break;
#if 0
- case 1:
- case 6:
- if(cl[i].status==CODECS_STATUS_WORKING)
- if((!strcmp(cl[i].drv,"vfw") || !strcmp(cl[i].drv,"dshow") || !strcmp(cl[i].drv,"vfwex") || !strcmp(cl[i].drv,"acm")))
- parsehtml(f1,f2,&cl[i],section,dshow);
- break;
-#endif
- case 2:
- case 7:
- if(cl[i].status==CODECS_STATUS_PROBLEMS)
+ case 1:
+ case 6:
+ if(cl[i].status==CODECS_STATUS_WORKING)
+ if((!strcmp(cl[i].drv,"vfw") || !strcmp(cl[i].drv,"dshow") || !strcmp(cl[i].drv,"vfwex") || !strcmp(cl[i].drv,"acm")))
parsehtml(f1,f2,&cl[i],section,dshow);
- break;
- case 3:
- case 8:
- if(cl[i].status==CODECS_STATUS_NOT_WORKING)
- parsehtml(f1,f2,&cl[i],section,dshow);
- break;
- case 4:
- case 9:
- if(cl[i].status==CODECS_STATUS_UNTESTED)
- parsehtml(f1,f2,&cl[i],section,dshow);
- break;
- default:
- printf("Warning! unimplemented section: %d\n",section);
- }
+ break;
+#endif
+ case 2:
+ case 7:
+ if(cl[i].status==CODECS_STATUS_PROBLEMS)
+ parsehtml(f1,f2,&cl[i],section,dshow);
+ break;
+ case 3:
+ case 8:
+ if(cl[i].status==CODECS_STATUS_NOT_WORKING)
+ parsehtml(f1,f2,&cl[i],section,dshow);
+ break;
+ case 4:
+ case 9:
+ if(cl[i].status==CODECS_STATUS_UNTESTED)
+ parsehtml(f1,f2,&cl[i],section,dshow);
+ break;
+ default:
+ printf("Warning! unimplemented section: %d\n",section);
}
- fseek(f1,pos,SEEK_SET);
- skiphtml(f1);
+ }
+ fseek(f1,pos,SEEK_SET);
+ skiphtml(f1);
//void parsehtml(FILE *f1,FILE *f2,codecs_t *codec,int section,int dshow){
- continue;
- }
- fputc(c,f2);
- fputc(d,f2);
+ continue;
}
+ fputc(c,f2);
+ fputc(d,f2);
+ }
- fclose(f2);
- fclose(f1);
- return 0;
+ fclose(f2);
+ fclose(f1);
+ return 0;
}
#endif
@@ -1185,69 +1180,69 @@ int main(int argc, char* argv[])
#ifdef TESTING
int main(void)
{
- codecs_t *c;
- int i,j, nr_codecs, state;
-
- if (!(parse_codec_cfg("etc/codecs.conf")))
- return 0;
- if (!video_codecs)
- printf("no videoconfig.\n");
- if (!audio_codecs)
- printf("no audioconfig.\n");
-
- printf("videocodecs:\n");
- c = video_codecs;
- nr_codecs = nr_vcodecs;
- state = 0;
+ codecs_t *c;
+ int i,j, nr_codecs, state;
+
+ if (!(parse_codec_cfg("etc/codecs.conf")))
+ return 0;
+ if (!video_codecs)
+ printf("no videoconfig.\n");
+ if (!audio_codecs)
+ printf("no audioconfig.\n");
+
+ printf("videocodecs:\n");
+ c = video_codecs;
+ nr_codecs = nr_vcodecs;
+ state = 0;
next:
- if (c) {
- printf("number of %scodecs: %d\n", state==0?"video":"audio",
- nr_codecs);
- for(i=0;i<nr_codecs;i++, c++){
- printf("\n============== %scodec %02d ===============\n",
- state==0?"video":"audio",i);
- printf("name='%s'\n",c->name);
- 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;j<CODECS_MAX_FOURCC;j++){
- if(c->fourcc[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;j<CODECS_MAX_OUTFMT;j++){
- if(c->outfmt[j]!=0xFFFFFFFF){
- printf("outfmt %02d: %08X (%.4s) flags: %d\n",j,c->outfmt[j],(char *) &c->outfmt[j],c->outflags[j]);
- }
- }
-
- for(j=0;j<CODECS_MAX_INFMT;j++){
- if(c->infmt[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;i<nr_codecs;i++, c++){
+ printf("\n============== %scodec %02d ===============\n",
+ state==0?"video":"audio",i);
+ printf("name='%s'\n",c->name);
+ 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;j<CODECS_MAX_FOURCC;j++){
+ if(c->fourcc[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;j<CODECS_MAX_OUTFMT;j++){
+ if(c->outfmt[j]!=0xFFFFFFFF){
+ printf("outfmt %02d: %08X (%.4s) flags: %d\n",j,c->outfmt[j],(char *) &c->outfmt[j],c->outflags[j]);
+ }
+ }
+
+ for(j=0;j<CODECS_MAX_INFMT;j++){
+ if(c->infmt[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 --git a/codec-cfg.h b/codec-cfg.h
index 3522f68a48..bf1fed56a8 100644
--- a/codec-cfg.h
+++ b/codec-cfg.h
@@ -19,60 +19,60 @@
#ifndef MPLAYER_CODEC_CFG_H
#define MPLAYER_CODEC_CFG_H
-#define CODEC_CFG_MIN 20070407
+#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_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_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
#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 {
- 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;
+ 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 --git a/command.c b/command.c
index 80babbd429..3c551f27c6 100644
--- a/command.c
+++ b/command.c
@@ -78,29 +78,29 @@ static void rescale_input_coordinates(struct MPContext *mpctx, int ix, int iy,
struct MPOpts *opts = &mpctx->opts;
struct vo *vo = mpctx->video_out;
//remove the borders, if any, and rescale to the range [0,1],[0,1]
- if (vo_fs) { //we are in full-screen mode
- if (opts->vo_screenwidth > vo->dwidth) //there are borders along the x axis
- ix -= (opts->vo_screenwidth - vo->dwidth) / 2;
- if (opts->vo_screenheight > vo->dheight) //there are borders along the y axis (usual way)
- iy -= (opts->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 (opts->vo_screenwidth > vo->dwidth) //there are borders along the x axis
+ ix -= (opts->vo_screenwidth - vo->dwidth) / 2;
+ if (opts->vo_screenheight > vo->dheight) //there are borders along the y axis (usual way)
+ iy -= (opts->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: %.3f, %.3f, screen (%d x %d), vodisplay: (%d, %d), fullscreen: %d\r\n",
- *dx, *dy, opts->vo_screenwidth, opts->vo_screenheight, vo->dwidth,
- vo->dheight, vo_fs);
+ "\r\nrescaled coordinates: %.3f, %.3f, screen (%d x %d), vodisplay: (%d, %d), fullscreen: %d\r\n",
+ *dx, *dy, opts->vo_screenwidth, opts->vo_screenheight, vo->dwidth,
+ vo->dheight, vo_fs);
}
static int sub_source_by_pos(MPContext *mpctx, int pos)
@@ -109,11 +109,11 @@ static int sub_source_by_pos(MPContext *mpctx, int pos)
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;
}
@@ -140,26 +140,26 @@ static void log_sub(struct MPContext *mpctx)
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",
+ fprintf(f,
+ "N: %s S: %02ld:%02ld:%02ld.%02ld E: %02ld:%02ld:%02ld.%02ld\n",
mpctx->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);
+ (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", mpctx->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);
}
@@ -174,7 +174,7 @@ static void log_sub(struct MPContext *mpctx)
/// OSD level (RW)
static int mp_property_osdlevel(m_option_t *prop, int action, void *arg,
- MPContext *mpctx)
+ MPContext *mpctx)
{
return m_property_choice(prop, action, arg, &mpctx->opts.osd_level);
}
@@ -200,45 +200,45 @@ static int mp_property_loop(m_option_t *prop, int action, void *arg,
/// Playback speed (RW)
static int mp_property_playback_speed(m_option_t *prop, int action,
- void *arg, MPContext *mpctx)
+ void *arg, MPContext *mpctx)
{
struct MPOpts *opts = &mpctx->opts;
switch (action) {
case M_PROPERTY_SET:
- if (!arg)
- return M_PROPERTY_ERROR;
- M_PROPERTY_CLAMP(prop, *(float *) arg);
- opts->playback_speed = *(float *) arg;
- build_afilter_chain(mpctx, mpctx->sh_audio, &ao_data);
- return M_PROPERTY_OK;
+ if (!arg)
+ return M_PROPERTY_ERROR;
+ M_PROPERTY_CLAMP(prop, *(float *) arg);
+ opts->playback_speed = *(float *) arg;
+ build_afilter_chain(mpctx, mpctx->sh_audio, &ao_data);
+ return M_PROPERTY_OK;
case M_PROPERTY_STEP_UP:
case M_PROPERTY_STEP_DOWN:
- opts->playback_speed += (arg ? *(float *) arg : 0.1) *
- (action == M_PROPERTY_STEP_DOWN ? -1 : 1);
- M_PROPERTY_CLAMP(prop, opts->playback_speed);
- build_afilter_chain(mpctx, mpctx->sh_audio, &ao_data);
- return M_PROPERTY_OK;
+ opts->playback_speed += (arg ? *(float *) arg : 0.1) *
+ (action == M_PROPERTY_STEP_DOWN ? -1 : 1);
+ M_PROPERTY_CLAMP(prop, opts->playback_speed);
+ build_afilter_chain(mpctx, mpctx->sh_audio, &ao_data);
+ return M_PROPERTY_OK;
}
return m_property_float_range(prop, action, arg, &opts->playback_speed);
}
/// filename with path (RO)
static int mp_property_path(m_option_t *prop, int action, void *arg,
- MPContext *mpctx)
+ MPContext *mpctx)
{
return m_property_string_ro(prop, action, arg, mpctx->filename);
}
/// filename without path (RO)
static int mp_property_filename(m_option_t *prop, int action, void *arg,
- MPContext *mpctx)
+ MPContext *mpctx)
{
char *f;
if (!mpctx->filename)
- return M_PROPERTY_UNAVAILABLE;
+ return M_PROPERTY_UNAVAILABLE;
if (((f = strrchr(mpctx->filename, '/'))
|| (f = strrchr(mpctx->filename, '\\'))) && f[1])
- f++;
+ f++;
else
f = mpctx->filename;
return m_property_string_ro(prop, action, arg, f);
@@ -246,86 +246,86 @@ static int mp_property_filename(m_option_t *prop, int action, void *arg,
/// Demuxer name (RO)
static int mp_property_demuxer(m_option_t *prop, int action, void *arg,
- MPContext *mpctx)
+ 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)
+ 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)
+ 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)
+ 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)
+ 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)
+ 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);
}
@@ -336,7 +336,7 @@ static int mp_property_percent_pos(m_option_t *prop, int action,
int pos;
if (!mpctx->demuxer)
- return M_PROPERTY_UNAVAILABLE;
+ return M_PROPERTY_UNAVAILABLE;
switch(action) {
case M_PROPERTY_SET:
@@ -549,7 +549,7 @@ static int mp_property_metadata(m_option_t *prop, int action, void *arg,
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:
@@ -582,10 +582,10 @@ static int mp_property_pause(m_option_t *prop, int action, void *arg,
switch (action) {
case M_PROPERTY_SET:
- if (!arg)
- return M_PROPERTY_ERROR;
- if (mpctx->paused == (bool)*(int *) arg)
- return M_PROPERTY_OK;
+ if (!arg)
+ return M_PROPERTY_ERROR;
+ if (mpctx->paused == (bool)*(int *) arg)
+ return M_PROPERTY_OK;
case M_PROPERTY_STEP_UP:
case M_PROPERTY_STEP_DOWN:
if (mpctx->paused) {
@@ -596,9 +596,9 @@ static int mp_property_pause(m_option_t *prop, int action, void *arg,
pause_player(mpctx);
mpctx->osd_function = OSD_PAUSE;
}
- return M_PROPERTY_OK;
+ return M_PROPERTY_OK;
default:
- return m_property_flag(prop, action, arg, &mpctx->paused);
+ return m_property_flag(prop, action, arg, &mpctx->paused);
}
}
@@ -611,128 +611,128 @@ static int mp_property_pause(m_option_t *prop, int action, void *arg,
/// Volume (RW)
static int mp_property_volume(m_option_t *prop, int action, void *arg,
- MPContext *mpctx)
+ 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;
+ 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;
+ 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 && *(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)
+ 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(mp_gtext("enabled (EDL)"));
- return M_PROPERTY_OK;
- }
+ if (!arg)
+ return M_PROPERTY_ERROR;
+ if (mpctx->edl_muted) {
+ *(char **) arg = strdup(mp_gtext("enabled (EDL)"));
+ 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)
+ 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)
+ 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);
}
@@ -741,25 +741,25 @@ 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)
+ 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)
+ 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;
@@ -772,84 +772,84 @@ static int mp_property_samplerate(m_option_t *prop, int action, void *arg,
/// Number of channels (RO)
static int mp_property_channels(m_option_t *prop, int action, void *arg,
- MPContext *mpctx)
+ 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)
+ 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;
- }
+ 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;
+ 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;
+ 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)
+ MPContext *mpctx)
{
struct MPOpts *opts = &mpctx->opts;
int current_id, tmp;
@@ -859,73 +859,73 @@ static int mp_property_audio(m_option_t *prop, int action, void *arg,
switch (action) {
case M_PROPERTY_GET:
- if (!arg)
- return M_PROPERTY_ERROR;
- *(int *) arg = current_id;
- return M_PROPERTY_OK;
+ if (!arg)
+ return M_PROPERTY_ERROR;
+ *(int *) arg = current_id;
+ return M_PROPERTY_OK;
case M_PROPERTY_PRINT:
- if (!arg)
- return M_PROPERTY_ERROR;
+ if (!arg)
+ return M_PROPERTY_ERROR;
- if (current_id < 0)
- *(char **) arg = strdup(mp_gtext("disabled"));
- else {
- char lang[40];
+ if (current_id < 0)
+ *(char **) arg = strdup(mp_gtext("disabled"));
+ else {
+ char lang[40];
strncpy(lang, mp_gtext("unknown"), sizeof(lang));
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, current_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, current_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", current_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 (action == M_PROPERTY_SET && arg)
- tmp = *((int *) arg);
- else
- tmp = -1;
+ if (action == M_PROPERTY_SET && arg)
+ tmp = *((int *) arg);
+ else
+ tmp = -1;
opts->audio_id = demuxer_switch_audio(mpctx->demuxer, tmp);
if (opts->audio_id == -2
|| (opts->audio_id > -1
- && mpctx->demuxer->audio->id != current_id && current_id != -2))
- uninit_player(mpctx, INITIALIZED_AO | INITIALIZED_ACODEC);
+ && mpctx->demuxer->audio->id != current_id && current_id != -2))
+ uninit_player(mpctx, INITIALIZED_AO | INITIALIZED_ACODEC);
if (opts->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(mpctx);
- }
- }
+ 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(mpctx);
+ }
+ }
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AUDIO_TRACK=%d\n", opts->audio_id);
- return M_PROPERTY_OK;
+ 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)
+ MPContext *mpctx)
{
struct MPOpts *opts = &mpctx->opts;
int current_id, tmp;
@@ -935,80 +935,80 @@ static int mp_property_video(m_option_t *prop, int action, void *arg,
switch (action) {
case M_PROPERTY_GET:
- if (!arg)
- return M_PROPERTY_ERROR;
- *(int *) arg = current_id;
- return M_PROPERTY_OK;
+ if (!arg)
+ return M_PROPERTY_ERROR;
+ *(int *) arg = current_id;
+ return M_PROPERTY_OK;
case M_PROPERTY_PRINT:
- if (!arg)
- return M_PROPERTY_ERROR;
+ if (!arg)
+ return M_PROPERTY_ERROR;
- if (current_id < 0)
- *(char **) arg = strdup(mp_gtext("disabled"));
- else {
- char lang[40];
+ if (current_id < 0)
+ *(char **) arg = strdup(mp_gtext("disabled"));
+ else {
+ char lang[40];
strncpy(lang, mp_gtext("unknown"), sizeof(lang));
- *(char **) arg = malloc(64);
- snprintf(*(char **) arg, 64, "(%d) %s", current_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 (action == M_PROPERTY_SET && arg)
- tmp = *((int *) arg);
- else
- tmp = -1;
+ if (action == M_PROPERTY_SET && arg)
+ tmp = *((int *) arg);
+ else
+ tmp = -1;
opts->video_id = demuxer_switch_video(mpctx->demuxer, tmp);
if (opts->video_id == -2
|| (opts->video_id > -1 && mpctx->demuxer->video->id != current_id
- && current_id != -2))
- uninit_player(mpctx, INITIALIZED_VCODEC |
+ && current_id != -2))
+ uninit_player(mpctx, INITIALIZED_VCODEC |
(mpctx->opts.fixed_vo && opts->video_id != -2 ? 0 : INITIALIZED_VO));
if (opts->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(mpctx);
- }
- }
+ 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(mpctx);
+ }
+ }
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_TRACK=%d\n", opts->video_id);
- return M_PROPERTY_OK;
+ 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)
+ 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;
-
- 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;
+ 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;
}
}
@@ -1020,56 +1020,56 @@ static int mp_property_program(m_option_t *prop, int action, void *arg,
/// Fullscreen state (RW)
static int mp_property_fullscreen(m_option_t *prop, int action, void *arg,
- MPContext *mpctx)
+ 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:
- if (mpctx->video_out->config_ok)
- vo_control(mpctx->video_out, VOCTRL_FULLSCREEN, 0);
+ if (mpctx->video_out->config_ok)
+ vo_control(mpctx->video_out, VOCTRL_FULLSCREEN, 0);
mpctx->opts.fullscreen = vo_fs;
- return M_PROPERTY_OK;
+ 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)
+ 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;
+ 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;
+ 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;
+ vf->control(vf, VFCTRL_GET_DEINTERLACE, &deinterlace);
+ deinterlace = !deinterlace;
+ vf->control(vf, VFCTRL_SET_DEINTERLACE, &deinterlace);
+ return M_PROPERTY_OK;
}
int value = 0;
vf->control(vf, VFCTRL_GET_DEINTERLACE, &value);
@@ -1086,15 +1086,15 @@ static int mp_property_yuv_colorspace(m_option_t *prop, int action,
int colorspace;
switch (action) {
case M_PROPERTY_GET:
- if (!arg)
- return M_PROPERTY_ERROR;
- if (vf->control(vf, VFCTRL_GET_YUV_COLORSPACE, arg) != true)
+ if (!arg)
+ return M_PROPERTY_ERROR;
+ if (vf->control(vf, VFCTRL_GET_YUV_COLORSPACE, arg) != true)
return M_PROPERTY_UNAVAILABLE;
- return M_PROPERTY_OK;
+ return M_PROPERTY_OK;
case M_PROPERTY_PRINT:
if (!arg)
return M_PROPERTY_ERROR;
- if (vf->control(vf, VFCTRL_GET_YUV_COLORSPACE, &colorspace) != true)
+ if (vf->control(vf, VFCTRL_GET_YUV_COLORSPACE, &colorspace) != true)
return M_PROPERTY_UNAVAILABLE;
char * const names[] = {"BT.601 (SD)", "BT.709 (HD)", "SMPTE-240M"};
if (colorspace < 0 || colorspace >= sizeof(names) / sizeof(names[0]))
@@ -1103,50 +1103,50 @@ static int mp_property_yuv_colorspace(m_option_t *prop, int action,
*(char**)arg = strdup(names[colorspace]);
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_YUV_COLORSPACE, arg);
- return M_PROPERTY_OK;
+ if (!arg)
+ return M_PROPERTY_ERROR;
+ M_PROPERTY_CLAMP(prop, *(int *) arg);
+ vf->control(vf, VFCTRL_SET_YUV_COLORSPACE, arg);
+ return M_PROPERTY_OK;
case M_PROPERTY_STEP_UP:;
- if (vf->control(vf, VFCTRL_GET_YUV_COLORSPACE, &colorspace) != true)
+ if (vf->control(vf, VFCTRL_GET_YUV_COLORSPACE, &colorspace) != true)
return M_PROPERTY_UNAVAILABLE;
- colorspace += 1;
- vf->control(vf, VFCTRL_SET_YUV_COLORSPACE, &colorspace);
- return M_PROPERTY_OK;
+ colorspace += 1;
+ vf->control(vf, VFCTRL_SET_YUV_COLORSPACE, &colorspace);
+ 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)
+ MPContext *mpctx)
{
if (!mpctx->video_out
- || vo_control(mpctx->video_out, VOCTRL_GET_PANSCAN, NULL) != VO_TRUE)
- return M_PROPERTY_UNAVAILABLE;
+ || vo_control(mpctx->video_out, 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;
- vo_control(mpctx->video_out, VOCTRL_SET_PANSCAN, NULL);
- return M_PROPERTY_OK;
+ if (!arg)
+ return M_PROPERTY_ERROR;
+ M_PROPERTY_CLAMP(prop, *(float *) arg);
+ vo_panscan = *(float *) arg;
+ vo_control(mpctx->video_out, 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;
- vo_control(mpctx->video_out, 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;
+ vo_control(mpctx->video_out, 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);
}
}
@@ -1154,32 +1154,32 @@ static int mp_property_panscan(m_option_t *prop, int action, void *arg,
/** \ingroup PropertyImplHelper
*/
static int mp_property_vo_flag(m_option_t *prop, int action, void *arg,
- int vo_ctrl, int *vo_var, MPContext *mpctx)
+ 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 (mpctx->video_out->config_ok)
- vo_control(mpctx->video_out, vo_ctrl, 0);
- return M_PROPERTY_OK;
+ if (mpctx->video_out->config_ok)
+ vo_control(mpctx->video_out, 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)
+ MPContext *mpctx)
{
return mp_property_vo_flag(prop, action, arg, VOCTRL_ONTOP,
&mpctx->opts.vo_ontop, mpctx);
@@ -1187,93 +1187,93 @@ static int mp_property_ontop(m_option_t *prop, int action, void *arg,
/// Display in the root window (RW)
static int mp_property_rootwin(m_option_t *prop, int action, void *arg,
- MPContext *mpctx)
+ 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)
+ 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)
+ 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 ? mp_gtext("enabled") :
- (frame_dropping == 2 ? mp_gtext("hard") :
- mp_gtext("disabled")));
- return M_PROPERTY_OK;
+ if (!arg)
+ return M_PROPERTY_ERROR;
+ *(char **) arg = strdup(frame_dropping == 1 ? mp_gtext("enabled") :
+ (frame_dropping == 2 ? mp_gtext("hard") :
+ mp_gtext("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)
+ MPContext *mpctx)
{
int *gamma = (int *)((char *)&mpctx->opts + (int)prop->priv);
int 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;
+ 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;
+ *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
@@ -1282,22 +1282,22 @@ static int mp_property_gamma(m_option_t *prop, int action, void *arg,
/// VSync (RW)
static int mp_property_vsync(m_option_t *prop, int action, void *arg,
- MPContext *mpctx)
+ 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)
+ 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;
@@ -1327,53 +1327,53 @@ 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)
+ 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)
+ 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)
+ 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)
+ 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)
+ 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);
}
@@ -1385,23 +1385,23 @@ static int mp_property_aspect(m_option_t *prop, int action, void *arg,
/// Text subtitle position (RW)
static int mp_property_sub_pos(m_option_t *prop, int action, void *arg,
- MPContext *mpctx)
+ MPContext *mpctx)
{
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)
+ MPContext *mpctx)
{
struct MPOpts *opts = &mpctx->opts;
demux_stream_t *const d_sub = mpctx->d_sub;
@@ -1414,47 +1414,47 @@ static int mp_property_sub(m_option_t *prop, int action, void *arg,
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 (mpctx->stream->type == STREAMTYPE_DVDNAV) {
if (vo_spudec && opts->sub_id >= 0) {
- unsigned char lang[3];
- if (mp_dvdnav_lang_from_sid(mpctx->stream, opts->sub_id, lang)) {
- snprintf(*(char **) arg, 63, "(%d) %s", opts->sub_id, lang);
- return M_PROPERTY_OK;
- }
- }
- }
+ unsigned char lang[3];
+ if (mp_dvdnav_lang_from_sid(mpctx->stream, opts->sub_id, lang)) {
+ snprintf(*(char **) arg, 63, "(%d) %s", opts->sub_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)
@@ -1462,69 +1462,69 @@ static int mp_property_sub(m_option_t *prop, int action, void *arg,
const char* lang = ((sh_sub_t*)d_sub->sh)->lang;
if (!lang) lang = mp_gtext("unknown");
snprintf(*(char **) arg, 63, "(%d) %s", opts->sub_id, lang);
- return M_PROPERTY_OK;
- }
-
- if (vo_vobsub && vobsub_id >= 0) {
- const char *language = mp_gtext("unknown");
- language = vobsub_get_id(vo_vobsub, (unsigned int) vobsub_id);
- snprintf(*(char **) arg, 63, "(%d) %s",
- vobsub_id, language ? language : mp_gtext("unknown"));
- return M_PROPERTY_OK;
- }
+ return M_PROPERTY_OK;
+ }
+
+ if (vo_vobsub && vobsub_id >= 0) {
+ const char *language = mp_gtext("unknown");
+ language = vobsub_get_id(vo_vobsub, (unsigned int) vobsub_id);
+ snprintf(*(char **) arg, 63, "(%d) %s",
+ vobsub_id, language ? language : mp_gtext("unknown"));
+ return M_PROPERTY_OK;
+ }
#ifdef CONFIG_DVDREAD
- if (vo_spudec && mpctx->stream->type == STREAMTYPE_DVD
+ if (vo_spudec && mpctx->stream->type == STREAMTYPE_DVD
&& opts->sub_id >= 0) {
- char lang[3];
+ char lang[3];
int code = dvd_lang_from_sid(mpctx->stream, opts->sub_id);
- lang[0] = code >> 8;
- lang[1] = code;
- lang[2] = 0;
+ lang[0] = code >> 8;
+ lang[1] = code;
+ lang[2] = 0;
snprintf(*(char **) arg, 63, "(%d) %s", opts->sub_id, lang);
- return M_PROPERTY_OK;
- }
+ return M_PROPERTY_OK;
+ }
#endif
if (opts->sub_id >= 0) {
snprintf(*(char **) arg, 63, "(%d) %s", opts->sub_id,
mp_gtext("unknown"));
- return M_PROPERTY_OK;
- }
- snprintf(*(char **) arg, 63, mp_gtext("disabled"));
- return M_PROPERTY_OK;
+ return M_PROPERTY_OK;
+ }
+ snprintf(*(char **) arg, 63, mp_gtext("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;
+ 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;
+ 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;
+ 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;
@@ -1532,9 +1532,9 @@ static int mp_property_sub(m_option_t *prop, int action, void *arg,
vobsub_id = -1;
opts->sub_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;
@@ -1543,55 +1543,55 @@ static int mp_property_sub(m_option_t *prop, int action, void *arg,
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 (opts->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
+ if (opts->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);
- }
+ {
+ subdata = mpctx->set_of_subtitles[mpctx->set_of_sub_pos];
+ vo_osd_changed(OSDTYPE_SUBTITLE);
+ }
} else if (source == SUB_SOURCE_DEMUX) {
opts->sub_id =
- mpctx->global_sub_pos - mpctx->global_sub_indices[SUB_SOURCE_DEMUX];
+ mpctx->global_sub_pos - mpctx->global_sub_indices[SUB_SOURCE_DEMUX];
if (d_sub && opts->sub_id < MAX_S_STREAMS) {
- int i = 0;
- // default: assume 1:1 mapping of sid and stream id
+ int i = 0;
+ // default: assume 1:1 mapping of sid and stream id
d_sub->id = opts->sub_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];
+ 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 == opts->sub_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(mpctx);
+ 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(mpctx);
#ifdef CONFIG_ASS
- else if (opts->ass_enabled)
- ass_track = sh->ass_track;
+ else if (opts->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)
+ && (mpctx->stream->type == STREAMTYPE_DVD
+ || mpctx->stream->type == STREAMTYPE_DVDNAV)
&& opts->sub_id < 0 && reset_spu) {
- d_sub->id = -2;
- d_sub->sh = NULL;
+ d_sub->id = -2;
+ d_sub->sh = NULL;
}
#endif
@@ -1780,101 +1780,101 @@ static int mp_property_sub_by_type(m_option_t *prop, int action, void *arg,
/// Subtitle delay (RW)
static int mp_property_sub_delay(m_option_t *prop, int action, void *arg,
- MPContext *mpctx)
+ 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)
+ void *arg, MPContext *mpctx)
{
char *name[] = { _("top"), _("center"), _("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(mp_gtext(name[sub_alignment]));
- return M_PROPERTY_OK;
+ if (!arg)
+ return M_PROPERTY_ERROR;
+ M_PROPERTY_CLAMP(prop, sub_alignment);
+ *(char **) arg = strdup(mp_gtext(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)
+ 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)
+ 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)
+ 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);
}
}
@@ -1882,7 +1882,7 @@ static int mp_property_sub_forced_only(m_option_t *prop, int action,
#ifdef CONFIG_FREETYPE
/// Subtitle scale (RW)
static int mp_property_sub_scale(m_option_t *prop, int action, void *arg,
- MPContext *mpctx)
+ MPContext *mpctx)
{
struct MPOpts *opts = &mpctx->opts;
@@ -1936,32 +1936,32 @@ static int mp_property_sub_scale(m_option_t *prop, int action, void *arg,
/// TV color settings (RW)
static int mp_property_tv_color(m_option_t *prop, int action, void *arg,
- MPContext *mpctx)
+ 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;
}
@@ -2443,28 +2443,28 @@ static int set_property_command(MPContext *mpctx, mp_cmd_t *cmd)
// 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;
show_property_osd(mpctx, pname);
@@ -2580,403 +2580,403 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
int osd_duration = opts->osd_duration;
int case_fallthrough_hack = 0;
if (!set_property_command(mpctx, cmd))
- switch (cmd->id) {
- case MP_CMD_SEEK:{
- float v;
- int abs;
+ switch (cmd->id) {
+ case MP_CMD_SEEK:{
+ float v;
+ int abs;
mpctx->add_osd_seek_info = true;
- 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 */
- mpctx->abs_seek_pos = SEEK_ABSOLUTE;
- if (sh_video)
- mpctx->osd_function =
- (v > sh_video->pts) ? OSD_FFW : OSD_REW;
- mpctx->rel_seek_secs = v;
- } else if (abs) { /* Absolute seek by percentage */
- mpctx->abs_seek_pos = SEEK_ABSOLUTE | SEEK_FACTOR;
- if (sh_video)
- mpctx->osd_function = OSD_FFW; // Direction isn't set correctly
- mpctx->rel_seek_secs = v / 100.0;
- } else {
- mpctx->rel_seek_secs += v;
- mpctx->osd_function = (v > 0) ? OSD_FFW : OSD_REW;
- }
- }
- break;
+ 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 */
+ mpctx->abs_seek_pos = SEEK_ABSOLUTE;
+ if (sh_video)
+ mpctx->osd_function =
+ (v > sh_video->pts) ? OSD_FFW : OSD_REW;
+ mpctx->rel_seek_secs = v;
+ } else if (abs) { /* Absolute seek by percentage */
+ mpctx->abs_seek_pos = SEEK_ABSOLUTE | SEEK_FACTOR;
+ if (sh_video)
+ mpctx->osd_function = OSD_FFW; // Direction isn't set correctly
+ mpctx->rel_seek_secs = v / 100.0;
+ } else {
+ mpctx->rel_seek_secs += v;
+ mpctx->osd_function = (v > 0) ? OSD_FFW : OSD_REW;
+ }
+ }
+ break;
case MP_CMD_SET_PROPERTY_OSD:
case_fallthrough_hack = 1;
- 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);
+ 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);
else if (case_fallthrough_hack)
show_property_osd(mpctx, cmd->args[0].v.s);
- if (r <= 0)
- mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_ERROR=%s\n", property_error_string(r));
- }
- break;
+ if (r <= 0)
+ mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_ERROR=%s\n", property_error_string(r));
+ }
+ break;
case MP_CMD_STEP_PROPERTY_OSD:
case_fallthrough_hack = 1;
- 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);
+ 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);
else if (case_fallthrough_hack)
show_property_osd(mpctx, cmd->args[0].v.s);
- 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(mpctx);
- if (mpctx->begin_skip == MP_NOPTS_VALUE) {
- mpctx->begin_skip = v;
- mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "EDL skip start, press 'i' again to end block.\n");
- } else {
- if (mpctx->begin_skip > v)
- mp_tmsg(MSGT_CPLAYER, MSGL_WARN, "EDL skip canceled, last start > stop\n");
- else {
- fprintf(edl_fd, "%f %f %d\n", mpctx->begin_skip, v, 0);
- mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "EDL skip end, line written.\n");
- }
- mpctx->begin_skip = MP_NOPTS_VALUE;
- }
- }
- break;
-
- case MP_CMD_SWITCH_RATIO:
+ 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(mpctx);
+ if (mpctx->begin_skip == MP_NOPTS_VALUE) {
+ mpctx->begin_skip = v;
+ mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "EDL skip start, press 'i' again to end block.\n");
+ } else {
+ if (mpctx->begin_skip > v)
+ mp_tmsg(MSGT_CPLAYER, MSGL_WARN, "EDL skip canceled, last start > stop\n");
+ else {
+ fprintf(edl_fd, "%f %f %d\n", mpctx->begin_skip, v, 0);
+ mp_tmsg(MSGT_CPLAYER, MSGL_INFO, "EDL skip end, line written.\n");
+ }
+ mpctx->begin_skip = MP_NOPTS_VALUE;
+ }
+ }
+ break;
+
+ case MP_CMD_SWITCH_RATIO:
if (!sh_video)
break;
- if (cmd->nargs == 0 || cmd->args[0].v.f == -1)
+ if (cmd->nargs == 0 || cmd->args[0].v.f == -1)
opts->movie_aspect = (float) sh_video->disp_w / sh_video->disp_h;
- else
+ else
opts->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;
- opts->playback_speed += v;
- build_afilter_chain(mpctx, sh_audio, &ao_data);
- set_osd_tmsg(OSD_MSG_SPEED, 1, osd_duration, "Speed: x %6.2f",
+ 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;
+ opts->playback_speed += v;
+ build_afilter_chain(mpctx, sh_audio, &ao_data);
+ set_osd_tmsg(OSD_MSG_SPEED, 1, osd_duration, "Speed: x %6.2f",
opts->playback_speed);
- } break;
+ } break;
- case MP_CMD_SPEED_MULT:{
- float v = cmd->args[0].v.f;
- opts->playback_speed *= v;
- build_afilter_chain(mpctx, sh_audio, &ao_data);
- set_osd_tmsg(OSD_MSG_SPEED, 1, osd_duration, "Speed: x %6.2f",
+ case MP_CMD_SPEED_MULT:{
+ float v = cmd->args[0].v.f;
+ opts->playback_speed *= v;
+ build_afilter_chain(mpctx, sh_audio, &ao_data);
+ set_osd_tmsg(OSD_MSG_SPEED, 1, osd_duration, "Speed: x %6.2f",
opts->playback_speed);
- } break;
+ } break;
- case MP_CMD_SPEED_SET:{
- float v = cmd->args[0].v.f;
- opts->playback_speed = v;
- build_afilter_chain(mpctx, sh_audio, &ao_data);
- set_osd_tmsg(OSD_MSG_SPEED, 1, osd_duration, "Speed: x %6.2f",
+ case MP_CMD_SPEED_SET:{
+ float v = cmd->args[0].v.f;
+ opts->playback_speed = v;
+ build_afilter_chain(mpctx, sh_audio, &ao_data);
+ set_osd_tmsg(OSD_MSG_SPEED, 1, osd_duration, "Speed: x %6.2f",
opts->playback_speed);
- } break;
+ } break;
- case MP_CMD_FRAME_STEP:
+ case MP_CMD_FRAME_STEP:
add_step_frame(mpctx);
- break;
-
- case MP_CMD_FILE_FILTER:
- file_filter = cmd->args[0].v.i;
- break;
-
- case MP_CMD_QUIT:
- exit_player_with_rc(mpctx, 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 (!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->stop_play =
- (n > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY;
- play_tree_iter_free(i);
- } else
- mpctx->stop_play = (n > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY;
- if (mpctx->stop_play)
- mpctx->play_tree_step = n;
- }
- }
- 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->stop_play = (n > 0) ? PT_UP_NEXT : PT_UP_PREV;
- play_tree_iter_free(i);
- } else
- mpctx->stop_play = (n > 0) ? PT_UP_NEXT : PT_UP_PREV;
- }
- 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->stop_play = PT_NEXT_SRC;
- else if (v < 0 && mpctx->playtree_iter->file > 1)
- mpctx->stop_play = PT_PREV_SRC;
- }
- break;
-
- case MP_CMD_SUB_STEP:
- if (sh_video) {
- int movement = cmd->args[0].v.i;
- step_sub(subdata, sh_video->pts, movement);
+ break;
+
+ case MP_CMD_FILE_FILTER:
+ file_filter = cmd->args[0].v.i;
+ break;
+
+ case MP_CMD_QUIT:
+ exit_player_with_rc(mpctx, 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 (!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->stop_play =
+ (n > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY;
+ play_tree_iter_free(i);
+ } else
+ mpctx->stop_play = (n > 0) ? PT_NEXT_ENTRY : PT_PREV_ENTRY;
+ if (mpctx->stop_play)
+ mpctx->play_tree_step = n;
+ }
+ }
+ 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->stop_play = (n > 0) ? PT_UP_NEXT : PT_UP_PREV;
+ play_tree_iter_free(i);
+ } else
+ mpctx->stop_play = (n > 0) ? PT_UP_NEXT : PT_UP_PREV;
+ }
+ 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->stop_play = PT_NEXT_SRC;
+ else if (v < 0 && mpctx->playtree_iter->file > 1)
+ mpctx->stop_play = PT_PREV_SRC;
+ }
+ 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.;
+ if (ass_track)
+ sub_delay +=
+ ass_step_sub(ass_track,
+ (sh_video->pts +
+ sub_delay) * 1000 + .5, movement) / 1000.;
#endif
- set_osd_tmsg(OSD_MSG_SUB_DELAY, 1, osd_duration,
+ set_osd_tmsg(OSD_MSG_SUB_DELAY, 1, osd_duration,
"Sub delay: %d ms", ROUND(sub_delay * 1000));
- }
- break;
+ }
+ break;
- case MP_CMD_SUB_LOG:
+ case MP_CMD_SUB_LOG:
log_sub(mpctx);
- 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 (opts->osd_level > max)
- opts->osd_level = max;
- if (v < 0)
- opts->osd_level = (opts->osd_level + 1) % (max + 1);
- else
- opts->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 && opts->osd_level <= 1)
- set_osd_tmsg(OSD_MSG_OSD_STATUS, 0, osd_duration,
+ 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 (opts->osd_level > max)
+ opts->osd_level = max;
+ if (v < 0)
+ opts->osd_level = (opts->osd_level + 1) % (max + 1);
+ else
+ opts->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 && opts->osd_level <= 1)
+ set_osd_tmsg(OSD_MSG_OSD_STATUS, 0, osd_duration,
"OSD: %s",
opts->osd_level ? mp_gtext("enabled") :
mp_gtext("disabled"));
- 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 <arg> 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->stop_play = PT_NEXT_SRC;
- }
- }
- break;
-
- case MP_CMD_LOADLIST:{
+ 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 <arg> 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->stop_play = PT_NEXT_SRC;
+ }
+ }
+ break;
+
+ case MP_CMD_LOADLIST:{
play_tree_t *e = parse_playlist_file(mpctx->mconfig, cmd->args[0].v.s);
- if (!e)
- mp_tmsg(MSGT_CPLAYER, MSGL_ERR,
- "\nUnable to load playlist %s.\n", 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->stop_play = PT_NEXT_SRC;
- }
- }
- }
- 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->stop_play = PT_STOP;
- 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(mpctx, 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;
+ if (!e)
+ mp_tmsg(MSGT_CPLAYER, MSGL_ERR,
+ "\nUnable to load playlist %s.\n", 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->stop_play = PT_NEXT_SRC;
+ }
+ }
+ }
+ 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->stop_play = PT_STOP;
+ 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(mpctx, 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_tmsg(OSD_MSG_RADIO_CHANNEL, 1, osd_duration,
+ 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_tmsg(OSD_MSG_RADIO_CHANNEL, 1, osd_duration,
"Channel: %s",
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_tmsg(OSD_MSG_RADIO_CHANNEL, 1, osd_duration,
+ }
+ }
+ 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_tmsg(OSD_MSG_RADIO_CHANNEL, 1, osd_duration,
"Channel: %s",
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;
+ }
+ }
+ 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));
@@ -2985,12 +2985,12 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
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));
@@ -2999,32 +2999,32 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
pvr_get_current_frequency (mpctx->stream));
}
#endif /* CONFIG_PVR */
- 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_tmsg(OSD_MSG_TV_CHANNEL, 1, osd_duration,
+ 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_tmsg(OSD_MSG_TV_CHANNEL, 1, osd_duration,
"Channel: %s", tv_channel_current->name);
- //vo_osd_changed(OSDTYPE_SUBTITLE);
- }
- }
+ //vo_osd_changed(OSDTYPE_SUBTITLE);
+ }
+ }
#ifdef CONFIG_PVR
else if (mpctx->stream &&
mpctx->stream->type == STREAMTYPE_PVR) {
@@ -3034,37 +3034,37 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
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;
+ 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;
+ mpctx->last_dvb_step = v;
+ if (v > 0)
+ dir = DVB_CHANNEL_HIGHER;
+ else
+ dir = DVB_CHANNEL_LOWER;
- if (dvb_step_channel(mpctx->stream, dir)) {
+ if (dvb_step_channel(mpctx->stream, dir)) {
mpctx->stop_play = PT_NEXT_ENTRY;
mpctx->dvbin_reopen = 1;
}
- }
+ }
#endif /* CONFIG_DVBIN */
- 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_tmsg(OSD_MSG_TV_CHANNEL, 1, osd_duration,
+ 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_tmsg(OSD_MSG_TV_CHANNEL, 1, osd_duration,
"Channel: %s", tv_channel_current->name);
- //vo_osd_changed(OSDTYPE_SUBTITLE);
- }
- }
+ //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);
@@ -3073,31 +3073,31 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
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;
+ 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,
+ if (dvb_set_channel(mpctx->stream, cmd->args[1].v.i,
cmd->args[0].v.i)) {
mpctx->stop_play = PT_NEXT_ENTRY;
mpctx->dvbin_reopen = 1;
}
- }
- break;
+ }
+ 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_tmsg(OSD_MSG_TV_CHANNEL, 1, osd_duration,
+ 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_tmsg(OSD_MSG_TV_CHANNEL, 1, osd_duration,
"Channel: %s", tv_channel_current->name);
- //vo_osd_changed(OSDTYPE_SUBTITLE);
- }
- }
+ //vo_osd_changed(OSDTYPE_SUBTITLE);
+ }
+ }
#ifdef CONFIG_PVR
else if (mpctx->stream && mpctx->stream->type == STREAMTYPE_PVR) {
pvr_set_lastchannel (mpctx->stream);
@@ -3106,295 +3106,295 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
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_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;
+ 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(mpctx, 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_SCREENSHOT:
- if (mpctx->video_out && mpctx->video_out->config_ok) {
- 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_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(mpctx, 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_SCREENSHOT:
+ if (mpctx->video_out && mpctx->video_out->config_ok) {
+ 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:
if (!sh_video)
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=%.2f\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(mpctx, META_NAME));
- }
- break;
-
- case MP_CMD_GET_VIDEO_CODEC:{
- char *inf = get_metadata(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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 && mpctx->video_out->config_ok)
- 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(mpctx);
- mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_TIME_POSITION=%.1f\n", pos);
- }
- break;
-
- case MP_CMD_RUN:
+ 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=%.2f\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(mpctx, META_NAME));
+ }
+ break;
+
+ case MP_CMD_GET_VIDEO_CODEC:{
+ char *inf = get_metadata(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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(mpctx, 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 && mpctx->video_out->config_ok)
+ 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(mpctx);
+ 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);
- }
+ 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(mpctx->key_fifo, 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(mpctx, pointer_x, pointer_y, &dx, &dy);
+ break;
+
+ case MP_CMD_KEYDOWN_EVENTS:
+ mplayer_put_key(mpctx->key_fifo, 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(mpctx, 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 (opts->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 (opts->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 (opts->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 (opts->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
@@ -3435,20 +3435,20 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
af_init(mpctx->mixer.afilter);
build_afilter_chain(mpctx, sh_audio, &ao_data);
break;
- default:
- mp_msg(MSGT_CPLAYER, MSGL_V,
- "Received unknown cmd %s\n", cmd->name);
- }
+ default:
+ mp_msg(MSGT_CPLAYER, MSGL_V,
+ "Received unknown cmd %s\n", cmd->name);
+ }
switch (cmd->pausing) {
- case 1: // "pausing"
+ case 1: // "pausing"
pause_player(mpctx);
- break;
- case 3: // "pausing_toggle"
+ break;
+ case 3: // "pausing_toggle"
if (mpctx->paused)
unpause_player(mpctx);
else
pause_player(mpctx);
- break;
+ break;
}
}
diff --git a/cpudetect.c b/cpudetect.c
index fa4c9ce4db..1edf4a08be 100644
--- a/cpudetect.c
+++ b/cpudetect.c
@@ -63,29 +63,29 @@ static int has_cpuid(void)
#if ARCH_X86_64
return 1;
#else
- long a, c;
- __asm__ volatile (
- /* See if CPUID instruction is supported ... */
- /* ... Get copies of EFLAGS into eax and ecx */
- "pushfl\n\t"
- "pop %0\n\t"
- "mov %0, %1\n\t"
-
- /* ... Toggle the ID bit in one copy and store */
- /* to the EFLAGS reg */
- "xor $0x200000, %0\n\t"
- "push %0\n\t"
- "popfl\n\t"
-
- /* ... Get the (hopefully modified) EFLAGS */
- "pushfl\n\t"
- "pop %0\n\t"
- : "=a" (a), "=c" (c)
- :
- : "cc"
- );
-
- return a != c;
+ long a, c;
+ __asm__ volatile (
+ /* See if CPUID instruction is supported ... */
+ /* ... Get copies of EFLAGS into eax and ecx */
+ "pushfl\n\t"
+ "pop %0\n\t"
+ "mov %0, %1\n\t"
+
+ /* ... Toggle the ID bit in one copy and store */
+ /* to the EFLAGS reg */
+ "xor $0x200000, %0\n\t"
+ "push %0\n\t"
+ "popfl\n\t"
+
+ /* ... Get the (hopefully modified) EFLAGS */
+ "pushfl\n\t"
+ "pop %0\n\t"
+ : "=a" (a), "=c" (c)
+ :
+ : "cc"
+ );
+
+ return a != c;
#endif
}
@@ -93,168 +93,167 @@ static void
do_cpuid(unsigned int ax, unsigned int *p)
{
#if 0
- __asm__ volatile(
- "cpuid;"
- : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3])
- : "0" (ax)
- );
+ __asm__ volatile(
+ "cpuid;"
+ : "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3])
+ : "0" (ax)
+ );
#else
// code from libavcodec:
__asm__ volatile
- ("mov %%"REG_b", %%"REG_S"\n\t"
+ ("mov %%"REG_b", %%"REG_S"\n\t"
"cpuid\n\t"
"xchg %%"REG_b", %%"REG_S
: "=a" (p[0]), "=S" (p[1]),
"=c" (p[2]), "=d" (p[3])
: "0" (ax));
#endif
-
}
void GetCpuCaps( CpuCaps *caps)
{
- unsigned int regs[4];
- unsigned int regs2[4];
-
- memset(caps, 0, sizeof(*caps));
- caps->isX86=1;
- caps->cl_size=32; /* default */
- if (!has_cpuid()) {
- mp_msg(MSGT_CPUDETECT,MSGL_WARN,"CPUID not supported!??? (maybe an old 486?)\n");
- return;
- }
- do_cpuid(0x00000000, regs); // get _max_ cpuid level and vendor name
- mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU vendor name: %.4s%.4s%.4s max cpuid level: %d\n",
- (char*) (regs+1),(char*) (regs+3),(char*) (regs+2), regs[0]);
- if (regs[0]>=0x00000001)
- {
- char *tmpstr, *ptmpstr;
- unsigned cl_size;
-
- do_cpuid(0x00000001, regs2);
-
- caps->cpuType=(regs2[0] >> 8)&0xf;
- caps->cpuModel=(regs2[0] >> 4)&0xf;
+ unsigned int regs[4];
+ unsigned int regs2[4];
+
+ memset(caps, 0, sizeof(*caps));
+ caps->isX86=1;
+ caps->cl_size=32; /* default */
+ if (!has_cpuid()) {
+ mp_msg(MSGT_CPUDETECT,MSGL_WARN,"CPUID not supported!??? (maybe an old 486?)\n");
+ return;
+ }
+ do_cpuid(0x00000000, regs); // get _max_ cpuid level and vendor name
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU vendor name: %.4s%.4s%.4s max cpuid level: %d\n",
+ (char*) (regs+1),(char*) (regs+3),(char*) (regs+2), regs[0]);
+ if (regs[0]>=0x00000001)
+ {
+ char *tmpstr, *ptmpstr;
+ unsigned cl_size;
+
+ do_cpuid(0x00000001, regs2);
+
+ caps->cpuType=(regs2[0] >> 8)&0xf;
+ caps->cpuModel=(regs2[0] >> 4)&0xf;
// see AMD64 Architecture Programmer's Manual, Volume 3: General-purpose and
// System Instructions, Table 3-2: Effective family computation, page 120.
- if(caps->cpuType==0xf){
- // use extended family (P4, IA64, K8)
- caps->cpuType=0xf+((regs2[0]>>20)&255);
- }
- if(caps->cpuType==0xf || caps->cpuType==6)
- caps->cpuModel |= ((regs2[0]>>16)&0xf) << 4;
-
- caps->cpuStepping=regs2[0] & 0xf;
-
- // general feature flags:
- caps->hasTSC = (regs2[3] & (1 << 8 )) >> 8; // 0x0000010
- caps->hasMMX = (regs2[3] & (1 << 23 )) >> 23; // 0x0800000
- caps->hasSSE = (regs2[3] & (1 << 25 )) >> 25; // 0x2000000
- caps->hasSSE2 = (regs2[3] & (1 << 26 )) >> 26; // 0x4000000
- caps->hasSSE3 = (regs2[2] & 1); // 0x0000001
- caps->hasSSSE3 = (regs2[2] & (1 << 9 )) >> 9; // 0x0000200
- caps->hasMMX2 = caps->hasSSE; // SSE cpus supports mmxext too
- cl_size = ((regs2[1] >> 8) & 0xFF)*8;
- if(cl_size) caps->cl_size = cl_size;
-
- ptmpstr=tmpstr=GetCpuFriendlyName(regs, regs2);
- while(*ptmpstr == ' ') // strip leading spaces
- ptmpstr++;
- mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: %s ", ptmpstr);
- free(tmpstr);
- mp_msg(MSGT_CPUDETECT,MSGL_V,"(Family: %d, Model: %d, Stepping: %d)\n",
- caps->cpuType, caps->cpuModel, caps->cpuStepping);
-
- }
- do_cpuid(0x80000000, regs);
- if (regs[0]>=0x80000001) {
- mp_msg(MSGT_CPUDETECT,MSGL_V,"extended cpuid-level: %d\n",regs[0]&0x7FFFFFFF);
- do_cpuid(0x80000001, regs2);
- caps->hasMMX |= (regs2[3] & (1 << 23 )) >> 23; // 0x0800000
- caps->hasMMX2 |= (regs2[3] & (1 << 22 )) >> 22; // 0x400000
- caps->has3DNow = (regs2[3] & (1 << 31 )) >> 31; //0x80000000
- caps->has3DNowExt = (regs2[3] & (1 << 30 )) >> 30;
- caps->hasSSE4a = (regs2[2] & (1 << 6 )) >> 6; // 0x0000040
- }
- if(regs[0]>=0x80000006)
- {
- do_cpuid(0x80000006, regs2);
- mp_msg(MSGT_CPUDETECT,MSGL_V,"extended cache-info: %d\n",regs2[2]&0x7FFFFFFF);
- caps->cl_size = regs2[2] & 0xFF;
- }
- mp_msg(MSGT_CPUDETECT,MSGL_V,"Detected cache-line size is %u bytes\n",caps->cl_size);
+ if(caps->cpuType==0xf){
+ // use extended family (P4, IA64, K8)
+ caps->cpuType=0xf+((regs2[0]>>20)&255);
+ }
+ if(caps->cpuType==0xf || caps->cpuType==6)
+ caps->cpuModel |= ((regs2[0]>>16)&0xf) << 4;
+
+ caps->cpuStepping=regs2[0] & 0xf;
+
+ // general feature flags:
+ caps->hasTSC = (regs2[3] & (1 << 8 )) >> 8; // 0x0000010
+ caps->hasMMX = (regs2[3] & (1 << 23 )) >> 23; // 0x0800000
+ caps->hasSSE = (regs2[3] & (1 << 25 )) >> 25; // 0x2000000
+ caps->hasSSE2 = (regs2[3] & (1 << 26 )) >> 26; // 0x4000000
+ caps->hasSSE3 = (regs2[2] & 1); // 0x0000001
+ caps->hasSSSE3 = (regs2[2] & (1 << 9 )) >> 9; // 0x0000200
+ caps->hasMMX2 = caps->hasSSE; // SSE cpus supports mmxext too
+ cl_size = ((regs2[1] >> 8) & 0xFF)*8;
+ if(cl_size) caps->cl_size = cl_size;
+
+ ptmpstr=tmpstr=GetCpuFriendlyName(regs, regs2);
+ while(*ptmpstr == ' ') // strip leading spaces
+ ptmpstr++;
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: %s ", ptmpstr);
+ free(tmpstr);
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"(Family: %d, Model: %d, Stepping: %d)\n",
+ caps->cpuType, caps->cpuModel, caps->cpuStepping);
+
+ }
+ do_cpuid(0x80000000, regs);
+ if (regs[0]>=0x80000001) {
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"extended cpuid-level: %d\n",regs[0]&0x7FFFFFFF);
+ do_cpuid(0x80000001, regs2);
+ caps->hasMMX |= (regs2[3] & (1 << 23 )) >> 23; // 0x0800000
+ caps->hasMMX2 |= (regs2[3] & (1 << 22 )) >> 22; // 0x400000
+ caps->has3DNow = (regs2[3] & (1 << 31 )) >> 31; //0x80000000
+ caps->has3DNowExt = (regs2[3] & (1 << 30 )) >> 30;
+ caps->hasSSE4a = (regs2[2] & (1 << 6 )) >> 6; // 0x0000040
+ }
+ if(regs[0]>=0x80000006)
+ {
+ do_cpuid(0x80000006, regs2);
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"extended cache-info: %d\n",regs2[2]&0x7FFFFFFF);
+ caps->cl_size = regs2[2] & 0xFF;
+ }
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"Detected cache-line size is %u bytes\n",caps->cl_size);
#if 0
- mp_msg(MSGT_CPUDETECT,MSGL_INFO,"cpudetect: MMX=%d MMX2=%d SSE=%d SSE2=%d 3DNow=%d 3DNowExt=%d\n",
- gCpuCaps.hasMMX,
- gCpuCaps.hasMMX2,
- gCpuCaps.hasSSE,
- gCpuCaps.hasSSE2,
- gCpuCaps.has3DNow,
- gCpuCaps.has3DNowExt );
+ mp_msg(MSGT_CPUDETECT,MSGL_INFO,"cpudetect: MMX=%d MMX2=%d SSE=%d SSE2=%d 3DNow=%d 3DNowExt=%d\n",
+ gCpuCaps.hasMMX,
+ gCpuCaps.hasMMX2,
+ gCpuCaps.hasSSE,
+ gCpuCaps.hasSSE2,
+ gCpuCaps.has3DNow,
+ gCpuCaps.has3DNowExt);
#endif
- /* FIXME: Does SSE2 need more OS support, too? */
- if (caps->hasSSE)
- check_os_katmai_support();
- if (!caps->hasSSE)
- caps->hasSSE2 = 0;
-// caps->has3DNow=1;
-// caps->hasMMX2 = 0;
-// caps->hasMMX = 0;
+ /* FIXME: Does SSE2 need more OS support, too? */
+ if (caps->hasSSE)
+ check_os_katmai_support();
+ if (!caps->hasSSE)
+ caps->hasSSE2 = 0;
+// caps->has3DNow=1;
+// caps->hasMMX2 = 0;
+// caps->hasMMX = 0;
#if !CONFIG_RUNTIME_CPUDETECT
#if !HAVE_MMX
- if(caps->hasMMX) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"MMX supported but disabled\n");
- caps->hasMMX=0;
+ if(caps->hasMMX) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"MMX supported but disabled\n");
+ caps->hasMMX=0;
#endif
#if !HAVE_MMX2
- if(caps->hasMMX2) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"MMX2 supported but disabled\n");
- caps->hasMMX2=0;
+ if(caps->hasMMX2) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"MMX2 supported but disabled\n");
+ caps->hasMMX2=0;
#endif
#if !HAVE_SSE
- if(caps->hasSSE) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"SSE supported but disabled\n");
- caps->hasSSE=0;
+ if(caps->hasSSE) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"SSE supported but disabled\n");
+ caps->hasSSE=0;
#endif
#if !HAVE_SSE2
- if(caps->hasSSE2) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"SSE2 supported but disabled\n");
- caps->hasSSE2=0;
+ if(caps->hasSSE2) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"SSE2 supported but disabled\n");
+ caps->hasSSE2=0;
#endif
#if !HAVE_AMD3DNOW
- if(caps->has3DNow) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"3DNow supported but disabled\n");
- caps->has3DNow=0;
+ if(caps->has3DNow) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"3DNow supported but disabled\n");
+ caps->has3DNow=0;
#endif
#if !HAVE_AMD3DNOWEXT
- if(caps->has3DNowExt) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"3DNowExt supported but disabled\n");
- caps->has3DNowExt=0;
+ if(caps->has3DNowExt) mp_msg(MSGT_CPUDETECT,MSGL_WARN,"3DNowExt supported but disabled\n");
+ caps->has3DNowExt=0;
#endif
#endif // CONFIG_RUNTIME_CPUDETECT
}
char *GetCpuFriendlyName(unsigned int regs[], unsigned int regs2[]){
- char vendor[13];
- char *retname;
- int i;
-
- if (NULL==(retname=malloc(256))) {
- mp_msg(MSGT_CPUDETECT,MSGL_FATAL,"Error: GetCpuFriendlyName() not enough memory\n");
- exit(1);
- }
- retname[0] = '\0';
-
- sprintf(vendor,"%.4s%.4s%.4s",(char*)(regs+1),(char*)(regs+3),(char*)(regs+2));
-
- do_cpuid(0x80000000,regs);
- if (regs[0] >= 0x80000004)
- {
- // CPU has built-in namestring
- for (i = 0x80000002; i <= 0x80000004; i++)
- {
- do_cpuid(i, regs);
- strncat(retname, (char*)regs, 16);
- }
- }
- return retname;
+ char vendor[13];
+ char *retname;
+ int i;
+
+ if (NULL==(retname=malloc(256))) {
+ mp_msg(MSGT_CPUDETECT,MSGL_FATAL,"Error: GetCpuFriendlyName() not enough memory\n");
+ exit(1);
+ }
+ retname[0] = '\0';
+
+ sprintf(vendor,"%.4s%.4s%.4s",(char*)(regs+1),(char*)(regs+3),(char*)(regs+2));
+
+ do_cpuid(0x80000000,regs);
+ if (regs[0] >= 0x80000004)
+ {
+ // CPU has built-in namestring
+ for (i = 0x80000002; i <= 0x80000004; i++)
+ {
+ do_cpuid(i, regs);
+ strncat(retname, (char*)regs, 16);
+ }
+ }
+ return retname;
}
#if defined(__linux__) && defined(_POSIX_SOURCE) && !ARCH_X86_64
@@ -281,31 +280,31 @@ static void sigill_handler_sse( int signal, struct sigcontext sc )
#if (defined(__MINGW32__) || defined(__CYGWIN__)) && !ARCH_X86_64
LONG CALLBACK win32_sig_handler_sse(EXCEPTION_POINTERS* ep)
{
- if(ep->ExceptionRecord->ExceptionCode==EXCEPTION_ILLEGAL_INSTRUCTION){
- mp_msg(MSGT_CPUDETECT,MSGL_V, "SIGILL, " );
- ep->ContextRecord->Eip +=3;
- gCpuCaps.hasSSE=0;
- return EXCEPTION_CONTINUE_EXECUTION;
- }
- return EXCEPTION_CONTINUE_SEARCH;
+ if(ep->ExceptionRecord->ExceptionCode==EXCEPTION_ILLEGAL_INSTRUCTION){
+ mp_msg(MSGT_CPUDETECT,MSGL_V, "SIGILL, " );
+ ep->ContextRecord->Eip +=3;
+ gCpuCaps.hasSSE=0;
+ return EXCEPTION_CONTINUE_EXECUTION;
+ }
+ return EXCEPTION_CONTINUE_SEARCH;
}
#endif /* defined(__MINGW32__) || defined(__CYGWIN__) */
#ifdef __OS2__
-ULONG _System os2_sig_handler_sse( PEXCEPTIONREPORTRECORD p1,
- PEXCEPTIONREGISTRATIONRECORD p2,
- PCONTEXTRECORD p3,
- PVOID p4 )
+ULONG _System os2_sig_handler_sse(PEXCEPTIONREPORTRECORD p1,
+ PEXCEPTIONREGISTRATIONRECORD p2,
+ PCONTEXTRECORD p3,
+ PVOID p4)
{
- if(p1->ExceptionNum == XCPT_ILLEGAL_INSTRUCTION){
- mp_msg(MSGT_CPUDETECT, MSGL_V, "SIGILL, ");
+ if(p1->ExceptionNum == XCPT_ILLEGAL_INSTRUCTION){
+ mp_msg(MSGT_CPUDETECT, MSGL_V, "SIGILL, ");
- p3->ctx_RegEip += 3;
- gCpuCaps.hasSSE = 0;
+ p3->ctx_RegEip += 3;
+ gCpuCaps.hasSSE = 0;
- return XCPT_CONTINUE_EXECUTION;
- }
- return XCPT_CONTINUE_SEARCH;
+ return XCPT_CONTINUE_EXECUTION;
+ }
+ return XCPT_CONTINUE_SEARCH;
}
#endif
@@ -325,103 +324,103 @@ ULONG _System os2_sig_handler_sse( PEXCEPTIONREPORTRECORD p1,
static void check_os_katmai_support( void )
{
#if ARCH_X86_64
- gCpuCaps.hasSSE=1;
- gCpuCaps.hasSSE2=1;
+ gCpuCaps.hasSSE=1;
+ gCpuCaps.hasSSE2=1;
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__APPLE__)
- int has_sse=0, ret;
- size_t len=sizeof(has_sse);
+ int has_sse=0, ret;
+ size_t len=sizeof(has_sse);
- ret = sysctlbyname(SSE_SYSCTL_NAME, &has_sse, &len, NULL, 0);
- if (ret || !has_sse)
- gCpuCaps.hasSSE=0;
+ ret = sysctlbyname(SSE_SYSCTL_NAME, &has_sse, &len, NULL, 0);
+ if (ret || !has_sse)
+ gCpuCaps.hasSSE=0;
#elif defined(__NetBSD__) || defined (__OpenBSD__)
#if __NetBSD_Version__ >= 105250000 || (defined __OpenBSD__)
- int has_sse, has_sse2, ret, mib[2];
- size_t varlen;
-
- mib[0] = CTL_MACHDEP;
- mib[1] = CPU_SSE;
- varlen = sizeof(has_sse);
-
- mp_msg(MSGT_CPUDETECT,MSGL_V, "Testing OS support for SSE... " );
- ret = sysctl(mib, 2, &has_sse, &varlen, NULL, 0);
- gCpuCaps.hasSSE = ret >= 0 && has_sse;
- mp_msg(MSGT_CPUDETECT,MSGL_V, gCpuCaps.hasSSE ? "yes.\n" : "no!\n" );
-
- mib[1] = CPU_SSE2;
- varlen = sizeof(has_sse2);
- mp_msg(MSGT_CPUDETECT,MSGL_V, "Testing OS support for SSE2... " );
- ret = sysctl(mib, 2, &has_sse2, &varlen, NULL, 0);
- gCpuCaps.hasSSE2 = ret >= 0 && has_sse2;
- mp_msg(MSGT_CPUDETECT,MSGL_V, gCpuCaps.hasSSE2 ? "yes.\n" : "no!\n" );
+ int has_sse, has_sse2, ret, mib[2];
+ size_t varlen;
+
+ mib[0] = CTL_MACHDEP;
+ mib[1] = CPU_SSE;
+ varlen = sizeof(has_sse);
+
+ mp_msg(MSGT_CPUDETECT,MSGL_V, "Testing OS support for SSE... " );
+ ret = sysctl(mib, 2, &has_sse, &varlen, NULL, 0);
+ gCpuCaps.hasSSE = ret >= 0 && has_sse;
+ mp_msg(MSGT_CPUDETECT,MSGL_V, gCpuCaps.hasSSE ? "yes.\n" : "no!\n" );
+
+ mib[1] = CPU_SSE2;
+ varlen = sizeof(has_sse2);
+ mp_msg(MSGT_CPUDETECT,MSGL_V, "Testing OS support for SSE2... " );
+ ret = sysctl(mib, 2, &has_sse2, &varlen, NULL, 0);
+ gCpuCaps.hasSSE2 = ret >= 0 && has_sse2;
+ mp_msg(MSGT_CPUDETECT,MSGL_V, gCpuCaps.hasSSE2 ? "yes.\n" : "no!\n" );
#else
- gCpuCaps.hasSSE = 0;
- mp_msg(MSGT_CPUDETECT,MSGL_WARN, "No OS support for SSE, disabling to be safe.\n" );
+ gCpuCaps.hasSSE = 0;
+ mp_msg(MSGT_CPUDETECT,MSGL_WARN, "No OS support for SSE, disabling to be safe.\n" );
#endif
#elif defined(__MINGW32__) || defined(__CYGWIN__)
- LPTOP_LEVEL_EXCEPTION_FILTER exc_fil;
- if ( gCpuCaps.hasSSE ) {
- mp_msg(MSGT_CPUDETECT,MSGL_V, "Testing OS support for SSE... " );
- exc_fil = SetUnhandledExceptionFilter(win32_sig_handler_sse);
- __asm__ volatile ("xorps %xmm0, %xmm0");
- SetUnhandledExceptionFilter(exc_fil);
- mp_msg(MSGT_CPUDETECT,MSGL_V, gCpuCaps.hasSSE ? "yes.\n" : "no!\n" );
- }
+ LPTOP_LEVEL_EXCEPTION_FILTER exc_fil;
+ if ( gCpuCaps.hasSSE ) {
+ mp_msg(MSGT_CPUDETECT,MSGL_V, "Testing OS support for SSE... " );
+ exc_fil = SetUnhandledExceptionFilter(win32_sig_handler_sse);
+ __asm__ volatile ("xorps %xmm0, %xmm0");
+ SetUnhandledExceptionFilter(exc_fil);
+ mp_msg(MSGT_CPUDETECT,MSGL_V, gCpuCaps.hasSSE ? "yes.\n" : "no!\n" );
+ }
#elif defined(__OS2__)
- EXCEPTIONREGISTRATIONRECORD RegRec = { 0, &os2_sig_handler_sse };
- if ( gCpuCaps.hasSSE ) {
- mp_msg(MSGT_CPUDETECT,MSGL_V, "Testing OS support for SSE... " );
- DosSetExceptionHandler( &RegRec );
- __asm__ volatile ("xorps %xmm0, %xmm0");
- DosUnsetExceptionHandler( &RegRec );
- mp_msg(MSGT_CPUDETECT,MSGL_V, gCpuCaps.hasSSE ? "yes.\n" : "no!\n" );
- }
+ EXCEPTIONREGISTRATIONRECORD RegRec = { 0, &os2_sig_handler_sse };
+ if ( gCpuCaps.hasSSE ) {
+ mp_msg(MSGT_CPUDETECT,MSGL_V, "Testing OS support for SSE... " );
+ DosSetExceptionHandler( &RegRec );
+ __asm__ volatile ("xorps %xmm0, %xmm0");
+ DosUnsetExceptionHandler( &RegRec );
+ mp_msg(MSGT_CPUDETECT,MSGL_V, gCpuCaps.hasSSE ? "yes.\n" : "no!\n" );
+ }
#elif defined(__linux__)
#if defined(_POSIX_SOURCE)
- struct sigaction saved_sigill;
+ struct sigaction saved_sigill;
- /* Save the original signal handlers.
- */
- sigaction( SIGILL, NULL, &saved_sigill );
+ /* Save the original signal handlers.
+ */
+ sigaction( SIGILL, NULL, &saved_sigill );
- signal( SIGILL, (void (*)(int))sigill_handler_sse );
+ signal( SIGILL, (void (*)(int))sigill_handler_sse );
- /* Emulate test for OSFXSR in CR4. The OS will set this bit if it
- * supports the extended FPU save and restore required for SSE. If
- * we execute an SSE instruction on a PIII and get a SIGILL, the OS
- * doesn't support Streaming SIMD Exceptions, even if the processor
- * does.
- */
- if ( gCpuCaps.hasSSE ) {
- mp_msg(MSGT_CPUDETECT,MSGL_V, "Testing OS support for SSE... " );
+ /* Emulate test for OSFXSR in CR4. The OS will set this bit if it
+ * supports the extended FPU save and restore required for SSE. If
+ * we execute an SSE instruction on a PIII and get a SIGILL, the OS
+ * doesn't support Streaming SIMD Exceptions, even if the processor
+ * does.
+ */
+ if ( gCpuCaps.hasSSE ) {
+ mp_msg(MSGT_CPUDETECT,MSGL_V, "Testing OS support for SSE... " );
// __asm__ volatile ("xorps %%xmm0, %%xmm0");
- __asm__ volatile ("xorps %xmm0, %xmm0");
+ __asm__ volatile ("xorps %xmm0, %xmm0");
- mp_msg(MSGT_CPUDETECT,MSGL_V, gCpuCaps.hasSSE ? "yes.\n" : "no!\n" );
- }
+ mp_msg(MSGT_CPUDETECT,MSGL_V, gCpuCaps.hasSSE ? "yes.\n" : "no!\n" );
+ }
- /* Restore the original signal handlers.
- */
- sigaction( SIGILL, &saved_sigill, NULL );
+ /* Restore the original signal handlers.
+ */
+ sigaction( SIGILL, &saved_sigill, NULL );
- /* If we've gotten to here and the XMM CPUID bit is still set, we're
- * safe to go ahead and hook out the SSE code throughout Mesa.
- */
- mp_msg(MSGT_CPUDETECT,MSGL_V, "Tests of OS support for SSE %s\n", gCpuCaps.hasSSE ? "passed." : "failed!" );
+ /* If we've gotten to here and the XMM CPUID bit is still set, we're
+ * safe to go ahead and hook out the SSE code throughout Mesa.
+ */
+ mp_msg(MSGT_CPUDETECT,MSGL_V, "Tests of OS support for SSE %s\n", gCpuCaps.hasSSE ? "passed." : "failed!" );
#else
- /* We can't use POSIX signal handling to test the availability of
- * SSE, so we disable it by default.
- */
- mp_msg(MSGT_CPUDETECT,MSGL_WARN, "Cannot test OS support for SSE, disabling to be safe.\n" );
- gCpuCaps.hasSSE=0;
+ /* We can't use POSIX signal handling to test the availability of
+ * SSE, so we disable it by default.
+ */
+ mp_msg(MSGT_CPUDETECT,MSGL_WARN, "Cannot test OS support for SSE, disabling to be safe.\n" );
+ gCpuCaps.hasSSE=0;
#endif /* _POSIX_SOURCE */
#else
- /* Do nothing on other platforms for now.
- */
- mp_msg(MSGT_CPUDETECT,MSGL_WARN, "Cannot test OS support for SSE, leaving disabled.\n" );
- gCpuCaps.hasSSE=0;
+ /* Do nothing on other platforms for now.
+ */
+ mp_msg(MSGT_CPUDETECT,MSGL_WARN, "Cannot test OS support for SSE, leaving disabled.\n" );
+ gCpuCaps.hasSSE=0;
#endif /* __linux__ */
}
#else /* ARCH_X86 */
@@ -451,98 +450,98 @@ static void sigill_handler (int sig)
void GetCpuCaps( CpuCaps *caps)
{
- caps->cpuType=0;
- caps->cpuModel=0;
- caps->cpuStepping=0;
- caps->hasMMX=0;
- caps->hasMMX2=0;
- caps->has3DNow=0;
- caps->has3DNowExt=0;
- caps->hasSSE=0;
- caps->hasSSE2=0;
- caps->hasSSE3=0;
- caps->hasSSSE3=0;
- caps->hasSSE4a=0;
- caps->isX86=0;
- caps->hasAltiVec = 0;
+ caps->cpuType=0;
+ caps->cpuModel=0;
+ caps->cpuStepping=0;
+ caps->hasMMX=0;
+ caps->hasMMX2=0;
+ caps->has3DNow=0;
+ caps->has3DNowExt=0;
+ caps->hasSSE=0;
+ caps->hasSSE2=0;
+ caps->hasSSE3=0;
+ caps->hasSSSE3=0;
+ caps->hasSSE4a=0;
+ caps->isX86=0;
+ caps->hasAltiVec = 0;
#if HAVE_ALTIVEC
#ifdef __APPLE__
/*
rip-off from ffmpeg altivec detection code.
this code also appears on Apple's AltiVec pages.
*/
- {
- int sels[2] = {CTL_HW, HW_VECTORUNIT};
- int has_vu = 0;
- size_t len = sizeof(has_vu);
- int err;
+ {
+ int sels[2] = {CTL_HW, HW_VECTORUNIT};
+ int has_vu = 0;
+ size_t len = sizeof(has_vu);
+ int err;
- err = sysctl(sels, 2, &has_vu, &len, NULL, 0);
+ err = sysctl(sels, 2, &has_vu, &len, NULL, 0);
- if (err == 0)
- if (has_vu != 0)
- caps->hasAltiVec = 1;
- }
+ if (err == 0)
+ if (has_vu != 0)
+ caps->hasAltiVec = 1;
+ }
#elif defined(__AMIGAOS4__)
- ULONG result = 0;
+ ULONG result = 0;
- GetCPUInfoTags(GCIT_VectorUnit, &result, TAG_DONE);
- if (result == VECTORTYPE_ALTIVEC)
- caps->hasAltiVec = 1;
+ GetCPUInfoTags(GCIT_VectorUnit, &result, TAG_DONE);
+ if (result == VECTORTYPE_ALTIVEC)
+ caps->hasAltiVec = 1;
#else
/* no Darwin, do it the brute-force way */
/* this is borrowed from the libmpeg2 library */
- {
- signal (SIGILL, sigill_handler);
- if (sigsetjmp (jmpbuf, 1)) {
+ {
+ signal (SIGILL, sigill_handler);
+ if (sigsetjmp (jmpbuf, 1)) {
signal (SIGILL, SIG_DFL);
- } else {
+ } else {
canjump = 1;
- __asm__ volatile ("mtspr 256, %0\n\t"
+ __asm__ volatile ("mtspr 256, %0\n\t"
"vand %%v0, %%v0, %%v0"
:
: "r" (-1));
- signal (SIGILL, SIG_DFL);
- caps->hasAltiVec = 1;
- }
+ signal (SIGILL, SIG_DFL);
+ caps->hasAltiVec = 1;
}
+ }
#endif /* __APPLE__ */
- mp_msg(MSGT_CPUDETECT,MSGL_V,"AltiVec %sfound\n", (caps->hasAltiVec ? "" : "not "));
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"AltiVec %sfound\n", (caps->hasAltiVec ? "" : "not "));
#endif /* HAVE_ALTIVEC */
-if (ARCH_IA64)
- mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: Intel Itanium\n");
+ if (ARCH_IA64)
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: Intel Itanium\n");
-if (ARCH_SPARC)
- mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: Sun Sparc\n");
+ if (ARCH_SPARC)
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: Sun Sparc\n");
-if (ARCH_ARM)
- mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: ARM\n");
+ if (ARCH_ARM)
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: ARM\n");
-if (ARCH_PPC)
- mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: PowerPC\n");
+ if (ARCH_PPC)
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: PowerPC\n");
-if (ARCH_ALPHA)
- mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: Digital Alpha\n");
+ if (ARCH_ALPHA)
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: Digital Alpha\n");
-if (ARCH_MIPS)
- mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: MIPS\n");
+ if (ARCH_MIPS)
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: MIPS\n");
-if (ARCH_PA_RISC)
- mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: Hewlett-Packard PA-RISC\n");
+ if (ARCH_PA_RISC)
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: Hewlett-Packard PA-RISC\n");
-if (ARCH_S390)
- mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: IBM S/390\n");
+ if (ARCH_S390)
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: IBM S/390\n");
-if (ARCH_S390X)
- mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: IBM S/390X\n");
+ if (ARCH_S390X)
+ mp_msg(MSGT_CPUDETECT,MSGL_V,"CPU: IBM S/390X\n");
-if (ARCH_VAX)
- mp_msg(MSGT_CPUDETECT,MSGL_V, "CPU: Digital VAX\n" );
+ if (ARCH_VAX)
+ mp_msg(MSGT_CPUDETECT,MSGL_V, "CPU: Digital VAX\n" );
-if (ARCH_XTENSA)
- mp_msg(MSGT_CPUDETECT,MSGL_V, "CPU: Tensilica Xtensa\n" );
+ if (ARCH_XTENSA)
+ mp_msg(MSGT_CPUDETECT,MSGL_V, "CPU: Tensilica Xtensa\n" );
}
#endif /* !ARCH_X86 */
diff --git a/cpudetect.h b/cpudetect.h
index cf39819d0b..38a7b79d11 100644
--- a/cpudetect.h
+++ b/cpudetect.h
@@ -21,30 +21,30 @@
#include "config.h"
-#define CPUTYPE_I386 3
-#define CPUTYPE_I486 4
-#define CPUTYPE_I586 5
+#define CPUTYPE_I386 3
+#define CPUTYPE_I486 4
+#define CPUTYPE_I586 5
#define CPUTYPE_I686 6
#include "ffmpeg_files/x86_cpu.h"
typedef struct cpucaps_s {
- int cpuType;
- int cpuModel;
- int cpuStepping;
- int hasMMX;
- int hasMMX2;
- int has3DNow;
- int has3DNowExt;
- int hasSSE;
- int hasSSE2;
- int hasSSE3;
- int hasSSSE3;
- int hasSSE4a;
- int isX86;
- unsigned cl_size; /* size of cache line */
- int hasAltiVec;
- int hasTSC;
+ int cpuType;
+ int cpuModel;
+ int cpuStepping;
+ int hasMMX;
+ int hasMMX2;
+ int has3DNow;
+ int has3DNowExt;
+ int hasSSE;
+ int hasSSE2;
+ int hasSSE3;
+ int hasSSSE3;
+ int hasSSE4a;
+ int isX86;
+ unsigned cl_size; /* size of cache line */
+ int hasAltiVec;
+ int hasTSC;
} CpuCaps;
extern CpuCaps gCpuCaps;
diff --git a/cpuinfo.c b/cpuinfo.c
index 2010efd8be..5a39ddb869 100644
--- a/cpuinfo.c
+++ b/cpuinfo.c
@@ -44,319 +44,319 @@ typedef long long int64_t;
#endif
#define CPUID_FEATURE_DEF(bit, desc, description) \
- { bit, desc }
+ { bit, desc }
typedef struct cpuid_regs {
- unsigned int eax;
- unsigned int ebx;
- unsigned int ecx;
- unsigned int edx;
+ unsigned int eax;
+ unsigned int ebx;
+ unsigned int ecx;
+ unsigned int edx;
} cpuid_regs_t;
static cpuid_regs_t
cpuid(int func) {
- cpuid_regs_t regs;
+ cpuid_regs_t regs;
#define CPUID ".byte 0x0f, 0xa2; "
#ifdef __x86_64__
- __asm__("mov %%rbx, %%rsi\n\t"
+ __asm__("mov %%rbx, %%rsi\n\t"
#else
- __asm__("mov %%ebx, %%esi\n\t"
+ __asm__("mov %%ebx, %%esi\n\t"
#endif
- CPUID"\n\t"
+ CPUID"\n\t"
#ifdef __x86_64__
- "xchg %%rsi, %%rbx\n\t"
+ "xchg %%rsi, %%rbx\n\t"
#else
- "xchg %%esi, %%ebx\n\t"
+ "xchg %%esi, %%ebx\n\t"
#endif
- : "=a" (regs.eax), "=S" (regs.ebx), "=c" (regs.ecx), "=d" (regs.edx)
- : "0" (func));
- return regs;
+ : "=a" (regs.eax), "=S" (regs.ebx), "=c" (regs.ecx), "=d" (regs.edx)
+ : "0" (func));
+ return regs;
}
static int64_t
rdtsc(void)
{
- uint32_t hi, lo;
+ uint32_t hi, lo;
#define RDTSC ".byte 0x0f, 0x31; "
- __asm__ volatile (RDTSC : "=a"(lo), "=d"(hi) : );
- return (uint64_t) hi << 32 | lo;
+ __asm__ volatile (RDTSC : "=a"(lo), "=d"(hi) : );
+ return (uint64_t) hi << 32 | lo;
}
static const char*
brandname(int i)
{
- static const char* brandmap[] = {
- NULL,
- "Intel(R) Celeron(R) processor",
- "Intel(R) Pentium(R) III processor",
- "Intel(R) Pentium(R) III Xeon(tm) processor",
- "Intel(R) Pentium(R) III processor",
- NULL,
- "Mobile Intel(R) Pentium(R) III processor-M",
- "Mobile Intel(R) Celeron(R) processor"
- };
+ static const char* brandmap[] = {
+ NULL,
+ "Intel(R) Celeron(R) processor",
+ "Intel(R) Pentium(R) III processor",
+ "Intel(R) Pentium(R) III Xeon(tm) processor",
+ "Intel(R) Pentium(R) III processor",
+ NULL,
+ "Mobile Intel(R) Pentium(R) III processor-M",
+ "Mobile Intel(R) Celeron(R) processor"
+ };
- if (i >= sizeof(brandmap))
- return NULL;
- else
- return brandmap[i];
+ if (i >= sizeof(brandmap))
+ return NULL;
+ else
+ return brandmap[i];
}
static void
store32(char *d, unsigned int v)
{
- d[0] = v & 0xff;
- d[1] = (v >> 8) & 0xff;
- d[2] = (v >> 16) & 0xff;
- d[3] = (v >> 24) & 0xff;
+ d[0] = v & 0xff;
+ d[1] = (v >> 8) & 0xff;
+ d[2] = (v >> 16) & 0xff;
+ d[3] = (v >> 24) & 0xff;
}
int
main(void)
{
- cpuid_regs_t regs, regs_ext;
- char idstr[13];
- unsigned max_cpuid;
- unsigned max_ext_cpuid;
- unsigned int amd_flags;
- unsigned int amd_flags2;
- const char *model_name = NULL;
- int i;
- char processor_name[49];
+ cpuid_regs_t regs, regs_ext;
+ char idstr[13];
+ unsigned max_cpuid;
+ unsigned max_ext_cpuid;
+ unsigned int amd_flags;
+ unsigned int amd_flags2;
+ const char *model_name = NULL;
+ int i;
+ char processor_name[49];
- regs = cpuid(0);
- max_cpuid = regs.eax;
- /* printf("%d CPUID function codes\n", max_cpuid+1); */
+ regs = cpuid(0);
+ max_cpuid = regs.eax;
+ /* printf("%d CPUID function codes\n", max_cpuid+1); */
- store32(idstr+0, regs.ebx);
- store32(idstr+4, regs.edx);
- store32(idstr+8, regs.ecx);
- idstr[12] = 0;
- printf("vendor_id\t: %s\n", idstr);
+ store32(idstr+0, regs.ebx);
+ store32(idstr+4, regs.edx);
+ store32(idstr+8, regs.ecx);
+ idstr[12] = 0;
+ printf("vendor_id\t: %s\n", idstr);
- regs_ext = cpuid((1<<31) + 0);
- max_ext_cpuid = regs_ext.eax;
- if (max_ext_cpuid >= (1<<31) + 1) {
- regs_ext = cpuid((1<<31) + 1);
- amd_flags = regs_ext.edx;
- amd_flags2 = regs_ext.ecx;
+ regs_ext = cpuid((1<<31) + 0);
+ max_ext_cpuid = regs_ext.eax;
+ if (max_ext_cpuid >= (1<<31) + 1) {
+ regs_ext = cpuid((1<<31) + 1);
+ amd_flags = regs_ext.edx;
+ amd_flags2 = regs_ext.ecx;
- if (max_ext_cpuid >= (1<<31) + 4) {
- for (i = 2; i <= 4; i++) {
- regs_ext = cpuid((1<<31) + i);
- store32(processor_name + (i-2)*16, regs_ext.eax);
- store32(processor_name + (i-2)*16 + 4, regs_ext.ebx);
- store32(processor_name + (i-2)*16 + 8, regs_ext.ecx);
- store32(processor_name + (i-2)*16 + 12, regs_ext.edx);
- }
- processor_name[48] = 0;
- model_name = processor_name;
- while (*model_name == ' ') {
- model_name++;
- }
+ if (max_ext_cpuid >= (1<<31) + 4) {
+ for (i = 2; i <= 4; i++) {
+ regs_ext = cpuid((1<<31) + i);
+ store32(processor_name + (i-2)*16, regs_ext.eax);
+ store32(processor_name + (i-2)*16 + 4, regs_ext.ebx);
+ store32(processor_name + (i-2)*16 + 8, regs_ext.ecx);
+ store32(processor_name + (i-2)*16 + 12, regs_ext.edx);
+ }
+ processor_name[48] = 0;
+ model_name = processor_name;
+ while (*model_name == ' ') {
+ model_name++;
+ }
+ }
+ } else {
+ amd_flags = 0;
+ amd_flags2 = 0;
}
- } else {
- amd_flags = 0;
- amd_flags2 = 0;
- }
- if (max_cpuid >= 1) {
- static struct {
- int bit;
- char *desc;
- } cap[] = {
- CPUID_FEATURE_DEF(0, "fpu", "Floating-point unit on-chip"),
- CPUID_FEATURE_DEF(1, "vme", "Virtual Mode Enhancements"),
- CPUID_FEATURE_DEF(2, "de", "Debugging Extension"),
- CPUID_FEATURE_DEF(3, "pse", "Page Size Extension"),
- CPUID_FEATURE_DEF(4, "tsc", "Time Stamp Counter"),
- CPUID_FEATURE_DEF(5, "msr", "Pentium Processor MSR"),
- CPUID_FEATURE_DEF(6, "pae", "Physical Address Extension"),
- CPUID_FEATURE_DEF(7, "mce", "Machine Check Exception"),
- CPUID_FEATURE_DEF(8, "cx8", "CMPXCHG8B Instruction Supported"),
- CPUID_FEATURE_DEF(9, "apic", "On-chip APIC Hardware Enabled"),
- CPUID_FEATURE_DEF(11, "sep", "SYSENTER and SYSEXIT"),
- CPUID_FEATURE_DEF(12, "mtrr", "Memory Type Range Registers"),
- CPUID_FEATURE_DEF(13, "pge", "PTE Global Bit"),
- CPUID_FEATURE_DEF(14, "mca", "Machine Check Architecture"),
- CPUID_FEATURE_DEF(15, "cmov", "Conditional Move/Compare Instruction"),
- CPUID_FEATURE_DEF(16, "pat", "Page Attribute Table"),
- CPUID_FEATURE_DEF(17, "pse36", "Page Size Extension 36-bit"),
- CPUID_FEATURE_DEF(18, "pn", "Processor Serial Number"),
- CPUID_FEATURE_DEF(19, "clflush", "CFLUSH instruction"),
- CPUID_FEATURE_DEF(21, "dts", "Debug Store"),
- CPUID_FEATURE_DEF(22, "acpi", "Thermal Monitor and Clock Ctrl"),
- CPUID_FEATURE_DEF(23, "mmx", "MMX Technology"),
- CPUID_FEATURE_DEF(24, "fxsr", "FXSAVE/FXRSTOR"),
- CPUID_FEATURE_DEF(25, "sse", "SSE Extensions"),
- CPUID_FEATURE_DEF(26, "sse2", "SSE2 Extensions"),
- CPUID_FEATURE_DEF(27, "ss", "Self Snoop"),
- CPUID_FEATURE_DEF(28, "ht", "Multi-threading"),
- CPUID_FEATURE_DEF(29, "tm", "Therm. Monitor"),
- CPUID_FEATURE_DEF(30, "ia64", "IA-64 Processor"),
- CPUID_FEATURE_DEF(31, "pbe", "Pend. Brk. EN."),
- { -1 }
- };
- static struct {
- int bit;
- char *desc;
- } cap2[] = {
- CPUID_FEATURE_DEF(0, "pni", "SSE3 Extensions"),
- CPUID_FEATURE_DEF(1, "pclmulqdq", "Carryless Multiplication"),
- CPUID_FEATURE_DEF(2, "dtes64", "64-bit Debug Store"),
- CPUID_FEATURE_DEF(3, "monitor", "MONITOR/MWAIT"),
- CPUID_FEATURE_DEF(4, "ds_cpl", "CPL Qualified Debug Store"),
- CPUID_FEATURE_DEF(5, "vmx", "Virtual Machine Extensions"),
- CPUID_FEATURE_DEF(6, "smx", "Safer Mode Extensions"),
- CPUID_FEATURE_DEF(7, "est", "Enhanced Intel SpeedStep Technology"),
- CPUID_FEATURE_DEF(8, "tm2", "Thermal Monitor 2"),
- CPUID_FEATURE_DEF(9, "ssse3", "Supplemental SSE3"),
- CPUID_FEATURE_DEF(10, "cid", "L1 Context ID"),
- CPUID_FEATURE_DEF(12, "fma", "Fused Multiply Add"),
- CPUID_FEATURE_DEF(13, "cx16", "CMPXCHG16B Available"),
- CPUID_FEATURE_DEF(14, "xtpr", "xTPR Disable"),
- CPUID_FEATURE_DEF(15, "pdcm", "Perf/Debug Capability MSR"),
- CPUID_FEATURE_DEF(18, "dca", "Direct Cache Access"),
- CPUID_FEATURE_DEF(19, "sse4_1", "SSE4.1 Extensions"),
- CPUID_FEATURE_DEF(20, "sse4_2", "SSE4.2 Extensions"),
- CPUID_FEATURE_DEF(21, "x2apic", "x2APIC Feature"),
- CPUID_FEATURE_DEF(22, "movbe", "MOVBE Instruction"),
- CPUID_FEATURE_DEF(23, "popcnt", "Pop Count Instruction"),
- CPUID_FEATURE_DEF(25, "aes", "AES Instruction"),
- CPUID_FEATURE_DEF(26, "xsave", "XSAVE/XRSTOR Extensions"),
- CPUID_FEATURE_DEF(27, "osxsave", "XSAVE/XRSTOR Enabled in the OS"),
- CPUID_FEATURE_DEF(28, "avx", "Advanced Vector Extension"),
- { -1 }
- };
- static struct {
- int bit;
- char *desc;
- } cap_amd[] = {
- CPUID_FEATURE_DEF(11, "syscall", "SYSCALL and SYSRET"),
- CPUID_FEATURE_DEF(19, "mp", "MP Capable"),
- CPUID_FEATURE_DEF(20, "nx", "No-Execute Page Protection"),
- CPUID_FEATURE_DEF(22, "mmxext", "MMX Technology (AMD Extensions)"),
- CPUID_FEATURE_DEF(25, "fxsr_opt", "Fast FXSAVE/FXRSTOR"),
- CPUID_FEATURE_DEF(26, "pdpe1gb", "PDP Entry for 1GiB Page"),
- CPUID_FEATURE_DEF(27, "rdtscp", "RDTSCP Instruction"),
- CPUID_FEATURE_DEF(29, "lm", "Long Mode Capable"),
- CPUID_FEATURE_DEF(30, "3dnowext", "3DNow! Extensions"),
- CPUID_FEATURE_DEF(31, "3dnow", "3DNow!"),
- { -1 }
- };
- static struct {
- int bit;
- char *desc;
- } cap_amd2[] = {
- CPUID_FEATURE_DEF(0, "lahf_lm", "LAHF/SAHF Supported in 64-bit Mode"),
- CPUID_FEATURE_DEF(1, "cmp_legacy", "Chip Multi-Core"),
- CPUID_FEATURE_DEF(2, "svm", "Secure Virtual Machine"),
- CPUID_FEATURE_DEF(3, "extapic", "Extended APIC Space"),
- CPUID_FEATURE_DEF(4, "cr8_legacy", "CR8 Available in Legacy Mode"),
- CPUID_FEATURE_DEF(5, "abm", "Advanced Bit Manipulation"),
- CPUID_FEATURE_DEF(6, "sse4a", "SSE4A Extensions"),
- CPUID_FEATURE_DEF(7, "misalignsse", "Misaligned SSE Mode"),
- CPUID_FEATURE_DEF(8, "3dnowprefetch", "3DNow! Prefetch/PrefetchW"),
- CPUID_FEATURE_DEF(9, "osvw", "OS Visible Workaround"),
- CPUID_FEATURE_DEF(10, "ibs", "Instruction Based Sampling"),
- CPUID_FEATURE_DEF(11, "sse5", "SSE5 Extensions"),
- CPUID_FEATURE_DEF(12, "skinit", "SKINIT, STGI, and DEV Support"),
- CPUID_FEATURE_DEF(13, "wdt", "Watchdog Timer Support"),
- { -1 }
- };
- unsigned int family, model, stepping;
+ if (max_cpuid >= 1) {
+ static struct {
+ int bit;
+ char *desc;
+ } cap[] = {
+ CPUID_FEATURE_DEF(0, "fpu", "Floating-point unit on-chip"),
+ CPUID_FEATURE_DEF(1, "vme", "Virtual Mode Enhancements"),
+ CPUID_FEATURE_DEF(2, "de", "Debugging Extension"),
+ CPUID_FEATURE_DEF(3, "pse", "Page Size Extension"),
+ CPUID_FEATURE_DEF(4, "tsc", "Time Stamp Counter"),
+ CPUID_FEATURE_DEF(5, "msr", "Pentium Processor MSR"),
+ CPUID_FEATURE_DEF(6, "pae", "Physical Address Extension"),
+ CPUID_FEATURE_DEF(7, "mce", "Machine Check Exception"),
+ CPUID_FEATURE_DEF(8, "cx8", "CMPXCHG8B Instruction Supported"),
+ CPUID_FEATURE_DEF(9, "apic", "On-chip APIC Hardware Enabled"),
+ CPUID_FEATURE_DEF(11, "sep", "SYSENTER and SYSEXIT"),
+ CPUID_FEATURE_DEF(12, "mtrr", "Memory Type Range Registers"),
+ CPUID_FEATURE_DEF(13, "pge", "PTE Global Bit"),
+ CPUID_FEATURE_DEF(14, "mca", "Machine Check Architecture"),
+ CPUID_FEATURE_DEF(15, "cmov", "Conditional Move/Compare Instruction"),
+ CPUID_FEATURE_DEF(16, "pat", "Page Attribute Table"),
+ CPUID_FEATURE_DEF(17, "pse36", "Page Size Extension 36-bit"),
+ CPUID_FEATURE_DEF(18, "pn", "Processor Serial Number"),
+ CPUID_FEATURE_DEF(19, "clflush", "CFLUSH instruction"),
+ CPUID_FEATURE_DEF(21, "dts", "Debug Store"),
+ CPUID_FEATURE_DEF(22, "acpi", "Thermal Monitor and Clock Ctrl"),
+ CPUID_FEATURE_DEF(23, "mmx", "MMX Technology"),
+ CPUID_FEATURE_DEF(24, "fxsr", "FXSAVE/FXRSTOR"),
+ CPUID_FEATURE_DEF(25, "sse", "SSE Extensions"),
+ CPUID_FEATURE_DEF(26, "sse2", "SSE2 Extensions"),
+ CPUID_FEATURE_DEF(27, "ss", "Self Snoop"),
+ CPUID_FEATURE_DEF(28, "ht", "Multi-threading"),
+ CPUID_FEATURE_DEF(29, "tm", "Therm. Monitor"),
+ CPUID_FEATURE_DEF(30, "ia64", "IA-64 Processor"),
+ CPUID_FEATURE_DEF(31, "pbe", "Pend. Brk. EN."),
+ { -1 }
+ };
+ static struct {
+ int bit;
+ char *desc;
+ } cap2[] = {
+ CPUID_FEATURE_DEF(0, "pni", "SSE3 Extensions"),
+ CPUID_FEATURE_DEF(1, "pclmulqdq", "Carryless Multiplication"),
+ CPUID_FEATURE_DEF(2, "dtes64", "64-bit Debug Store"),
+ CPUID_FEATURE_DEF(3, "monitor", "MONITOR/MWAIT"),
+ CPUID_FEATURE_DEF(4, "ds_cpl", "CPL Qualified Debug Store"),
+ CPUID_FEATURE_DEF(5, "vmx", "Virtual Machine Extensions"),
+ CPUID_FEATURE_DEF(6, "smx", "Safer Mode Extensions"),
+ CPUID_FEATURE_DEF(7, "est", "Enhanced Intel SpeedStep Technology"),
+ CPUID_FEATURE_DEF(8, "tm2", "Thermal Monitor 2"),
+ CPUID_FEATURE_DEF(9, "ssse3", "Supplemental SSE3"),
+ CPUID_FEATURE_DEF(10, "cid", "L1 Context ID"),
+ CPUID_FEATURE_DEF(12, "fma", "Fused Multiply Add"),
+ CPUID_FEATURE_DEF(13, "cx16", "CMPXCHG16B Available"),
+ CPUID_FEATURE_DEF(14, "xtpr", "xTPR Disable"),
+ CPUID_FEATURE_DEF(15, "pdcm", "Perf/Debug Capability MSR"),
+ CPUID_FEATURE_DEF(18, "dca", "Direct Cache Access"),
+ CPUID_FEATURE_DEF(19, "sse4_1", "SSE4.1 Extensions"),
+ CPUID_FEATURE_DEF(20, "sse4_2", "SSE4.2 Extensions"),
+ CPUID_FEATURE_DEF(21, "x2apic", "x2APIC Feature"),
+ CPUID_FEATURE_DEF(22, "movbe", "MOVBE Instruction"),
+ CPUID_FEATURE_DEF(23, "popcnt", "Pop Count Instruction"),
+ CPUID_FEATURE_DEF(25, "aes", "AES Instruction"),
+ CPUID_FEATURE_DEF(26, "xsave", "XSAVE/XRSTOR Extensions"),
+ CPUID_FEATURE_DEF(27, "osxsave", "XSAVE/XRSTOR Enabled in the OS"),
+ CPUID_FEATURE_DEF(28, "avx", "Advanced Vector Extension"),
+ { -1 }
+ };
+ static struct {
+ int bit;
+ char *desc;
+ } cap_amd[] = {
+ CPUID_FEATURE_DEF(11, "syscall", "SYSCALL and SYSRET"),
+ CPUID_FEATURE_DEF(19, "mp", "MP Capable"),
+ CPUID_FEATURE_DEF(20, "nx", "No-Execute Page Protection"),
+ CPUID_FEATURE_DEF(22, "mmxext", "MMX Technology (AMD Extensions)"),
+ CPUID_FEATURE_DEF(25, "fxsr_opt", "Fast FXSAVE/FXRSTOR"),
+ CPUID_FEATURE_DEF(26, "pdpe1gb", "PDP Entry for 1GiB Page"),
+ CPUID_FEATURE_DEF(27, "rdtscp", "RDTSCP Instruction"),
+ CPUID_FEATURE_DEF(29, "lm", "Long Mode Capable"),
+ CPUID_FEATURE_DEF(30, "3dnowext", "3DNow! Extensions"),
+ CPUID_FEATURE_DEF(31, "3dnow", "3DNow!"),
+ { -1 }
+ };
+ static struct {
+ int bit;
+ char *desc;
+ } cap_amd2[] = {
+ CPUID_FEATURE_DEF(0, "lahf_lm", "LAHF/SAHF Supported in 64-bit Mode"),
+ CPUID_FEATURE_DEF(1, "cmp_legacy", "Chip Multi-Core"),
+ CPUID_FEATURE_DEF(2, "svm", "Secure Virtual Machine"),
+ CPUID_FEATURE_DEF(3, "extapic", "Extended APIC Space"),
+ CPUID_FEATURE_DEF(4, "cr8_legacy", "CR8 Available in Legacy Mode"),
+ CPUID_FEATURE_DEF(5, "abm", "Advanced Bit Manipulation"),
+ CPUID_FEATURE_DEF(6, "sse4a", "SSE4A Extensions"),
+ CPUID_FEATURE_DEF(7, "misalignsse", "Misaligned SSE Mode"),
+ CPUID_FEATURE_DEF(8, "3dnowprefetch", "3DNow! Prefetch/PrefetchW"),
+ CPUID_FEATURE_DEF(9, "osvw", "OS Visible Workaround"),
+ CPUID_FEATURE_DEF(10, "ibs", "Instruction Based Sampling"),
+ CPUID_FEATURE_DEF(11, "sse5", "SSE5 Extensions"),
+ CPUID_FEATURE_DEF(12, "skinit", "SKINIT, STGI, and DEV Support"),
+ CPUID_FEATURE_DEF(13, "wdt", "Watchdog Timer Support"),
+ { -1 }
+ };
+ unsigned int family, model, stepping;
- regs = cpuid(1);
- family = (regs.eax >> 8) & 0xf;
- model = (regs.eax >> 4) & 0xf;
- stepping = regs.eax & 0xf;
+ regs = cpuid(1);
+ family = (regs.eax >> 8) & 0xf;
+ model = (regs.eax >> 4) & 0xf;
+ stepping = regs.eax & 0xf;
- if (family == 0xf)
- family += (regs.eax >> 20) & 0xff;
- if (family == 0xf || family == 6)
- model += ((regs.eax >> 16) & 0xf) << 4;
+ if (family == 0xf)
+ family += (regs.eax >> 20) & 0xff;
+ if (family == 0xf || family == 6)
+ model += ((regs.eax >> 16) & 0xf) << 4;
- printf("cpu family\t: %d\n"
- "model\t\t: %d\n"
- "stepping\t: %d\n" ,
- family,
- model,
- stepping);
+ printf("cpu family\t: %d\n"
+ "model\t\t: %d\n"
+ "stepping\t: %d\n" ,
+ family,
+ model,
+ stepping);
- if (strstr(idstr, "Intel") && !model_name) {
- if (family == 6 && model == 0xb && stepping == 1)
- model_name = "Intel (R) Celeron (R) processor";
- else
- model_name = brandname(regs.ebx & 0xf);
- }
+ if (strstr(idstr, "Intel") && !model_name) {
+ if (family == 6 && model == 0xb && stepping == 1)
+ model_name = "Intel (R) Celeron (R) processor";
+ else
+ model_name = brandname(regs.ebx & 0xf);
+ }
- printf("flags\t\t:");
- for (i = 0; cap[i].bit >= 0; i++) {
- if (regs.edx & (1 << cap[i].bit)) {
- printf(" %s", cap[i].desc);
- }
- }
- for (i = 0; cap2[i].bit >= 0; i++) {
- if (regs.ecx & (1 << cap2[i].bit)) {
- printf(" %s", cap2[i].desc);
- }
- }
- /* k6_mtrr is supported by some AMD K6-2/K6-III CPUs but
- it is not indicated by a CPUID feature bit, so we
- have to check the family, model and stepping instead. */
- if (strstr(idstr, "AMD") &&
- family == 5 &&
- (model >= 9 || (model == 8 && stepping >= 8)))
- printf(" %s", "k6_mtrr");
- /* similar for cyrix_arr. */
- if (strstr(idstr, "Cyrix") &&
- (family == 5 && (model < 4 || family == 6)))
- printf(" %s", "cyrix_arr");
- /* as well as centaur_mcr. */
- if (strstr(idstr, "Centaur") &&
- family == 5)
- printf(" %s", "centaur_mcr");
+ printf("flags\t\t:");
+ for (i = 0; cap[i].bit >= 0; i++) {
+ if (regs.edx & (1 << cap[i].bit)) {
+ printf(" %s", cap[i].desc);
+ }
+ }
+ for (i = 0; cap2[i].bit >= 0; i++) {
+ if (regs.ecx & (1 << cap2[i].bit)) {
+ printf(" %s", cap2[i].desc);
+ }
+ }
+ /* k6_mtrr is supported by some AMD K6-2/K6-III CPUs but
+ it is not indicated by a CPUID feature bit, so we
+ have to check the family, model and stepping instead. */
+ if (strstr(idstr, "AMD") &&
+ family == 5 &&
+ (model >= 9 || (model == 8 && stepping >= 8)))
+ printf(" %s", "k6_mtrr");
+ /* similar for cyrix_arr. */
+ if (strstr(idstr, "Cyrix") &&
+ (family == 5 && (model < 4 || family == 6)))
+ printf(" %s", "cyrix_arr");
+ /* as well as centaur_mcr. */
+ if (strstr(idstr, "Centaur") &&
+ family == 5)
+ printf(" %s", "centaur_mcr");
- for (i = 0; cap_amd[i].bit >= 0; i++) {
- if (amd_flags & (1 << cap_amd[i].bit)) {
- printf(" %s", cap_amd[i].desc);
- }
- }
- for (i = 0; cap_amd2[i].bit >= 0; i++) {
- if (amd_flags2 & (1 << cap_amd2[i].bit)) {
- printf(" %s", cap_amd2[i].desc);
- }
- }
- printf("\n");
+ for (i = 0; cap_amd[i].bit >= 0; i++) {
+ if (amd_flags & (1 << cap_amd[i].bit)) {
+ printf(" %s", cap_amd[i].desc);
+ }
+ }
+ for (i = 0; cap_amd2[i].bit >= 0; i++) {
+ if (amd_flags2 & (1 << cap_amd2[i].bit)) {
+ printf(" %s", cap_amd2[i].desc);
+ }
+ }
+ printf("\n");
- if (regs.edx & (1 << 4)) {
- int64_t tsc_start, tsc_end;
- struct timeval tv_start, tv_end;
- int usec_delay;
+ if (regs.edx & (1 << 4)) {
+ int64_t tsc_start, tsc_end;
+ struct timeval tv_start, tv_end;
+ int usec_delay;
- tsc_start = rdtsc();
- gettimeofday(&tv_start, NULL);
+ tsc_start = rdtsc();
+ gettimeofday(&tv_start, NULL);
#ifdef MISSING_USLEEP
- sleep(1);
+ sleep(1);
#else
- usleep(100000);
+ usleep(100000);
#endif
- tsc_end = rdtsc();
- gettimeofday(&tv_end, NULL);
+ tsc_end = rdtsc();
+ gettimeofday(&tv_end, NULL);
- usec_delay = 1000000 * (tv_end.tv_sec - tv_start.tv_sec)
- + (tv_end.tv_usec - tv_start.tv_usec);
+ usec_delay = 1000000 * (tv_end.tv_sec - tv_start.tv_sec)
+ + (tv_end.tv_usec - tv_start.tv_usec);
- printf("cpu MHz\t\t: %.3f\n",
- (double)(tsc_end-tsc_start) / usec_delay);
+ printf("cpu MHz\t\t: %.3f\n",
+ (double)(tsc_end-tsc_start) / usec_delay);
+ }
}
- }
- printf("model name\t: ");
- if (model_name)
- printf("%s\n", model_name);
- else
- printf("Unknown %s CPU\n", idstr);
+ printf("model name\t: ");
+ if (model_name)
+ printf("%s\n", model_name);
+ else
+ printf("Unknown %s CPU\n", idstr);
}
diff --git a/edl.h b/edl.h
index f7f8b81122..8160acb952 100644
--- a/edl.h
+++ b/edl.h
@@ -28,12 +28,12 @@
#define EDL_MUTE_END 0
struct edl_record {
- float start_sec;
- float stop_sec;
- float length_sec;
- short action;
- struct edl_record* next;
- struct edl_record* prev;
+ float start_sec;
+ float stop_sec;
+ float length_sec;
+ short action;
+ struct edl_record* next;
+ struct edl_record* prev;
};
typedef struct edl_record* edl_record_ptr;