From b4c17b02a061ef0102ffde35a41836310caf2786 Mon Sep 17 00:00:00 2001 From: Philippe G Date: Tue, 16 Jun 2020 18:16:33 -0700 Subject: [PATCH] aac channels wrong calculation - release --- components/squeezelite/helix-aac.c | 2 +- components/squeezelite/pcm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/squeezelite/helix-aac.c b/components/squeezelite/helix-aac.c index 7eee1279..b1dface9 100644 --- a/components/squeezelite/helix-aac.c +++ b/components/squeezelite/helix-aac.c @@ -156,7 +156,7 @@ static int read_mp4_header(unsigned long *samplerate_p, unsigned char *channels_ info.sampRateCore = (*ptr++ & 0x07) << 1; info.sampRateCore |= (*ptr >> 7) & 0x01; info.sampRateCore = rates[info.sampRateCore]; - info.nChans = *ptr >> 3; + info.nChans = (*ptr & 0x7f) >> 3; *channels_p = info.nChans; *samplerate_p = info.sampRateCore; HAAC(a, SetRawBlockParams, a->hAac, 0, &info); diff --git a/components/squeezelite/pcm.c b/components/squeezelite/pcm.c index 0221255b..063a9f15 100644 --- a/components/squeezelite/pcm.c +++ b/components/squeezelite/pcm.c @@ -204,7 +204,7 @@ static decode_state pcm_decode(void) { out = process.max_in_frames; ); - if ((stream.state <= DISCONNECT && bytes == 0) || (limit && audio_left == 0)) { + if ((stream.state <= DISCONNECT && bytes < bytes_per_frame) || (limit && audio_left == 0)) { UNLOCK_O_direct; UNLOCK_S; return DECODE_COMPLETE;