diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index b9416d2606..84b912f7f2 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -827,7 +827,8 @@ int ff_rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st) if (!rtsp_st->transport_priv) { return AVERROR(ENOMEM); - } else if (CONFIG_RTPDEC && rt->transport == RTSP_TRANSPORT_RTP) { + } else if (CONFIG_RTPDEC && rt->transport == RTSP_TRANSPORT_RTP && + s->iformat) { RTPDemuxContext *rtpctx = rtsp_st->transport_priv; rtpctx->ssrc = rtsp_st->ssrc; if (rtsp_st->dynamic_handler) {