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

ranma subversion at mplayerhq.hu
Sat Feb 19 10:17:38 CET 2011


Author: ranma
Date: Sat Feb 19 10:17:38 2011
New Revision: 32928

Log:
For codecs that produce no data on the first pass, e.g.
libtheora/libvpx, the stats file will come out empty due to the fact
that the check for stats is after one on the output frame size.
The attached moves the stats check prior to this. I verified that the
stats file generated for x264 is unaffected by this change.

Patch by James Zern, jzern google com

Modified:
   trunk/libmpcodecs/ve_lavc.c

Modified: trunk/libmpcodecs/ve_lavc.c
==============================================================================
--- trunk/libmpcodecs/ve_lavc.c	Fri Feb 18 23:14:47 2011	(r32927)
+++ trunk/libmpcodecs/ve_lavc.c	Sat Feb 19 10:17:38 2011	(r32928)
@@ -812,6 +812,10 @@ static int encode_frame(struct vf_instan
 	out_size = avcodec_encode_video(lavc_venc_context, mux_v->buffer, mux_v->buffer_size,
 	    pic);
 
+    /* store stats if there are any */
+    if(lavc_venc_context->stats_out && stats_file)
+        fprintf(stats_file, "%s", lavc_venc_context->stats_out);
+
     if(pts != MP_NOPTS_VALUE)
         dts= pts - lavc_venc_context->delay * av_q2d(lavc_venc_context->time_base);
     else
@@ -889,9 +893,6 @@ static int encode_frame(struct vf_instan
             pict_type_char[lavc_venc_context->coded_frame->pict_type]
             );
     }
-    /* store stats if there are any */
-    if(lavc_venc_context->stats_out && stats_file)
-        fprintf(stats_file, "%s", lavc_venc_context->stats_out);
     return out_size;
 }
 


More information about the MPlayer-cvslog mailing list