summaryrefslogtreecommitdiff
path: root/libavformat/rtp_aac.c
diff options
context:
space:
mode:
authorLuca Abeni <lucabe72@email.it>2007-09-14 09:00:31 +0000
committerLuca Abeni <lucabe72@email.it>2007-09-14 09:00:31 +0000
commit1a3a0a79b6f77043737926e457c8360dead032a7 (patch)
treeeb74b1ac67fd5383591752f8dec025da17b38daf /libavformat/rtp_aac.c
parent171dce486ce85fbb6a54e24394e1d740395437b0 (diff)
Support fragmentation for AAC frames
Originally committed as revision 10492 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtp_aac.c')
-rw-r--r--libavformat/rtp_aac.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/libavformat/rtp_aac.c b/libavformat/rtp_aac.c
index 267ed932d5..04dc3cfdda 100644
--- a/libavformat/rtp_aac.c
+++ b/libavformat/rtp_aac.c
@@ -67,6 +67,22 @@ void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size)
memcpy(s->buf_ptr, buff, size);
s->buf_ptr += size;
} else {
- av_log(s1, AV_LOG_ERROR, "Unsupported!\n");
+ if (s->buf_ptr != s->buf + MAX_AU_HEADERS_SIZE) {
+ av_log(s1, AV_LOG_ERROR, "Strange...\n");
+ av_abort();
+ }
+ 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;
+ memcpy(p + 4, buff, len);
+ ff_rtp_send_data(s1, p, len + 4, len == size);
+ size -= len;
+ buff += len;
+ }
}
}