static int sdp_parse_rtpmap(AVFormatContext *s,

                            AVStream *st, RTSPStream *rtsp_st,

                            int payload_type, const char *p)

{

    AVCodecContext *codec = st->codec;

    char buf[256];

    int i;

    AVCodec *c;

    const char *c_name;



    /* See if we can handle this kind of payload.

     * The space should normally not be there but some Real streams or

     * particular servers ("RealServer Version 6.1.3.970", see issue 1658)

     * have a trailing space. */

    get_word_sep(buf, sizeof(buf), "/ ", &p);

    if (payload_type < RTP_PT_PRIVATE) {

        /* We are in a standard case

         * (from http://www.iana.org/assignments/rtp-parameters). */

        codec->codec_id = ff_rtp_codec_id(buf, codec->codec_type);

    }



    if (codec->codec_id == AV_CODEC_ID_NONE) {

        RTPDynamicProtocolHandler *handler =

            ff_rtp_handler_find_by_name(buf, codec->codec_type);

        init_rtp_handler(handler, rtsp_st, st);

        /* If no dynamic handler was found, check with the list of standard

         * allocated types, if such a stream for some reason happens to

         * use a private payload type. This isn't handled in rtpdec.c, since

         * the format name from the rtpmap line never is passed into rtpdec. */

        if (!rtsp_st->dynamic_handler)

            codec->codec_id = ff_rtp_codec_id(buf, codec->codec_type);

    }



    c = avcodec_find_decoder(codec->codec_id);

    if (c && c->name)

        c_name = c->name;

    else

        c_name = "(null)";



    get_word_sep(buf, sizeof(buf), "/", &p);

    i = atoi(buf);

    switch (codec->codec_type) {

    case AVMEDIA_TYPE_AUDIO:

        av_log(s, AV_LOG_DEBUG, "audio codec set to: %s\n", c_name);

        codec->sample_rate = RTSP_DEFAULT_AUDIO_SAMPLERATE;

        codec->channels = RTSP_DEFAULT_NB_AUDIO_CHANNELS;

        if (i > 0) {

            codec->sample_rate = i;

            avpriv_set_pts_info(st, 32, 1, codec->sample_rate);

            get_word_sep(buf, sizeof(buf), "/", &p);

            i = atoi(buf);

            if (i > 0)

                codec->channels = i;

        }

        av_log(s, AV_LOG_DEBUG, "audio samplerate set to: %i\n",

               codec->sample_rate);

        av_log(s, AV_LOG_DEBUG, "audio channels set to: %i\n",

               codec->channels);

        break;

    case AVMEDIA_TYPE_VIDEO:

        av_log(s, AV_LOG_DEBUG, "video codec set to: %s\n", c_name);

        if (i > 0)

            avpriv_set_pts_info(st, 32, 1, i);

        break;

    default:

        break;

    }

    if (rtsp_st->dynamic_handler && rtsp_st->dynamic_handler->init)

        rtsp_st->dynamic_handler->init(s, st->index,

                                       rtsp_st->dynamic_protocol_context);

    return 0;

}

static int sdp_parse_rtpmap(AVFormatContext *s,

                            AVStream *st, RTSPStream *rtsp_st,

                            int payload_type, const char *p)

{

    AVCodecContext *codec = st->codec;

    char buf[256];

    int i;

    AVCodec *c;

    const char *c_name;



    







    get_word_sep(buf, sizeof(buf), "/ ", &p);

    if (payload_type < RTP_PT_PRIVATE) {

        



        codec->codec_id = ff_rtp_codec_id(buf, codec->codec_type);

    }



    if (codec->codec_id == AV_CODEC_ID_NONE) {

        RTPDynamicProtocolHandler *handler =

            ff_rtp_handler_find_by_name(buf, codec->codec_type);

        init_rtp_handler(handler, rtsp_st, st);

        







        if (!rtsp_st->dynamic_handler)

            codec->codec_id = ff_rtp_codec_id(buf, codec->codec_type);

    }



    c = avcodec_find_decoder(codec->codec_id);

    if (c && c->name)

        c_name = c->name;

    else

        c_name = "(null)";



    get_word_sep(buf, sizeof(buf), "/", &p);

    i = atoi(buf);

    switch (codec->codec_type) {

    case AVMEDIA_TYPE_AUDIO:

        av_log(s, AV_LOG_DEBUG, "audio codec set to: %s\n", c_name);

        codec->sample_rate = RTSP_DEFAULT_AUDIO_SAMPLERATE;

        codec->channels = RTSP_DEFAULT_NB_AUDIO_CHANNELS;

        if (i > 0) {

            codec->sample_rate = i;

            avpriv_set_pts_info(st, 32, 1, codec->sample_rate);

            get_word_sep(buf, sizeof(buf), "/", &p);

            i = atoi(buf);

            if (i > 0)

                codec->channels = i;

        }

        av_log(s, AV_LOG_DEBUG, "audio samplerate set to: %i\n",

               codec->sample_rate);

        av_log(s, AV_LOG_DEBUG, "audio channels set to: %i\n",

               codec->channels);

        break;

    case AVMEDIA_TYPE_VIDEO:

        av_log(s, AV_LOG_DEBUG, "video codec set to: %s\n", c_name);

        if (i > 0)

            avpriv_set_pts_info(st, 32, 1, i);

        break;

    default:

        break;

    }

    if (rtsp_st->dynamic_handler && rtsp_st->dynamic_handler->init)

        rtsp_st->dynamic_handler->init(s, st->index,

                                       rtsp_st->dynamic_protocol_context);

    return 0;

}

    if (rtsp_st->dynamic_handler && rtsp_st->dynamic_handler->init)         rtsp_st->dynamic_handler->init(s, st->index,                                        rtsp_st->dynamic_protocol_context);
static int FUNC_0(AVFormatContext *VAR_0,

                            AVStream *VAR_1, RTSPStream *VAR_2,

                            int VAR_3, const char *VAR_4)

{

    AVCodecContext *codec = VAR_1->codec;

    char VAR_5[256];

    int VAR_6;

    AVCodec *c;

    const char *VAR_7;



    







    get_word_sep(VAR_5, sizeof(VAR_5), "/ ", &VAR_4);

    if (VAR_3 < RTP_PT_PRIVATE) {

        



        codec->codec_id = ff_rtp_codec_id(VAR_5, codec->codec_type);

    }



    if (codec->codec_id == AV_CODEC_ID_NONE) {

        RTPDynamicProtocolHandler *handler =

            ff_rtp_handler_find_by_name(VAR_5, codec->codec_type);

        init_rtp_handler(handler, VAR_2, VAR_1);

        







        if (!VAR_2->dynamic_handler)

            codec->codec_id = ff_rtp_codec_id(VAR_5, codec->codec_type);

    }



    c = avcodec_find_decoder(codec->codec_id);

    if (c && c->name)

        VAR_7 = c->name;

    else

        VAR_7 = "(null)";



    get_word_sep(VAR_5, sizeof(VAR_5), "/", &VAR_4);

    VAR_6 = atoi(VAR_5);

    switch (codec->codec_type) {

    case AVMEDIA_TYPE_AUDIO:

        av_log(VAR_0, AV_LOG_DEBUG, "audio codec set to: %VAR_0\n", VAR_7);

        codec->sample_rate = RTSP_DEFAULT_AUDIO_SAMPLERATE;

        codec->channels = RTSP_DEFAULT_NB_AUDIO_CHANNELS;

        if (VAR_6 > 0) {

            codec->sample_rate = VAR_6;

            avpriv_set_pts_info(VAR_1, 32, 1, codec->sample_rate);

            get_word_sep(VAR_5, sizeof(VAR_5), "/", &VAR_4);

            VAR_6 = atoi(VAR_5);

            if (VAR_6 > 0)

                codec->channels = VAR_6;

        }

        av_log(VAR_0, AV_LOG_DEBUG, "audio samplerate set to: %VAR_6\n",

               codec->sample_rate);

        av_log(VAR_0, AV_LOG_DEBUG, "audio channels set to: %VAR_6\n",

               codec->channels);

        break;

    case AVMEDIA_TYPE_VIDEO:

        av_log(VAR_0, AV_LOG_DEBUG, "video codec set to: %VAR_0\n", VAR_7);

        if (VAR_6 > 0)

            avpriv_set_pts_info(VAR_1, 32, 1, VAR_6);

        break;

    default:

        break;

    }

    if (VAR_2->dynamic_handler && VAR_2->dynamic_handler->init)

        VAR_2->dynamic_handler->init(VAR_0, VAR_1->index,

                                       VAR_2->dynamic_protocol_context);

    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0,
AVStream *VAR_1, RTSPStream *VAR_2,
int VAR_3, const char *VAR_4)
{ AVCodecContext *codec = VAR_1->codec; char VAR_5[256]; int VAR_6; AVCodec *c; const char *VAR_7; get_word_sep(VAR_5, sizeof(VAR_5), "/ ", &VAR_4); if (VAR_3 < RTP_PT_PRIVATE) { codec->codec_id = ff_rtp_codec_id(VAR_5, codec->codec_type); } if (codec->codec_id == AV_CODEC_ID_NONE) { RTPDynamicProtocolHandler *handler =
ff_rtp_handler_find_by_name(VAR_5, codec->codec_type); init_rtp_handler(handler, VAR_2, VAR_1); if (!VAR_2->dynamic_handler)
codec->codec_id = ff_rtp_codec_id(VAR_5, codec->codec_type); } c = avcodec_find_decoder(codec->codec_id); if (c && c->name)
VAR_7 = c->name; else
VAR_7 = "(null)"; get_word_sep(VAR_5, sizeof(VAR_5), "/", &VAR_4); VAR_6 = atoi(VAR_5); switch (codec->codec_type) { case AVMEDIA_TYPE_AUDIO:
av_log(VAR_0, AV_LOG_DEBUG, "audio codec set to: %VAR_0\n", VAR_7); codec->sample_rate = RTSP_DEFAULT_AUDIO_SAMPLERATE; codec->channels = RTSP_DEFAULT_NB_AUDIO_CHANNELS; if (VAR_6 > 0) { codec->sample_rate = VAR_6; avpriv_set_pts_info(VAR_1, 32, 1, codec->sample_rate); get_word_sep(VAR_5, sizeof(VAR_5), "/", &VAR_4); VAR_6 = atoi(VAR_5); if (VAR_6 > 0)
codec->channels = VAR_6; } av_log(VAR_0, AV_LOG_DEBUG, "audio samplerate set to: %VAR_6\n",
codec->sample_rate); av_log(VAR_0, AV_LOG_DEBUG, "audio channels set to: %VAR_6\n",
codec->channels); break; case AVMEDIA_TYPE_VIDEO:
av_log(VAR_0, AV_LOG_DEBUG, "video codec set to: %VAR_0\n", VAR_7); if (VAR_6 > 0)
avpriv_set_pts_info(VAR_1, 32, 1, VAR_6); break; default:
break; } if (VAR_2->dynamic_handler && VAR_2->dynamic_handler->init)
VAR_2->dynamic_handler->init(VAR_0, VAR_1->index,
VAR_2->dynamic_protocol_context); return 0; }