[vlc-devel] [PATCH 5/7] libvlc: set media's sub_items readonly

Jean-Baptiste Kempf jb at videolan.org
Sat Jan 17 05:54:28 CET 2015


OK.

On 15 Jan, Thomas Guillem wrote :
> media's sub_items should be only writable by media.
> ---
>  lib/media.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/media.c b/lib/media.c
> index bfed267..b7bf08e 100644
> --- a/lib/media.c
> +++ b/lib/media.c
> @@ -43,6 +43,7 @@
>  
>  #include "libvlc_internal.h"
>  #include "media_internal.h"
> +#include "media_list_internal.h"
>  
>  static const vlc_meta_type_t libvlc_to_vlc_meta[] =
>  {
> @@ -112,7 +113,10 @@ static libvlc_media_list_t *media_get_subitems( libvlc_media_t * p_md )
>      {
>          p_md->p_subitems = libvlc_media_list_new( p_md->p_libvlc_instance );
>          if( p_md->p_subitems != NULL )
> +        {
> +            p_md->p_subitems->b_read_only = true;
>              libvlc_media_list_set_media( p_md->p_subitems, p_md );
> +        }
>      }
>      p_subitems = p_md->p_subitems;
>      vlc_mutex_unlock( &p_md->subitems_lock );
> @@ -137,7 +141,7 @@ static void input_item_subitem_added( const vlc_event_t *p_event,
>      /* Add this to our media list */
>      p_subitems = media_get_subitems( p_md );
>      if( p_subitems != NULL )
> -        libvlc_media_list_add_media( p_subitems, p_md_child );
> +        _libvlc_media_list_add_media( p_subitems, p_md_child );
>  
>      /* Construct the event */
>      event.type = libvlc_MediaSubItemAdded;
> -- 
> 2.1.3
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

-- 
With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list