diff options
author | Robin Gareus <robin@gareus.org> | 2020-02-29 01:51:04 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-02-29 22:20:01 +0100 |
commit | c086f05ba54ebfc12129120066b5bc1754490dce (patch) | |
tree | 4f07c26d75cbf87e63ca4ab069bd2784ae1d5ac5 /libs/ardour/io_processor.cc | |
parent | 814af0f51c7a6db7f300bf8a6741667e6a278c13 (diff) |
Fix order setting I/O names
IO::set_name() may fail, in case Port::set_name() fails.
In that case the IOProcessor should not update its name.
Diffstat (limited to 'libs/ardour/io_processor.cc')
-rw-r--r-- | libs/ardour/io_processor.cc | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/libs/ardour/io_processor.cc b/libs/ardour/io_processor.cc index 90df95fd29..0bdb812b87 100644 --- a/libs/ardour/io_processor.cc +++ b/libs/ardour/io_processor.cc @@ -245,16 +245,25 @@ IOProcessor::natural_input_streams () const } bool -IOProcessor::set_name (const std::string& name) +IOProcessor::set_name (const std::string& new_name) { - bool ret = SessionObject::set_name (name); + bool ret = true; + + if (name () == new_name) { + return ret; + } if (ret && _own_input && _input) { - ret = _input->set_name (name); + ret = _input->set_name (new_name); } if (ret && _own_output && _output) { - ret = _output->set_name (name); + ret = _output->set_name (new_name); + } + + if (ret) { + ret = SessionObject::set_name (new_name); // never fails + assert (ret); } return ret; |