Always delegate meter-point positioning to rt-thread

Previously set_state() -> set_meter_point() acquired the
process-lock to change meter-position, usually causing x-runs
when setting route-state.

This also fixes an issue introduced in fd414ec158. After
populating the processor list, force setting the meter-position
looks up the output streams of the processor before the meter.
However the processors are not configured. That will only happen
later from Session::post_engine_init().

---
#3 0x00007ff07b7d4102 in __GI___assert_fail at assert.c:101
#4 0x00007ff080d3224a in ARDOUR::PluginInsert::output_streams() const at ../libs/ardour/plugin_insert.cc:289
#5 0x00007ff080de8c30 in ARDOUR::Route::set_meter_point_unlocked() at ../libs/ardour/route.cc:4106
#6 0x00007ff080de8699 in ARDOUR::Route::set_meter_point(ARDOUR::MeterPoint, bool) at ../libs/ardour/route.cc:4037
#7 0x00007ff080ddfad3 in ARDOUR::Route::set_state(XMLNode const&, int) at ../libs/ardour/route.cc:269
This commit is contained in:
Robin Gareus 2020-03-30 17:58:35 +02:00
parent b6ca576832
commit 40e3364c66
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 5 additions and 5 deletions

View File

@ -190,7 +190,7 @@ public:
void set_denormal_protection (bool yn);
bool denormal_protection() const;
void set_meter_point (MeterPoint, bool force = false);
void set_meter_point (MeterPoint);
bool apply_processor_changes_rt ();
void emit_pending_signals ();
MeterPoint meter_point() const { return _pending_meter_point; }

View File

@ -2693,7 +2693,7 @@ Route::set_state (const XMLNode& node, int version)
MeterPoint mp;
if (node.get_property (X_("meter-point"), mp)) {
set_meter_point (mp, true);
set_meter_point (mp);
if (_meter) {
_meter->set_display_to_user (_meter_point == MeterCustom);
}
@ -4022,13 +4022,13 @@ Route::emit_pending_signals ()
}
void
Route::set_meter_point (MeterPoint p, bool force)
Route::set_meter_point (MeterPoint p)
{
if (_pending_meter_point == p && !force) {
if (_pending_meter_point == p) {
return;
}
if (force || !AudioEngine::instance()->running()) {
if (!AudioEngine::instance()->running()) {
bool meter_visibly_changed = false;
{
Glib::Threads::Mutex::Lock lx (AudioEngine::instance()->process_lock ());