[Ffmpeg-cvslog] r6817 - in trunk/libavformat: Makefile rtp.c

gpoirier subversion
Sat Oct 28 02:29:59 CEST 2006


Author: gpoirier
Date: Sat Oct 28 02:29:59 2006
New Revision: 6817

Modified:
   trunk/libavformat/Makefile
   trunk/libavformat/rtp.c

Log:
move up (in the file) AAC audio handling moved from below
This is because upper section handles packets, and the lower switch handles timestamps
Patch by Ryan Martell % rdm4 A martellventures P com %
Original thread:
Date: Oct 27, 2006 11:40 PM
Subject: Re: [Ffmpeg-devel] RTP patches & RFC


Modified: trunk/libavformat/Makefile
==============================================================================
--- trunk/libavformat/Makefile	(original)
+++ trunk/libavformat/Makefile	Sat Oct 28 02:29:59 2006
@@ -174,7 +174,7 @@
 ifeq ($(CONFIG_PROTOCOLS),yes)
 OBJS+= file.o
 ifeq ($(CONFIG_NETWORK),yes)
-OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o mpegts.o
+OBJS+= udp.o tcp.o http.o rtsp.o rtp.o rtpproto.o mpegts.o base64.o
 # BeOS and Darwin network stuff
 ifeq ($(NEED_INET_ATON),yes)
 OBJS+= barpainet.o

Modified: trunk/libavformat/rtp.c
==============================================================================
--- trunk/libavformat/rtp.c	(original)
+++ trunk/libavformat/rtp.c	Sat Oct 28 02:29:59 2006
@@ -526,6 +526,31 @@
             av_new_packet(pkt, len);
             memcpy(pkt->data, buf, len);
             break;
+            // moved from below, verbatim.  this is because this section handles packets, and the lower switch handles
+            // timestamps.
+            // TODO: Put this into a dynamic packet handler...
+        case CODEC_ID_MPEG4AAC:
+            if (rtp_parse_mp4_au(s, buf))
+                return -1;
+            {
+                rtp_payload_data_t *infos = s->rtp_payload_data;
+                if (infos == NULL)
+                    return -1;
+                buf += infos->au_headers_length_bytes + 2;
+                len -= infos->au_headers_length_bytes + 2;
+
+                /* XXX: Fixme we only handle the case where rtp_parse_mp4_au define
+                    one au_header */
+                av_new_packet(pkt, infos->au_headers[0].size);
+                memcpy(pkt->data, buf, infos->au_headers[0].size);
+                buf += infos->au_headers[0].size;
+                len -= infos->au_headers[0].size;
+            }
+            s->read_buf_size = len;
+            s->buf_ptr = buf;
+            pkt->stream_index = s->st->index;
+            return 0; ///< Temporary return.
+            break;
         default:
             if(s->parse_packet) {
                 return s->parse_packet(s, pkt, timestamp, buf, len);
@@ -550,30 +575,11 @@
                 pkt->pts = addend + delta_timestamp;
             }
             break;
+        case CODEC_ID_MPEG4AAC:
+        case CODEC_ID_H264:
         case CODEC_ID_MPEG4:
             pkt->pts = timestamp;
             break;
-        case CODEC_ID_MPEG4AAC:
-            if (rtp_parse_mp4_au(s, buf))
-              return -1;
-            {
-            rtp_payload_data_t *infos = s->rtp_payload_data;
-            if (infos == NULL)
-                return -1;
-            buf += infos->au_headers_length_bytes + 2;
-            len -= infos->au_headers_length_bytes + 2;
-
-            /* XXX: Fixme we only handle the case where rtp_parse_mp4_au define
-               one au_header */
-            av_new_packet(pkt, infos->au_headers[0].size);
-            memcpy(pkt->data, buf, infos->au_headers[0].size);
-            buf += infos->au_headers[0].size;
-            len -= infos->au_headers[0].size;
-            }
-            s->read_buf_size = len;
-            s->buf_ptr = buf;
-            pkt->stream_index = s->st->index;
-            return 0;
         default:
             /* no timestamp info yet */
             break;




More information about the ffmpeg-cvslog mailing list