From: ratchov Date: Thu, 1 Feb 2024 05:28:54 +0000 (+0000) Subject: aucat: Fix MIDI control of the levels of individual files X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=fcae193a71fb1f81c75469d5abe05769c8d8d70d;p=openbsd aucat: Fix MIDI control of the levels of individual files Change the order of slot_list to match the order of the -io options on the command-line and fix the way slot_list searched using the MIDI channel number of the CC-07 message. Reported and analysed by Dirk-Wilhelm Peters Thanks! --- diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c index 64b9986d492..d90ad729d31 100644 --- a/usr.bin/aucat/aucat.c +++ b/usr.bin/aucat/aucat.c @@ -220,7 +220,7 @@ static int slot_new(char *path, int mode, struct aparams *par, int hdr, int cmin, int cmax, int rate, int dup, int vol, long long pos) { - struct slot *s; + struct slot *s, **ps; s = xmalloc(sizeof(struct slot)); if (!afile_open(&s->afile, path, hdr, @@ -273,8 +273,10 @@ slot_new(char *path, int mode, struct aparams *par, int hdr, } log_puts("\n"); } - s->next = slot_list; - slot_list = s; + for (ps = &slot_list; *ps != NULL; ps = &(*ps)->next) + ; + s->next = NULL; + *ps = s; return 1; } @@ -801,6 +803,7 @@ dev_slotvol(int midich, int val) #endif break; } + midich--; } }