/*****************************************************************************
* duplicate.c: duplicate stream output module
*****************************************************************************
- * Copyright (C) 2003-2004 VideoLAN (Centrale Réseaux) and its contributors
+ * Copyright (C) 2003-2004 the VideoLAN team
* $Id$
*
* Author: Laurent Aimar <fenrir@via.ecp.fr>
if( !strncmp( psz, "no-audio", strlen( "no-audio" ) ) ||
!strncmp( psz, "noaudio", strlen( "noaudio" ) ) )
{
- if( i_cat != 1 )
+ if( i_cat == -1 )
{
i_cat = fmt->i_cat != AUDIO_ES ? 1 : 0;
}
else if( !strncmp( psz, "no-video", strlen( "no-video" ) ) ||
!strncmp( psz, "novideo", strlen( "novideo" ) ) )
{
- if( i_cat != 1 )
+ if( i_cat == -1 )
{
i_cat = fmt->i_cat != VIDEO_ES ? 1 : 0;
}
else if( !strncmp( psz, "no-spu", strlen( "no-spu" ) ) ||
!strncmp( psz, "nospu", strlen( "nospu" ) ) )
{
- if( i_cat != 1 )
+ if( i_cat == -1 )
{
i_cat = fmt->i_cat != SPU_ES ? 1 : 0;
}
}
else if( !strncmp( psz, "audio", strlen( "audio" ) ) )
{
- if( i_cat != 1 )
+ if( i_cat == -1 )
{
i_cat = fmt->i_cat == AUDIO_ES ? 1 : 0;
}
}
else if( !strncmp( psz, "video", strlen( "video" ) ) )
{
- if( i_cat != 1 )
+ if( i_cat == -1 )
{
i_cat = fmt->i_cat == VIDEO_ES ? 1 : 0;
}
}
else if( !strncmp( psz, "spu", strlen( "spu" ) ) )
{
- if( i_cat != 1 )
+ if( i_cat == -1 )
{
i_cat = fmt->i_cat == SPU_ES ? 1 : 0;
}
if( !strcmp( psz, "no-es" ) || !strcmp( psz, "noes" ) )
{
- if( i_es != 1 )
+ if( i_es == -1 )
{
- i_es = !NumInRange( psz_arg, fmt->i_id ) ? 1 : 0;
+ i_es = NumInRange( psz_arg, fmt->i_id ) ? 0 : -1;
}
}
else if( !strcmp( psz, "es" ) )
{
- if( i_es != 1 )
+ if( i_es == -1 )
{
- i_es = NumInRange( psz_arg, fmt->i_id) ? 1 : 0;
+ i_es = NumInRange( psz_arg, fmt->i_id) ? 1 : -1;
}
}
else if( !strcmp( psz, "no-prgm" ) || !strcmp( psz, "noprgm" ) ||
!strcmp( psz, "no-program" ) || !strcmp( psz, "noprogram" ) )
{
- if( fmt->i_group >= 0 && i_prgm != 1 )
+ if( fmt->i_group >= 0 && i_prgm == -1 )
{
- i_prgm = !NumInRange( psz_arg, fmt->i_group ) ? 1 : 0;
+ i_prgm = NumInRange( psz_arg, fmt->i_group ) ? 0 : -1;
}
}
else if( !strcmp( psz, "prgm" ) || !strcmp( psz, "program" ) )
{
- if( fmt->i_group >= 0 && i_prgm != 1 )
+ if( fmt->i_group >= 0 && i_prgm == -1 )
{
- i_prgm = NumInRange( psz_arg, fmt->i_group ) ? 1 : 0;
+ i_prgm = NumInRange( psz_arg, fmt->i_group ) ? 1 : -1;
}
}
}
free( psz_dup );
- if( i_cat == 0 || i_es == 0 || i_prgm == 0 )
+ if( i_cat == 1 || i_es == 1 || i_prgm == 1 )
{
- /* One test failed */
- return VLC_FALSE;
+ return VLC_TRUE;
}
- return VLC_TRUE;
+ return VLC_FALSE;
}