[vlc-commits] stream: removed unused control argument

Rémi Denis-Courmont git at videolan.org
Tue Apr 18 20:40:28 CEST 2017


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Apr 17 18:47:33 2017 +0300| [a51db3bfd063216391f3e944a7abaa349d5fa795] | committer: Rémi Denis-Courmont

stream: removed unused control argument

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

 include/vlc_stream.h                |  2 +-
 modules/access/dsm/access.c         | 17 +----------------
 modules/access/ftp.c                | 17 +----------------
 modules/access/nfs.c                | 19 ++-----------------
 modules/access/sftp.c               | 17 +----------------
 modules/access/smb.c                | 17 +----------------
 modules/demux/playlist/directory.c  |  3 +--
 modules/demux/playlist/playlist.h   |  5 ++---
 modules/services_discovery/upnp.cpp | 16 +---------------
 src/input/access.c                  |  1 -
 10 files changed, 11 insertions(+), 103 deletions(-)

diff --git a/include/vlc_stream.h b/include/vlc_stream.h
index a2a84065f8..e5701722c0 100644
--- a/include/vlc_stream.h
+++ b/include/vlc_stream.h
@@ -143,7 +143,7 @@ enum stream_query_e
     STREAM_CAN_CONTROL_PACE,    /**< arg1= bool *   res=cannot fail*/
     /* */
     STREAM_GET_SIZE=6,          /**< arg1= uint64_t *     res=can fail */
-    STREAM_IS_DIRECTORY,        /**< arg1= bool *, res=can fail*/
+    STREAM_IS_DIRECTORY,        /**< res=can fail */
 
     /* */
     STREAM_GET_PTS_DELAY = 0x101,/**< arg1= int64_t* res=cannot fail */
diff --git a/modules/access/dsm/access.c b/modules/access/dsm/access.c
index ec25a75656..aed5d7075c 100644
--- a/modules/access/dsm/access.c
+++ b/modules/access/dsm/access.c
@@ -614,21 +614,6 @@ static int BrowseDirectory( access_t *p_access, input_item_node_t *p_node )
     return i_ret;
 }
 
-static int DirControl( access_t *p_access, int i_query, va_list args )
-{
-    switch( i_query )
-    {
-    case STREAM_IS_DIRECTORY:
-        *va_arg( args, bool * ) = p_access->pf_readdir == BrowseDirectory;
-                                  /* might loop */
-        break;
-    default:
-        return access_vaDirectoryControlHelper( p_access, i_query, args );
-    }
-
-    return VLC_SUCCESS;
-}
-
 static int BrowserInit( access_t *p_access )
 {
     access_sys_t *p_sys = p_access->p_sys;
@@ -637,7 +622,7 @@ static int BrowserInit( access_t *p_access )
         p_access->pf_readdir = BrowseShare;
     else
         p_access->pf_readdir = BrowseDirectory;
-    p_access->pf_control = DirControl;
+    p_access->pf_control = access_vaDirectoryControlHelper;
 
     return VLC_SUCCESS;
 }
diff --git a/modules/access/ftp.c b/modules/access/ftp.c
index 67b212a897..c2e4b33b3b 100644
--- a/modules/access/ftp.c
+++ b/modules/access/ftp.c
@@ -113,7 +113,6 @@ static ssize_t Read( access_t *, void *, size_t );
 static int Seek( access_t *, uint64_t );
 static int Control( access_t *, int, va_list );
 static int DirRead( access_t *, input_item_node_t * );
-static int DirControl( access_t *, int, va_list );
 #ifdef ENABLE_SOUT
 static int OutSeek( sout_access_out_t *, off_t );
 static ssize_t Write( sout_access_out_t *, block_t * );
@@ -728,7 +727,7 @@ static int InOpen( vlc_object_t *p_this )
     if( b_directory )
     {
         p_access->pf_readdir = DirRead;
-        p_access->pf_control = DirControl;
+        p_access->pf_control = access_vaDirectoryControlHelper;
     } else
         ACCESS_SET_CALLBACKS( Read, NULL, Control, Seek ); \
 
@@ -963,20 +962,6 @@ static int DirRead (access_t *p_access, input_item_node_t *p_current_node)
     return i_ret;
 }
 
-static int DirControl( access_t *p_access, int i_query, va_list args )
-{
-    switch( i_query )
-    {
-    case STREAM_IS_DIRECTORY:
-        *va_arg( args, bool * ) = true; /* might loop */
-        break;
-    default:
-        return access_vaDirectoryControlHelper( p_access, i_query, args );
-    }
-
-    return VLC_SUCCESS;
-}
-
 /*****************************************************************************
  * Write:
  *****************************************************************************/
diff --git a/modules/access/nfs.c b/modules/access/nfs.c
index 0b4a03358c..5470b7c102 100644
--- a/modules/access/nfs.c
+++ b/modules/access/nfs.c
@@ -401,21 +401,6 @@ MountRead(access_t *p_access, input_item_node_t *p_node)
     return i_ret;
 }
 
-static int
-DirControl(access_t *p_access, int i_query, va_list args)
-{
-    switch (i_query)
-    {
-    case STREAM_IS_DIRECTORY:
-        *va_arg( args, bool * ) = true; /* might loop */
-        break;
-    default:
-        return access_vaDirectoryControlHelper(p_access, i_query, args);
-    }
-
-    return VLC_SUCCESS;
-}
-
 static void
 nfs_opendir_cb(int i_status, struct nfs_context *p_nfs, void *p_data,
                void *p_private_data)
@@ -712,7 +697,7 @@ Open(vlc_object_t *p_obj)
         {
             p_access->pf_readdir = DirRead;
             p_access->pf_seek = NULL;
-            p_access->pf_control = DirControl;
+            p_access->pf_control = access_vaDirectoryControl;
         }
         else
             vlc_assert_unreachable();
@@ -745,7 +730,7 @@ Open(vlc_object_t *p_obj)
 
         p_access->pf_readdir = MountRead;
         p_access->pf_seek = NULL;
-        p_access->pf_control = DirControl;
+        p_access->pf_control = access_vaDirectoryControlHelper;
     }
 
     return VLC_SUCCESS;
diff --git a/modules/access/sftp.c b/modules/access/sftp.c
index 1abaf3a685..290ccd69dd 100644
--- a/modules/access/sftp.c
+++ b/modules/access/sftp.c
@@ -81,7 +81,6 @@ static int      Seek( access_t *, uint64_t );
 static int      Control( access_t *, int, va_list );
 
 static int DirRead( access_t *, input_item_node_t * );
-static int DirControl( access_t *, int, va_list );
 
 struct access_sys_t
 {
@@ -402,7 +401,7 @@ static int Open( vlc_object_t* p_this )
         p_sys->file = libssh2_sftp_opendir( p_sys->sftp_session, psz_path );
 
         p_access->pf_readdir = DirRead;
-        p_access->pf_control = DirControl;
+        p_access->pf_control = access_vaDirectoryControlHelper;
 
         if( !p_sys->psz_base_url )
         {
@@ -600,17 +599,3 @@ static int DirRead (access_t *p_access, input_item_node_t *p_current_node)
     free( psz_file );
     return i_ret;
 }
-
-static int DirControl( access_t *p_access, int i_query, va_list args )
-{
-    switch( i_query )
-    {
-    case STREAM_IS_DIRECTORY:
-        *va_arg( args, bool * ) = true; /* might loop */
-        break;
-    default:
-        return access_vaDirectoryControlHelper( p_access, i_query, args );
-    }
-
-    return VLC_SUCCESS;
-}
diff --git a/modules/access/smb.c b/modules/access/smb.c
index 517a619599..008c582b47 100644
--- a/modules/access/smb.c
+++ b/modules/access/smb.c
@@ -85,7 +85,6 @@ static int Seek( access_t *, uint64_t );
 static int Control( access_t *, int, va_list );
 #ifndef _WIN32
 static int DirRead( access_t *, input_item_node_t * );
-static int DirControl( access_t *, int, va_list );
 #endif
 
 struct access_sys_t
@@ -244,7 +243,7 @@ static int Open( vlc_object_t *p_this )
 #else
         p_sys->url = url;
         p_access->pf_readdir = DirRead;
-        p_access->pf_control = DirControl;
+        p_access->pf_control = access_DirectoryControlHelper;
         i_smb = smbc_opendir( psz_uri );
         i_size = 0;
 #endif
@@ -399,20 +398,6 @@ static int DirRead (access_t *p_access, input_item_node_t *p_node )
 
     return i_ret;
 }
-
-static int DirControl( access_t *p_access, int i_query, va_list args )
-{
-    switch( i_query )
-    {
-    case STREAM_IS_DIRECTORY:
-        *va_arg( args, bool * ) = true; /* might loop */
-        break;
-    default:
-        return access_vaDirectoryControlHelper( p_access, i_query, args );
-    }
-
-    return VLC_SUCCESS;
-}
 #endif
 
 /*****************************************************************************
diff --git a/modules/demux/playlist/directory.c b/modules/demux/playlist/directory.c
index 08da448665..6cb1be462e 100644
--- a/modules/demux/playlist/directory.c
+++ b/modules/demux/playlist/directory.c
@@ -42,9 +42,8 @@ static int Demux( demux_t *p_demux );
 int Import_Dir ( vlc_object_t *p_this)
 {
     demux_t  *p_demux = (demux_t *)p_this;
-    bool b_dir_can_loop;
 
-    if( vlc_stream_Control( p_demux->s, STREAM_IS_DIRECTORY, &b_dir_can_loop ) )
+    if( vlc_stream_Control( p_demux->s, STREAM_IS_DIRECTORY ) )
         return VLC_EGENERIC;
 
     p_demux->pf_demux = Demux;
diff --git a/modules/demux/playlist/playlist.h b/modules/demux/playlist/playlist.h
index 480b134409..c11ee7ef36 100644
--- a/modules/demux/playlist/playlist.h
+++ b/modules/demux/playlist/playlist.h
@@ -81,9 +81,8 @@ bool CheckMimeType( stream_t * p_stream, const char * psz_ctype );
 
 #define CHECK_FILE() \
 do { \
-    bool b_loop; \
-    if( vlc_stream_Control( ((demux_t *)p_this)->s, STREAM_IS_DIRECTORY, \
-                        &b_loop ) == VLC_SUCCESS ) \
+    if( vlc_stream_Control( ((demux_t *)p_this)->s, \
+                            STREAM_IS_DIRECTORY ) == VLC_SUCCESS ) \
         return VLC_EGENERIC; \
 } while(0)
 
diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp
index 9c95cb8a94..93aa2997d3 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -1259,20 +1259,6 @@ static int ReadDirectory( access_t *p_access, input_item_node_t* p_node )
     return VLC_SUCCESS;
 }
 
-static int ControlDirectory( access_t *p_access, int i_query, va_list args )
-{
-    switch( i_query )
-    {
-    case STREAM_IS_DIRECTORY:
-        *va_arg( args, bool * ) = true; /* might loop */
-        break;
-    default:
-        return access_vaDirectoryControlHelper( p_access, i_query, args );
-    }
-
-    return VLC_SUCCESS;
-}
-
 static int Open( vlc_object_t *p_this )
 {
     access_t* p_access = (access_t*)p_this;
@@ -1289,7 +1275,7 @@ static int Open( vlc_object_t *p_this )
     }
 
     p_access->pf_readdir = ReadDirectory;
-    p_access->pf_control = ControlDirectory;
+    p_access->pf_control = access_vaDirectoryControlHelper;
 
     return VLC_SUCCESS;
 }
diff --git a/src/input/access.c b/src/input/access.c
index e1a03e67e1..2b1a9cc592 100644
--- a/src/input/access.c
+++ b/src/input/access.c
@@ -171,7 +171,6 @@ int access_vaDirectoryControlHelper( access_t *p_access, int i_query, va_list ar
             *va_arg( args, int64_t * ) = 0;
             break;
         case STREAM_IS_DIRECTORY:
-            *va_arg( args, bool * ) = false;
             break;
         default:
             return VLC_EGENERIC;



More information about the vlc-commits mailing list