From 932117171f32fc3160f3d92943290238945fcb28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 23 Jan 2013 23:21:52 +0200 Subject: [PATCH 1/2] rtp: Make sure the output format pointer is set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not sure if this actually happens, but we do the same check when checking payload_type further above in the function, so it might be needed. Signed-off-by: Martin Storsjö --- libavformat/rtp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/rtp.c b/libavformat/rtp.c index d1c6ed09aa..e827c2e0ab 100644 --- a/libavformat/rtp.c +++ b/libavformat/rtp.c @@ -103,7 +103,7 @@ int ff_rtp_get_payload_type(AVFormatContext *fmt, /* static payload type */ for (i = 0; rtp_payload_types[i].pt >= 0; ++i) if (rtp_payload_types[i].codec_id == codec->codec_id) { - if (codec->codec_id == AV_CODEC_ID_H263 && (!fmt || + if (codec->codec_id == AV_CODEC_ID_H263 && (!fmt || !fmt->oformat || !fmt->oformat->priv_class || !fmt->priv_data || !av_opt_flag_is_set(fmt->priv_data, "rtpflags", "rfc2190"))) continue; From 4a4a7e138c92901e04db46a6b05cc6948023e5f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 23 Jan 2013 23:25:09 +0200 Subject: [PATCH 2/2] rtpenc_chain: Use the original AVFormatContext for getting payload type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In ff_rtp_get_payload_type, the AVFormatContext is used for checking whether the payload_type or rtpflags options are set. In rtpenc_chain, the rtpctx struct is a newly initialized struct where no options have been set yet, so no options can be fetched from there. All muxers that internally chain rtp muxers have the "rtpflags" field that allows passing such options on (which is how this worked before 8034130e06), so this works just as intended. This makes it possible to produce H263 in RFC2190 format with chained RTP muxers. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö --- libavformat/rtpenc_chain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/rtpenc_chain.c b/libavformat/rtpenc_chain.c index 3c297eb97b..935dd6cd31 100644 --- a/libavformat/rtpenc_chain.c +++ b/libavformat/rtpenc_chain.c @@ -62,7 +62,7 @@ int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s, /* Get the payload type from the codec */ if (st->id < RTP_PT_PRIVATE) rtpctx->streams[0]->id = - ff_rtp_get_payload_type(rtpctx, st->codec, idx); + ff_rtp_get_payload_type(s, st->codec, idx); else rtpctx->streams[0]->id = st->id;