Hi

We did a little debugging outside the list and found the bug (I
guess). Developers: please read this and tell me if my solution could
work. 


"Lars Michael Jogback" wrote:
>> 
>> I just have an idea: also try to change
>> util.SynchronizedObject(OSD()) to OSD() in get_singleton at the top
>> of osd.py
>> 
>
> Did that, and then it works

OK, we found the bug. And I'm not happy about it :-(
The util.SynchronizedObject is to prevent threads from using osd at
the same time because pygame and osd.py are not thread save. 

> Animations using mplayervis works aswell.  The only side-effect is
> that maybe, perhaps, elapsed time is a little bit "jumpy", but I'm
> not sure...

That may be right. The output of mplayer is parsed in a thread and
this thread updates the osd. Without the SynchronizedObject we may
have a problem here. Maybe the bug is related to the fact that the
main thread locks osd.py while doing it's time.sleep() and the mplayer
stdout reading thread is blocking. Ugly, ugly, ugly... 

That brings me to a second bug: the skin code is not thread save,
too. A thread shouldn't call it. Bad, bad bug. 

Solution: we need to remove the SynchronizedObject and prevent threads
from doing anything osd or skin related. We still need threads to read
stdout and stderr from the players or everything will stop. What we
need is a list of functions to call from main:

1. create a thread save list main_callbacks with function and
   parameter. 

2. The threads reading stdout and stderr only put the callback
   function and the current line to the list.

3. the main loop needs to call all callback functions in the list.


This should work, or am I missing something here.


I HATE THREADS! 



Dischi


-- 
One advantage of talking to yourself is that you know at least somebody's
listening.
                -- Franklin P. Jones


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
Freevo-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-users

Reply via email to