summaryrefslogtreecommitdiff
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2008-10-04 04:19:15 +0000
committerRonald S. Bultje <rsbultje@gmail.com>2008-10-04 04:19:15 +0000
commitaccc248f28cc71bd5f97c25cb4585dd6ff611242 (patch)
tree543b86aebad2e8ec62286d0b8d574b8538d43396 /libavformat/rtsp.c
parent5465b0d4740cad41287e305958bd8fd8c8cfbec6 (diff)
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
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r--libavformat/rtsp.c15
1 files changed, 13 insertions, 2 deletions
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;i<rt->nb_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,