From 4e41b71a4eaf59dd6708dfe69da539bd3e1f0f5d Mon Sep 17 00:00:00 2001 From: nick_m Date: Wed, 9 Nov 2016 02:01:22 +1100 Subject: [PATCH] ensure non-zero midi region length when tempo map changes. --- libs/ardour/midi_region.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index 869cb487e4..7f98f191f7 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -285,7 +285,7 @@ MidiRegion::update_after_tempo_map_change (bool /* send */) Region::update_after_tempo_map_change (false); /* _start has now been updated. */ - _length = _session.tempo_map().frames_between_quarter_notes (pos_beats(), pos_beats() + _length_beats); + _length = max ((framecnt_t) 1, _session.tempo_map().frames_between_quarter_notes (pos_beats(), pos_beats() + _length_beats)); if (old_start != _start) { s_and_l.add (Properties::start);