Skip to content

Commit 8f24b42

Browse files
author
Tobias Schlemmer
committed
getPortList returns an empty set if the requirements cannot be met.
It's up to the developers to deal with this case, anyway.
1 parent 356d619 commit 8f24b42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

RtMidi.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4338,7 +4338,7 @@ namespace rtmidi{
43384338
PortList MidiInWinMM :: getPortList(int capabilities)
43394339
{
43404340
WinMidiData *data = static_cast<WinMidiData *> (apiData_);
4341-
if (!data) return PortList();
4341+
if (!data || capabilities != PortDescriptor::INPUT) return PortList();
43424342
return WinMMPortDescriptor::getPortList(PortDescriptor::INPUT,data->getClientName());
43434343
}
43444344

@@ -4587,7 +4587,7 @@ namespace rtmidi{
45874587
PortList MidiOutWinMM :: getPortList(int capabilities)
45884588
{
45894589
WinMidiData *data = static_cast<WinMidiData *> (apiData_);
4590-
if (!data) return PortList();
4590+
if (!data || capabilities != PortDescriptor::OUTPUT) return PortList();
45914591
return WinMMPortDescriptor::getPortList(PortDescriptor::OUTPUT,data->getClientName());
45924592
}
45934593

0 commit comments

Comments
 (0)