Commit 01bec007 authored by Laurent Aimar's avatar Laurent Aimar

Fixed a potential race condition in input_resource_HoldVout*.

parent fee7f059
...@@ -275,14 +275,11 @@ static vout_thread_t *RequestVout( input_resource_t *p_resource, ...@@ -275,14 +275,11 @@ static vout_thread_t *RequestVout( input_resource_t *p_resource,
} }
static vout_thread_t *HoldVout( input_resource_t *p_resource ) static vout_thread_t *HoldVout( input_resource_t *p_resource )
{ {
if( p_resource->i_vout <= 0 )
return NULL;
/* TODO FIXME: p_resource->pp_vout order is NOT stable */ /* TODO FIXME: p_resource->pp_vout order is NOT stable */
vlc_mutex_lock( &p_resource->lock_hold ); vlc_mutex_lock( &p_resource->lock_hold );
vout_thread_t *p_vout = p_resource->pp_vout[0]; vout_thread_t *p_vout = p_resource->i_vout > 0 ? p_resource->pp_vout[0] : NULL;
if( p_vout )
vlc_object_hold( p_vout ); vlc_object_hold( p_vout );
vlc_mutex_unlock( &p_resource->lock_hold ); vlc_mutex_unlock( &p_resource->lock_hold );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment