changeset 32841:f698af71f514

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
author ranma
date Sat, 19 Feb 2011 09:17:38 +0000
parents 904d9843ffb6
children fe8f9b5d3ba2
files libmpcodecs/ve_lavc.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ve_lavc.c	Fri Feb 18 22:14:47 2011 +0000
+++ b/libmpcodecs/ve_lavc.c	Sat Feb 19 09:17:38 2011 +0000
@@ -812,6 +812,10 @@
 	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 @@
             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;
 }