[vlc-devel] [RFC] JS and libvlc mouse events

Rémi Denis-Courmont remi at remlab.net
Tue Feb 9 18:42:01 CET 2010


From b3b17be8c6d5d1669033d9c7773db7981fad75c6 Mon Sep 17 00:00:00 2001
From: Jean-Paul Saman <jean-paul.saman at m2x.nl>
> +        struct
> +        {
> +            int button;
> +        } media_player_mouse_button;

The mouse-button-down value is supposed to be a bitmask.

>+static vout_thread_t *get_vout_thread( libvlc_media_player_t *p_mi )
> +{
> +    vout_thread_t *p_vout_thread = NULL;
> +
> +    if( !p_mi ) return NULL;

Reverse NULL.

> +    lock( p_mi );

Too late.

> +    if( !p_mi->p_input_thread )
> +    {
> +        unlock( p_mi );
> +        return NULL;
> +    }

Impossible.

> +    unlock( p_mi );

Too early.

...

> +    if( !p_mi || !p_mi->p_vout_thread )
> +        return;
> +
> +    lock(p_mi);
> +    p_vout_thread = p_mi->p_vout_thread;

Again, the lock is misused here.

-- 
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis



More information about the vlc-devel mailing list