summaryrefslogtreecommitdiff
path: root/libs/midi++2
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-05-22 21:36:27 +0000
committerDavid Robillard <d@drobilla.net>2008-05-22 21:36:27 +0000
commit54bec37b5a72e1fae18be44c85f405f6bd99ee90 (patch)
tree981cccc1ab8341ea3404c91a9a7491d180afc855 /libs/midi++2
parent39b2e2b572e4f2aa1f74668892bfc09f01da863e (diff)
Fix corrupt MIDI file writing when meta events are present (fixes missing first note issue on some imported files).
Reduce number of buffer allocations on MIDI read/write. git-svn-id: svn://localhost/ardour2/branches/3.0@3395 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/midi++2')
-rw-r--r--libs/midi++2/midi++/event.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/libs/midi++2/midi++/event.h b/libs/midi++2/midi++/event.h
index 5734c1228c..89f7dd4c07 100644
--- a/libs/midi++2/midi++/event.h
+++ b/libs/midi++2/midi++/event.h
@@ -125,13 +125,12 @@ struct Event {
if (_size < size) {
_buffer = (uint8_t*) ::realloc(_buffer, size);
}
+ memcpy (_buffer, buf, size);
} else {
- _buffer = (uint8_t*) malloc(size);
- _owns_buffer = true;
+ _buffer = buf;
}
_size = size;
- memcpy (_buffer, buf, size);
_time = t;
}