From 0a9303538456cba3c83ae85fa62267749ab0c5dc Mon Sep 17 00:00:00 2001 From: Renaud Dartus Date: Tue, 24 Oct 2000 16:00:56 +0000 Subject: [PATCH] =?UTF-8?q?Modification=20l=EF=BF=BDg=EF=BF=BDre=20de=20la?= =?UTF-8?q?=20gestion=20du=20volume?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/audio_output.h | 6 +++--- src/audio_output/audio_output.c | 11 +++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/audio_output.h b/include/audio_output.h index 80d909104f..6f4cfd2ddc 100644 --- a/include/audio_output.h +++ b/include/audio_output.h @@ -65,10 +65,10 @@ #define AOUT_MAX_RATE 48000 -/* Volume (default 100) */ -#define VOL 100 +/* Volume (default 256) */ +#define VOL 256 #define VOLSTEP 5 -#define VOLMAX 300 +#define VOLMAX 765 /* Number of audio output frames contained in an audio output fifo. * (AOUT_FIFO_SIZE + 1) must be a power of 2, in order to optimise the diff --git a/src/audio_output/audio_output.c b/src/audio_output/audio_output.c index 701e116194..3a61b69904 100644 --- a/src/audio_output/audio_output.c +++ b/src/audio_output/audio_output.c @@ -3,7 +3,7 @@ ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN * - * Authors: + * Authors: Michel Kaempf * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -569,6 +569,7 @@ void aout_Thread_S8_Stereo( aout_thread_t * p_aout ) void aout_Thread_U8_Mono( aout_thread_t * p_aout ) { +# if 0 int i_fifo; long l_buffer, l_buffer_limit; long l_units, l_bytes; @@ -927,7 +928,7 @@ intf_DbgMsg( "%d - p_aout->s32b %ld\n", l_buffer, (s32) ( ((s16 *)p_aout->fifo[i } } vlc_mutex_unlock( &p_aout->fifos_lock ); - +#endif } void aout_Thread_U8_Stereo( aout_thread_t * p_aout ) @@ -1178,8 +1179,7 @@ void aout_Thread_U8_Stereo( aout_thread_t * p_aout ) for ( l_buffer = 0; l_buffer < l_buffer_limit; l_buffer++ ) { - ((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / 256) + 128 ) * \ - ((float) p_aout->vol / 100 ) ); + ((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / 256) + 128 ) * p_aout->vol / 256 ); p_aout->s32_buffer[l_buffer] = 0; } l_bytes = p_aout->p_sys_getbufinfo( p_aout, l_buffer_limit ); @@ -1474,8 +1474,7 @@ void aout_Thread_S16_Stereo( aout_thread_t * p_aout ) for ( l_buffer = 0; l_buffer < l_buffer_limit; l_buffer++ ) { - ((s16 *)p_aout->buffer)[l_buffer] = (s16)( ( p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS ) * \ - ((float) p_aout->vol / 100 ) ) ; + ((s16 *)p_aout->buffer)[l_buffer] = (s16)( ( p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS ) * p_aout->vol / 256 ) ; p_aout->s32_buffer[l_buffer] = 0; }