[vlc-devel] commit: vlm: Avoid a deadlock when stoping the input. (Pierre d'Herbemont )

Laurent Aimar fenrir at via.ecp.fr
Thu Feb 11 20:16:45 CET 2010


Hi,

On Thu, Feb 11, 2010, git version control wrote:
> vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Thu Feb 11 18:11:24 2010 +0100| [966540425ec13fc7ac4113bc3aaecc2464c4ca08] | committer: Pierre d'Herbemont 
> 
> vlm: Avoid a deadlock when stoping the input.
> 
> We may be joining the input_thread inside the vlm lock, and try to vlm lock inside the stop event handler.
> 
> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=966540425ec13fc7ac4113bc3aaecc2464c4ca08
> ---
> 
>  src/input/vlm.c |   14 ++++++++++++--
>  1 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/src/input/vlm.c b/src/input/vlm.c
> index fc63d21..19f2a56 100644
> --- a/src/input/vlm.c
> +++ b/src/input/vlm.c
> @@ -105,6 +105,16 @@ static int InputEvent( vlc_object_t *p_this, char const *psz_cmd,
>          }
>          vlm_SendEventMediaInstanceState( p_vlm, p_media->cfg.id, p_media->cfg.psz_name, psz_instance_name, var_GetInteger( p_input, "state" ) );
>  
> +        // We have ourselves been triggering the stop event.
> +        // No need to wake up our manage thread, because
> +        // we'll join it just after the Stop().
> +        vlc_mutex_lock( &p_input->p->lock_control );
> +        bool abort = p_input->p->b_abort;
> +        vlc_mutex_unlock( &p_input->p->lock_control );
 Could you explain why you need to acces this private input field ?
I would really really really like to find another solution, p_input->p
must not be used in vlm.c
 Can't you store the value you need in a vlm context?

-- 
fenrir



More information about the vlc-devel mailing list