[MPlayer-cvslog] CVS: main mencoder.c,1.340,1.341

Corey Hickey CVS syncmail at mplayerhq.hu
Tue Feb 21 10:39:24 CET 2006


CVS change done by Corey Hickey CVS

Update of /cvsroot/mplayer/main
In directory mail:/var2/tmp/cvs-serv29957

Modified Files:
	mencoder.c 
Log Message:
Fix video delay when encoding with B-frames.

Encoding delay is adjusted for on-the-fly during encoding.

Decoding delay is compensated for by setting an appropriate dwStart on
the audio stream (only in muxer_avi at this point). 



Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.340
retrieving revision 1.341
diff -u -r1.340 -r1.341
--- mencoder.c	20 Feb 2006 09:36:09 -0000	1.340
+++ mencoder.c	21 Feb 2006 09:39:22 -0000	1.341
@@ -1394,6 +1394,9 @@
     AV_delay-=audio_delay;
     AV_delay /= playback_speed;
     AV_delay-=mux_a->timer-(mux_v->timer-(v_timer_corr+v_pts_corr));
+    // adjust for encoder delays
+    AV_delay -= (float) mux_a->encoder_delay * mux_a->h.dwScale/mux_a->h.dwRate;
+    AV_delay += (float) mux_v->encoder_delay * mux_v->h.dwScale/mux_v->h.dwRate;
 	// compensate input video timer by av:
         x=AV_delay*0.1f;
         if(x<-max_pts_correction) x=-max_pts_correction; else




More information about the MPlayer-cvslog mailing list