summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorReinhard Nißl <rnissl@gmx.de>2010-07-15 21:11:48 +0200
committerReinhard Nißl <rnissl@gmx.de>2010-07-15 21:11:48 +0200
commit99fac65726da3158cfcbe2323fc15bca28d304df (patch)
tree380bb99283ae40018e4b0eff94efc5dec1e6596c /src
parent381cde936a88888674b1be36e3c9ffa7cf507877 (diff)
downloadxine-lib-99fac65726da3158cfcbe2323fc15bca28d304df.tar.gz
xine-lib-99fac65726da3158cfcbe2323fc15bca28d304df.tar.bz2
Change order of locking drawable and frame output callback to avoid deadlock.
Recently I've posted a patch for xine-ui which uses a timed lock to avoid a deadlock when the output callback happens while changing the drawable. It is possible to avoid this deadlock at all by moving the drawable lock (and the reinit call which it is not necessary for the callback) after the callback. As a result the mentioned patch for xine-ui may be reverted.
Diffstat (limited to 'src')
-rw-r--r--src/video_out/video_out_vdpau.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/video_out/video_out_vdpau.c b/src/video_out/video_out_vdpau.c
index e512a4127..7ca5775f1 100644
--- a/src/video_out/video_out_vdpau.c
+++ b/src/video_out/video_out_vdpau.c
@@ -1564,11 +1564,6 @@ static void vdpau_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
uint32_t mix_h = this->video_mixer_height;
VdpTime stream_speed;
- pthread_mutex_lock(&this->drawable_lock); /* protect drawble from being changed */
-
- if(this->reinit_needed)
- vdpau_reinit(this_gen);
-
if ( (frame->width != this->sc.delivered_width) || (frame->height != this->sc.delivered_height) || (frame->ratio != this->sc.delivered_ratio) ) {
this->sc.force_redraw = 1; /* trigger re-calc of output size */
}
@@ -1583,6 +1578,11 @@ static void vdpau_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
vdpau_redraw_needed( this_gen );
+ pthread_mutex_lock(&this->drawable_lock); /* protect drawble from being changed */
+
+ if(this->reinit_needed)
+ vdpau_reinit(this_gen);
+
if ( (frame->format == XINE_IMGFMT_YV12) || (frame->format == XINE_IMGFMT_YUY2) ) {
chroma = ( frame->format==XINE_IMGFMT_YV12 )? VDP_CHROMA_TYPE_420 : VDP_CHROMA_TYPE_422;
if ( (frame->width != this->soft_surface_width) || (frame->height != this->soft_surface_height) || (frame->format != this->soft_surface_format) ) {