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

stream: STREAM_IS_DIRECTORY can actually fail, fix accordingly

parent 9c389564
......@@ -83,7 +83,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 *, arg2= bool *, arg3=bool *, res=cannot fail*/
STREAM_IS_DIRECTORY, /**< arg1= bool *, arg2= bool *, arg3=bool *, res=can fail*/
/* */
STREAM_GET_PTS_DELAY = 0x101,/**< arg1= int64_t* res=cannot fail */
......
......@@ -48,14 +48,10 @@ 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_is_dir, b_dir_sorted, b_dir_can_loop;
bool b_is_dir = false;
bool b_dir_sorted = false;
bool b_dir_can_loop = false;
int i_err = stream_Control( p_demux->s, STREAM_IS_DIRECTORY, &b_is_dir,
&b_dir_sorted, &b_dir_can_loop );
if ( !( i_err == VLC_SUCCESS && b_is_dir ) )
if( stream_Control( p_demux->s, STREAM_IS_DIRECTORY, &b_is_dir,
&b_dir_sorted, &b_dir_can_loop ) || !b_is_dir )
return VLC_EGENERIC;
STANDARD_DEMUX_INIT_MSG( "reading directory content" );
......
......@@ -82,10 +82,11 @@ extern input_item_t * GetCurrentItem(demux_t *p_demux);
bool CheckContentType( stream_t * p_stream, const char * psz_ctype );
#define CHECK_FILE() do { \
bool b_is_dir = false; \
stream_Control( ((demux_t *)p_this)->s, STREAM_IS_DIRECTORY, &b_is_dir, NULL, NULL ); \
if( b_is_dir ) \
#define CHECK_FILE() \
do { \
bool b_is_dir; \
if( stream_Control( ((demux_t *)p_this)->s, STREAM_IS_DIRECTORY, \
&b_is_dir, NULL, NULL ) == VLC_SUCCESS && b_is_dir ) \
return VLC_EGENERIC; \
} while(0)
......
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