[MPlayer-cvslog] r32947 - trunk/libmpcodecs/ve_lavc.c

ranma subversion at mplayerhq.hu
Mon Feb 21 15:52:26 CET 2011


Author: ranma
Date: Mon Feb 21 15:52:25 2011
New Revision: 32947

Log:
Make sure we don't store the same stats twice by nulling the first byte of the stats_out string once we have written it.

I've verified that this is necessary, without it at normally at least the last stats line is duplicated, it could also happen when we call encode_video more often due to encoder delay as Reimar noted.

Sample encode was with default -ovc lavc -lavcopts vpass=1:
--- pass1stats.log	2011-02-21 15:44:42.314259000 +0100
+++ pass1stats.log.dedup_patch	2011-02-21 15:41:51.262778000 +0100
@@ -6421,4 +6421,3 @@
 in:6420 out:6420 type:2 q:239 itex:0 ptex:15905 mv:441 misc:1911 fcode:1 bcode:1 mc-var:989 var:350603 icount:0 skipcount:373 hbits:55;
 in:6421 out:6421 type:2 q:247 itex:0 ptex:13020 mv:422 misc:1863 fcode:1 bcode:1 mc-var:953 var:352607 icount:0 skipcount:379 hbits:55;
 in:6422 out:6422 type:2 q:252 itex:0 ptex:3162 mv:258 misc:1293 fcode:1 bcode:1 mc-var:837 var:352872 icount:0 skipcount:449 hbits:55;
-in:6422 out:6422 type:2 q:252 itex:0 ptex:3162 mv:258 misc:1293 fcode:1 bcode:1 mc-var:837 var:352872 icount:0 skipcount:449 hbits:55;

Modified:
   trunk/libmpcodecs/ve_lavc.c

Modified: trunk/libmpcodecs/ve_lavc.c
==============================================================================
--- trunk/libmpcodecs/ve_lavc.c	Mon Feb 21 12:03:33 2011	(r32946)
+++ trunk/libmpcodecs/ve_lavc.c	Mon Feb 21 15:52:25 2011	(r32947)
@@ -813,8 +813,11 @@ static int encode_frame(struct vf_instan
 	    pic);
 
     /* store stats if there are any */
-    if(lavc_venc_context->stats_out && stats_file)
+    if(lavc_venc_context->stats_out && stats_file) {
         fprintf(stats_file, "%s", lavc_venc_context->stats_out);
+        /* make sure we can't accidentally store the same stats twice */
+        lavc_venc_context->stats_out[0] = 0;
+    }
 
     if(pts != MP_NOPTS_VALUE)
         dts= pts - lavc_venc_context->delay * av_q2d(lavc_venc_context->time_base);


More information about the MPlayer-cvslog mailing list