snd_seq_query_port_subscribers not updating subs index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I'm iterating through subscribers with snd_seq_query_port_subscribers to
disconnect them. It works most of the time, but when a2j (an alsa -> jack
MIDI bridge) runs, snd_seq_query_port_subscribers does not update the subs
index, and the next call returns 0, leading to an infinite loop. I have to
manually increase the index when the disconnection fails (meaning that I
hit an a2j connection).

while (snd_seq_query_port_subscribers(seq, subs) >= 0) {
  addr = *snd_seq_query_subscribe_get_addr(subs);
  if (snd_seq_disconnect_to(seq, port, addr.client, addr.port) < 0) {
    snd_seq_query_subscribe_set_index(subs,
snd_seq_query_subscribe_get_index(subs) + 1);
  }
}

1. Is the non-updated subs index an expected behavior ?

2. Is my fix a correct one or could it leads to other issues ?

Many thanks,
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux