From 288db091c2737e68e89dad391b9880e55df7f7d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20Ni=C3=9Fl?= Date: Tue, 25 Jan 2011 20:27:29 +0100 Subject: Prevent deadlock caused by guarded_vdp_output_surface_destroy() guarded_vdp_output_surface_destroy() calls XLockDisplay() and XUnlockDisplay() always and not depending on define LOCKDISPLAY. This may cause a deadlock among threads using VDPAU API due to different resource allocation orders when guarding is not used (i. e. #undef LOCKDISPLAY is enabled). --HG-- extra : rebase_source : abafc9604d8cfb6efe07f665361c4e01e60adc37 --- src/video_out/video_out_vdpau.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/video_out/video_out_vdpau.c b/src/video_out/video_out_vdpau.c index 148aad732..4348aaa0a 100644 --- a/src/video_out/video_out_vdpau.c +++ b/src/video_out/video_out_vdpau.c @@ -230,9 +230,13 @@ static VdpStatus guarded_vdp_output_surface_create(VdpDevice device, VdpChromaTy static VdpStatus guarded_vdp_output_surface_destroy(VdpVideoSurface surface) { VdpStatus r; +#ifdef LOCKDISPLAY XLockDisplay(guarded_display); +#endif r = orig_vdp_output_surface_destroy(surface); +#ifdef LOCKDISPLAY XUnlockDisplay(guarded_display); +#endif return r; } -- cgit v1.2.3