// This is required in the top thread for Alsa to work
alsa_leaks() {
ArrayList<char*> *alsa_titles = new ArrayList<char*>;
+ alsa_titles->set_array_delete();
AudioALSA::list_devices(alsa_titles, 0, MODEPLAY);
alsa_titles->remove_all_objects();
delete alsa_titles;
char string[BCTEXTLEN];
snd_pcm_stream_t stream = SND_PCM_STREAM_PLAYBACK;
- devices->set_array_delete();
-
-
switch(mode)
{
case MODERECORD:
#define DEFAULT_DEVICE "default"
char *result = new char[strlen(DEFAULT_DEVICE) + 1];
devices->append(result);
- devices->set_array_delete(); // since we are allocating by new[]
strcpy(result, DEFAULT_DEVICE);
while(snd_card_next(&card) >= 0)
void AudioALSA::translate_name(char *output, char *input, int mode)
{
ArrayList<char*> titles;
+ titles.set_array_delete();
+
ArrayList<char*> pcm_titles;
+ pcm_titles.set_array_delete();
list_devices(&titles, 0, mode);
list_devices(&pcm_titles, 1, mode);
translate_name(pcm_name, device->in_config->alsa_in_device,MODERECORD);
//printf("AudioALSA::open_input %s\n", pcm_name);
- err = snd_pcm_open(&dsp_in, device->in_config->alsa_in_device, stream, open_mode);
+ err = snd_pcm_open(&dsp_in, pcm_name, stream, open_mode);
if(err < 0) {
dsp_in = 0;
return 1;
}
- set_params(dsp_out, MODEPLAY,
+ err = set_params(dsp_out, MODEPLAY,
device->get_ochannels(),
device->out_config->alsa_out_bits,
device->out_samplerate,