diff --git a/luasession/luasession.cc b/luasession/luasession.cc index 8d149a0a24..45a90e6678 100644 --- a/luasession/luasession.cc +++ b/luasession/luasession.cc @@ -17,6 +17,7 @@ #include +#include "pbd/basename.h" #include "pbd/debug.h" #include "pbd/error.h" #include "pbd/event_loop.h" @@ -243,12 +244,19 @@ _create_session (string dir, string state, uint32_t rate) // throws } static Session* -_load_session (string dir, string state) // throws +_load_session (string const& dir, string state) // throws { if (prepare_engine ()) { return 0; } + if (state.empty ()) { + state = Session::get_snapshot_from_instant (dir); + } + if (state.empty ()) { + state = PBD::basename_nosuffix (dir); + } + float sr; SampleFormat sf; std::string v;