# HG changeset patch # User reimar # Date 1082053179 0 # Node ID 2e8b305586a0a8943039056fbccf1d08cc617340 # Parent 78ef87bd576d65b2c83959114a9252ed4877d619 fixed suboption parsing, added help for suboptions diff -r 78ef87bd576d -r 2e8b305586a0 libvo/vo_gl.c --- a/libvo/vo_gl.c Thu Apr 15 13:56:06 2004 +0000 +++ b/libvo/vo_gl.c Thu Apr 15 18:19:39 2004 +0000 @@ -324,6 +324,10 @@ int i; uint8_t *ImageData=src[0]; + if (slice_height == 0) + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, image_width, image_height, + gl_format, gl_type, ImageData); + else for(i=0;i= 1.2 and used corresponding headers for compiling!"); - many_fmts = 1; - arg = &arg[8]; - } - if (arg[0] != 0) { - slice_height = atoi(arg); - if (slice_height <= 0) - slice_height = 65536; - } + char *parse_pos = &arg[0]; + while (parse_pos[0] && !parse_err) { + if (strncmp (parse_pos, "manyfmts", 8) == 0) { + parse_pos = &parse_pos[8]; + many_fmts = 1; + } else if (strncmp (parse_pos, "slice-height=", 13) == 0) { + parse_pos = &parse_pos[13]; + slice_height = strtol(parse_pos, &parse_pos, 0); + if (slice_height < 0) parse_err = 1; + } + if (parse_pos[0] == ':') parse_pos = &parse_pos[1]; + else if (parse_pos[0]) parse_err = 1; + } } - mp_msg(MSGT_VO, MSGL_INFO, "[vo_gl] Using %d as slice_height (0 means image_height).\n", slice_height); - + if (parse_err) { + mp_msg(MSGT_VO, MSGL_ERR, + "\n-vo gl command line help:\n" + "Example: mplayer -vo gl:slice-height=4\n" + "\nOptions:\n" + " manyfmts\n" + " Enable extended color formats for OpenGL 1.2 and later\n" + " slice-height=<0-...>\n" + " Slice size for texture transfer, 0 for whole image\n" + "\n" ); + return -1; + } + if (many_fmts) + mp_msg (MSGT_VO, MSGL_WARN, "[gl] using extended formats.\n" + "Make sure you have OpenGL >= 1.2 and used corresponding " + "headers for compiling!\n"); + mp_msg (MSGT_VO, MSGL_INFO, "[gl] Using %d as slice height " + "(0 means image height).\n", slice_height); if( !vo_init() ) return -1; // Can't open X11 return 0;