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

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Dec 3 15:05:27 CET 2006


Hello,
On Sun, Dec 03, 2006 at 01:13:42PM +0100, Dirk Meyer wrote:
> 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.

sleep always acts as a yield, i.e. it will cause a thread switch. Though
if this causes performance problems you either have
1) something else running that soaks up all the cpu time freed
2) a really bad OS where a yield is expensive even when only one process
is runnable

Anyway, fixed in SVN r21468.
Btw. finding the cause is easy with gdb if instead of "return 0;" you do
"*(char *)NULL = 0;"...

Greetings,
Reimar Döffinger



More information about the MPlayer-users mailing list