]> git.sesse.net Git - ffmpeg/commitdiff
rtpenc_aac: Fix calculation of the header size
authorLuca Abeni <lucabe72@email.it>
Thu, 8 Nov 2012 00:38:50 +0000 (01:38 +0100)
committerMartin Storsjö <martin@martin.st>
Thu, 8 Nov 2012 17:48:32 +0000 (19:48 +0200)
Previously the high end byte was always set to zero. Also get
rid of an unnecessary multiplication (which in practice couldn't
overflow) before shifting.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rtpenc_aac.c

index 86318dfa6e11efa166a298da2892017c2f132f46..1b2fa0a78cdaf0a8205f919e250a4258c170d606 100644 (file)
@@ -47,8 +47,8 @@ void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size)
             memmove(p + 2, s->buf + 2, au_size);
         }
         /* Write the AU header size */
-        p[0] = ((au_size * 8) & 0xFF) >> 8;
-        p[1] = (au_size * 8) & 0xFF;
+        p[0] =  au_size >> 5;
+        p[1] = (au_size & 0x1F) << 3;
 
         ff_rtp_send_data(s1, p, s->buf_ptr - p, 1);