Index: libvo/vo_png.c =================================================================== RCS file: /cvsroot/mplayer/main/libvo/vo_png.c,v retrieving revision 1.24 diff -u -r1.24 vo_png.c --- libvo/vo_png.c 19 Jul 2004 23:11:06 -0000 1.24 +++ libvo/vo_png.c 26 Aug 2004 21:50:06 -0000 @@ -17,6 +17,7 @@ #include "config.h" #include "video_out.h" #include "video_out_internal.h" +#include "../mp_msg.h" static vo_info_t info = { @@ -30,6 +31,7 @@ extern int verbose; int z_compression = Z_NO_COMPRESSION; +char * png_outdir = "."; static int framenum = 0; struct pngdata { @@ -208,11 +210,40 @@ static uint32_t preinit(const char *arg) { - if(arg) - { - printf("PNG Unknown subdevice: %s\n",arg); - return ENOSYS; - } + unsigned int errors=0; + while(arg && *arg!='\0') + { + if(*arg ==':') ++arg; + if(strncmp(arg,"outdir=",7)==0) + { + arg+=7; + const char *end=arg; + while(end && *end !='\0' && *end!=':' ) ++end; + size_t len=end-arg; + if(len) + { + png_outdir=malloc(len+1); + strncpy(png_outdir,arg,len); + png_outdir[len]='\0'; + arg+=len; + }else + printf("vo_png: Empty outdir string given, using ./ as outdir path\n"); + }else if(strncmp(arg,"z=",2)==0){ + arg+=2; + z_compression=atoi(arg); + while(isdigit(*arg)) ++arg; //go to next arg + }else if(*arg!='\0'){ //something unrecognizeable found + ++errors; + const char *temp=arg; + while(*temp!='\0' && *temp!=':') ++temp; + size_t len=temp-arg; + mp_msg(MSGT_VO, MSGL_ERR, "vo_png: Unknown subdevice input: %.*s\n", len,arg); + arg=temp; + } + } + + if(errors) + return ENOSYS; return 0; }