changeset 4841:94eb88d4ac0f libavformat

Fix two checks in the AAC packetiser, which were too conservative Patch by Martin Storsj (martin AT martin DOT st)
author lucabe
date Thu, 09 Apr 2009 21:37:11 +0000
parents d99a060db4a4
children bbdefe369edc
files rtp_aac.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rtp_aac.c	Thu Apr 09 14:16:22 2009 +0000
+++ b/rtp_aac.c	Thu Apr 09 21:37:11 2009 +0000
@@ -39,7 +39,7 @@
 
     /* test if the packet must be sent */
     len = (s->buf_ptr - s->buf);
-    if ((s->num_frames == MAX_FRAMES_PER_PACKET) || (len && (len + size) > max_packet_size)) {
+    if ((s->num_frames == MAX_FRAMES_PER_PACKET) || (len && (len + size) > s->max_payload_size)) {
         int au_size = s->num_frames * 2;
 
         p = s->buf + MAX_AU_HEADERS_SIZE - au_size - 2;
@@ -59,7 +59,7 @@
         s->timestamp = s->cur_timestamp;
     }
 
-    if (size < max_packet_size) {
+    if (size <= max_packet_size) {
         p = s->buf + s->num_frames++ * 2 + 2;
         *p++ = size >> 5;
         *p = (size & 0x1F) << 3;