aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-01-17 14:34:59 +0200
committerMartin Storsjö <martin@martin.st>2013-01-20 18:17:17 +0200
commit2326558d5277ec87ba6d607a01ec6acfc51c694c (patch)
tree3417a2e59c2d6f4b67e4b959dd03011e7658d9b0 /libavformat/rtsp.c
parentd5bb8cc2dd91687c87a05f386694e16b2860a7f7 (diff)
downloadffmpeg-2326558d5277ec87ba6d607a01ec6acfc51c694c.tar.gz
rtpdec: Split mpegts parsing to a normal depacketizer
This gets rid of a number of special cases from the common rtpdec code. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r--libavformat/rtsp.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 9a657fb440..1ce28d6457 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -180,7 +180,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();
@@ -382,8 +383,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