From 644af18a4b3502682075ef47dd9fb39cddd872ee Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 11 Dec 2010 20:45:11 +0000 Subject: [PATCH] fix thinko in AudioEngine::get_port_by_name() git-svn-id: svn://localhost/ardour2/branches/3.0@8247 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/audioengine.cc | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index 580d34cca3..a9d170beed 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -962,15 +962,13 @@ AudioEngine::frames_per_cycle () const } } -/** @param name Full name of port (including prefix:) +/** @param name Full or short name of port (including prefix:) * @return Corresponding Port*, or 0. This object remains the property of the AudioEngine * so must not be deleted. */ Port * AudioEngine::get_port_by_name (const string& portname) { - string s; - if (!_running) { if (!_has_run) { fatal << _("get_port_by_name() called before engine was started") << endmsg; @@ -980,16 +978,12 @@ AudioEngine::get_port_by_name (const string& portname) } } - if (portname.find_first_of (':') == string::npos) { - s = make_port_name_non_relative (portname); - } else { - s = portname; - } - - if (portname.substr (0, jack_client_name.length ()) != jack_client_name) { - /* not an ardour: port */ - return 0; - } + if (portname.find_first_of (':') != string::npos) { + if (portname.substr (0, jack_client_name.length ()) != jack_client_name) { + /* not an ardour: port */ + return 0; + } + } std::string const rel = make_port_name_relative (portname);