---
libavformat/rtp.c | 18 +++++++++---------
libavformat/rtp.h | 4 ++--
libavformat/rtpenc.c | 2 +-
libavformat/rtpenc_chain.c | 2 +-
libavformat/sdp.c | 2 +-
5 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/libavformat/rtp.c b/libavformat/rtp.c
index 0a3c411..2c9284b 100644
--- a/libavformat/rtp.c
+++ b/libavformat/rtp.c
@@ -87,7 +87,7 @@ int ff_rtp_get_codec_info(AVCodecContext *codec, int
payload_type)
}
int ff_rtp_get_payload_type(AVFormatContext *fmt,
- AVCodecContext *codec, int idx)
+ AVCodecParameters *par, int idx)
{
int i;
AVOutputFormat *ofmt = fmt ? fmt->oformat : NULL;
@@ -102,27 +102,27 @@ 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 || !fmt->oformat
||
+ if (rtp_payload_types[i].codec_id == par->codec_id) {
+ if (par->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;
/* G722 has 8000 as nominal rate even if the sample rate is 16000,
* see section 4.5.2 in RFC 3551. */
- if (codec->codec_id == AV_CODEC_ID_ADPCM_G722 &&
- codec->sample_rate == 16000 && codec->channels == 1)
+ if (par->codec_id == AV_CODEC_ID_ADPCM_G722 &&
+ par->sample_rate == 16000 && par->channels == 1)
return rtp_payload_types[i].pt;
- if (codec->codec_type == AVMEDIA_TYPE_AUDIO &&
+ if (par->codec_type == AVMEDIA_TYPE_AUDIO &&
((rtp_payload_types[i].clock_rate > 0 &&
- codec->sample_rate != rtp_payload_types[i].clock_rate) ||
+ par->sample_rate != rtp_payload_types[i].clock_rate) ||
(rtp_payload_types[i].audio_channels > 0 &&
- codec->channels != rtp_payload_types[i].audio_channels)))
+ par->channels != rtp_payload_types[i].audio_channels)))
continue;
return rtp_payload_types[i].pt;
}
if (idx < 0)
- idx = codec->codec_type == AVMEDIA_TYPE_AUDIO;
+ idx = par->codec_type == AVMEDIA_TYPE_AUDIO;
/* dynamic payload type */
return RTP_PT_PRIVATE + idx;
diff --git a/libavformat/rtp.h b/libavformat/rtp.h
index feaf167..d1bd123 100644
--- a/libavformat/rtp.h
+++ b/libavformat/rtp.h
@@ -32,11 +32,11 @@
* The format context private option payload_type overrides both.
*
* @param fmt The context of the format
- * @param codec The context of the codec
+ * @param par The codec parameters
* @param idx The stream index
* @return The payload type (the 'PT' field in the RTP header).
*/
-int ff_rtp_get_payload_type(AVFormatContext *fmt, AVCodecContext *codec,
+int ff_rtp_get_payload_type(AVFormatContext *fmt, AVCodecParameters *par,
int idx);
/**
diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index 6158934..de26fab 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -106,7 +106,7 @@ static int rtp_write_header(AVFormatContext *s1)
if (s->payload_type < 0) {
/* Re-validate non-dynamic payload types */
if (st->id < RTP_PT_PRIVATE)
- st->id = ff_rtp_get_payload_type(s1, st->codec, -1);
+ st->id = ff_rtp_get_payload_type(s1, st->codecpar, -1);
s->payload_type = st->id;
} else {
diff --git a/libavformat/rtpenc_chain.c b/libavformat/rtpenc_chain.c
index e58eb54..3708205 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(s, st->codec, idx);
+ ff_rtp_get_payload_type(s, st->codecpar, idx);
else
rtpctx->streams[0]->id = st->id;
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index fe43e04..cc20528 100644
--- a/libavformat/sdp.c
+++ b/libavformat/sdp.c
@@ -714,7 +714,7 @@ void ff_sdp_write_media(char *buff, int size, AVStream *st,
int idx,
const char *type;
int payload_type;
- payload_type = ff_rtp_get_payload_type(fmt, c, idx);
+ payload_type = ff_rtp_get_payload_type(fmt, st->codecpar, idx);
switch (c->codec_type) {
case AVMEDIA_TYPE_VIDEO : type = "video" ; break;
--
2.0.0
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel