[MPlayer-cvslog] CVS: main/libmpcodecs vf_screenshot.c,1.4,1.5

Jindrich Makovicka CVS syncmail at mplayerhq.hu
Sun Sep 11 17:41:10 CEST 2005


CVS change done by Jindrich Makovicka CVS

Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var2/tmp/cvs-serv8060

Modified Files:
	vf_screenshot.c 
Log Message:
do nothing if no free filenames are available

Index: vf_screenshot.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_screenshot.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- vf_screenshot.c	11 Sep 2005 15:08:48 -0000	1.4
+++ vf_screenshot.c	11 Sep 2005 15:41:08 -0000	1.5
@@ -120,7 +120,10 @@
     do {
 	snprintf (priv->fname, 100, "shot%04d.png", ++priv->frameno);
     } while (fexists(priv->fname) && priv->frameno < 100000);
-    if (fexists(priv->fname)) return;
+    if (fexists(priv->fname)) {
+	priv->fname[0] = '\0';
+	return;
+    }
 
     mp_msg(MSGT_VFILTER,MSGL_INFO,"*** screenshot '%s' ***\n",priv->fname);
 
@@ -209,7 +212,8 @@
 	if(vf->priv->store_slices) {
 	    vf->priv->store_slices = 0;
 	    gen_fname(vf->priv);
-	    write_png(vf->priv->fname, vf->priv->buffer, vf->priv->dw, vf->priv->dh, vf->priv->stride);
+	    if (vf->priv->fname[0])
+		write_png(vf->priv->fname, vf->priv->buffer, vf->priv->dw, vf->priv->dh, vf->priv->stride);
 	}
 	return vf_next_put_image(vf,vf->dmpi);
     }
@@ -235,8 +239,10 @@
     if(vf->priv->shot) {
 	vf->priv->shot=0;
 	gen_fname(vf->priv);
-	scale_image(vf->priv);
-	write_png(vf->priv->fname, vf->priv->buffer, vf->priv->dw, vf->priv->dh, vf->priv->stride);
+	if (vf->priv->fname[0]) {
+	    scale_image(vf->priv);
+	    write_png(vf->priv->fname, vf->priv->buffer, vf->priv->dw, vf->priv->dh, vf->priv->stride);
+	}
     }
 
     return vf_next_put_image(vf, vf->priv->dmpi);




More information about the MPlayer-cvslog mailing list