From 8e14e5d313edd4bf2c99581821dc688164a8a215 Mon Sep 17 00:00:00 2001
From: lucabe <lucabe@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Date: Fri, 29 May 2009 13:46:46 +0000
Subject: [PATCH] Correctly set the "AU size" field in the payload header for
 fragmented AAC frames

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18984 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
---
 libavformat/rtp_aac.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/rtp_aac.c b/libavformat/rtp_aac.c
index b597bb16b..e19b28697 100644
--- a/libavformat/rtp_aac.c
+++ b/libavformat/rtp_aac.c
@@ -66,14 +66,16 @@ void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size)
         memcpy(s->buf_ptr, buff, size);
         s->buf_ptr += size;
     } else {
+        int au_size = size;
+
         max_packet_size = s->max_payload_size - 4;
         p = s->buf;
         p[0] = 0;
         p[1] = 16;
         while (size > 0) {
             len = FFMIN(size, max_packet_size);
-            p[2] = len >> 5;
-            p[3] = (size & 0x1F) << 3;
+            p[2] = au_size >> 5;
+            p[3] = (au_size & 0x1F) << 3;
             memcpy(p + 4, buff, len);
             ff_rtp_send_data(s1, p, len + 4, len == size);
             size -= len;
-- 
2.25.4