Commit 05b378dd authored by Gildas Bazin's avatar Gildas Bazin

* ALL: fixed a f*ckage I introduced recently ;) var_Type() now returns 0 when the variable
doesn't exist, but the rest of the code wasn't updated according to this new behaviour.
* modules/audio_output/waveout.c: changed a few error messages into warning messages.
parent 2fd77aa1
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* oss.c : OSS /dev/dsp module for vlc * oss.c : OSS /dev/dsp module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2002 VideoLAN * Copyright (C) 2000-2002 VideoLAN
* $Id: oss.c,v 1.37 2002/12/07 23:50:30 massiot Exp $ * $Id: oss.c,v 1.38 2002/12/10 18:22:01 gbazin Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -251,7 +251,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -251,7 +251,7 @@ static int Open( vlc_object_t *p_this )
p_aout->output.pf_play = Play; p_aout->output.pf_play = Play;
if ( var_Type( p_aout, "audio-device" ) < 0 ) if ( var_Type( p_aout, "audio-device" ) == 0 )
{ {
Probe( p_aout ); Probe( p_aout );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* sdl.c : SDL audio output plugin for vlc * sdl.c : SDL audio output plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2002 VideoLAN * Copyright (C) 2000-2002 VideoLAN
* $Id: sdl.c,v 1.17 2002/12/07 23:50:30 massiot Exp $ * $Id: sdl.c,v 1.18 2002/12/10 18:22:01 gbazin Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -170,7 +170,7 @@ static int Open ( vlc_object_t *p_this ) ...@@ -170,7 +170,7 @@ static int Open ( vlc_object_t *p_this )
AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT : AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT :
AOUT_CHAN_CENTER); AOUT_CHAN_CENTER);
if ( var_Type( p_aout, "audio-device" ) < 0 ) if ( var_Type( p_aout, "audio-device" ) == 0 )
{ {
vlc_value_t val; vlc_value_t val;
var_Create( p_aout, "audio-device", VLC_VAR_STRING | VLC_VAR_HASCHOICE ); var_Create( p_aout, "audio-device", VLC_VAR_STRING | VLC_VAR_HASCHOICE );
...@@ -181,7 +181,7 @@ static int Open ( vlc_object_t *p_this ) ...@@ -181,7 +181,7 @@ static int Open ( vlc_object_t *p_this )
NULL ); NULL );
} }
} }
else if ( var_Type( p_aout, "audio-device" ) < 0 ) else if ( var_Type( p_aout, "audio-device" ) == 0 )
{ {
/* First launch. */ /* First launch. */
vlc_value_t val; vlc_value_t val;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* waveout.c : Windows waveOut plugin for vlc * waveout.c : Windows waveOut plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: waveout.c,v 1.12 2002/11/20 16:43:33 sam Exp $ * $Id: waveout.c,v 1.13 2002/12/10 18:22:01 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -130,7 +130,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -130,7 +130,7 @@ static int Open( vlc_object_t *p_this )
if ( OpenWaveOut( p_aout, WAVE_FORMAT_IEEE_FLOAT, i_nb_channels, if ( OpenWaveOut( p_aout, WAVE_FORMAT_IEEE_FLOAT, i_nb_channels,
p_aout->output.output.i_rate ) ) p_aout->output.output.i_rate ) )
{ {
msg_Err( p_aout, "Audio device doesn't allow WAVE_FORMAT_IEEE_FLOAT" ); msg_Warn( p_aout, "Audio device can't use WAVE_FORMAT_IEEE_FLOAT" );
p_aout->output.output.i_format = VLC_FOURCC('s','1','6','l'); p_aout->output.output.i_format = VLC_FOURCC('s','1','6','l');
if ( OpenWaveOut( p_aout, WAVE_FORMAT_PCM, i_nb_channels, if ( OpenWaveOut( p_aout, WAVE_FORMAT_PCM, i_nb_channels,
...@@ -257,12 +257,12 @@ static int OpenWaveOut( aout_instance_t *p_aout, int i_format, ...@@ -257,12 +257,12 @@ static int OpenWaveOut( aout_instance_t *p_aout, int i_format,
CALLBACK_FUNCTION ); CALLBACK_FUNCTION );
if( result == WAVERR_BADFORMAT ) if( result == WAVERR_BADFORMAT )
{ {
msg_Err( p_aout, "waveOutOpen failed WAVERR_BADFORMAT" ); msg_Warn( p_aout, "waveOutOpen failed WAVERR_BADFORMAT" );
return( 1 ); return 1;
} }
if( result != MMSYSERR_NOERROR ) if( result != MMSYSERR_NOERROR )
{ {
msg_Err( p_aout, "waveOutOpen failed" ); msg_Warn( p_aout, "waveOutOpen failed" );
return 1; return 1;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* dec.c : audio output API towards decoders * dec.c : audio output API towards decoders
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: dec.c,v 1.3 2002/12/06 10:10:39 sam Exp $ * $Id: dec.c,v 1.4 2002/12/10 18:22:01 gbazin Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -80,11 +80,11 @@ static aout_input_t * DecNew( aout_instance_t * p_aout, ...@@ -80,11 +80,11 @@ static aout_input_t * DecNew( aout_instance_t * p_aout,
{ {
int i; int i;
if ( var_Type( p_aout, "audio-device" ) >= 0 ) if ( var_Type( p_aout, "audio-device" ) != 0 )
{ {
var_Destroy( p_aout, "audio-device" ); var_Destroy( p_aout, "audio-device" );
} }
if ( var_Type( p_aout, "audio-channels" ) >= 0 ) if ( var_Type( p_aout, "audio-channels" ) != 0 )
{ {
var_Destroy( p_aout, "audio-channels" ); var_Destroy( p_aout, "audio-channels" );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf.c : audio output API towards the interface modules * intf.c : audio output API towards the interface modules
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: intf.c,v 1.10 2002/12/07 23:50:30 massiot Exp $ * $Id: intf.c,v 1.11 2002/12/10 18:22:01 gbazin Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -419,11 +419,11 @@ void aout_FindAndRestart( vlc_object_t * p_this ) ...@@ -419,11 +419,11 @@ void aout_FindAndRestart( vlc_object_t * p_this )
if ( p_aout == NULL ) return; if ( p_aout == NULL ) return;
if ( var_Type( p_aout, "audio-device" ) >= 0 ) if ( var_Type( p_aout, "audio-device" ) != 0 )
{ {
var_Destroy( p_aout, "audio-device" ); var_Destroy( p_aout, "audio-device" );
} }
if ( var_Type( p_aout, "audio-channels" ) >= 0 ) if ( var_Type( p_aout, "audio-channels" ) != 0 )
{ {
var_Destroy( p_aout, "audio-channels" ); var_Destroy( p_aout, "audio-channels" );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* variables.c: routines for object variables handling * variables.c: routines for object variables handling
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: variables.c,v 1.16 2002/12/08 19:56:04 gbazin Exp $ * $Id: variables.c,v 1.17 2002/12/10 18:22:01 gbazin Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -414,7 +414,7 @@ int __var_Change( vlc_object_t *p_this, const char *psz_name, ...@@ -414,7 +414,7 @@ int __var_Change( vlc_object_t *p_this, const char *psz_name,
/***************************************************************************** /*****************************************************************************
* var_Type: request a variable's type * var_Type: request a variable's type
***************************************************************************** *****************************************************************************
* This function returns the variable type if it exists, or an error if the * This function returns the variable type if it exists, or 0 if the
* variable could not be found. * variable could not be found.
*****************************************************************************/ *****************************************************************************/
int __var_Type( vlc_object_t *p_this, const char *psz_name ) int __var_Type( vlc_object_t *p_this, const char *psz_name )
......
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