correct size computation for RTMidiBuffer, and reduce expansion amount

This commit is contained in:
Paul Davis 2019-10-16 08:12:04 -06:00
parent 08ab8fc58a
commit b017f20141

View file

@ -120,10 +120,8 @@ RTMidiBuffer::write (TimeType time, Evoral::EventType /*type*/, uint32_t size, c
{
/* This buffer stores only MIDI, we don't care about the value of "type" */
const size_t bytes_to_merge = sizeof (time) + sizeof (uint32_t);
if (_size + bytes_to_merge > _capacity) {
resize (_capacity + 8192); // XXX 8192 is completely arbitrary
if (_size == _capacity) {
resize (_capacity + 1024); // XXX 1024 is completely arbitrary
}
_data[_size].timestamp = time;