midiUI thread needs tempo-map (#9358)

This fixes handling MMC commands (locate, record) or
any async MIDI message that uses timepos_t/timecnt_t.
This commit is contained in:
Robin Gareus 2023-06-03 18:21:47 +02:00
parent 0006f4d8cd
commit 8bf8e67545
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 6 additions and 0 deletions

View File

@ -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<MIDI::byte> 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) {