merge with master and fix 4 conflicts by hand
[ardour.git] / libs / evoral / src / SMF.cpp
index 6557a01b800e50e6ec84b4d8ee2f6f83f51a7c64..dc3512a0f6673d620048aa68746a523344304787 100644 (file)
 #include "evoral/midi_util.h"
 #include "pbd/file_manager.h"
 
+#ifdef COMPILER_MSVC
+extern double round(double x);
+#endif
+
 using namespace std;
 
 namespace Evoral {
@@ -336,7 +340,7 @@ SMF::append_event_delta(uint32_t delta_t, uint32_t size, const uint8_t* buf, eve
                /* this should be allocated by malloc(3) because libsmf will
                   call free(3) on it
                */
-               event->midi_buffer = (uint8_t*) malloc (sizeof (uint8_t*) * event->midi_buffer_length);
+               event->midi_buffer = (uint8_t*) malloc (sizeof(uint8_t) * event->midi_buffer_length);
 
                event->midi_buffer[0] = 0xff; // Meta-event
                event->midi_buffer[1] = 0x7f; // Sequencer-specific