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

Alexander Strasser eclipse7 at gmx.net
Mon Apr 25 20:13:14 CEST 2005


The Wanderer wrote:
> 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.
[...]
> >--- 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.)

Am I blind or did you oversee the if-statement in between?
The order can make a difference at runtime, see:

/* the above lines may well change ret_size in some cases */
 	if(r2 > 0)
 		ret_size = r2;
/* and here ret_size is output through mp_msg */
	mp_msg(MSGT_MENCODER, MSGL_V, "\nSIZE: %d, max: %d, r2: %d\n", 
ret_size, max_size, r2);

Maybe I am just blind,
  Alex (beastd)




More information about the MPlayer-dev-eng mailing list