[MPlayer-dev-eng] [PATCH] Fix dead lock in ao_macosx when switch stream format.

Ulion ulion2002 at gmail.com
Mon Nov 5 12:59:25 CET 2007


Hello,

I found a dead lock occur in ao_macosx (that part of code is from my
patch based on vlc's source) when switch stream format for use digital
passthrough output.
The detail is, if the pthread_cond_timedwait timeouted, and detected
the stream format already changed, or after 5 times
pthread_cond_timedwait timeouted, when removing the stream listener,
while on the other hand, the listener callback is blocked to wait the
lock since it may be callbacked after pthread_cond_timedwait
timeouted.
Here's the fix, one thing to make the pthread_cond_timedwait wait
longer, another thing to make the callback does not wait the lock,
just siginal the wait cond. Now this code will not dead lock any more.

If  no objects, I will apply this soon in two days.

-- 
Ulion
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ao_osx_chg_fmt_dead_lock.diff
Type: text/x-diff
Size: 917 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20071105/c5f78690/attachment.diff>


More information about the MPlayer-dev-eng mailing list