Skip to content
Snippets Groups Projects
Commit e8e1c183 authored by Rafaël Carré's avatar Rafaël Carré
Browse files

alsalayer : reduce indentation

parent 6716fef1
No related branches found
No related tags found
No related merge requests found
......@@ -1014,17 +1014,21 @@ void AlsaLayer::audioCallback (void)
SFLDataFormat* in = NULL;
if (is_capture_running()) {
if (!is_capture_running())
return;
micAvailBytes = snd_pcm_avail_update (_CaptureHandle);
if (micAvailBytes > 0) {
if (micAvailBytes < 0)
_debug ("Audio: Mic error: %s", snd_strerror (micAvailBytes));
if (micAvailBytes <= 0)
return;
micAvailPut = getMainBuffer()->availForPut();
toPut = (micAvailBytes <= framesPerBufferAlsa) ? micAvailBytes : framesPerBufferAlsa;
in = (SFLDataFormat*) malloc (toPut * sizeof (SFLDataFormat));
toPut = read (in, toPut* sizeof (SFLDataFormat));
if (in) {
adjustVolume (in, toPut, SFL_PCM_CAPTURE);
int _mainBufferSampleRate = getMainBuffer()->getInternalSamplingRate();
......@@ -1055,14 +1059,8 @@ void AlsaLayer::audioCallback (void)
free (filter_out);
}
}
}
free (in);
in=0;
} else if (micAvailBytes < 0) {
_debug ("Audio: Mic error: %s", snd_strerror (micAvailBytes));
}
}
}
void* AlsaLayer::adjustVolume (void* buffer , int len, int stream)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment