From d441bf52d53ed4af4349e9a5b50f415df8803885 Mon Sep 17 00:00:00 2001 From: sletz Date: Fri, 22 Feb 2008 10:28:50 +0000 Subject: [PATCH] Correct JACK_port_unregister. git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1874 0c269be4-1314-0410-8aa9-9f06e86f4224 --- linux/alsa/alsa_midi_jackmp.cpp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/linux/alsa/alsa_midi_jackmp.cpp b/linux/alsa/alsa_midi_jackmp.cpp index ad06270b..f7778304 100644 --- a/linux/alsa/alsa_midi_jackmp.cpp +++ b/linux/alsa/alsa_midi_jackmp.cpp @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2006,2007 Dmitry S. Baikov + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "JackAlsaDriver.h" #include "JackPort.h" #include "alsa_midi_impl.h" @@ -24,16 +42,17 @@ jack_port_t* JACK_port_register(jack_client_t *client, const char *port_name, co { JackAlsaDriver *driver = (JackAlsaDriver*)client; int port_id = driver->port_register(port_name, port_type, flags, buffer_size); - if (port_id == NO_PORT) + if (port_id == NO_PORT) { return 0; - else + } else { return (jack_port_t*) new fake_port_t(driver, port_id); + } } int JACK_port_unregister(jack_client_t *client, jack_port_t *port) { fake_port_t* real = (fake_port_t*)port; - int res = 0; //real->driver->port_unregister(real->port_id); + int res = real->driver->port_unregister(real->port_id); delete real; return res; }