arecordmidi2: Start queue at starting the stream

The queue should be started at the very same time of the start of the
stream itself in the interactive mode.  Otherwise it'll get bogus long
waits until the start of the clip.

Move the code to start the queue in start_bar(), so that it's always
tied with the start sequence.

Fixes: 1205dd5f6c ("arecordmidi2: Add passive mode and interactive mode")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2024-07-08 16:15:45 +02:00
parent 1205dd5f6c
commit 16533f81de

View file

@ -355,6 +355,13 @@ static void write_file_header(FILE *file)
/* write start bar */
static void start_bar(FILE *file)
{
int err;
/* start the queue */
err = snd_seq_start_queue(seq, queue, NULL);
check_snd("start queue", err);
snd_seq_drain_output(seq);
write_start_clip(file);
write_tempo(file);
write_time_sig(file);
@ -489,10 +496,6 @@ int main(int argc, char *argv[])
start = 1;
}
err = snd_seq_start_queue(seq, queue, NULL);
check_snd("start queue", err);
snd_seq_drain_output(seq);
err = snd_seq_nonblock(seq, 1);
check_snd("set nonblock mode", err);