[vlc-devel] commit: Resource attach/detach requires the lock. Add vlc_assert_locked() ( Rémi Denis-Courmont )
git version control
git at videolan.org
Thu Jan 28 17:20:30 CET 2010
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jan 28 18:19:58 2010 +0200| [d20e98fbb17fd6c9bf2630ebb6b936f9c6e609d3] | committer: Rémi Denis-Courmont
Resource attach/detach requires the lock. Add vlc_assert_locked()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d20e98fbb17fd6c9bf2630ebb6b936f9c6e609d3
---
src/input/resource.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/input/resource.c b/src/input/resource.c
index 0f54b8b..ae890c4 100644
--- a/src/input/resource.c
+++ b/src/input/resource.c
@@ -154,6 +154,7 @@ static void DestroyVout( input_resource_t *p_resource )
}
static vout_thread_t *DetachVout( input_resource_t *p_resource )
{
+ vlc_assert_locked( &p_resource->lock );
assert( p_resource->i_vout == 0 );
vout_thread_t *p_vout = p_resource->p_vout_free;
p_resource->p_vout_free = NULL;
@@ -207,6 +208,8 @@ static vout_thread_t *RequestVout( input_resource_t *p_resource,
vout_thread_t *p_vout, video_format_t *p_fmt,
bool b_recycle )
{
+ vlc_assert_locked( &p_resource->lock );
+
if( !p_vout && !p_fmt )
{
if( p_resource->p_vout_free )
@@ -330,6 +333,7 @@ static void DestroyAout( input_resource_t *p_resource )
}
static aout_instance_t *DetachAout( input_resource_t *p_resource )
{
+ vlc_assert_locked( &p_resource->lock );
vlc_mutex_lock( &p_resource->lock_hold );
aout_instance_t *p_aout = p_resource->p_aout;
@@ -342,6 +346,7 @@ static aout_instance_t *DetachAout( input_resource_t *p_resource )
static aout_instance_t *RequestAout( input_resource_t *p_resource, aout_instance_t *p_aout )
{
+ vlc_assert_locked( &p_resource->lock );
assert( p_resource->p_input );
if( p_aout )
More information about the vlc-devel
mailing list