summaryrefslogtreecommitdiff
path: root/libavformat/rtpdec_mpeg4.c
diff options
context:
space:
mode:
authorJosh Allmann <joshua.allmann@gmail.com>2010-06-28 11:30:44 +0000
committerMartin Storsjö <martin@martin.st>2010-06-28 11:30:44 +0000
commitefc6d451965754a7982f68437645d88a400b3fbb (patch)
tree7f22b23c0ca16182245ac292305081a9a09b84c0 /libavformat/rtpdec_mpeg4.c
parentfb4ca2cb51f99dfa658d5fc4f082d18423172f38 (diff)
rtpdec: Clean up FMTP parsing code in MPEG-4/AAC RTP depacketizer
Patch by Josh Allmann, joshua dot allmann at gmail Originally committed as revision 23851 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtpdec_mpeg4.c')
-rw-r--r--libavformat/rtpdec_mpeg4.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/libavformat/rtpdec_mpeg4.c b/libavformat/rtpdec_mpeg4.c
index cb22b32e11..cf1e7fa819 100644
--- a/libavformat/rtpdec_mpeg4.c
+++ b/libavformat/rtpdec_mpeg4.c
@@ -219,24 +219,12 @@ static int aac_parse_packet(AVFormatContext *ctx,
return 0;
}
-static int parse_sdp_line(AVFormatContext *s, int st_index,
- PayloadContext *data, const char *line)
+static int parse_fmtp(AVStream *stream, PayloadContext *data,
+ char *attr, char *value)
{
- const char *p;
- char value[4096], attr[25];
- int res = 0, i;
- AVStream *st = s->streams[st_index];
- AVCodecContext* codec = st->codec;
-
- if (av_strstart(line, "fmtp:", &p)) {
- // remove protocol identifier
- while (*p && *p == ' ') p++; // strip spaces
- while (*p && *p != ' ') p++; // eat protocol identifier
- while (*p && *p == ' ') p++; // strip trailing spaces
-
- while (ff_rtsp_next_attr_and_value(&p,
- attr, sizeof(attr),
- value, sizeof(value))) {
+ AVCodecContext *codec = stream->codec;
+ int res, i;
+
if (!strcmp(attr, "config")) {
res = parse_fmtp_config(codec, value);
@@ -257,11 +245,18 @@ static int parse_sdp_line(AVFormatContext *s, int st_index,
}
}
}
+ return 0;
}
- }
- return 0;
+static int parse_sdp_line(AVFormatContext *s, int st_index,
+ PayloadContext *data, const char *line)
+{
+ const char *p;
+
+ if (av_strstart(line, "fmtp:", &p))
+ return ff_parse_fmtp(s->streams[st_index], data, p, parse_fmtp);
+ return 0;
}
RTPDynamicProtocolHandler ff_mp4v_es_dynamic_handler = {