SHA256
1
0
forked from pool/rtmidi
rtmidi/ALSA-Avoid-listing-ports-that-are-usually-from-3rd-party.patch
Konstantin Voinov 9852a76446 Accepting request 1128843 from home:kill_it:branches:multimedia:libs
- fix rtmidi.pc:
  rework rtmidi-4.0.0-pkgconfig.patch to rtmidi-6.0.0-pkgconfig.patch
  update rtmidi-cmake.patch
- add ALSA-Avoid-listing-ports-that-are-usually-from-3rd-party.patch
  from upstream

OBS-URL: https://build.opensuse.org/request/show/1128843
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/rtmidi?expand=0&rev=8
2023-11-26 04:43:59 +00:00

26 lines
933 B
Diff

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;
}