]> git.sesse.net Git - nageru/commitdiff
Do not try to subscribe to our own MIDI port; causes some warnings on the console.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 19 Feb 2018 08:38:01 +0000 (09:38 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 19 Feb 2018 08:38:01 +0000 (09:38 +0100)
midi_mapper.cpp

index fc3b4ef30bf06b274661ad6aa9415d4d0dbb4ff0..42ad1e5e2a00f3e29d43459e77b41ff1b90fbe33 100644 (file)
@@ -396,6 +396,11 @@ void MIDIMapper::subscribe_to_port_lock_held(snd_seq_t *seq, const snd_seq_addr_
                return;
        }
 
+       // Don't listen to ourselves.
+       if (addr.client == snd_seq_client_id(seq)) {
+               return;
+       }
+
        int err = snd_seq_connect_from(seq, 0, addr.client, addr.port);
        if (err < 0) {
                // Just print out a warning (i.e., don't die); it could