Web lists-archives.com

[MPlayer-dev-eng] [PATCH] Print screenshot message after screenshot file is saved




When screenshot is requeste from mplayer, mplayer prints message like

*** screenshot 'shot0001.png' ***

before the file is actually saved to disk. That's very inconvenient
for application
using mplayer in slave mode that wants to save screenshot files in some separate
place with user-defined name. Because application has to wait until
that file appears
in mplayer's working directory and check somehow that it is fully written.

I suggest to move this message from gen_fname() to write_png() and
print it after
the file is closed
Index: libmpcodecs/vf_screenshot.c
===================================================================
--- libmpcodecs/vf_screenshot.c	(revision 37329)
+++ libmpcodecs/vf_screenshot.c	(working copy)
@@ -121,6 +121,7 @@
         fwrite(priv->outbuffer, pkt.size, 1, fp);
 
     fclose (fp);
+    mp_msg(MSGT_VFILTER,MSGL_INFO,"*** screenshot '%s' ***\n",priv->fname);
 }
 
 static int fexists(char *fname)
@@ -139,8 +140,6 @@
         return;
     }
 
-    mp_msg(MSGT_VFILTER,MSGL_INFO,"*** screenshot '%s' ***\n",priv->fname);
-
 }
 
 static void scale_image(struct vf_priv_s* priv, mp_image_t *mpi)
_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng@xxxxxxxxxxxx
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng