From 787e5a2ea8b5af68066e30e92b385fd14bc1574a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 25 Oct 2021 13:55:03 -0600 Subject: [PATCH] midiregion: remove internal_offset local variable Even in 6.9, the logic of this conditional would always generate an internal_offset value of zero samples. --- libs/ardour/midi_region.cc | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index 3fe4f9bae7..6caf61833b 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -294,8 +294,6 @@ MidiRegion::render_range (Evoral::EventSink& dst, timecnt_t const & read_length, MidiChannelFilter* filter) const { - timecnt_t internal_offset; - /* precondition: caller has verified that we cover the desired section */ assert(chan_n == 0); @@ -304,22 +302,6 @@ MidiRegion::render_range (Evoral::EventSink& dst, return 0; /* read nothing */ } - /* render() pulls from zero to infinity ... */ - - if (!position().zero()) { - /* we are starting the read from before the start of the region */ - internal_offset = timecnt_t (Temporal::BeatTime); - } else { - /* we are starting the read from after the start of the region */ - internal_offset = timecnt_t (-position()); - } - - cerr << "RENDER , iffoset " << internal_offset << endl; - - if (internal_offset >= _length) { - return 0; /* read nothing */ - } - boost::shared_ptr src = midi_source(chan_n); Glib::Threads::Mutex::Lock lm(src->mutex()); @@ -330,11 +312,9 @@ MidiRegion::render_range (Evoral::EventSink& dst, cerr << "MR " << name () << " render " << " _position = " << _position << " _start = " << _start - << " intoffset = " << internal_offset << " quarter_note = " << quarter_note() << " start_beat = " << _start_beats << " a1 " << _position - _start - << " a2 " << _start + internal_offset << " a3 " << _length << endl; #endif @@ -348,7 +328,7 @@ MidiRegion::render_range (Evoral::EventSink& dst, lm, // source lock dst, // destination buffer this->source_position(), // start position of the source in session samples - read_start + internal_offset, + read_start, read_length, 0, cursor, @@ -360,7 +340,7 @@ MidiRegion::render_range (Evoral::EventSink& dst, * Note-Off's get inserted at the end of the region */ - const timepos_t end = source_position() + read_start + internal_offset + read_length; + const timepos_t end = source_position() + read_start + read_length; tracker.resolve_notes (dst, end.samples()); return 0;