[MPlayer-cvslog] r32842 - in trunk: DOCS/man/en/mplayer.1 libvo/vo_png.c

cboesch subversion at mplayerhq.hu
Thu Feb 3 00:55:16 CET 2011


Author: cboesch
Date: Thu Feb  3 00:55:16 2011
New Revision: 32842

Log:
Add prefix filename option for PNG video output.

Patch by Marco Aurélio Graciotto Silva, magsilva gmail.

Modified:
   trunk/libvo/vo_png.c

Changes in other areas also in this revision:
Modified:
   trunk/DOCS/man/en/mplayer.1

Modified: trunk/libvo/vo_png.c
==============================================================================
--- trunk/libvo/vo_png.c	Wed Feb  2 19:30:20 2011	(r32841)
+++ trunk/libvo/vo_png.c	Thu Feb  3 00:55:16 2011	(r32842)
@@ -54,6 +54,7 @@ const LIBVO_EXTERN (png)
 
 static int z_compression;
 static char *png_outdir;
+static char *png_outfile_prefix;
 static int framenum;
 static int use_alpha;
 static AVCodecContext *avctx;
@@ -135,7 +136,7 @@ static uint32_t draw_image(mp_image_t* m
     // if -dr or -slices then do nothing:
     if(mpi->flags&(MP_IMGFLAG_DIRECT|MP_IMGFLAG_DRAW_CALLBACK)) return VO_TRUE;
 
-    snprintf (buf, 100, "%s/%08d.png", png_outdir, ++framenum);
+    snprintf (buf, 100, "%s/%s%08d.png", png_outdir, png_outfile_prefix, ++framenum);
     outfile = fopen(buf, "wb");
     if (!outfile) {
         mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_PNG_ErrorOpeningForWriting, strerror(errno));
@@ -201,6 +202,8 @@ static void uninit(void){
     outbuffer_size = 0;
     free(png_outdir);
     png_outdir = NULL;
+    free(png_outfile_prefix);
+    png_outfile_prefix = NULL;
 }
 
 static void check_events(void){}
@@ -215,6 +218,7 @@ static const opt_t subopts[] = {
     {"alpha", OPT_ARG_BOOL, &use_alpha, NULL},
     {"z",   OPT_ARG_INT, &z_compression, int_zero_to_nine},
     {"outdir",      OPT_ARG_MSTRZ,  &png_outdir,           NULL},
+    {"prefix", OPT_ARG_MSTRZ, &png_outfile_prefix, NULL },
     {NULL}
 };
 
@@ -222,6 +226,7 @@ static int preinit(const char *arg)
 {
     z_compression = 0;
     png_outdir = strdup(".");
+    png_outfile_prefix = strdup("");
     use_alpha = 0;
     if (subopt_parse(arg, subopts) != 0) {
         return -1;


More information about the MPlayer-cvslog mailing list