[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xine-cvslog
Subject:    [xine-cvs] HG: xine-lib-1.2: Change order of locking drawable and
From:       Reinhard Nißl <rnissl () gmx ! de>
Date:       2010-07-15 22:02:04
Message-ID: 8d864acff67ddbc2280b.1279221108 () hg ! debian ! org
[Download RAW message or body]

# HG changeset patch
# User Reinhard Nißl <rnissl@gmx.de>
# Date 1279221108 -7200
# Node ID 8d864acff67ddbc2280b8eef26b6ac527fd811d3
# Parent  886becfd9d4fbb4084719ede8e155c663e44e911
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.

diff --git a/src/video_out/video_out_vdpau.c b/src/video_out/video_out_vdpau.c
--- a/src/video_out/video_out_vdpau.c
+++ b/src/video_out/video_out_vdpau.c
@@ -1564,11 +1564,6 @@
   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 */  }
@@ -1582,6 +1577,11 @@
   this->sc.crop_bottom      = frame->vo_frame.crop_bottom;
 
   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;

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Xine-cvslog mailing list
Xine-cvslog@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xine-cvslog


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic