[vlc-devel] [PATCH 8/9] access: directory: Implement STREAM_GET_TYPE
Hugo Beauzée-Luyssen
hugo at beauzee.fr
Wed Sep 16 15:54:16 CEST 2020
---
modules/access/directory.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/modules/access/directory.c b/modules/access/directory.c
index 8b590df944..cfec73e4f7 100644
--- a/modules/access/directory.c
+++ b/modules/access/directory.c
@@ -50,6 +50,20 @@ typedef struct
static int DirRead (stream_t *access, input_item_node_t *node);
+static int DirControl( stream_t *p_access, int i_query, va_list args )
+{
+ switch ( i_query )
+ {
+ case STREAM_GET_TYPE:
+ {
+ *va_arg( args, enum input_item_type_e* ) = ITEM_TYPE_DIRECTORY;
+ return VLC_SUCCESS;
+ }
+ default:
+ return access_vaDirectoryControlHelper( p_access, i_query, args );
+ }
+}
+
/*****************************************************************************
* DirInit: Init the directory access with a directory stream
*****************************************************************************/
@@ -80,7 +94,7 @@ int DirInit (stream_t *access, DIR *dir)
access->p_sys = sys;
access->pf_readdir = DirRead;
- access->pf_control = access_vaDirectoryControlHelper;
+ access->pf_control = DirControl;
return VLC_SUCCESS;
error:
--
2.20.1
More information about the vlc-devel
mailing list