Revision accc248f libavformat/rtsp.c

View differences:

libavformat/rtsp.c
873 873
    for(i=0;i<rt->nb_rtsp_streams;i++) {
874 874
        rtsp_st = rt->rtsp_streams[i];
875 875
        if (rtsp_st) {
876
            if (rtsp_st->tx_ctx)
876
            if (rtsp_st->tx_ctx) {
877
                if (rt->transport == RTSP_TRANSPORT_RDT)
878
                    ff_rdt_parse_close(rtsp_st->tx_ctx);
879
                else
877 880
                rtp_parse_close(rtsp_st->tx_ctx);
881
            }
878 882
            if (rtsp_st->rtp_handle)
879 883
                url_close(rtsp_st->rtp_handle);
880 884
            if (rtsp_st->dynamic_handler && rtsp_st->dynamic_protocol_context)
......
887 891
static int
888 892
rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
889 893
{
894
    RTSPState *rt = s->priv_data;
890 895
    AVStream *st = NULL;
891 896

  
892 897
    /* open the RTP context */
......
894 899
        st = s->streams[rtsp_st->stream_index];
895 900
    if (!st)
896 901
        s->ctx_flags |= AVFMTCTX_NOHEADER;
902

  
903
    if (rt->transport == RTSP_TRANSPORT_RDT)
904
        rtsp_st->tx_ctx = ff_rdt_parse_open(s, st,
905
                                            rtsp_st->dynamic_protocol_context,
906
                                            rtsp_st->dynamic_handler);
907
    else
897 908
    rtsp_st->tx_ctx = rtp_parse_open(s, st, rtsp_st->rtp_handle, rtsp_st->sdp_payload_type, &rtsp_st->rtp_payload_data);
898 909

  
899 910
    if (!rtsp_st->tx_ctx) {
900 911
         return AVERROR(ENOMEM);
901
    } else {
912
    } else if (rt->transport != RTSP_TRANSPORT_RDT) {
902 913
        if(rtsp_st->dynamic_handler) {
903 914
            rtp_parse_set_dynamic_protocol(rtsp_st->tx_ctx,
904 915
                                           rtsp_st->dynamic_protocol_context,

Also available in: Unified diff