fetch thread local tempo map in potential peak-building threads

This commit is contained in:
Paul Davis 2022-06-20 14:25:32 -06:00
parent 4825d67c4a
commit bbb0b78a50
3 changed files with 9 additions and 2 deletions

View file

@ -27,6 +27,8 @@
#include "pbd/convert.h" #include "pbd/convert.h"
#include "pbd/error.h" #include "pbd/error.h"
#include "temporal/tempo.h"
#include "ardour/audio_playlist_source.h" #include "ardour/audio_playlist_source.h"
#include "ardour/audioplaylist.h" #include "ardour/audioplaylist.h"
#include "ardour/boost_debug.h" #include "ardour/boost_debug.h"
@ -71,6 +73,7 @@ peak_thread_work ()
wait: wait:
if (SourceFactory::files_with_peaks.empty () && SourceFactory::peak_thread_run) { if (SourceFactory::files_with_peaks.empty () && SourceFactory::peak_thread_run) {
SourceFactory::PeaksToBuild.wait (SourceFactory::peak_building_lock); SourceFactory::PeaksToBuild.wait (SourceFactory::peak_building_lock);
(void) Temporal::TempoMap::fetch();
} }
if (!SourceFactory::peak_thread_run) { if (!SourceFactory::peak_thread_run) {

View file

@ -32,6 +32,8 @@
#include "pbd/convert.h" #include "pbd/convert.h"
#include "pbd/signals.h" #include "pbd/signals.h"
#include "temporal/tempo.h"
#include "ardour/types.h" #include "ardour/types.h"
#include "ardour/dB.h" #include "ardour/dB.h"
#include "ardour/lmath.h" #include "ardour/lmath.h"
@ -884,6 +886,8 @@ WaveView::process_draw_request (boost::shared_ptr<WaveViewDrawRequest> req)
return; return;
} }
(void) Temporal::TempoMap::fetch();
WaveViewProperties const& props = req->image->props; WaveViewProperties const& props = req->image->props;
const int n_peaks = props.get_width_pixels (); const int n_peaks = props.get_width_pixels ();

View file

@ -50,8 +50,8 @@ def build(bld):
obj.export_includes = ['.'] obj.export_includes = ['.']
obj.includes = ['.'] obj.includes = ['.']
obj.uselib = 'SIGCPP CAIROMM GTKMM BOOST XML' obj.uselib = 'SIGCPP CAIROMM GTKMM BOOST XML TEMPORAL'
obj.use = [ 'libpbd', 'libcanvas', 'libardour', 'libgtkmm2ext' ] obj.use = [ 'libpbd', 'libcanvas', 'libardour', 'libgtkmm2ext', 'libtemporal' ]
obj.name = 'libwaveview' obj.name = 'libwaveview'
obj.target = 'waveview' obj.target = 'waveview'
obj.vnum = WAVEVIEW_LIB_VERSION obj.vnum = WAVEVIEW_LIB_VERSION