mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 11:46:25 +01:00
MidiRegion::clone() needs to ensure that the model is loaded before calling MidiSource::write_to()
This commit is contained in:
parent
977cabf54a
commit
0f4d61ab30
1 changed files with 11 additions and 3 deletions
|
|
@ -178,10 +178,18 @@ MidiRegion::clone (boost::shared_ptr<MidiSource> newsrc) const
|
||||||
Evoral::Beats const bend = bfc.from (_start + _length);
|
Evoral::Beats const bend = bfc.from (_start + _length);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
boost::shared_ptr<MidiSource> ms = midi_source(0);
|
||||||
|
Source::Lock lm (ms->mutex());
|
||||||
|
|
||||||
|
if (!ms->model()) {
|
||||||
|
ms->load_model (lm);
|
||||||
|
}
|
||||||
|
|
||||||
/* Lock our source since we'll be reading from it. write_to() will
|
/* Lock our source since we'll be reading from it. write_to() will
|
||||||
take a lock on newsrc. */
|
take a lock on newsrc.
|
||||||
Source::Lock lm (midi_source(0)->mutex());
|
*/
|
||||||
if (midi_source(0)->write_to (lm, newsrc, bbegin, bend)) {
|
|
||||||
|
if (ms->write_to (lm, newsrc, bbegin, bend)) {
|
||||||
return boost::shared_ptr<MidiRegion> ();
|
return boost::shared_ptr<MidiRegion> ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue