mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-10 23:46:20 +01:00
"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:
parent
78b6c9632c
commit
ff234c0544
2 changed files with 9 additions and 6 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue