* ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: ac3_spdif.c,v 1.19 2002/03/11 07:23:09 gbazin Exp $
+ * $Id: ac3_spdif.c,v 1.20 2002/03/12 18:37:46 stef Exp $
*
* Authors: Stéphane Borel <stef@via.ecp.fr>
* Juha Yrjola <jyrjola@cc.hut.fi>
* Build configuration tree.
*****************************************************************************/
MODULE_CONFIG_START
-ADD_CATEGORY_HINT( "Misc Options", NULL )
-ADD_BOOL( "spdif", NULL, "enable AC3 pass-through mode", NULL )
MODULE_CONFIG_STOP
MODULE_INIT_START
SET_DESCRIPTION( "SPDIF pass-through AC3 decoder" )
- ADD_CAPABILITY( DECODER, 100 )
+ ADD_CAPABILITY( DECODER, 0 )
+ ADD_SHORTCUT( "ac3_spdif" )
+ ADD_SHORTCUT( "pass_through" )
+ ADD_SHORTCUT( "pass" )
MODULE_INIT_STOP
MODULE_ACTIVATE_START
*****************************************************************************/
static int decoder_Probe( u8 *pi_type )
{
- return( ( config_GetIntVariable( "spdif" )
- && *pi_type == AC3_AUDIO_ES ) ? 0 : -1 );
+ return( *pi_type == AC3_AUDIO_ES ) ? 0 : -1;
}
{
intf_ErrMsg( "spdif error: stream not valid");
- aout_DestroyFifo( p_spdif->p_aout_fifo );
return( -1 );
}
//return -1;
}
+ /* The audio output need to be ready for an ac3 stream */
+ p_spdif->i_previous_format = config_GetIntVariable( "aout_format" );
+ config_PutIntVariable( "aout_format", 8 );
+
/* Creating the audio output fifo */
p_spdif->p_aout_fifo = aout_CreateFifo( AOUT_FIFO_SPDIF, 1,
p_spdif->ac3_info.i_sample_rate,
}
+ /* restore previous setting for output format */
+ config_PutIntVariable( "aout_format", p_spdif->i_previous_format );
+
/* Destroy descriptor */
free( p_spdif->p_ac3 );
free( p_spdif );