/*****************************************************************************
- * m3u.c : M3U playlist export module
+ * m3u.c : M3U playlist export module
*****************************************************************************
- * Copyright (C) 2004 the VideoLAN team
+ * Copyright (C) 2004-2009 the VideoLAN team
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
* Preamble
*****************************************************************************/
-#include <vlc/vlc.h>
-#include <vlc_interface.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
#include <vlc_playlist.h>
#include <vlc_input.h>
#include <vlc_meta.h>
-#include <errno.h> /* ENOMEM */
+#include <assert.h>
/*****************************************************************************
* Local prototypes
/*****************************************************************************
* Export_M3U: main export function
*****************************************************************************/
-static void DoChildren( playlist_t *p_playlist, playlist_export_t *p_export,
- playlist_item_t *p_root )
+static void DoChildren( playlist_export_t *p_export, playlist_item_t *p_root )
{
int i, j;
if( p_current->i_children >= 0 )
{
- DoChildren( p_playlist, p_export, p_current );
+ DoChildren( p_export, p_current );
continue;
}
}
free( psz_artist );
}
- free( psz_uri );
free( psz_name );
/* VLC specific options */
vlc_mutex_unlock( &p_current->p_input->lock );
fprintf( p_export->p_file, "%s\n", psz_uri );
+ free( psz_uri );
}
}
int Export_M3U( vlc_object_t *p_this )
{
- playlist_t *p_playlist = (playlist_t*)p_this;
- playlist_export_t *p_export = (playlist_export_t *)p_playlist->p_private;
+ playlist_export_t *p_export = (playlist_export_t *)p_this;
- msg_Dbg(p_playlist, "saving using M3U format");
+ msg_Dbg( p_export, "saving using M3U format");
/* Write header */
fprintf( p_export->p_file, "#EXTM3U\n" );
- DoChildren( p_playlist, p_export, p_export->p_root );
+ DoChildren( p_export, p_export->p_root );
return VLC_SUCCESS;
}