diff --git a/src/audio/alsalayer.cpp b/src/audio/alsalayer.cpp index 33a14637b4cd39c1b64116fbf3069a7117250020..acd933c9d071b4d82e1a02c7206f07ab069a279d 100644 --- a/src/audio/alsalayer.cpp +++ b/src/audio/alsalayer.cpp @@ -752,17 +752,16 @@ AlsaLayer::soundCardGetIndex( std::string description ) void* AlsaLayer::adjustVolume( void* buffer , int len, int stream ) { - int vol; - if( stream == SFL_PCM_PLAYBACK ) - vol = _manager->getSpkrVolume(); - else - vol = _manager->getMicVolume(); + int vol, i, size; + SFLDataFormat *src = NULL; + + (stream == SFL_PCM_PLAYBACK)? vol = _manager->getSpkrVolume() : vol = _manager->getMicVolume(); + + src = (SFLDataFormat*) buffer; - SFLDataFormat* src = (SFLDataFormat*) buffer; if( vol != 100 ) { - int size = len / sizeof(SFLDataFormat); - int i; + size = len / sizeof(SFLDataFormat); for( i = 0 ; i < size ; i++ ){ src[i] = src[i] * vol / 100 ; } diff --git a/src/audio/pulselayer.cpp b/src/audio/pulselayer.cpp index 9f7c5a78a6c7d702dd1575c236fff600d477d7dc..ce58efddbb9737531afe6fca1f8c9275540e702e 100644 --- a/src/audio/pulselayer.cpp +++ b/src/audio/pulselayer.cpp @@ -348,7 +348,7 @@ void PulseLayer::readFromMic( void ) } if( data != 0 ){ - _micRingBuffer.Put( (void*)data , r, 100); + _micRingBuffer.Put( (void*)data ,r, 100); } if( pa_stream_drop( record->pulseStream() ) < 0 ) { @@ -373,17 +373,6 @@ static void retrieve_server_info(pa_context *c UNUSED, const pa_server_info *i, _debug("\t\tDefault source name : %s\n" , i->default_source_name); } -/* -static void retrieve_client_list(pa_context *c, const pa_client_info *i, int eol, void *userdata) -{ - _debug("end of list = %i\n", eol); - _debug("Clients Info: index : %i\n" , i->index); - _debug("\t\tClient name : %s\n" , i->name); - _debug("\t\tOwner module : %i\n" , i->owner_module); - _debug("\t\tDriver : %s\n" , i->driver); -} -*/ - static void reduce_sink_list_cb(pa_context *c UNUSED, const pa_sink_input_info *i, int eol, void *userdata) { PulseLayer* pulse = (PulseLayer*) userdata;