SHA256
1
0
forked from pool/rtmidi
rtmidi/ALSA-Avoid-listing-ports-that-are-usually-from-3rd-party.patch

26 lines
933 B
Diff
Raw Permalink Normal View History

From b70cfd8763fcdbbade6e57b81d2bc06dbd925e84 Mon Sep 17 00:00:00 2001
From: rncbc <rncbc@rncbc.org>
Date: Thu, 21 Sep 2023 14:56:49 +0100
Subject: [PATCH] ALSA: Avoid listing ports that are usually from 3rd.party
managers or clients that have no subscriptable ports at all.
---
RtMidi.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/RtMidi.cpp b/RtMidi.cpp
index 0c3dcbe..2216d50 100644
--- a/RtMidi.cpp
+++ b/RtMidi.cpp
@@ -2087,7 +2087,9 @@ unsigned int portInfo( snd_seq_t *seq, snd_seq_port_info_t *pinfo, unsigned int
( ( atyp & SND_SEQ_PORT_TYPE_APPLICATION ) == 0 ) ) continue;
unsigned int caps = snd_seq_port_info_get_capability( pinfo );
- if ( ( caps & type ) != type ) continue;
+ if ( ( ( caps & type ) != type ) ||
+ ( ( caps & SND_SEQ_PORT_CAP_NO_EXPORT ) != 0 ) ) continue;
+
if ( count == portNumber ) return 1;
++count;
}