summaryrefslogtreecommitdiff
path: root/libs/ardour/audio_track.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-05-27 17:10:08 +0000
committerCarl Hetherington <carl@carlh.net>2010-05-27 17:10:08 +0000
commit36538ed3dfa61972a35ac1995eec730b05f17299 (patch)
treed2d52456cef1d0f35f9c95ffa6fc0466ee4009f4 /libs/ardour/audio_track.cc
parent8689ae88f748ae6a635e3e86cbc0db61999d390a (diff)
Take route's processor lock for things called by the process thread. Prevents problems when processors are being reconfigured and a process callback occurs.
git-svn-id: svn://localhost/ardour2/branches/3.0@7183 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audio_track.cc')
-rw-r--r--libs/ardour/audio_track.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc
index e90c569753..fcd211375a 100644
--- a/libs/ardour/audio_track.cc
+++ b/libs/ardour/audio_track.cc
@@ -351,20 +351,18 @@ int
AudioTrack::roll (nframes_t nframes, sframes_t start_frame, sframes_t end_frame, int declick,
bool can_record, bool rec_monitors_input, bool& need_butler)
{
+ Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
+ if (!lm.locked()) {
+ return 0;
+ }
+
int dret;
Sample* b;
Sample* tmpb;
nframes_t transport_frame;
boost::shared_ptr<AudioDiskstream> diskstream = audio_diskstream();
- {
- Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
- if (lm.locked()) {
- // automation snapshot can also be called from the non-rt context
- // and it uses the redirect list, so we take the lock out here
- automation_snapshot (start_frame, false);
- }
- }
+ automation_snapshot (start_frame, false);
if (n_outputs().n_total() == 0 && _processors.empty()) {
return 0;