[MPlayer-dev-eng] [PATCH/PROPOSAL] precise timestamps for encoded audio

The Wanderer inverseparadox at comcast.net
Mon Apr 25 19:58:18 CEST 2005


Nico Sabbi wrote:

> As for the subject:
> 
> after every aencoder->encode(),  aencoder->get_frame_duration()
> returns the correct duration of the portion of audio encoded, so
> mux_a->timer can be increased with the returned value and set precise
> timestamps to the stream, that the muxer can reuse.

Irrespective of functionality, one thing which must be corrected:

> --- mencoder.c	25 Apr 2005 07:07:57 -0000	1.281
> +++ mencoder.c	25 Apr 2005 15:09:47 -0000
> @@ -1110,6 +1110,8 @@
>  				mux_a->buffer_len += len;
>  			}
>  	    }
> +	    if(len)
> +	    	fprintf(stderr, "\nDURATION: %.3lf\n", aencoder->get_frame_duration(aencoder));

Don't use fprintf here. Use mp_msg instead.

Also:

> --- libmpcodecs/ae_toolame.c	25 Apr 2005 10:37:55 -0000	1.7
> +++ libmpcodecs/ae_toolame.c	25 Apr 2005 15:09:47 -0000
> @@ -96,12 +96,31 @@
>  	
>  	toolame_encode_buffer(ctx->toolame_ctx, ctx->left_pcm, ctx->right_pcm, nsamples, dest, max_size, &ret_size);
>  	r2 = mp_decode_mp3_header(dest);	
> -	mp_msg(MSGT_MENCODER, MSGL_V, "\nSIZE: %d, max: %d, r2: %d\n", ret_size, max_size, r2);
>  	if(r2 > 0)
>  		ret_size = r2;
> +	mp_msg(MSGT_MENCODER, MSGL_V, "\nSIZE: %d, max: %d, r2: %d\n", ret_size, max_size, r2);
> +	

I don't see any change here, other than the cosmetic addition of a blank
line. (I don't even know what made the mp_msg line appear in the patch;
the two versions appear identical to me, and cmp and diff agree.)

-- 
       The Wanderer

Warning: Simply because I argue an issue does not mean I agree with any
side of it.

A government exists to serve its citizens, not to control them.




More information about the MPlayer-dev-eng mailing list