- /* Initialize structure */
- msg_Dbg( p_input, "opening directory `%s'", psz_name );
- p_access_data = malloc( sizeof(input_directory_t) );
- p_input->p_access_data = (void *)p_access_data;
- if( p_access_data == NULL )
+ LocaleFree( psz_path );
+ p_access->pf_read = Read;
+ p_access->pf_block = NULL;
+ p_access->pf_seek = NULL;
+ p_access->pf_control= Control;
+
+ /* Force a demux */
+ p_access->psz_demux = strdup( "directory" );
+
+ return VLC_SUCCESS;
+}
+
+/*****************************************************************************
+ * Close: close the target
+ *****************************************************************************/
+static void Close( vlc_object_t * p_this )
+{
+}
+
+/*****************************************************************************
+ * ReadNull: read the directory
+ *****************************************************************************/
+static int ReadNull( access_t *p_access, uint8_t *p_buffer, int i_len)
+{
+ /* Return fake data */
+ memset( p_buffer, 0, i_len );
+ return i_len;
+}
+
+/*****************************************************************************
+ * Read: read the directory
+ *****************************************************************************/
+static int Read( access_t *p_access, uint8_t *p_buffer, int i_len)
+{
+ char *psz_name = NULL;
+ char *psz;
+ int i_mode, i_pos;
+
+ playlist_item_t *p_item;
+ vlc_bool_t b_play = VLC_FALSE;
+
+ playlist_t *p_playlist =
+ (playlist_t *) vlc_object_find( p_access,
+ VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+
+ if( !p_playlist )