diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-21 16:52:06 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-21 16:52:42 +0400 |
commit | 950482bf587889c507340ae5893a851be8e99fcc (patch) | |
tree | 8ab3a6cb2b895518df5a594c69144985dc0e7cc8 /libavformat/rtsp.c | |
parent | c3f3c2256325532eb9ee8a44f1f43c31de79eb2f (diff) | |
parent | 2326558d5277ec87ba6d607a01ec6acfc51c694c (diff) |
Merge commit '2326558d5277ec87ba6d607a01ec6acfc51c694c'
* commit '2326558d5277ec87ba6d607a01ec6acfc51c694c':
rtpdec: Split mpegts parsing to a normal depacketizer
rtpdec: Reorder payload handler registration alphabetically
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r-- | libavformat/rtsp.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 23ce65c0bf..317893c5d0 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -181,7 +181,8 @@ static void init_rtp_handler(RTPDynamicProtocolHandler *handler, { if (!handler) return; - codec->codec_id = handler->codec_id; + if (codec) + codec->codec_id = handler->codec_id; rtsp_st->dynamic_handler = handler; if (handler->alloc) { rtsp_st->dynamic_protocol_context = handler->alloc(); @@ -383,8 +384,17 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, if (!strcmp(ff_rtp_enc_name(rtsp_st->sdp_payload_type), "MP2T")) { /* no corresponding stream */ - if (rt->transport == RTSP_TRANSPORT_RAW && !rt->ts && CONFIG_RTPDEC) - rt->ts = ff_mpegts_parse_open(s); + if (rt->transport == RTSP_TRANSPORT_RAW) { + if (!rt->ts && CONFIG_RTPDEC) + rt->ts = ff_mpegts_parse_open(s); + } else { + RTPDynamicProtocolHandler *handler; + handler = ff_rtp_handler_find_by_id( + rtsp_st->sdp_payload_type, AVMEDIA_TYPE_DATA); + init_rtp_handler(handler, rtsp_st, NULL); + if (handler && handler->init) + handler->init(s, -1, rtsp_st->dynamic_protocol_context); + } } else if (rt->server_type == RTSP_SERVER_WMS && codec_type == AVMEDIA_TYPE_DATA) { /* RTX stream, a stream that carries all the other actual |