create peak files in background when loading session
authorRobin Gareus <robin@gareus.org>
Sat, 5 Sep 2015 21:28:34 +0000 (23:28 +0200)
committerRobin Gareus <robin@gareus.org>
Sat, 5 Sep 2015 21:28:34 +0000 (23:28 +0200)
libs/ardour/audiosource.cc
libs/ardour/session.cc

index 01a030914db36a924d24d7cdbbc4d1970eff7dab..bfc2d9e4abbe61df36332548e046d2e8e8fb9f16 100644 (file)
@@ -744,12 +744,16 @@ AudioSource::build_peaks_from_scratch ()
                                goto out;
                        }
 
+                       lp.release(); // allow butler to refill buffers
+
                        if (compute_and_write_peaks (buf.get(), current_frame, frames_read, true, false, _FPP)) {
                                break;
                        }
 
                        current_frame += frames_read;
                        cnt -= frames_read;
+
+                       lp.acquire();
                }
 
                if (cnt == 0) {
index b0fbe8f4d18c8cbe031de86a104597f28b5a631a..f8bd39fe3395f539965be710154b0977c018084b 100644 (file)
@@ -4694,7 +4694,7 @@ Session::create_audio_source_for_session (size_t n_chans, string const & base, u
 
        if (!path.empty()) {
                return boost::dynamic_pointer_cast<AudioFileSource> (
-                       SourceFactory::createWritable (DataType::AUDIO, *this, path, destructive, frame_rate()));
+                       SourceFactory::createWritable (DataType::AUDIO, *this, path, destructive, frame_rate(), true, true));
        } else {
                throw failed_constructor ();
        }