[vlc-commits] stream: disallow NULL parameters to STREAM_IS_DIRECTORY, simplify
Rémi Denis-Courmont
git at videolan.org
Wed Sep 2 21:54:14 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Sep 2 21:33:24 2015 +0300| [c1de095745966d8a13ebfa11cf3d77e7f8623eb6] | committer: Rémi Denis-Courmont
stream: disallow NULL parameters to STREAM_IS_DIRECTORY, simplify
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c1de095745966d8a13ebfa11cf3d77e7f8623eb6
---
modules/access/archive/stream.c | 13 +++----------
modules/demux/playlist/playlist.h | 5 +++--
src/input/access.c | 12 ++----------
3 files changed, 8 insertions(+), 22 deletions(-)
diff --git a/modules/access/archive/stream.c b/modules/access/archive/stream.c
index ae3997c..36ead12 100644
--- a/modules/access/archive/stream.c
+++ b/modules/access/archive/stream.c
@@ -39,17 +39,10 @@ static int Control(stream_t *p_stream, int i_query, va_list args)
switch( i_query )
{
case STREAM_IS_DIRECTORY:
- {
- bool *pb_canreaddir = va_arg( args, bool * );
- bool *pb_dirsorted = va_arg( args, bool * );
- bool *pb_dircanloop = va_arg( args, bool * );
- *pb_canreaddir = true;
- if (pb_dirsorted)
- *pb_dirsorted = false;
- if (pb_dircanloop)
- pb_dircanloop = false;
+ *va_arg( args, bool * ) = true;
+ *va_arg( args, bool * ) = false;
+ *va_arg( args, bool * ) = false;
break;
- }
case STREAM_CAN_SEEK:
case STREAM_CAN_FASTSEEK:
diff --git a/modules/demux/playlist/playlist.h b/modules/demux/playlist/playlist.h
index 9bd9b1d..1456cf2 100644
--- a/modules/demux/playlist/playlist.h
+++ b/modules/demux/playlist/playlist.h
@@ -84,9 +84,10 @@ bool CheckContentType( stream_t * p_stream, const char * psz_ctype );
#define CHECK_FILE() \
do { \
- bool b_is_dir; \
+ bool b_is_dir, b_sorted, b_loop; \
if( stream_Control( ((demux_t *)p_this)->s, STREAM_IS_DIRECTORY, \
- &b_is_dir, NULL, NULL ) == VLC_SUCCESS && b_is_dir ) \
+ &b_is_dir, &b_sorted, &b_loop ) == VLC_SUCCESS && \
+ b_is_dir ) \
return VLC_EGENERIC; \
} while(0)
diff --git a/src/input/access.c b/src/input/access.c
index fdfb808..c2dd3d7 100644
--- a/src/input/access.c
+++ b/src/input/access.c
@@ -311,18 +311,10 @@ static int AStreamControl(stream_t *s, int cmd, va_list args)
return access_vaControl(access, cmd, args);
case STREAM_IS_DIRECTORY:
- {
- bool *b;
-
*va_arg(args, bool *) = access->pf_readdir != NULL;
- b = va_arg(args, bool *);
- if (b != NULL)
- *b = access->info.b_dir_sorted;
- b = va_arg(args, bool *);
- if (b != NULL)
- *b = access->info.b_dir_can_loop;
+ *va_arg(args, bool *) = access->info.b_dir_sorted;
+ *va_arg(args, bool *) = access->info.b_dir_can_loop;
break;
- }
case STREAM_GET_PRIVATE_BLOCK:
{
More information about the vlc-commits
mailing list