[vlc-devel] commit: Renamed lock_vout in lock_hold in resource (No functionnal changes) . (Laurent Aimar )
git version control
git at videolan.org
Fri Jun 19 00:13:06 CEST 2009
vlc | branch: 1.0-bugfix | Laurent Aimar <fenrir at videolan.org> | Thu Jun 18 22:34:09 2009 +0200| [d8550f959c264fb873c0c16024ac83501d012844] | committer: Derk-Jan Hartman
Renamed lock_vout in lock_hold in resource (No functionnal changes).
(cherry picked from commit fee7f059d72a04b1b07e20aea1c11d4064a9a23c)
Signed-off-by: Derk-Jan Hartman <hartman at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d8550f959c264fb873c0c16024ac83501d012844
---
src/input/resource.c | 32 ++++++++++++++++++--------------
1 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/src/input/resource.c b/src/input/resource.c
index 3f5f3b7..849a1d5 100644
--- a/src/input/resource.c
+++ b/src/input/resource.c
@@ -55,8 +55,12 @@ struct input_resource_t
/* This lock is used to protect vout resources access (for hold)
* It is a special case because of embed video (possible deadlock
- * between vout window request and vout holds in some(qt4) interface) */
- vlc_mutex_t lock_vout;
+ * between vout window request and vout holds in some(qt4) interface)
+ */
+ vlc_mutex_t lock_hold;
+
+ /* You need lock+lock_hold to write to the following variables and
+ * only lock or lock_hold to read them */
int i_vout;
vout_thread_t **pp_vout;
};
@@ -225,9 +229,9 @@ static vout_thread_t *RequestVout( input_resource_t *p_resource,
{
assert( p_vout != p_resource->p_vout_free );
- vlc_mutex_lock( &p_resource->lock_vout );
+ vlc_mutex_lock( &p_resource->lock_hold );
TAB_REMOVE( p_resource->i_vout, p_resource->pp_vout, p_vout );
- vlc_mutex_unlock( &p_resource->lock_vout );
+ vlc_mutex_unlock( &p_resource->lock_hold );
}
/* */
@@ -237,9 +241,9 @@ static vout_thread_t *RequestVout( input_resource_t *p_resource,
DisplayVoutTitle( p_resource, p_vout );
- vlc_mutex_lock( &p_resource->lock_vout );
+ vlc_mutex_lock( &p_resource->lock_hold );
TAB_APPEND( p_resource->i_vout, p_resource->pp_vout, p_vout );
- vlc_mutex_unlock( &p_resource->lock_vout );
+ vlc_mutex_unlock( &p_resource->lock_hold );
return p_vout;
}
@@ -247,10 +251,10 @@ static vout_thread_t *RequestVout( input_resource_t *p_resource,
{
assert( p_vout );
- vlc_mutex_lock( &p_resource->lock_vout );
+ vlc_mutex_lock( &p_resource->lock_hold );
TAB_REMOVE( p_resource->i_vout, p_resource->pp_vout, p_vout );
const int i_vout_active = p_resource->i_vout;
- vlc_mutex_unlock( &p_resource->lock_vout );
+ vlc_mutex_unlock( &p_resource->lock_hold );
if( p_resource->p_vout_free || i_vout_active > 0 || !b_recycle )
{
@@ -275,13 +279,13 @@ static vout_thread_t *HoldVout( input_resource_t *p_resource )
return NULL;
/* TODO FIXME: p_resource->pp_vout order is NOT stable */
- vlc_mutex_lock( &p_resource->lock_vout );
+ vlc_mutex_lock( &p_resource->lock_hold );
vout_thread_t *p_vout = p_resource->pp_vout[0];
vlc_object_hold( p_vout );
- vlc_mutex_unlock( &p_resource->lock_vout );
+ vlc_mutex_unlock( &p_resource->lock_hold );
return p_vout;
}
@@ -292,7 +296,7 @@ static void HoldVouts( input_resource_t *p_resource, vout_thread_t ***ppp_vout,
*pi_vout = 0;
*ppp_vout = NULL;
- vlc_mutex_lock( &p_resource->lock_vout );
+ vlc_mutex_lock( &p_resource->lock_hold );
if( p_resource->i_vout <= 0 )
goto exit;
@@ -311,7 +315,7 @@ static void HoldVouts( input_resource_t *p_resource, vout_thread_t ***ppp_vout,
}
exit:
- vlc_mutex_unlock( &p_resource->lock_vout );
+ vlc_mutex_unlock( &p_resource->lock_hold );
}
/* */
@@ -380,7 +384,7 @@ input_resource_t *input_resource_New( void )
return NULL;
vlc_mutex_init( &p_resource->lock );
- vlc_mutex_init( &p_resource->lock_vout );
+ vlc_mutex_init( &p_resource->lock_hold );
return p_resource;
}
@@ -390,7 +394,7 @@ void input_resource_Delete( input_resource_t *p_resource )
DestroyVout( p_resource );
DestroyAout( p_resource );
- vlc_mutex_destroy( &p_resource->lock_vout );
+ vlc_mutex_destroy( &p_resource->lock_hold );
vlc_mutex_destroy( &p_resource->lock );
free( p_resource );
}
More information about the vlc-devel
mailing list