typedef struct stat_list_t stat_list_t;
-static int Read( access_t *, uint8_t *, int );
-static int ReadNull( access_t *, uint8_t *, int );
+static ssize_t Read( access_t *, uint8_t *, size_t );
+static ssize_t ReadNull( access_t *, uint8_t *, size_t );
static int Control( access_t *, int, va_list );
static int Demux( demux_t *p_demux );
/*****************************************************************************
* ReadNull: read the directory
*****************************************************************************/
-static int ReadNull( access_t *p_access, uint8_t *p_buffer, int i_len)
+static ssize_t ReadNull( access_t *p_access, uint8_t *p_buffer, size_t i_len)
{
/* Return fake data */
memset( p_buffer, 0, i_len );
/*****************************************************************************
* Read: read the directory
*****************************************************************************/
-static int Read( access_t *p_access, uint8_t *p_buffer, int i_len)
+static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len)
{
char *psz;
int i_mode, i_activity;
/* Return fake data forever */
p_access->pf_read = ReadNull;
- return ReadNull( p_access, p_buffer, i_len );
+ return -1;
}
/*****************************************************************************
case ACCESS_SET_TITLE:
case ACCESS_SET_SEEKPOINT:
case ACCESS_SET_PRIVATE_ID_STATE:
+ case ACCESS_GET_CONTENT_TYPE:
return VLC_EGENERIC;
default:
if ((fd == -1) || fstat (fd, &stself.st))
{
- msg_Err (p_playlist, "cannot stat `%s': %s", psz_name,
- strerror (errno));
+ msg_Err (p_playlist, "cannot stat `%s': %m", psz_name);
return VLC_EGENERIC;
}
i_dir_content = utf8_loaddir (handle, &pp_dir_content, NULL, Sort);
if( i_dir_content == -1 )
{
- msg_Err (p_playlist, "cannot read `%s': %s", psz_name,
- strerror (errno));
+ msg_Err (p_playlist, "cannot read `%s': %m", psz_name);
return VLC_EGENERIC;
}
else if( i_dir_content <= 0 )
p_node = playlist_NodeCreate( p_playlist, entry,
p_parent_category,
- PLAYLIST_NO_REBUILD );
+ PLAYLIST_NO_REBUILD, NULL );
/* If we had the parent in category, the it is now node.
* Else, we still don't have */
memcpy (psz_uri, "file://", 7);
p_input = input_ItemNewWithType( VLC_OBJECT(p_playlist),
psz_uri, entry, 0, NULL,
- -1, ITEM_TYPE_VFILE );
+ -1, ITEM_TYPE_FILE );
if (p_input != NULL)
{
if( p_current_input )
PLAYLIST_NO_REBUILD,
PLAYLIST_END, NULL, NULL,
VLC_FALSE );
+ vlc_gc_decref( p_input );
}
}
}
{
int err = errno;
if (err != ENOTDIR)
- msg_Err (obj, "%s: %s", path, strerror (err));
+ msg_Err (obj, "%s: %m", path);
else
msg_Dbg (obj, "skipping non-directory `%s'", path);
errno = err;