Update backend API: read-only MIDI input buffers
[ardour.git] / libs / backends / jack / jack_portengine.cc
index 934f8b5d9e0cc583eb8686750c757f46610a2abe..dfa2bdad113313a27bd5ad3f5b9ff79583f52d73 100644 (file)
@@ -135,12 +135,17 @@ JACKAudioBackend::get_port_property (PortHandle port, const std::string& key, st
        jack_uuid_t uuid = jack_port_uuid((jack_port_t*) port);
        rv = jack_get_property(uuid, key.c_str(), &cvalue, &ctype);
 
-       if (0 == rv) {
+       if (0 == rv && cvalue) {
                value = cvalue;
-               type = ctype;
-               jack_free(cvalue);
-               jack_free(ctype);
+               if (ctype) {
+                       type = ctype;
+               }
+       } else {
+               rv = -1;
        }
+
+       jack_free(cvalue);
+       jack_free(ctype);
        return rv;
 #else
        return -1;
@@ -483,7 +488,7 @@ JACKAudioBackend::disconnect_all (PortHandle port)
 }
 
 int
-JACKAudioBackend::midi_event_get (pframes_t& timestamp, size_t& size, uint8_t** buf, void* port_buffer, uint32_t event_index)
+JACKAudioBackend::midi_event_get (pframes_t& timestamp, size_t& size, uint8_t const** buf, void* port_buffer, uint32_t event_index)
 {
        jack_midi_event_t ev;
        int ret;