aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-18 23:22:08 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-18 23:22:12 +0200
commitbe94f5c171d95c2a4e926c59f9fd08e57b47edf9 (patch)
treeea803eae609e9a2dc9fce574c4b61eaf0b7ab18b
parent1ebc77bc7d68748598878c08c85a571b526a729f (diff)
parentc9c1e00f95350e7a36b0d05a03939c7f6438e371 (diff)
downloadffmpeg-be94f5c171d95c2a4e926c59f9fd08e57b47edf9.tar.gz
Merge commit 'c9c1e00f95350e7a36b0d05a03939c7f6438e371'
* commit 'c9c1e00f95350e7a36b0d05a03939c7f6438e371': rtsp: Factor out fmtp parsing Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/rtsp.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index d25838a074..6c1095a094 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -313,6 +313,22 @@ static void copy_default_source_addrs(struct RTSPSource **addrs, int count,
}
}
+static void parse_fmtp(AVFormatContext *s, RTSPState *rt,
+ int payload_type, const char *line)
+{
+ int i;
+
+ for (i = 0; i < rt->nb_rtsp_streams; i++) {
+ RTSPStream *rtsp_st = rt->rtsp_streams[i];
+ if (rtsp_st->sdp_payload_type == payload_type &&
+ rtsp_st->dynamic_handler &&
+ rtsp_st->dynamic_handler->parse_sdp_a_line) {
+ rtsp_st->dynamic_handler->parse_sdp_a_line(s, i,
+ rtsp_st->dynamic_protocol_context, line);
+ }
+ }
+}
+
static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
int letter, const char *buf)
{
@@ -320,7 +336,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
char buf1[64], st_type[64];
const char *p;
enum AVMediaType codec_type;
- int payload_type, i;
+ int payload_type;
AVStream *st;
RTSPStream *rtsp_st;
RTSPSource *rtsp_src;
@@ -498,14 +514,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
// let dynamic protocol handlers have a stab at the line.
get_word(buf1, sizeof(buf1), &p);
payload_type = atoi(buf1);
- for (i = 0; i < rt->nb_rtsp_streams; i++) {
- rtsp_st = rt->rtsp_streams[i];
- if (rtsp_st->sdp_payload_type == payload_type &&
- rtsp_st->dynamic_handler &&
- rtsp_st->dynamic_handler->parse_sdp_a_line)
- rtsp_st->dynamic_handler->parse_sdp_a_line(s, i,
- rtsp_st->dynamic_protocol_context, buf);
- }
+ parse_fmtp(s, rt, payload_type, buf);
} else if (av_strstart(p, "range:", &p)) {
int64_t start, end;