summaryrefslogtreecommitdiff
path: root/libavformat/rtp.c
diff options
context:
space:
mode:
authorRyan Martell <rdm4@martellventures.com>2006-10-28 00:29:59 +0000
committerGuillaume Poirier <gpoirier@mplayerhq.hu>2006-10-28 00:29:59 +0000
commitd83723305e15f0d483638520b0c1402492f459a9 (patch)
tree918fe5f25ac474c19d8a7e78ce1478fc9c5206b2 /libavformat/rtp.c
parenta01e68aa5eb4ff5c5113597c5821186cb29eea5e (diff)
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 Originally committed as revision 6817 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtp.c')
-rw-r--r--libavformat/rtp.c48
1 files changed, 27 insertions, 21 deletions
diff --git a/libavformat/rtp.c b/libavformat/rtp.c
index e075ba6e6d..ad6931d15d 100644
--- a/libavformat/rtp.c
+++ b/libavformat/rtp.c
@@ -526,6 +526,31 @@ int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
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 @@ int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
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;