[vlc-devel] [PATCH 3/4] Media library features

Jean-Baptiste Kempf jb at videolan.org
Mon Oct 18 08:57:45 CEST 2010


On Mon, Oct 18, 2010 at 01:11:30AM +0530, Srikanth Raju wrote :
> I'm looking for the most feedback on this one.

> +/**
> + * Definition of item_list_t
> + */
> +struct item_list_t {
> +    int           i_media_id; /**< Media id */
> +    ml_media_t   *p_media;    /**< Media item */
> +    input_item_t *p_item;     /**< Input item */
> +    int           i_age;      /**< Time spent in this list without activity */
> +    int           i_refs;     /**< Number of important refs */
> +    item_list_t  *p_next;     /**< Next element in the list */
> +    int           i_update;   /**< Flag set when the input item is updated:
> +                                    0: no update,
> +                                    1: meta update,
> +                                    2: increment play count,
> +                                    3: both */
> +};
Please make sure to pack it correctly...
Especially with a 64bit machine.

> +item_list_t* item_list_delMedia( watch_thread_t *p_wt, int i_media_id );
> +item_list_t* item_list_delItem( watch_thread_t *p_wt, input_item_t *p_item, bool );
> +item_list_t* item_list_listitemOfMediaId( watch_thread_t *p_wt, int i_media_id );
> +input_item_t* item_list_itemOfMediaId( watch_thread_t *p_wt, int i_media_id );
> +ml_media_t* item_list_mediaOfMediaId( watch_thread_t *p_wt, int i_media_id );
> +ml_media_t* item_list_mediaOfItem( watch_thread_t *p_wt, input_item_t* p_item, bool );
> +int item_list_mediaIdOfItem( watch_thread_t *p_wt, input_item_t *p_item );
> +int item_list_updateInput( watch_thread_t *p_wt, input_item_t *p_item,
> +                           bool b_play_count );
Why this weird camelCase and underscore_case mix?

> +struct preparsed_item_t
> +{
> +    char* psz_uri;
> +    int i_dir_id;
> +    int i_mtime;
> +    int i_update_id;
> +    bool b_update;
> +    monitoring_thread_t *p_mon;
> +};
Do you need all that for all items?
(Hint: put p_mon at the top or 2nd place)

Best Regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/
+33 672 704 734



More information about the vlc-devel mailing list