[MPlayer-dev-eng] [PATCH] ve_lavc: fix 1st pass file generation
Tobias Diedrich
ranma at tdiedrich.de
Sat Feb 19 10:21:18 CET 2011
James Zern wrote:
> 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.
Looks like a valid bugfix to me, committed.
> Index: libmpcodecs/ve_lavc.c
> ===================================================================
> --- libmpcodecs/ve_lavc.c (revision 32850)
> +++ libmpcodecs/ve_lavc.c (working copy)
> @@ -828,6 +828,9 @@ static int encode_frame(struct vf_instan
> assert(MP_NOPTS_VALUE == AV_NOPTS_VALUE);
> #endif
> //fprintf(stderr, "ve_lavc %f/%f\n", dts, pts);
> + /* store stats if there are any */
> + if(lavc_venc_context->stats_out && stats_file)
> + fprintf(stats_file, "%s", lavc_venc_context->stats_out);
I've moved it a bit further up to write the stats directly after
the call to avcodec_encode_video().
> if(out_size == 0 && lavc_param_skip_threshold==0 && lavc_param_skip_factor==0){
> ++mux_v->encoder_delay;
> return 0;
> @@ -889,9 +892,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;
> }
--
Tobias PGP: http://8ef7ddba.uguu.de
More information about the MPlayer-dev-eng
mailing list