diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-07-25 16:11:00 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-07-25 16:11:00 +0000 |
commit | ff234c05449e6410a3f38ca27baa951e76a3cc32 (patch) | |
tree | db00c23ad70fd61517b8229bb2547d508f576afd /libs | |
parent | 78b6c9632ce42b210fae6d3697c625efab33bef9 (diff) |
"forward" port IO::ensure_* changes from 2.X for correctness and consistency
git-svn-id: svn://localhost/ardour2/branches/3.0@9918 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/io.h | 2 | ||||
-rw-r--r-- | libs/ardour/io.cc | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h index f8e30584d4..5a54b903e5 100644 --- a/libs/ardour/ardour/io.h +++ b/libs/ardour/ardour/io.h @@ -241,7 +241,7 @@ class IO : public SessionObject, public Latent boost::shared_ptr<Bundle> find_possible_bundle (const std::string &desired_name); - bool ensure_ports_locked (ChanCount, bool clear, void *src); + int ensure_ports_locked (ChanCount, bool clear, bool& changed); std::string build_legal_port_name (DataType type); int32_t find_port_hole (const char* base); diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 0d9933cb0c..ae0cdcce29 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -366,13 +366,14 @@ IO::disconnect (void* src) } /** Caller must hold process lock */ -bool -IO::ensure_ports_locked (ChanCount count, bool clear, void* /*src*/) +int +IO::ensure_ports_locked (ChanCount count, bool clear, bool& changed) { assert (!AudioEngine::instance()->process_lock().trylock()); Port* port = 0; - bool changed = false; + + changed = false; for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) { @@ -432,7 +433,7 @@ IO::ensure_ports_locked (ChanCount count, bool clear, void* /*src*/) } } - return changed; + return 0; } /** Caller must hold process lock */ @@ -453,7 +454,9 @@ IO::ensure_ports (ChanCount count, bool clear, void* src) { Glib::Mutex::Lock im (io_lock); - changed = ensure_ports_locked (count, clear, src); + if (ensure_ports_locked (count, clear, changed)) { + return -1; + } } if (changed) { |