From 32c2a4d68a4d78c914f48b0aa2681c89620847d9 Mon Sep 17 00:00:00 2001 From: Philippe G Date: Sat, 9 Jan 2021 23:51:52 -0800 Subject: [PATCH] =?UTF-8?q?24=C3=A0x320=20VU-display=20fixes=20+=20alac=20?= =?UTF-8?q?decoder=20code=20style?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/squeezelite/alac.c | 7 +++---- components/squeezelite/display.c | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/components/squeezelite/alac.c b/components/squeezelite/alac.c index 9d670fe1..0fc0f8b1 100644 --- a/components/squeezelite/alac.c +++ b/components/squeezelite/alac.c @@ -374,10 +374,9 @@ static decode_state alac_decode(void) { // need to create a buffer with contiguous data if (bytes < block_size) { - u8_t *buffer = malloc(block_size); - memcpy(buffer, streambuf->readp, bytes); - memcpy(buffer + bytes, streambuf->buf, block_size - bytes); - iptr = buffer; + iptr = malloc(block_size); + memcpy(iptr, streambuf->readp, bytes); + memcpy(iptr + bytes, streambuf->buf, block_size - bytes); } else iptr = streambuf->readp; if (!alac_to_pcm(l->decoder, iptr, l->writebuf, 2, &frames)) { diff --git a/components/squeezelite/display.c b/components/squeezelite/display.c index 8a2dae8a..b1ee365f 100644 --- a/components/squeezelite/display.c +++ b/components/squeezelite/display.c @@ -972,7 +972,7 @@ static void visu_update(void) { } } } - } else if (displayer.width / 2 > 3 * VU_WIDTH / 4) { + } else if (displayer.width / 2 >= 3 * VU_WIDTH / 4) { if (visu.rotate) { draw_VU(display, vu_bitmap, visu.bars[0].current, 0, visu.row, visu.height / 2, visu.rotate); draw_VU(display, vu_bitmap, visu.bars[1].current, 0, visu.row + visu.height / 2, visu.height / 2, visu.rotate);