]> git.sesse.net Git - vlc/commitdiff
playlist: Make playlist_archived_services_discovery_t internal.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 19 Aug 2007 14:51:08 +0000 (14:51 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 19 Aug 2007 14:51:08 +0000 (14:51 +0000)
include/vlc_playlist.h
src/playlist/engine.c
src/playlist/playlist_internal.h
src/playlist/services_discovery.c

index 20bce26e89efb6b2f97388bd6205c9d68a0f52e6..ef2dd21022e1fb8ab4fa5833f08660cc7f129d24 100644 (file)
@@ -176,6 +176,8 @@ struct services_discovery_t
 struct playlist_t
 {
     VLC_COMMON_MEMBERS
+    struct playlist_internal_t * p_internal; /**< Internal members */
+
     int                   i_enabled; /**< How many items are enabled ? */
 
     playlist_item_array_t items; /**< Arrays of items */
@@ -192,13 +194,6 @@ struct playlist_t
     int                   i_last_playlist_id; /**< Last id to an item */
     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 */
     playlist_item_t *     p_root_category; /**< Root of category tree */
     playlist_item_t *     p_root_onelevel; /**< Root of onelevel tree */
index 4807abcaf9a0c0c19b0db1928de1d309a5bb7ba3..b1ef6a23db6043dcf285abec590f76c4d71f12ac 100644 (file)
@@ -65,6 +65,10 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
         msg_Err( p_parent, "out of memory" );
         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;
 
     VariablesInit( p_playlist );
@@ -174,6 +178,7 @@ void playlist_Destroy( playlist_t *p_playlist )
 
     vlc_mutex_destroy( &p_playlist->gc_lock );
     vlc_object_detach( p_playlist );
+    free( p_playlist->p_internal );
     vlc_object_destroy( p_playlist );
 }
 
@@ -434,10 +439,10 @@ void playlist_LastLoop( playlist_t *p_playlist )
         vout_Destroy( (vout_thread_t *)p_obj );
     }
 
-    while( p_playlist->i_asds )
+    while( p_playlist->p_internal->i_asds )
     {
         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 );
index e82b677ee5eb31d54ff736fafc16c4e7657c5e78..015bdd726b1d36fcb4d95f5f6cf10bc0c279b8ef 100644 (file)
@@ -58,6 +58,19 @@ struct playlist_fetcher_t
     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
  *****************************************************************************/
index ddf87ac9fd557fd556754261f95d09d27fbf18b2..931feaa297b4aa5e8a22c7c5282dd8481e2a8244 100644 (file)
@@ -175,7 +175,7 @@ static void RunSD( services_discovery_t *p_sd )
 /*
  * Playlist - Services discovery bridge
  */
+
  /* 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 )
 {
@@ -296,7 +296,7 @@ int playlist_ServicesDiscoveryAdd( playlist_t *p_playlist,  const char *psz_modu
         p_asd->p_cat = p_cat;
         
         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;
     }
 
@@ -310,12 +310,12 @@ int playlist_ServicesDiscoveryRemove( playlist_t * p_playlist,
     struct playlist_archived_services_discovery_t *p_asd = NULL;
 
     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];
-            REMOVE_ELEM( p_playlist->pp_asds, p_playlist->i_asds, i );
+            p_asd = p_playlist->p_internal->pp_asds[i];
+            REMOVE_ELEM( p_playlist->p_internal->pp_asds, p_playlist->p_internal->i_asds, i );
             break;
         }
     }
@@ -373,9 +373,9 @@ vlc_bool_t playlist_IsServicesDiscoveryLoaded( playlist_t * p_playlist,
     int i;
     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;
             return VLC_TRUE;