From 7ed19d7fbfc0dda44d401388db06b245f07d206f Mon Sep 17 00:00:00 2001 From: Luca Abeni Date: Fri, 16 Nov 2007 07:59:41 +0000 Subject: Remove the "AVRtpPayloadTypes[i].pt == i" assumption from RTP and RTSP code (this is needed for supporting MPEG2 video in the RTP muxer) Originally committed as revision 11046 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/rtsp.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'libavformat/rtsp.c') diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 3dbb3e3aba..c494ebd3d8 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -167,11 +167,7 @@ static int sdp_parse_rtpmap(AVCodecContext *codec, RTSPStream *rtsp_st, int payl } else { /* We are in a standard case ( from http://www.iana.org/assignments/rtp-parameters) */ /* search into AVRtpPayloadTypes[] */ - for (i = 0; AVRtpPayloadTypes[i].pt >= 0; ++i) - if (!strcmp(buf, AVRtpPayloadTypes[i].enc_name) && (codec->codec_type == AVRtpPayloadTypes[i].codec_type)){ - codec->codec_id = AVRtpPayloadTypes[i].codec_id; - break; - } + codec->codec_id = ff_rtp_codec_id(buf, codec->codec_type); } c = avcodec_find_decoder(codec->codec_id); @@ -443,7 +439,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, get_word(buf1, sizeof(buf1), &p); /* format list */ rtsp_st->sdp_payload_type = atoi(buf1); - if (!strcmp(AVRtpPayloadTypes[rtsp_st->sdp_payload_type].enc_name, "MP2T")) { + if (!strcmp(ff_rtp_enc_name(rtsp_st->sdp_payload_type), "MP2T")) { /* no corresponding stream */ } else { st = av_new_stream(s, 0); -- cgit v1.2.3