diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-12-20 14:09:33 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-12-20 14:09:39 -0500 |
commit | 282c563fce744b97c22d36a3e78a861e220f8e6b (patch) | |
tree | d9889ddfeb695de17164744304b38b58ce870116 /libs/ardour/midi_region.cc | |
parent | abe97dbc8c3c767316ac319357ce370aaf788296 (diff) |
fix newly introduced deadlock when cloning MIDI regions
Diffstat (limited to 'libs/ardour/midi_region.cc')
-rw-r--r-- | libs/ardour/midi_region.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index e94e4e4854..c399b4e438 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -151,7 +151,16 @@ MidiRegion::clone (boost::shared_ptr<MidiSource> newsrc) const Evoral::MusicalTime const bend = bfc.from (_start + _length); { - Source::Lock lm(newsrc->mutex()); + Source::Lock lm (midi_source(0)->mutex()); + /* ::write_to() will take the lock on newsrc. + + XXX taking the lock on our own source here seems + partly sane and partly odd. We don't write the + data to the newsrc from our source, but from + the in memory copy. This whole thing (memory vs. disk, SMF + versus MidiModel) is so f'ed up that its no wonder + stuff is wierd sometimes. + */ if (midi_source(0)->write_to (lm, newsrc, bbegin, bend)) { return boost::shared_ptr<MidiRegion> (); } |