Waveout: Fix SPDIF output

Ref #9522
This commit is contained in:
Andy Tather 2013-12-05 18:32:38 +01:00 committed by Jean-Baptiste Kempf
parent 193af81939
commit 4fcfd8479f

View File

@ -175,12 +175,6 @@ static int Start( audio_output_t *p_aout, audio_sample_format_t *restrict fmt )
/* Default behaviour is to use software gain */
p_aout->sys->b_soft = true;
/*
check for configured audio device!
*/
fmt->i_format = var_InheritBool( p_aout, "waveout-float32" )?
VLC_CODEC_FL32: VLC_CODEC_S16N;
char *dev = var_GetNonEmptyString( p_aout, "waveout-audio-device");
uint32_t devid = findDeviceID( dev );
@ -230,6 +224,12 @@ static int Start( audio_output_t *p_aout, audio_sample_format_t *restrict fmt )
if( fmt->i_format != VLC_CODEC_SPDIFL )
{
/*
check for configured audio device!
*/
fmt->i_format = var_InheritBool( p_aout, "waveout-float32" )?
VLC_CODEC_FL32: VLC_CODEC_S16N;
int max_chan = var_InheritInteger( p_aout, "waveout-audio-channels");
int i_channels = aout_FormatNbChannels(fmt);
i_channels = ( i_channels < max_chan )? i_channels: max_chan;