[vlc-commits] access: directory: Implement STREAM_GET_TYPE

Hugo Beauzée-Luyssen git at videolan.org
Thu Sep 17 17:53:38 CEST 2020


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Sep 14 14:06:50 2020 +0200| [99f0bfa88947be7a053a2c66103a21dbe9c1470e] | committer: Hugo Beauzée-Luyssen

access: directory: Implement STREAM_GET_TYPE

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=99f0bfa88947be7a053a2c66103a21dbe9c1470e
---

 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..5579bc0fab 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, int* ) = 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:



More information about the vlc-commits mailing list