aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-07-24 20:43:07 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-07-24 21:15:57 +0200
commit93342de1d88081822dad55af70dd4738cd15d242 (patch)
tree7dd3f6fe644743880f7be2554570bda7497688c7 /libavformat/rtp.c
parent3ccf22c64a0065fa08fe642500f193394fd83d01 (diff)
parent6a433fdba82ff241be2e9193f66a43689766e4d7 (diff)
downloadffmpeg-93342de1d88081822dad55af70dd4738cd15d242.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: rtmp: Add credit/copyright to librtmp authors for parts of the RTMPE code rtmp: Move the CONFIG_ condition into the if conditions aac: Mention abbreviation as well in long_name build: Skip compiling rtmpdh.h if ffrtmpcrypt protocol is not enabled doc: Add Git configuration section configure: Add a dependency on https for rtmpts rtp: Only choose static payload types if the sample rate and channels are right Conflicts: doc/git-howto.texi libavformat/rtmpproto.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtp.c')
-rw-r--r--libavformat/rtp.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/libavformat/rtp.c b/libavformat/rtp.c
index a5484ae6fa..2a801625e9 100644
--- a/libavformat/rtp.c
+++ b/libavformat/rtp.c
@@ -110,9 +110,17 @@ int ff_rtp_get_payload_type(AVFormatContext *fmt, AVCodecContext *codec)
!fmt->oformat->priv_class ||
!av_opt_flag_is_set(fmt->priv_data, "rtpflags", "rfc2190")))
continue;
- if (codec->codec_id == CODEC_ID_PCM_S16BE)
- if (codec->channels != AVRtpPayloadTypes[i].audio_channels)
- 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 == CODEC_ID_ADPCM_G722 &&
+ codec->sample_rate == 16000 && codec->channels == 1)
+ return AVRtpPayloadTypes[i].pt;
+ if (codec->codec_type == AVMEDIA_TYPE_AUDIO &&
+ ((AVRtpPayloadTypes[i].clock_rate > 0 &&
+ codec->sample_rate != AVRtpPayloadTypes[i].clock_rate) ||
+ (AVRtpPayloadTypes[i].audio_channels > 0 &&
+ codec->channels != AVRtpPayloadTypes[i].audio_channels)))
+ continue;
return AVRtpPayloadTypes[i].pt;
}