Fix crash when playing back MIDI within a loop.
authorDavid Robillard <d@drobilla.net>
Tue, 5 May 2009 02:04:56 +0000 (02:04 +0000)
committerDavid Robillard <d@drobilla.net>
Tue, 5 May 2009 02:04:56 +0000 (02:04 +0000)
Fixes mantis issue #0002570.

git-svn-id: svn://localhost/ardour2/branches/3.0@5052 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/midi_ring_buffer.cc

index 469222d5d7b2f1912055100253effc7a21d4ef3d..746dc3b3eba04eae46cc2b103cda47dd5f34b4c6 100644 (file)
@@ -65,14 +65,12 @@ MidiRingBuffer<T>::read(MidiBuffer& dst, nframes_t start, nframes_t end, nframes
 
                // This event marks a loop end (i.e. the next event's timestamp will be non-monotonic)
                if (ev_type == LoopEventType) {
-                       ev_time -= start;
+                       /*ev_time -= start;
                        ev_time += offset;
-                       Evoral::MIDIEvent<T> loopevent(LoopEventType, ev_time); 
-                       dst.push_back(loopevent);
-                       
-                       // We can safely return, without reading the data, because
-                       // a LoopEvent does not have data.
-                       cerr << "MRB loop boundary @ " << ev_time << endl;
+                       cerr << "MRB loop boundary @ " << ev_time << endl;*/
+
+                       // Return without reading data or writing to buffer (loop events have no data)
+                       // FIXME: This is not correct, loses events after the loop this cycle
                        return count + 1;
                }