# HG changeset patch # User ranma # Date 1298107058 0 # Node ID f698af71f5143c147add12e752809e0642c1823e # Parent 904d9843ffb67d9f19db64f6e3bd4d4a63688691 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 diff -r 904d9843ffb6 -r f698af71f514 libmpcodecs/ve_lavc.c --- 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; }