[MPlayer-users] [Patch] Re: Problem with -slave and A-V sync

Dirk Meyer dischi at tzi.de
Sun Dec 3 13:13:42 CET 2006


Dirk Meyer wrote:
> I have a strange problem with slave mode and A-V sync. It happens when
> I play 720p H.264 files. I have a Core 2 Duo and cpu usage is always
> around 50% of one cpu. When I play such a file it works fine, A-V sync
> is perfect. When I add -slave to the command line, the video gets out
> of sync very fast, about one second after 20 seconds playtime. The cpu
> usage is still at 50%, no change there.

I found the problem, but I can't really explain it. The problem is
that usec_sleep is called with 0 as sleeping interval some times. This
shouldn't be a problem, but it causes my problems. nanosleep seems to
sleep at least a very short time. The following patch resolves that
problem by catching the usec_delay == 0 before calling nanosleep.
Sounds stupid, but this fixes my problems.

===================================================================
--- osdep/timer-lx.c    (revision 21459)
+++ osdep/timer-lx.c    (working copy)
@@ -18,6 +18,8 @@
 
 int usec_sleep(int usec_delay)
 {
+    if (!usec_delay)
+       return 0;
 #ifdef HAVE_NANOSLEEP
     struct timespec ts;
     ts.tv_sec  =  usec_delay / 1000000;


Dischi

-- 
"To study and not think is a waste. To think and not study is dangerous."
                                                [Confucius 551 BC - 479 BC]




More information about the MPlayer-users mailing list