]> git.sesse.net Git - vlc/blobdiff - src/control/media_list_player.c
libvlc: Split libvlc_internal in different independant headers.
[vlc] / src / control / media_list_player.c
index d5865d99c2e6ceb833f1f9938ebdaf2e01baa360..1ed1af0b324b10fb3d79127718a99877066d19ef 100644 (file)
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
-#include "libvlc_internal.h"
+
 #include <vlc/libvlc.h>
+#include <vlc/libvlc_media.h>
+#include <vlc/libvlc_media_list.h>
+#include <vlc/libvlc_media_player.h>
+#include <vlc/libvlc_media_list_player.h>
+#include <vlc/libvlc_events.h>
+
+#include "libvlc_internal.h"
+
+#include "media_internal.h" // Abuse, could and should be removed
 #include "media_list_path.h"
 
+
+struct libvlc_media_list_player_t
+{
+    libvlc_event_manager_t *    p_event_manager;
+    libvlc_instance_t *         p_libvlc_instance;
+    int                         i_refcount;
+    vlc_mutex_t                 object_lock;
+    libvlc_media_list_path_t    current_playing_item_path;
+    libvlc_media_t *            p_current_playing_item;
+    libvlc_media_list_t *       p_mlist;
+    libvlc_media_player_t *     p_mi;
+};
+
 /*
  * Private functions
  */
@@ -264,10 +286,13 @@ libvlc_media_list_player_new( libvlc_instance_t * p_instance,
     if( !p_mlp )
         return NULL;
 
+    libvlc_retain( p_instance );
+    p_mlp->p_libvlc_instance = p_instance;
+    p_mlp->i_refcount = 0;
+    vlc_mutex_init( &p_mlp->object_lock );
     p_mlp->current_playing_item_path = NULL;
-    p_mlp->p_mi = NULL;
     p_mlp->p_mlist = NULL;
-    vlc_mutex_init( &p_mlp->object_lock );
+    p_mlp->p_mi = NULL;
     p_mlp->p_event_manager = libvlc_event_manager_new( p_mlp,
                                                        p_instance,
                                                        p_e );
@@ -306,6 +331,7 @@ void libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp )
     }
 
     free( p_mlp->current_playing_item_path );
+    libvlc_release( p_mlp->p_libvlc_instance );
     free( p_mlp );
 }