Skip to content
This repository has been archived by the owner on Mar 27, 2020. It is now read-only.

Commit

Permalink
only calculate second port name if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Skrylar committed Mar 26, 2019
1 parent 69a22e3 commit 84fd2ad
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/jaq.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,15 @@ namespace jaq {
m_output ? "out" : "in"); // idiomatic suffix

auto x = client::x_jack_port_by_name(mom->handle, port_name);

snprintf
(reinterpret_cast<char*>(&port_name),
buffer_size,
"%s-%s",
new_name.c_str(), // desired port name
m_output ? "out" : "in"); // idiomatic suffix

if (x == NULL)
if (x == NULL) {
snprintf
(reinterpret_cast<char*>(&port_name),
buffer_size,
"%s-%s",
new_name.c_str(), // desired port name
m_output ? "out" : "in"); // idiomatic suffix
return client::x_jack_port_rename(mom->handle, handle, port_name) == 0;
}
else
return false;
}
Expand Down

0 comments on commit 84fd2ad

Please sign in to comment.