mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
prevent crash in MIDI triggers when transport op is invoked on an inactive track
This commit is contained in:
parent
4a00630e07
commit
41d91e7527
1 changed files with 15 additions and 1 deletions
|
|
@ -3148,7 +3148,21 @@ MIDITrigger::midi_run (BufferSet& bufs, samplepos_t start_sample, samplepos_t en
|
||||||
Temporal::Beats const & start_beats, Temporal::Beats const & end_beats,
|
Temporal::Beats const & start_beats, Temporal::Beats const & end_beats,
|
||||||
pframes_t nframes, pframes_t dest_offset, double bpm, pframes_t& quantize_offset)
|
pframes_t nframes, pframes_t dest_offset, double bpm, pframes_t& quantize_offset)
|
||||||
{
|
{
|
||||||
assert (rt_midibuffer);
|
/* We can get here if our Triggerbox is in an inactive track, and some
|
||||||
|
transport operations (load, stop) are called. That's OK, but the
|
||||||
|
route must be inactive. A null rt_midibuffer value in any condition
|
||||||
|
is a coding error.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!rt_midibuffer) {
|
||||||
|
Route* rt = static_cast<Route*> (box().owner());
|
||||||
|
|
||||||
|
if (!rt || !rt->active()) {
|
||||||
|
return nframes;
|
||||||
|
}
|
||||||
|
|
||||||
|
assert (false);
|
||||||
|
}
|
||||||
|
|
||||||
MidiBuffer* mb (in_process_context? &bufs.get_midi (0) : nullptr);
|
MidiBuffer* mb (in_process_context? &bufs.get_midi (0) : nullptr);
|
||||||
typedef Evoral::Event<MidiModel::TimeType> MidiEvent;
|
typedef Evoral::Event<MidiModel::TimeType> MidiEvent;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue