[MPlayer-dev-eng] [PATCH] MEncoder: print more precise FPS

Oded Shimon ods15 at ods15.dyndns.org
Thu Nov 17 15:45:51 CET 2005


On Thu, Nov 17, 2005 at 03:25:45PM +0100, Guillaume Poirier wrote:
> Hi there,
> 
> The attached patch modifies the way "fps" is displayed: from "int" to a
> "float" in order to get a more precise fps figure at slow encoding speed.
> 
> If you've got a slow machine, or you use killer encoding options which
> all in all, make the encoding process run at about 1-3fps, it's quite
> nice to have this extra precision.
> 
> Now, I wonder why fps has not been displayed as a float from day one, so
> I'm not gonna apply it unless somebody tells me this patch is fine.
> 
> Please review and comment, it's jut a two-liner.
> 
> Regards,
> Guillaume

> Index: mencoder.c
> ===================================================================
> RCS file: /cvsroot/mplayer/main/mencoder.c,v
> retrieving revision 1.318
> diff -u -r1.318 mencoder.c
> --- mencoder.c	30 Oct 2005 09:11:40 -0000	1.318
> +++ mencoder.c	16 Nov 2005 21:45:54 -0000
> @@ -1426,9 +1426,9 @@
>  			duplicatedframes, badframes, skippedframes
>  		);
>  	} else
> -	mp_msg(MSGT_AVSYNC,MSGL_STATUS,"Pos:%6.1fs %6df (%2d%%) %3dfps Trem:%4dmin %3dmb  A-V:%5.3f [%d:%d]\r",
> +	mp_msg(MSGT_AVSYNC,MSGL_STATUS,"Pos:%6.1fs %6df (%2d%%) %5.3ffps Trem:%4dmin %3dmb  A-V:%5.3f [%d:%d]\r",
>  	    mux_v->timer, decoded_frameno, (int)(p*100),
> -	    (t>1) ? (int)(decoded_frameno/t+0.5) : 0,
> +	    (t>1) ? (float)(decoded_frameno/t+0.5) : 0,

no +0.5, that as only there for integer rounding.

- ods15




More information about the MPlayer-dev-eng mailing list