return -1;
}
-int ff_rtp_get_payload_type(AVFormatContext *fmt, AVCodecContext *codec)
+int ff_rtp_get_payload_type(AVFormatContext *fmt,
+ AVCodecContext *codec, int idx)
{
int i;
AVOutputFormat *ofmt = fmt ? fmt->oformat : NULL;
return AVRtpPayloadTypes[i].pt;
}
+ if (idx < 0)
+ idx = codec->codec_type == AVMEDIA_TYPE_AUDIO;
+
/* dynamic payload type */
- return RTP_PT_PRIVATE + (codec->codec_type == AVMEDIA_TYPE_AUDIO);
+ return RTP_PT_PRIVATE + idx;
}
const char *ff_rtp_enc_name(int payload_type)