diff options
Diffstat (limited to 'libs/ardour/luaproc.cc')
-rw-r--r-- | libs/ardour/luaproc.cc | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/libs/ardour/luaproc.cc b/libs/ardour/luaproc.cc index b393a2e00d..af5534e21a 100644 --- a/libs/ardour/luaproc.cc +++ b/libs/ardour/luaproc.cc @@ -388,11 +388,13 @@ LuaProc::can_support_io_configuration (const ChanCount& in, ChanCount& out, Chan const int preferred_out = out.n_audio (); for (luabridge::Iterator i (iotable); !i.isNil (); ++i) { - assert (i.value ().type () == LUA_TTABLE); luabridge::LuaRef io (i.value ()); + if (!io.isTable()) { + continue; + } - int possible_in = io["audio_in"]; - int possible_out = io["audio_out"]; + int possible_in = io["audio_in"].isNumber() ? io["audio_in"] : -1; + int possible_out = io["audio_out"].isNumber() ? io["audio_out"] : -1; // exact match if ((possible_in == audio_in) && (possible_out == preferred_out)) { @@ -428,11 +430,13 @@ LuaProc::can_support_io_configuration (const ChanCount& in, ChanCount& out, Chan } for (luabridge::Iterator i (iotable); !i.isNil (); ++i) { - assert (i.value ().type () == LUA_TTABLE); luabridge::LuaRef io (i.value ()); + if (!io.isTable()) { + continue; + } - int possible_in = io["audio_in"]; - int possible_out = io["audio_out"]; + int possible_in = io["audio_in"].isNumber() ? io["audio_in"] : -1; + int possible_out = io["audio_out"].isNumber() ? io["audio_out"] : -1; if (possible_out == 0) { if (possible_in == 0) { @@ -563,11 +567,13 @@ LuaProc::can_support_io_configuration (const ChanCount& in, ChanCount& out, Chan if (!found && imprecise) { /* try harder */ for (luabridge::Iterator i (iotable); !i.isNil (); ++i) { - assert (i.value ().type () == LUA_TTABLE); luabridge::LuaRef io (i.value ()); + if (!io.isTable()) { + continue; + } - int possible_in = io["audio_in"]; - int possible_out = io["audio_out"]; + int possible_in = io["audio_in"].isNumber() ? io["audio_in"] : -1; + int possible_out = io["audio_out"].isNumber() ? io["audio_out"] : -1; if (possible_out == 0 && possible_in == 0 && _has_midi_output) { assert (audio_in > 0); // no input is handled above |