mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-30 18:37:40 +01:00
[Summary] Fixed bug with sample rate dropping to previous value when new session is created
This commit is contained in:
parent
126333bc6b
commit
eded0c06cd
2 changed files with 5 additions and 2 deletions
|
|
@ -1333,7 +1333,7 @@ EngineStateController::_on_session_loaded ()
|
|||
_session->reconnect_mmc_ports (true);
|
||||
_session->reconnect_mmc_ports (false);
|
||||
|
||||
if (_session && _desired_sample_rate && set_new_sample_rate_in_controller(_desired_sample_rate) )
|
||||
if (_desired_sample_rate > 0 && set_new_sample_rate_in_controller(_desired_sample_rate) )
|
||||
{
|
||||
push_current_state_to_backend(false);
|
||||
SampleRateChanged(); // emit a signal
|
||||
|
|
@ -1770,7 +1770,7 @@ EngineStateController::push_current_state_to_backend(bool start)
|
|||
void
|
||||
EngineStateController::set_desired_sample_rate(framecnt_t session_desired_sr)
|
||||
{
|
||||
if (session_desired_sr == 0 || session_desired_sr == _desired_sample_rate) {
|
||||
if (session_desired_sr < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -306,6 +306,9 @@ Session::Session (AudioEngine &eng,
|
|||
pre_engine_init (fullpath);
|
||||
|
||||
if (_is_new) {
|
||||
|
||||
sr = EngineStateController::instance()->get_current_sample_rate();
|
||||
|
||||
if (ensure_engine (sr)) {
|
||||
destroy ();
|
||||
throw failed_constructor ();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue