Commit 2553373c authored by lucabe's avatar lucabe

Fix two checks in the AAC packetiser, which were too conservative

Patch by Martin Storsjö (martin AT martin DOT st)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18400 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent b73f832f
...@@ -39,7 +39,7 @@ void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size) ...@@ -39,7 +39,7 @@ void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size)
/* test if the packet must be sent */ /* test if the packet must be sent */
len = (s->buf_ptr - s->buf); 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; int au_size = s->num_frames * 2;
p = s->buf + MAX_AU_HEADERS_SIZE - au_size - 2; p = s->buf + MAX_AU_HEADERS_SIZE - au_size - 2;
...@@ -59,7 +59,7 @@ void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size) ...@@ -59,7 +59,7 @@ void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size)
s->timestamp = s->cur_timestamp; s->timestamp = s->cur_timestamp;
} }
if (size < max_packet_size) { if (size <= max_packet_size) {
p = s->buf + s->num_frames++ * 2 + 2; p = s->buf + s->num_frames++ * 2 + 2;
*p++ = size >> 5; *p++ = size >> 5;
*p = (size & 0x1F) << 3; *p = (size & 0x1F) << 3;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment