[vlc-devel] commit: Do not notifications actions if the server does not support it ( Cody Russell )

Laurent Aimar fenrir at via.ecp.fr
Wed Feb 25 17:41:28 CET 2009


Hi,

> +static gboolean
> +can_support_actions ()
> +{
> +    static gboolean supports_actions = FALSE;
> +    static gboolean have_checked = FALSE;
> +
> +    if( !have_checked ) {
> +        GList *caps = NULL;
> +        GList *c;
> +
> +        have_checked = TRUE;
> +
> +        caps = notify_get_server_caps ();
> +        if( caps != NULL ) {
> +            for( c = caps; c != NULL; c = c->next ) {
> +                if( strcmp( (char*)c->data, "actions" ) == 0 ) {
> +                    supports_actions = TRUE;
> +                    break;
> +                }
> +            }
> +        }
 This is not thread safe (unless I missed a global lock somewhere).
It would probably be better to store it inside p_intf->p_sys instead.

-- 
fenrir



More information about the vlc-devel mailing list