[FFmpeg-devel] [PATCH] mp4a-latm rtp output & dynamic payload type from URL

Luca Abeni lucabe72
Fri Oct 9 09:34:58 CEST 2009


Hi Sergiy,

Sergiy wrote:
> Hi, all!
> 
> In attachment patch, that implements MP4A-LATM rtp output as described in
> RFC 3016.
> Also this patch adds payload_type URL parameter (this for setting dynamic
> payload type).

First of all, thanks for the patch; I hope to integrate your MP4A-LATM
support soon (BTW, how can it be tested? Which clients are able to
receive/play MP4A-LATM over RTP?).

However, I think your patch mixes too many changes together, and it should
be split in various parts. I am also not convinced that all the modifications
to avio.*, etc are really needed...
Why cannot this functionality be implemented by only modifying rtp-related
files?

Finally, one doubt about the code:
[...]
+/* latm muxer */
+void ff_rtp_send_aac_latm(AVFormatContext *s1, const uint8_t *buff, int size)
+{
+    RTPMuxContext *s = s1->priv_data;
+    int len, max_packet_size;
+    uint8_t *p = s->buf;
+    int latmhdrsize;
+
+    /* skip ADTS header, if present */
+    if ((s1->streams[0]->codec->extradata_size) == 0) {
+        size -= 7;
+        buff += 7;
+    }
+
+    latmhdrsize = size/0xff + 1;
+    max_packet_size = s->max_payload_size - latmhdrsize;
+    s->timestamp = s->cur_timestamp;
+
+    while (size > 0) {
+	len = FFMIN(size, max_packet_size);
+	memcpy(p + latmhdrsize, buff, len);
Shouldn't the "max_packet_size = s->max_payload_size - latmhdrsize;" go
inside the "while (size > 0) {" loop? (since latmhdrsize is modified
inside the loop).



			Thanks,
				Luca



More information about the ffmpeg-devel mailing list