[MPlayer-dev-eng] [PATCH] Fix av sync calculations during lagging video

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Apr 6 13:05:31 CEST 2006


Hi,
On Wed, Apr 05, 2006 at 06:06:46PM +0300, Uoti Urpala wrote:
> late timing but because it can't meet the current time target). As a
> result, if the performance problem goes away, the video will now jump
> ahead of audio until the timing gets gradually corrected back. The
> problem does not occur in autosync mode.

Actually it is much worse, in autosync mode the desync caused by too
slow playback is not detected all, causing permanent desync!!
So, please try the attached patch instead. And a better comment to
describe the problem is welcome, too (I found yours rather confusing,
though I'm not sure mine is better *g*).

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.926
diff -u -r1.926 mplayer.c
--- mplayer.c	30 Mar 2006 23:47:03 -0000	1.926
+++ mplayer.c	6 Apr 2006 11:03:17 -0000
@@ -3809,7 +3865,8 @@
 	  ++drop_message;
 	  mp_msg(MSGT_AVSYNC,MSGL_WARN,MSGTR_SystemTooSlow);
 	}
-        x=AV_delay*0.1f;
+        // add time_frame to ignore delay caused by too slow computer
+        x = (AV_delay + time_frame)*0.1f;
         if(x<-max_pts_correction) x=-max_pts_correction; else
         if(x> max_pts_correction) x= max_pts_correction;
         if(default_max_pts_correction>=0)


More information about the MPlayer-dev-eng mailing list