Commit 5e21c13b authored by Cyril Deguet's avatar Cyril Deguet

- added support for S8 and U16 aout (not tested)
- The sound is very dirty in U8 mode. I don't know if it comes from the
8 bit mode itself or from the S16->U8 conversion.
parent 72f00b22
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* aout_common.h: audio output inner functions * aout_common.h: audio output inner functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: aout_common.h,v 1.8 2002/01/14 19:54:36 asmax Exp $ * $Id: aout_common.h,v 1.9 2002/01/15 11:51:11 asmax Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr> * Cyril Deguet <asmax@via.ecp.fr>
...@@ -72,8 +72,9 @@ void aout_##format##Thread( aout_thread_t * p_aout ) \ ...@@ -72,8 +72,9 @@ void aout_##format##Thread( aout_thread_t * p_aout ) \
\ \
for ( l_buffer = 0; l_buffer < l_buffer_limit; l_buffer++ ) \ for ( l_buffer = 0; l_buffer < l_buffer_limit; l_buffer++ ) \
{ \ { \
((type *)p_aout->buffer)[l_buffer] = (type)( buffer_copy ); \ ((type *)p_aout->buffer)[l_buffer] = (type)( buffer_copy * \
p_aout->s32_buffer[l_buffer] = 0; \ p_aout->i_volume / 256 ); \
p_aout->s32_buffer[l_buffer] = 0; \
} \ } \
\ \
l_bytes = p_aout->pf_getbufinfo( p_aout, l_buffer_limit ); \ l_bytes = p_aout->pf_getbufinfo( p_aout, l_buffer_limit ); \
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* audio_output.c : audio output thread * audio_output.c : audio output thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: audio_output.c,v 1.72 2002/01/14 19:54:36 asmax Exp $ * $Id: audio_output.c,v 1.73 2002/01/15 11:51:11 asmax Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr> * Cyril Deguet <asmax@via.ecp.fr>
...@@ -174,24 +174,20 @@ aout_thread_t *aout_CreateThread( int *pi_status, int i_channels, long l_rate ) ...@@ -174,24 +174,20 @@ aout_thread_t *aout_CreateThread( int *pi_status, int i_channels, long l_rate )
/***************************************************************************** /*****************************************************************************
* Declare the different aout thread fucntions * Declare the different aout thread functions
*****************************************************************************/ *****************************************************************************/
DECLARE_AOUT_THREAD( S16, s16, ( p_aout->s32_buffer[l_buffer] / DECLARE_AOUT_THREAD( S16, s16, ( p_aout->s32_buffer[l_buffer] /
AOUT_MAX_FIFOS ) * p_aout->i_volume / 256 ) AOUT_MAX_FIFOS ) )
DECLARE_AOUT_THREAD( U8, u8, (( p_aout->s32_buffer[l_buffer] / DECLARE_AOUT_THREAD( U16, u16, (( p_aout->s32_buffer[l_buffer] /
AOUT_MAX_FIFOS / 256) + 128 ) * p_aout->i_volume / 256 ) AOUT_MAX_FIFOS) + 128) )
void aout_S8Thread( aout_thread_t * p_aout ) DECLARE_AOUT_THREAD( U8, u8, (( p_aout->s32_buffer[l_buffer] /
{ AOUT_MAX_FIFOS / 256) + 128 ) )
intf_ErrMsg( "aout error: 8 bit signed thread unsupported" );
} DECLARE_AOUT_THREAD( S8, s8, ( p_aout->s32_buffer[l_buffer] /
AOUT_MAX_FIFOS / 256) )
void aout_U16Thread( aout_thread_t * p_aout )
{
intf_ErrMsg( "aout error: 16 bit unsigned thread unsupported" );
}
/***************************************************************************** /*****************************************************************************
* aout_SpawnThread * aout_SpawnThread
......
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