]> git.alsa-project.org Git - alsa-utils.git/commitdiff
arecordmidi2: Start queue at starting the stream
authorTakashi Iwai <tiwai@suse.de>
Mon, 8 Jul 2024 14:15:45 +0000 (16:15 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 8 Jul 2024 14:26:09 +0000 (16:26 +0200)
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: 1205dd5f6c14 ("arecordmidi2: Add passive mode and interactive mode")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
seq/aplaymidi2/arecordmidi2.c

index cad5851c48eae553c7b1225ed3ab0816a3b6a105..c4a82599713c657fcf29a65999f6667e252bd722 100644 (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);