do not queue multiple Locate or LocateRoll events
[ardour.git] / session_utils / common.cc
index 8d1cdec950d8afb39c3b9c8650701b23ef9b6efb..eb17cfdbeb21e0b4a76d04d1006a201945b04f29 100644 (file)
@@ -120,9 +120,16 @@ static Session * _load_session (string dir, string state)
 
        float sr;
        SampleFormat sf;
+       std::string v;
 
        std::string s = Glib::build_filename (dir, state + statefile_suffix);
-       if (Session::get_info_from_path (s, sr, sf) == 0) {
+
+       if (!Glib::file_test (s, Glib::FILE_TEST_EXISTS | Glib::FILE_TEST_IS_REGULAR)) {
+               std::cerr << "Cannot read session '"<< s << "'\n";
+               return 0;
+       }
+
+       if (Session::get_info_from_path (s, sr, sf, v) == 0) {
                if (engine->set_sample_rate (sr)) {
                        std::cerr << "Cannot set session's samplerate.\n";
                        return 0;