From 8bf8e675454237bcf7fe78ed3b6ec335c6b19f82 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 3 Jun 2023 18:21:47 +0200 Subject: [PATCH] midiUI thread needs tempo-map (#9358) This fixes handling MMC commands (locate, record) or any async MIDI message that uses timepos_t/timecnt_t. --- libs/ardour/async_midi_port.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/ardour/async_midi_port.cc b/libs/ardour/async_midi_port.cc index 8c227c50dc..0b38f0966c 100644 --- a/libs/ardour/async_midi_port.cc +++ b/libs/ardour/async_midi_port.cc @@ -29,6 +29,8 @@ #include "midi++/types.h" +#include "temporal/tempo.h" + #include "ardour/async_midi_port.h" #include "ardour/audioengine.h" #include "ardour/midi_buffer.h" @@ -330,6 +332,10 @@ AsyncMIDIPort::read (MIDI::byte *, size_t) uint32_t size; vector buffer(input_fifo.capacity()); + if (!is_process_thread()) { + (void) Temporal::TempoMap::fetch(); + } + while (input_fifo.read (&time, &type, &size, &buffer[0])) { _parser->set_timestamp (time); for (uint32_t i = 0; i < size; ++i) {