Commit 2ec4bfe7 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

stream: remove dummy pf_readdir callbacks

This was required for stream filters, but not for accesses. Now that
both are stream_t, this has become inconsistent.

So this just makes them optional also for stream filters.
parent 1f7058ad
......@@ -503,22 +503,6 @@ VLC_API void vlc_stream_fifo_Close(stream_t *s);
**/
VLC_API stream_t* vlc_stream_FilterNew( stream_t *p_source, const char *psz_stream_filter );
/**
* Default ReadDir implementation for stream Filter. This implementation just
* forward the pf_readdir call to the p_source stream.
*/
VLC_API int vlc_stream_FilterDefaultReadDir(stream_t *s,
input_item_node_t *p_node);
/**
* Sets vlc_stream_FilterDefaultReadDir as the pf_readdir callback for this
* stream filter.
*/
#define stream_FilterSetDefaultReadDir(stream) \
do { \
(stream)->pf_readdir = vlc_stream_FilterDefaultReadDir; \
} while (0)
/**
* @}
*/
......
......@@ -94,12 +94,6 @@ static ssize_t Read(stream_t *stream, void *buf, size_t buflen)
return -1;
}
static int ReadDir(stream_t *stream, input_item_node_t *node)
{
(void) stream; (void) node;
return VLC_EGENERIC;
}
static int Seek(stream_t *stream, uint64_t offset)
{
(void) stream; (void) offset;
......@@ -178,7 +172,6 @@ static int Open(vlc_object_t *obj)
stream->p_sys = sys;
stream->pf_read = Read;
stream->pf_readdir = ReadDir;
stream->pf_seek = Seek;
stream->pf_control = Control;
return VLC_SUCCESS;
......
......@@ -333,12 +333,6 @@ static ssize_t Read(stream_t *stream, void *buf, size_t buflen)
return copy;
}
static int ReadDir(stream_t *stream, input_item_node_t *node)
{
(void) stream; (void) node;
return VLC_EGENERIC;
}
static int Control(stream_t *stream, int query, va_list args)
{
stream_sys_t *sys = stream->p_sys;
......@@ -488,7 +482,6 @@ static int Open(vlc_object_t *obj)
msg_Dbg(stream, "using %zu bytes buffer, %zu bytes read",
sys->buffer_size, sys->read_size);
stream->pf_read = Read;
stream->pf_readdir = ReadDir;
stream->pf_control = Control;
return VLC_SUCCESS;
......
......@@ -94,7 +94,6 @@ static int Open ( vlc_object_t *p_this )
s->pf_read = Read;
s->pf_seek = Seek;
s->pf_control = Control;
stream_FilterSetDefaultReadDir( s );
return VLC_SUCCESS;
}
......
......@@ -152,12 +152,6 @@ static ssize_t Read(stream_t *stream, void *buf, size_t buflen)
return vlc_stream_Read(stream->s, buf, buflen);
}
static int ReadDir(stream_t *stream, input_item_node_t *node)
{
(void) stream; (void) node;
return VLC_EGENERIC;
}
static int Seek(stream_t *stream, uint64_t offset)
{
const struct skiptags_sys_t *sys = stream->p_sys;
......@@ -229,7 +223,6 @@ static int Open(vlc_object_t *obj)
sys->p_tags = p_tags;
stream->p_sys = sys;
stream->pf_read = Read;
stream->pf_readdir = ReadDir;
stream->pf_seek = Seek;
stream->pf_control = Control;
return VLC_SUCCESS;
......
......@@ -175,12 +175,6 @@ int access_vaDirectoryControlHelper( stream_t *p_access, int i_query, va_list ar
return VLC_SUCCESS;
}
static int AStreamNoReadDir(stream_t *s, input_item_node_t *p_node)
{
(void) s; (void) p_node;
return VLC_EGENERIC;;
}
/* Block access */
static block_t *AStreamReadBlock(stream_t *s, bool *restrict eof)
{
......@@ -298,8 +292,6 @@ stream_t *stream_AccessNew(vlc_object_t *parent, input_thread_t *input,
if (access->pf_readdir != NULL)
s->pf_readdir = AStreamReadDir;
else
s->pf_readdir = AStreamNoReadDir;
s->pf_seek = AStreamSeek;
s->pf_control = AStreamControl;
......
......@@ -120,9 +120,3 @@ static void StreamDelete( stream_t *s )
free(s->psz_filepath);
}
int vlc_stream_FilterDefaultReadDir( stream_t *s, input_item_node_t *p_node )
{
assert( s->s != NULL );
return vlc_stream_ReadDir( s->s, p_node );
}
......@@ -411,7 +411,6 @@ vlc_stream_NewMRL
vlc_stream_NewURL
vlc_stream_vaControl
vlc_stream_ReadDir
vlc_stream_FilterDefaultReadDir
vlc_stream_fifo_New
vlc_stream_fifo_Queue
vlc_stream_fifo_Write
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment