Skip to content

Commit

Permalink
arecordmidi2: Start queue at starting the stream
Browse files Browse the repository at this point in the history
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: 1205dd5 ("arecordmidi2: Add passive mode and interactive mode")
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Jul 8, 2024
1 parent 1205dd5 commit 16533f8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions seq/aplaymidi2/arecordmidi2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 16533f8

Please sign in to comment.