Mercurial > libavformat.hg
changeset 2551:be9b08eba612 libavformat
Support fragmentation for AAC frames
author | lucabe |
---|---|
date | Fri, 14 Sep 2007 09:00:31 +0000 |
parents | e9c34ec665c6 |
children | 937b5d76c3dd |
files | rtp_aac.c |
diffstat | 1 files changed, 17 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/rtp_aac.c Fri Sep 14 08:17:06 2007 +0000 +++ b/rtp_aac.c Fri Sep 14 09:00:31 2007 +0000 @@ -67,6 +67,22 @@ 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; + } } }