Skip to content
Snippets Groups Projects
Commit c00e25b4 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Clean adjust volume method in alsalayer

parent 2fa53a3d
No related branches found
No related tags found
No related merge requests found
......@@ -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 ;
}
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment