remove pointless version of Stripable::set_presentation_order()
[ardour.git] / libs / ardour / session.cc
index 74f20306d2e54a9e6133d69c1b1a828a46b69a1d..043d72d1283bed0edb34d445094a579f4ce5d25f 100644 (file)
@@ -213,6 +213,7 @@ Session::Session (AudioEngine &eng,
        , _exporting (false)
        , _export_rolling (false)
        , _export_preroll (0)
+       , _export_latency (0)
        , _pre_export_mmc_enabled (false)
        , _name (snapshot_name)
        , _is_new (true)
@@ -249,6 +250,7 @@ Session::Session (AudioEngine &eng,
        , _rt_thread_active (false)
        , _rt_emit_pending (false)
        , _ac_thread_active (false)
+       , _latency_recompute_pending (0)
        , step_speed (0)
        , outbound_mtc_timecode_frame (0)
        , next_quarter_frame_to_send (-1)
@@ -279,7 +281,6 @@ Session::Session (AudioEngine &eng,
        , _reconnecting_routes_in_progress (false)
        , _route_deletion_in_progress (false)
        , destructive_index (0)
-       , _latency_recompute_pending (0)
        , _track_number_decimals(1)
        , default_fade_steepness (0)
        , default_fade_msecs (0)
@@ -3452,7 +3453,7 @@ Session::add_routes_inner (RouteList& new_routes, bool input_auto_connect, bool
 
                                if (order == PresentationInfo::max_order) {
                                        /* just add to the end */
-                                       r->set_presentation_order_explicit (n_routes + added);
+                                       r->set_presentation_order (n_routes + added, false);
                                        DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("group order not set, set to NR %1 + %2 = %3\n", n_routes, added, n_routes + added));
                                } else {
                                        r->set_presentation_order (order + added);
@@ -7015,8 +7016,18 @@ Session::auto_connect_thread_run ()
                        }
                }
 
-               while (g_atomic_int_and (&_latency_recompute_pending, 0)) {
-                       update_latency_compensation ();
+               if (!actively_recording ()) { // might not be needed,
+                       /* this is only used for updating plugin latencies, the
+                        * graph does not change. so it's safe in general.
+                        * BUT..
+                        * .. update_latency_compensation () entails set_capture_offset()
+                        * which calls Diskstream::set_capture_offset () which
+                        * modifies the capture offset... which can be a proplem
+                        * in "prepare_to_stop"
+                        */
+                       while (g_atomic_int_and (&_latency_recompute_pending, 0)) {
+                               update_latency_compensation ();
+                       }
                }
 
                pthread_cond_wait (&_auto_connect_cond, &_auto_connect_mutex);