int ff_rtp_get_payload_type(AVFormatContext *fmt,

                            AVCodecContext *codec, int idx)

{

    int i;

    AVOutputFormat *ofmt = fmt ? fmt->oformat : NULL;



    /* Was the payload type already specified for the RTP muxer? */

    if (ofmt && ofmt->priv_class && fmt->priv_data) {

        int64_t payload_type;

        if (av_opt_get_int(fmt->priv_data, "payload_type", 0, &payload_type) >= 0 &&

            payload_type >= 0)

            return (int)payload_type;

    }



    /* 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->priv_class ||

                !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)

                return rtp_payload_types[i].pt;

            if (codec->codec_type == AVMEDIA_TYPE_AUDIO &&

                ((rtp_payload_types[i].clock_rate > 0 &&

                  codec->sample_rate != rtp_payload_types[i].clock_rate) ||

                 (rtp_payload_types[i].audio_channels > 0 &&

                  codec->channels != rtp_payload_types[i].audio_channels)))

                continue;

            return rtp_payload_types[i].pt;

        }



    if (idx < 0)

        idx = codec->codec_type == AVMEDIA_TYPE_AUDIO;



    /* dynamic payload type */

    return RTP_PT_PRIVATE + idx;

}

int ff_rtp_get_payload_type(AVFormatContext *fmt,

                            AVCodecContext *codec, int idx)

{

    int i;

    AVOutputFormat *ofmt = fmt ? fmt->oformat : NULL;



    

    if (ofmt && ofmt->priv_class && fmt->priv_data) {

        int64_t payload_type;

        if (av_opt_get_int(fmt->priv_data, "payload_type", 0, &payload_type) >= 0 &&

            payload_type >= 0)

            return (int)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->priv_class ||

                !av_opt_flag_is_set(fmt->priv_data, "rtpflags", "rfc2190")))

                continue;

            



            if (codec->codec_id == AV_CODEC_ID_ADPCM_G722 &&

                codec->sample_rate == 16000 && codec->channels == 1)

                return rtp_payload_types[i].pt;

            if (codec->codec_type == AVMEDIA_TYPE_AUDIO &&

                ((rtp_payload_types[i].clock_rate > 0 &&

                  codec->sample_rate != rtp_payload_types[i].clock_rate) ||

                 (rtp_payload_types[i].audio_channels > 0 &&

                  codec->channels != rtp_payload_types[i].audio_channels)))

                continue;

            return rtp_payload_types[i].pt;

        }



    if (idx < 0)

        idx = codec->codec_type == AVMEDIA_TYPE_AUDIO;



    

    return RTP_PT_PRIVATE + idx;

}

                !fmt->oformat->priv_class ||
int FUNC_0(AVFormatContext *VAR_0,

                            AVCodecContext *VAR_1, int VAR_2)

{

    int VAR_3;

    AVOutputFormat *ofmt = VAR_0 ? VAR_0->oformat : NULL;



    

    if (ofmt && ofmt->priv_class && VAR_0->priv_data) {

        int64_t payload_type;

        if (av_opt_get_int(VAR_0->priv_data, "payload_type", 0, &payload_type) >= 0 &&

            payload_type >= 0)

            return (int)payload_type;

    }



    

    for (VAR_3 = 0; rtp_payload_types[VAR_3].pt >= 0; ++VAR_3)

        if (rtp_payload_types[VAR_3].codec_id == VAR_1->codec_id) {

            if (VAR_1->codec_id == AV_CODEC_ID_H263 && (!VAR_0 ||

                !VAR_0->oformat->priv_class ||

                !av_opt_flag_is_set(VAR_0->priv_data, "rtpflags", "rfc2190")))

                continue;

            



            if (VAR_1->codec_id == AV_CODEC_ID_ADPCM_G722 &&

                VAR_1->sample_rate == 16000 && VAR_1->channels == 1)

                return rtp_payload_types[VAR_3].pt;

            if (VAR_1->codec_type == AVMEDIA_TYPE_AUDIO &&

                ((rtp_payload_types[VAR_3].clock_rate > 0 &&

                  VAR_1->sample_rate != rtp_payload_types[VAR_3].clock_rate) ||

                 (rtp_payload_types[VAR_3].audio_channels > 0 &&

                  VAR_1->channels != rtp_payload_types[VAR_3].audio_channels)))

                continue;

            return rtp_payload_types[VAR_3].pt;

        }



    if (VAR_2 < 0)

        VAR_2 = VAR_1->codec_type == AVMEDIA_TYPE_AUDIO;



    

    return RTP_PT_PRIVATE + VAR_2;

}

int FUNC_0(AVFormatContext *VAR_0,
AVCodecContext *VAR_1, int VAR_2)
{ int VAR_3; AVOutputFormat *ofmt = VAR_0 ? VAR_0->oformat : NULL; if (ofmt && ofmt->priv_class && VAR_0->priv_data) { int64_t payload_type; if (av_opt_get_int(VAR_0->priv_data, "payload_type", 0, &payload_type) >= 0 &&
payload_type >= 0)
return (int)payload_type; } for (VAR_3 = 0; rtp_payload_types[VAR_3].pt >= 0; ++VAR_3) if (rtp_payload_types[VAR_3].codec_id == VAR_1->codec_id) { if (VAR_1->codec_id == AV_CODEC_ID_H263 && (!VAR_0 ||
!VAR_0->oformat->priv_class ||
!av_opt_flag_is_set(VAR_0->priv_data, "rtpflags", "rfc2190")))
continue; if (VAR_1->codec_id == AV_CODEC_ID_ADPCM_G722 &&
VAR_1->sample_rate == 16000 && VAR_1->channels == 1)
return rtp_payload_types[VAR_3].pt; if (VAR_1->codec_type == AVMEDIA_TYPE_AUDIO &&
((rtp_payload_types[VAR_3].clock_rate > 0 &&
VAR_1->sample_rate != rtp_payload_types[VAR_3].clock_rate) ||
(rtp_payload_types[VAR_3].audio_channels > 0 &&
VAR_1->channels != rtp_payload_types[VAR_3].audio_channels)))
continue; return rtp_payload_types[VAR_3].pt; } if (VAR_2 < 0)
VAR_2 = VAR_1->codec_type == AVMEDIA_TYPE_AUDIO; return RTP_PT_PRIVATE + VAR_2; }