Commit 513520c9 authored by sletz's avatar sletz
Browse files

Dmitry Baikov patch for alsa_rawmidi driver.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2094 0c269be4-1314-0410-8aa9-9f06e86f4224
parent bf75a68b
......@@ -22,7 +22,8 @@ Fernando Lopez-Lezcano
2008-03-27 Stephane Letz <letz@grame.fr>
* Pieter Palmers patch FFADO driver.
* Pieter Palmers patch for FFADO driver.
* Dmitry Baikov patch for alsa_rawmidi driver.
2008-03-26 Stephane Letz <letz@grame.fr>
......
......@@ -479,15 +479,22 @@ int midi_port_open(alsa_rawmidi_t *midi, midi_port_t *port)
static
void midi_port_close(const alsa_rawmidi_t *midi, midi_port_t *port)
{
if (port->data_ring)
if (port->data_ring) {
jack_ringbuffer_free(port->data_ring);
if (port->event_ring)
port->data_ring = NULL;
}
if (port->event_ring) {
jack_ringbuffer_free(port->event_ring);
if (port->jack)
port->event_ring = NULL;
}
if (port->jack) {
jack_port_unregister(midi->client, port->jack);
if (port->rawmidi)
port->jack = NULL;
}
if (port->rawmidi) {
snd_rawmidi_close(port->rawmidi);
memset(port, 0, sizeof(*port));
port->rawmidi = NULL;
}
}
/*
......@@ -689,11 +696,12 @@ midi_port_t** scan_port_open(alsa_rawmidi_t *midi, midi_port_t **list)
(str->port_close)(midi, port);
fail_1:
midi_port_close(midi, port);
port->state = PORT_ZOMBIFIED;
error_log("scan: can't open port %s %s, zombified", port->dev, port->name);
return &port->next;
fail_0:
*list = port->next;
error_log("scan: can't open port %s %s", port->dev, port->name);
free(port);
return list;
return &port->next;
}
static
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment