From 400f318adb9f1c14d77b83b562f10f931dbd67b6 Mon Sep 17 00:00:00 2001 From: escitalopram Date: Tue, 27 Oct 2015 10:06:26 +0100 Subject: [PATCH] Fix CPU hogging of the midi_thread() The midi thread was always late after 2^31-1 Samples (~13.5h at 44.1kHz), because when there's no time limit, a uint64_t sample counter was compared against a signed 32bit INT_MAX to determine lateness. Now the CPU lockup will occur only after ~3 million years (at 192kHz), and because of the overflow it will presumably fix itself after a few milliseconds. --- linux/alsa/alsa_rawmidi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/alsa/alsa_rawmidi.c b/linux/alsa/alsa_rawmidi.c index aa69e9dd..5faf7996 100644 --- a/linux/alsa/alsa_rawmidi.c +++ b/linux/alsa/alsa_rawmidi.c @@ -43,7 +43,7 @@ enum { NANOSLEEP_RESOLUTION = 7000 }; -#define NFRAMES_INF INT_MAX +#define NFRAMES_INF ULLONG_MAX enum { #ifndef JACK_MIDI_DEBUG