summaryrefslogtreecommitdiff
path: root/libs/ardour/audio_playlist_source.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-05-16 13:06:55 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-05-16 13:06:55 +0000
commit43798a7c259660b53cd3edc7feca17cf41faf13b (patch)
treedb0b5ea102b3636680b9a9ecfaf90a1f3f0be2be /libs/ardour/audio_playlist_source.cc
parent0a9cef7720ed9bd83442d284d18831437b80a482 (diff)
sane naming scheme for combined regions; fix deadlock when nesting to more than one level
git-svn-id: svn://localhost/ardour2/branches/3.0@9519 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audio_playlist_source.cc')
-rw-r--r--libs/ardour/audio_playlist_source.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/libs/ardour/audio_playlist_source.cc b/libs/ardour/audio_playlist_source.cc
index 7d1e528ee6..e8fabef7b1 100644
--- a/libs/ardour/audio_playlist_source.cc
+++ b/libs/ardour/audio_playlist_source.cc
@@ -158,7 +158,7 @@ AudioPlaylistSource::set_state (const XMLNode& node, int /* version */)
_peak_path = prop->value ();
- _level = _playlist->max_source_level ();
+ _level = _playlist->max_source_level () + 1;
ensure_buffers_for_level (_level);
return 0;
@@ -167,6 +167,8 @@ AudioPlaylistSource::set_state (const XMLNode& node, int /* version */)
framecnt_t
AudioPlaylistSource::read_unlocked (Sample* dst, framepos_t start, framecnt_t cnt) const
{
+ Sample* sbuf;
+ gain_t* gbuf;
framecnt_t to_read;
framecnt_t to_zero;
pair<framepos_t,framepos_t> extent = _playlist->get_extent();
@@ -185,10 +187,18 @@ AudioPlaylistSource::read_unlocked (Sample* dst, framepos_t start, framecnt_t cn
}
{
+ /* Don't need to hold the lock for the actual read, and
+ actually, we cannot, but we do want to interlock
+ with any changes to the list of buffers caused
+ by creating new nested playlists/sources
+ */
Glib::Mutex::Lock lm (_level_buffer_lock);
- _playlist->read (dst, _mixdown_buffers[_level-1], _gain_buffers[_level-1], start+_playlist_offset, to_read, _playlist_channel);
+ sbuf = _mixdown_buffers[_level-1];
+ gbuf = _gain_buffers[_level-1];
}
+ _playlist->read (dst, sbuf, gbuf, start+_playlist_offset, to_read, _playlist_channel);
+
if (to_zero) {
memset (dst+to_read, 0, sizeof (Sample) * to_zero);
}
@@ -246,19 +256,13 @@ AudioPlaylistSource::setup_peakfile ()
/* the peak data is setup once and once only
*/
- cerr << "looking for peakfile " << _peak_path << endl;
-
-
if (!Glib::file_test (_peak_path, Glib::FILE_TEST_EXISTS)) {
/* the 2nd argument here will be passed
in to ::peak_path, and is irrelevant
since our peak file path is fixed and
not dependent on anything.
*/
- cerr << "build it!\n";
return initialize_peakfile (false, string());
- } else {
- cerr << "exists!\n";
}
return 0;