Fix peak-thread race on session-load
Session dirs must exist when loading Sources of a project. SourceFactory::init() starts the PeakFileBuilder background thread early on when libardour is initialized. This thread [re-]creates missing peak files when Sources are created or loaded. However AudioSource::prepare_for_peakfile_writes assumes the peak/ folder exists. This may not be true, which lead to "AudioSource: cannot open _peakpath [..] (No such file or directory)" errors. Also drop creation from Source::get_transients_path() as this may be called concurrently from Analyser background threads.
This commit is contained in:
parent
69d3bd8821
commit
839400f438
@ -424,6 +424,8 @@ Session::Session (AudioEngine &eng,
|
||||
destroy ();
|
||||
throw SessionException (_("Failed to load state"));
|
||||
}
|
||||
|
||||
ensure_subdirs (); // archived or zipped sessions may lack peaks/ analysis/ etc
|
||||
}
|
||||
|
||||
/* apply the loaded state_tree */
|
||||
@ -509,8 +511,6 @@ Session::Session (AudioEngine &eng,
|
||||
_engine.set_session (this);
|
||||
_engine.reset_timebase ();
|
||||
|
||||
ensure_subdirs (); // archived or zipped sessions may lack peaks/ analysis/ etc
|
||||
|
||||
if (!mix_template.empty ()) {
|
||||
/* ::create() unsets _is_new after creating the session.
|
||||
* But for templated sessions, the sample-rate is initially unset
|
||||
|
@ -368,10 +368,6 @@ Source::get_transients_path () const
|
||||
vector<string> parts;
|
||||
string s;
|
||||
|
||||
/* old sessions may not have the analysis directory */
|
||||
|
||||
_session.ensure_subdirs ();
|
||||
|
||||
s = _session.analysis_dir ();
|
||||
parts.push_back (s);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user