1
0
mirror of https://github.com/openbsd/src.git synced 2026-06-18 07:13:36 +02:00

sndiod: When connecting midi endpoints, check their modes

As sndiod always uses IN|OUT, the behavior is unchanged.
This commit is contained in:
ratchov
2026-05-20 13:26:57 +00:00
parent 712016e9c2
commit aeb045601f
+3 -3
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: midi.c,v 1.34 2026/05/20 13:26:02 ratchov Exp $ */
/* $OpenBSD: midi.c,v 1.35 2026/05/20 13:26:57 ratchov Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
@@ -147,11 +147,11 @@ midi_del(struct midi *ep)
void
midi_link(struct midi *ep, struct midi *peer)
{
if (ep->mode & MODE_MIDIOUT) {
if ((ep->mode & MODE_MIDIOUT) && (peer->mode & MODE_MIDIIN)) {
ep->txmask |= peer->self;
midi_tickets(ep);
}
if (ep->mode & MODE_MIDIIN) {
if ((ep->mode & MODE_MIDIIN) && (peer->mode & MODE_MIDIOUT)) {
#ifdef DEBUG
if (ep->obuf.used > 0) {
logx(0, "midi%u: linked with non-empty buffer", ep->num);