Commit 02e8a6cf authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

playlist: Make playlist_archived_services_discovery_t internal.

parent 88cc4a8a
...@@ -176,6 +176,8 @@ struct services_discovery_t ...@@ -176,6 +176,8 @@ struct services_discovery_t
struct playlist_t struct playlist_t
{ {
VLC_COMMON_MEMBERS VLC_COMMON_MEMBERS
struct playlist_internal_t * p_internal; /**< Internal members */
int i_enabled; /**< How many items are enabled ? */ int i_enabled; /**< How many items are enabled ? */
playlist_item_array_t items; /**< Arrays of items */ playlist_item_array_t items; /**< Arrays of items */
...@@ -192,13 +194,6 @@ struct playlist_t ...@@ -192,13 +194,6 @@ struct playlist_t
int i_last_playlist_id; /**< Last id to an item */ int i_last_playlist_id; /**< Last id to an item */
int i_last_input_id ; /**< Last id on an input */ int i_last_input_id ; /**< Last id on an input */
struct playlist_archived_services_discovery_t {
services_discovery_t * p_sd; /* The service discovery module */
playlist_item_t * p_cat;/* Corresponding item in the category view */
playlist_item_t * p_one;/* Corresponding item in the one level view */
} **pp_asds; /**< Loaded service discovery modules */
int i_asds; /**< Number of service discovery modules */
/* Predefined items */ /* Predefined items */
playlist_item_t * p_root_category; /**< Root of category tree */ playlist_item_t * p_root_category; /**< Root of category tree */
playlist_item_t * p_root_onelevel; /**< Root of onelevel tree */ playlist_item_t * p_root_onelevel; /**< Root of onelevel tree */
......
...@@ -65,6 +65,10 @@ playlist_t * playlist_Create( vlc_object_t *p_parent ) ...@@ -65,6 +65,10 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
msg_Err( p_parent, "out of memory" ); msg_Err( p_parent, "out of memory" );
return NULL; return NULL;
} }
p_playlist->p_internal = malloc(sizeof(struct playlist_internal_t));
memset( p_playlist->p_internal, 0, sizeof(struct playlist_internal_t) );
p_parent->p_libvlc->p_playlist = p_playlist; p_parent->p_libvlc->p_playlist = p_playlist;
VariablesInit( p_playlist ); VariablesInit( p_playlist );
...@@ -174,6 +178,7 @@ void playlist_Destroy( playlist_t *p_playlist ) ...@@ -174,6 +178,7 @@ void playlist_Destroy( playlist_t *p_playlist )
vlc_mutex_destroy( &p_playlist->gc_lock ); vlc_mutex_destroy( &p_playlist->gc_lock );
vlc_object_detach( p_playlist ); vlc_object_detach( p_playlist );
free( p_playlist->p_internal );
vlc_object_destroy( p_playlist ); vlc_object_destroy( p_playlist );
} }
...@@ -434,10 +439,10 @@ void playlist_LastLoop( playlist_t *p_playlist ) ...@@ -434,10 +439,10 @@ void playlist_LastLoop( playlist_t *p_playlist )
vout_Destroy( (vout_thread_t *)p_obj ); vout_Destroy( (vout_thread_t *)p_obj );
} }
while( p_playlist->i_asds ) while( p_playlist->p_internal->i_asds )
{ {
playlist_ServicesDiscoveryRemove( p_playlist, playlist_ServicesDiscoveryRemove( p_playlist,
p_playlist->pp_asds[0]->p_sd->psz_module ); p_playlist->p_internal->pp_asds[0]->p_sd->psz_module );
} }
playlist_MLDump( p_playlist ); playlist_MLDump( p_playlist );
......
...@@ -58,6 +58,19 @@ struct playlist_fetcher_t ...@@ -58,6 +58,19 @@ struct playlist_fetcher_t
DECL_ARRAY(playlist_album_t) albums; DECL_ARRAY(playlist_album_t) albums;
}; };
typedef struct playlist_archived_services_discovery_t {
services_discovery_t * p_sd; /* The service discovery module */
playlist_item_t * p_cat;/* Corresponding item in the category view */
playlist_item_t * p_one;/* Corresponding item in the one level view */
} playlist_archived_services_discovery_t;
struct playlist_internal_t {
struct playlist_archived_services_discovery_t
**pp_asds; /**< Loaded service discovery modules */
int i_asds; /**< Number of service discovery modules */
};
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
......
...@@ -175,7 +175,7 @@ static void RunSD( services_discovery_t *p_sd ) ...@@ -175,7 +175,7 @@ static void RunSD( services_discovery_t *p_sd )
/* /*
* Playlist - Services discovery bridge * Playlist - Services discovery bridge
*/ */
/* A new item has been added to a certain sd */ /* A new item has been added to a certain sd */
static void playlist_sd_item_added( const vlc_event_t * p_event, void * user_data ) static void playlist_sd_item_added( const vlc_event_t * p_event, void * user_data )
{ {
...@@ -296,7 +296,7 @@ int playlist_ServicesDiscoveryAdd( playlist_t *p_playlist, const char *psz_modu ...@@ -296,7 +296,7 @@ int playlist_ServicesDiscoveryAdd( playlist_t *p_playlist, const char *psz_modu
p_asd->p_cat = p_cat; p_asd->p_cat = p_cat;
PL_LOCK; PL_LOCK;
TAB_APPEND( p_playlist->i_asds, p_playlist->pp_asds, p_asd ); TAB_APPEND( p_playlist->p_internal->i_asds, p_playlist->p_internal->pp_asds, p_asd );
PL_UNLOCK; PL_UNLOCK;
} }
...@@ -310,12 +310,12 @@ int playlist_ServicesDiscoveryRemove( playlist_t * p_playlist, ...@@ -310,12 +310,12 @@ int playlist_ServicesDiscoveryRemove( playlist_t * p_playlist,
struct playlist_archived_services_discovery_t *p_asd = NULL; struct playlist_archived_services_discovery_t *p_asd = NULL;
PL_LOCK; PL_LOCK;
for( i = 0 ; i< p_playlist->i_asds ; i ++ ) for( i = 0 ; i< p_playlist->p_internal->i_asds ; i ++ )
{ {
if( !strcmp( psz_module, p_playlist->pp_asds[i]->p_sd->psz_module ) ) if( !strcmp( psz_module, p_playlist->p_internal->pp_asds[i]->p_sd->psz_module ) )
{ {
p_asd = p_playlist->pp_asds[i]; p_asd = p_playlist->p_internal->pp_asds[i];
REMOVE_ELEM( p_playlist->pp_asds, p_playlist->i_asds, i ); REMOVE_ELEM( p_playlist->p_internal->pp_asds, p_playlist->p_internal->i_asds, i );
break; break;
} }
} }
...@@ -373,9 +373,9 @@ vlc_bool_t playlist_IsServicesDiscoveryLoaded( playlist_t * p_playlist, ...@@ -373,9 +373,9 @@ vlc_bool_t playlist_IsServicesDiscoveryLoaded( playlist_t * p_playlist,
int i; int i;
PL_LOCK; PL_LOCK;
for( i = 0 ; i< p_playlist->i_asds ; i ++ ) for( i = 0 ; i< p_playlist->p_internal->i_asds ; i ++ )
{ {
if( !strcmp( psz_module, p_playlist->pp_asds[i]->p_sd->psz_module ) ) if( !strcmp( psz_module, p_playlist->p_internal->pp_asds[i]->p_sd->psz_module ) )
{ {
PL_UNLOCK; PL_UNLOCK;
return VLC_TRUE; return VLC_TRUE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment