summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinhard Nißl <rnissl@gmx.de>2009-01-04 18:21:11 +0100
committerReinhard Nißl <rnissl@gmx.de>2009-01-04 18:21:11 +0100
commitad91982481c386e7df642866f8fd8f029b325edf (patch)
tree3fa1052bb6a239ced31cf7f6b49e32070271cf73
parent47f8094edf25edcdd9d56e3ceea91262ecd9818a (diff)
downloadxine-lib-ad91982481c386e7df642866f8fd8f029b325edf.tar.gz
xine-lib-ad91982481c386e7df642866f8fd8f029b325edf.tar.bz2
Introduce XVMC_LOCKDISPLAY_SAFE to solve deadlocks in certain xxmc implementations.
Some implementations are buggy and lock resources (for example the display or internal data structures) in different order, which results in deadlocks. As XVMC_LOCKDISPLAY_SAFE is not defined by default, most API functions will now be guarded by a LockDisplay()/UnlockDisplay() pair, which imposes a lock order at least for the resource display and hence avoids those deadlocks.
-rw-r--r--src/video_out/xxmc.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/video_out/xxmc.h b/src/video_out/xxmc.h
index 9aea10854..edb440a14 100644
--- a/src/video_out/xxmc.h
+++ b/src/video_out/xxmc.h
@@ -37,6 +37,14 @@
#define XVMC_THREAD_SAFE
+/*
+ * some implementations are not aware of the display having been locked
+ * already before calling the xvmc function and may therefore deadlock.
+ */
+/*
+#define XVMC_LOCKDISPLAY_SAFE
+*/
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -170,7 +178,7 @@ typedef struct context_lock_s {
return; \
}
-#ifdef XVMC_THREAD_SAFE
+#if defined(XVMC_THREAD_SAFE) && defined(XVMC_LOCKDISPLAY_SAFE)
#define XVMCLOCKDISPLAY(display)
#define XVMCUNLOCKDISPLAY(display)
#else