[MPlayer-users] [Bug report] Interrupting xvmc playback may result in deadlock.
Thomas Hellström
thomas at tungstengraphics.com
Mon Dec 18 12:53:18 CET 2006
Version:
SVN as of today.
Summary:
When used with certain XvMC libraries that use non-recursive pthread
mutexes to protect data in multithreaded environments, a deadlock can
occur when mplayer exits as the result of a terminating signal.
What happens is that the mutex may be held by the main thread, when
mplayer as part of the signal handler calls the xvmc uninit function.
This function calls the XvMC library recursively, trying to lock the
mutex again, and this results in a deadlock.
XvMC libraries are not guaranteed to be reentrant.
Fix:
I have attached an extremely ugly workaround that sets a global variable
to indicate when execution is part of a signal handler. In that case,
the XvMC library is never called. We can do this because when mplayer
exits, the X server will do all necessary XvMC cleanup. Note: This patch
is just to illustrate the problem. It's possible that gmplayer needs
fixing too, and it's also possible that there is a much cleaner solution.
/Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xvmc_exit.patch
Type: text/x-patch
Size: 1903 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20061218/e2bee941/attachment.bin>
More information about the MPlayer-users
mailing list