From 745b194241b20f320308c18dddc248171a11ab18 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 19 Mar 2021 22:51:12 +0100 Subject: [PATCH] Get sample-rate from session-archive This correctly sets the engine sample-rate when opening a session-archive. --- gtk2_ardour/startup_fsm.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gtk2_ardour/startup_fsm.cc b/gtk2_ardour/startup_fsm.cc index 44e528fcbe..4bf29d8a7f 100644 --- a/gtk2_ardour/startup_fsm.cc +++ b/gtk2_ardour/startup_fsm.cc @@ -713,6 +713,15 @@ StartupFSM::check_session_parameters (bool must_be_new) return 1; } else if (rv == 0) { /* names are good (and session is unarchived/inflated */ + float sr; + SampleFormat fmt; + string program_version; + const string statefile_path = Glib::build_filename (session_path, session_name + ARDOUR::statefile_suffix); + if (Session::get_info_from_path (statefile_path, sr, fmt, program_version, &session_engine_hints)) { + /* exists but we can't read it */ + return -1; + } + session_existing_sample_rate = sr; return 0; } }