"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
This commit is contained in:
Paul Davis 2011-07-25 16:11:00 +00:00
parent 78b6c9632c
commit ff234c0544
2 changed files with 9 additions and 6 deletions

View file

@ -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);

View file

@ -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) {