From fe0a66c2a4453bcc5335f2756886e4a3c00f030d Mon Sep 17 00:00:00 2001 From: jcdr428 <56721609+jcdr428@users.noreply.github.com> Date: Sun, 24 Nov 2019 19:20:56 +0200 Subject: [PATCH] Correct AAC frame size parsing --- tsMuxer/aac.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsMuxer/aac.cpp b/tsMuxer/aac.cpp index f3cad11..28fb286 100644 --- a/tsMuxer/aac.cpp +++ b/tsMuxer/aac.cpp @@ -48,7 +48,7 @@ uint8_t* AACCodec::findAacFrame(uint8_t* buffer, uint8_t* end) int AACCodec::getFrameSize(uint8_t* buffer) { - return buffer[4]*8 + (buffer[5] >> 5); + return ((buffer[3] & 0x03) << 11) + (buffer[4] << 3) + (buffer[5] >> 5); } bool AACCodec::decodeFrame(uint8_t* buffer, uint8_t* end)