mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-22 20:25:39 +02:00
module/alsa: free channel list on each connect attempt
Otherwise we’ll keep adding the same channel(s) over and over again, for each (successful) connect attempt. I.e. if you plug and unplug an USB soundcard repeatedly, we’ll keep extending the channel list each time.
This commit is contained in:
parent
360e1fbada
commit
a5be550964
1 changed files with 3 additions and 0 deletions
|
@ -188,6 +188,9 @@ run_while_online(struct module *mod)
|
|||
struct private *m = mod->private;
|
||||
enum run_state ret = RUN_ERROR;
|
||||
|
||||
/* Make sure we aren’t still tracking channels from previous connects */
|
||||
tll_free(m->channels);
|
||||
|
||||
snd_mixer_t *handle;
|
||||
if (snd_mixer_open(&handle, 0) != 0) {
|
||||
LOG_ERR("failed to open handle");
|
||||
|
|
Loading…
Add table
Reference in a new issue