diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 487437023c..5bbc069055 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -1811,6 +1811,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop void save_as_bring_callback (uint32_t, uint32_t, std::string); static int get_session_info_from_path (XMLTree& state_tree, const std::string& xmlpath); + static const uint32_t session_end_shift; }; diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index e1eed879a5..c4d0b8c338 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -139,6 +139,13 @@ const framecnt_t Session::bounce_chunk_size = 65536; static void clean_up_session_event (SessionEvent* ev) { delete ev; } const SessionEvent::RTeventCallback Session::rt_cleanup (clean_up_session_event); +// seconds should be added afte the region exceeds end marker +#ifdef USE_TRACKS_CODE_FEATURES +const uint32_t Session::session_end_shift = 5; +#else +const uint32_t Session::session_end_shift = 0; +#endif + /** @param snapshot_name Snapshot name, without .ardour suffix */ Session::Session (AudioEngine &eng, const string& fullpath, @@ -3944,9 +3951,11 @@ Session::maybe_update_session_range (framepos_t a, framepos_t b) return; } + framepos_t session_end_marker_shift_samples = session_end_shift * _nominal_frame_rate; + if (_session_range_location == 0) { - set_session_range_location (a, b); + set_session_range_location (a, b + session_end_marker_shift_samples); } else {