[vlc-devel] [Patch] Sending a signal when a vout is created/destroyed

Laurent Aimar fenrir at via.ecp.fr
Wed Jan 20 00:47:50 CET 2010


On Wed, Jan 20, 2010, Hugo Beauzee-Luyssen wrote:
> This should integrate your advices.
> I renamed the created field to has_vout. It's enough to know when an
> user can starts to use the function mentioned earlier.
> 
>  
>  #ifdef __cplusplus
> @@ -256,6 +257,11 @@ struct libvlc_event_t
>          {
>              libvlc_media_t * new_media;
>          } media_player_media_changed;
> +        /* Vout created or destroyed */
> +        struct
> +        {
> +            int has_vout;
 Using bool would make more sense (unless bool is not to be used in this
file ?)
> +        } media_player_vout_changed;
>      } u;

> +    else if ( newval.i_int == INPUT_EVENT_VOUT )
> +    {
> +        vout_thread_t* vout = input_GetVout( p_input );
> +        bool    has_vout = vout != NULL;
> +        vlc_object_release( vout );
You cannot call vlc_object_release on NULL.
> +
> +        event.type = libvlc_MediaPlayerVoutChanged;
> +        event.u.media_player_vout_changed.has_vout = has_vout;
> +        libvlc_event_send( p_mi->p_event_manager, &event );
> +    }


-- 
fenrir




More information about the vlc-devel mailing list