Index: cfg-mplayer.h =================================================================== RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v retrieving revision 1.226 diff -u -r1.226 cfg-mplayer.h --- cfg-mplayer.h 23 Aug 2004 00:31:32 -0000 1.226 +++ cfg-mplayer.h 25 Aug 2004 13:08:44 -0000 @@ -28,6 +28,7 @@ #endif #ifdef HAVE_PNG extern int z_compression; +extern char * png_outdir; #endif #ifdef HAVE_JPEG extern int jpeg_baseline; @@ -156,6 +157,13 @@ }; #endif +#ifdef HAVE_PNG +m_option_t png_conf[]={ + {"outdir", &png_outdir, CONF_TYPE_STRING, 0, 0, 0, NULL}, + {NULL, NULL, 0, 0, 0, 0, NULL} +}; +#endif //HAVE_PNG + extern int sws_flags; extern int readPPOpt(void *conf, char *arg); extern void revertPPOpt(void *conf, char* opt); @@ -221,6 +229,7 @@ // -vo png only: #ifdef HAVE_PNG {"z", &z_compression, CONF_TYPE_INT, CONF_RANGE, 0, 9, NULL}, + {"png", png_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, #endif // -vo jpeg only: #ifdef HAVE_JPEG Index: libvo/vo_jpeg.c =================================================================== RCS file: /cvsroot/mplayer/main/libvo/vo_jpeg.c,v retrieving revision 1.12 diff -u -r1.12 vo_jpeg.c --- libvo/vo_jpeg.c 19 Jul 2004 23:11:06 -0000 1.12 +++ libvo/vo_jpeg.c 25 Aug 2004 13:08:45 -0000 @@ -93,7 +93,6 @@ { char buf[256]; uint8_t *dst= src[0]; - snprintf (buf, 256, "%s/%08d.jpg", jpeg_outdir, ++framenum); return jpeg_write( buf,src[0] ); @@ -129,7 +128,14 @@ } static uint32_t preinit(const char *arg) -{ +{ + if(arg!=NULL) + { + char * temp=NULL; + temp=strstr(arg,"="); + if(temp!=NULL && *temp!='\0') + jpeg_outdir=++temp; + } return 0; } 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 25 Aug 2004 13:08:45 -0000 @@ -32,6 +32,8 @@ int z_compression = Z_NO_COMPRESSION; static int framenum = 0; +char * png_outdir = "."; + struct pngdata { FILE * fp; png_structp png_ptr; @@ -152,9 +154,8 @@ // if -dr or -slices then do nothing: if(mpi->flags&(MP_IMGFLAG_DIRECT|MP_IMGFLAG_DRAW_CALLBACK)) return VO_TRUE; - - snprintf (buf, 100, "%08d.png", ++framenum); - + snprintf (buf, 100, "%s/%08d.png", png_outdir, ++framenum); + png = create_png(buf, mpi->w, mpi->h, mpi->flags&MP_IMGFLAG_SWAPPED); if(png.status){ @@ -208,10 +209,12 @@ static uint32_t preinit(const char *arg) { - if(arg) + if(arg!=NULL) { - printf("PNG Unknown subdevice: %s\n",arg); - return ENOSYS; + char * temp=NULL; + temp=strstr(arg,"="); + if(temp!=NULL && *temp!='\0') + png_outdir=++temp; } return 0; }