From 5d3c8acafb0462d1c0afafcc33b35602ca4d382c Mon Sep 17 00:00:00 2001 From: Nedko Arnaudov Date: Sun, 24 May 2009 22:53:45 +0300 Subject: [PATCH] Poor man's no-self-connect code (cherry picked from commit d160dd3c67607f0225cbe0b5de011f3a95faf5ce) --- common/JackLibClient.cpp | 13 ++++++++++--- common/JackLibClient.h | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/common/JackLibClient.cpp b/common/JackLibClient.cpp index e908a371..77e46aca 100644 --- a/common/JackLibClient.cpp +++ b/common/JackLibClient.cpp @@ -209,7 +209,7 @@ JackLibClient::NoSelfConnectCheck(const char* src, const char* dst) // 2 means client is connecting its own ports (i.e. for app internal functionality) // TODO: Make this check an engine option and more tweakable (return error or success) // MAYBE: make the engine option changable on the fly and expose it through client or control API - if (src_self + dst_self == 1) + if (src_self + dst_self != 0) { jack_info("ignoring self hook to other client ports ('%s': '%s' -> '%s')", client_name_ptr, src, dst); return 0; @@ -223,7 +223,7 @@ int JackLibClient::PortConnect(const char* src, const char* dst) { int ret; - //jack_info("Client connecting '%s' to '%s'"); + //jack_info("Client connecting '%s' to '%s'", src, dst); ret = NoSelfConnectCheck(src, dst); if (ret > 0) @@ -238,7 +238,7 @@ int JackLibClient::PortDisconnect(const char* src, const char* dst) { int ret; - //jack_info("Client disconnecting '%s' to '%s'"); + //jack_info("Client disconnecting '%s' to '%s'", src, dst); ret = NoSelfConnectCheck(src, dst); if (ret > 0) @@ -249,6 +249,13 @@ int JackLibClient::PortDisconnect(const char* src, const char* dst) return ret; } +int JackLibClient::PortDisconnect(jack_port_id_t src) +{ + jack_info("Ignoring port disconnect request"); + + return 0; +} + } // end of namespace diff --git a/common/JackLibClient.h b/common/JackLibClient.h index 67e94c72..d44d6f06 100644 --- a/common/JackLibClient.h +++ b/common/JackLibClient.h @@ -55,6 +55,7 @@ class JackLibClient : public JackClient int NoSelfConnectCheck(const char* src, const char* dst); virtual int PortConnect(const char* src, const char* dst); virtual int PortDisconnect(const char* src, const char* dst); + virtual int PortDisconnect(jack_port_id_t src); };