From accc248f28cc71bd5f97c25cb4585dd6ff611242 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sat, 4 Oct 2008 04:19:15 +0000 Subject: Implement RDTDemuxContext, which contains RDT-specific data (similar to RTPDemuxContext for RTP) for these streams where the transport protocol is RDT (as served by Realmedia servers). Originally committed as revision 15544 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/rtsp.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'libavformat/rtsp.c') diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 33a0569300..d304d92d09 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -873,8 +873,12 @@ static void rtsp_close_streams(RTSPState *rt) for(i=0;inb_rtsp_streams;i++) { rtsp_st = rt->rtsp_streams[i]; if (rtsp_st) { - if (rtsp_st->tx_ctx) + if (rtsp_st->tx_ctx) { + if (rt->transport == RTSP_TRANSPORT_RDT) + ff_rdt_parse_close(rtsp_st->tx_ctx); + else rtp_parse_close(rtsp_st->tx_ctx); + } if (rtsp_st->rtp_handle) url_close(rtsp_st->rtp_handle); if (rtsp_st->dynamic_handler && rtsp_st->dynamic_protocol_context) @@ -887,6 +891,7 @@ static void rtsp_close_streams(RTSPState *rt) static int rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st) { + RTSPState *rt = s->priv_data; AVStream *st = NULL; /* open the RTP context */ @@ -894,11 +899,17 @@ rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st) st = s->streams[rtsp_st->stream_index]; if (!st) s->ctx_flags |= AVFMTCTX_NOHEADER; + + if (rt->transport == RTSP_TRANSPORT_RDT) + rtsp_st->tx_ctx = ff_rdt_parse_open(s, st, + rtsp_st->dynamic_protocol_context, + rtsp_st->dynamic_handler); + else rtsp_st->tx_ctx = rtp_parse_open(s, st, rtsp_st->rtp_handle, rtsp_st->sdp_payload_type, &rtsp_st->rtp_payload_data); if (!rtsp_st->tx_ctx) { return AVERROR(ENOMEM); - } else { + } else if (rt->transport != RTSP_TRANSPORT_RDT) { if(rtsp_st->dynamic_handler) { rtp_parse_set_dynamic_protocol(rtsp_st->tx_ctx, rtsp_st->dynamic_protocol_context, -- cgit v1.2.3