diff options
Diffstat (limited to 'libs/ardour/chan_mapping.cc')
-rw-r--r-- | libs/ardour/chan_mapping.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libs/ardour/chan_mapping.cc b/libs/ardour/chan_mapping.cc index 3f7ccad8f9..5c5bb17de6 100644 --- a/libs/ardour/chan_mapping.cc +++ b/libs/ardour/chan_mapping.cc @@ -41,12 +41,19 @@ ChanMapping::ChanMapping(ChanCount identity) } uint32_t -ChanMapping::get(DataType t, uint32_t from) +ChanMapping::get(DataType t, uint32_t from, bool* valid) { Mappings::iterator tm = _mappings.find(t); - assert(tm != _mappings.end()); + if (tm == _mappings.end()) { + *valid = false; + return -1; + } TypeMapping::iterator m = tm->second.find(from); - assert(m != tm->second.end()); + if (m == tm->second.end()) { + *valid = false; + return -1; + } + *valid = true; return m->second; } |