static int pcm_read_header(AVFormatContext *s)

{

    PCMAudioDemuxerContext *s1 = s->priv_data;

    AVStream *st;

    uint8_t *mime_type = NULL;



    st = avformat_new_stream(s, NULL);

    if (!st)

        return AVERROR(ENOMEM);





    st->codecpar->codec_type  = AVMEDIA_TYPE_AUDIO;

    st->codecpar->codec_id    = s->iformat->raw_codec_id;

    st->codecpar->sample_rate = s1->sample_rate;

    st->codecpar->channels    = s1->channels;



    av_opt_get(s->pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type);

    if (mime_type && s->iformat->mime_type) {

        int rate = 0, channels = 0;

        size_t len = strlen(s->iformat->mime_type);

        if (!strncmp(s->iformat->mime_type, mime_type, len)) {

            uint8_t *options = mime_type + len;

            len = strlen(mime_type);

            while (options < mime_type + len) {

                options = strstr(options, ";");

                if (!options++)

                    break;

                if (!rate)

                    sscanf(options, " rate=%d",     &rate);

                if (!channels)

                    sscanf(options, " channels=%d", &channels);

            }

            if (rate <= 0) {

                av_log(s, AV_LOG_ERROR,

                       "Invalid sample_rate found in mime_type \"%s\"\n",

                       mime_type);


                return AVERROR_INVALIDDATA;

            }

            st->codecpar->sample_rate = rate;

            if (channels > 0)

                st->codecpar->channels = channels;

        }

    }




    st->codecpar->bits_per_coded_sample =

        av_get_bits_per_sample(st->codecpar->codec_id);



    av_assert0(st->codecpar->bits_per_coded_sample > 0);



    st->codecpar->block_align =

        st->codecpar->bits_per_coded_sample * st->codecpar->channels / 8;



    avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);

    return 0;

}
static int pcm_read_header(AVFormatContext *s)

{

    PCMAudioDemuxerContext *s1 = s->priv_data;

    AVStream *st;

    uint8_t *mime_type = NULL;



    st = avformat_new_stream(s, NULL);

    if (!st)

        return AVERROR(ENOMEM);





    st->codecpar->codec_type  = AVMEDIA_TYPE_AUDIO;

    st->codecpar->codec_id    = s->iformat->raw_codec_id;

    st->codecpar->sample_rate = s1->sample_rate;

    st->codecpar->channels    = s1->channels;



    av_opt_get(s->pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type);

    if (mime_type && s->iformat->mime_type) {

        int rate = 0, channels = 0;

        size_t len = strlen(s->iformat->mime_type);

        if (!strncmp(s->iformat->mime_type, mime_type, len)) {

            uint8_t *options = mime_type + len;

            len = strlen(mime_type);

            while (options < mime_type + len) {

                options = strstr(options, ";");

                if (!options++)

                    break;

                if (!rate)

                    sscanf(options, " rate=%d",     &rate);

                if (!channels)

                    sscanf(options, " channels=%d", &channels);

            }

            if (rate <= 0) {

                av_log(s, AV_LOG_ERROR,

                       "Invalid sample_rate found in mime_type \"%s\"\n",

                       mime_type);


                return AVERROR_INVALIDDATA;

            }

            st->codecpar->sample_rate = rate;

            if (channels > 0)

                st->codecpar->channels = channels;

        }

    }




    st->codecpar->bits_per_coded_sample =

        av_get_bits_per_sample(st->codecpar->codec_id);



    av_assert0(st->codecpar->bits_per_coded_sample > 0);



    st->codecpar->block_align =

        st->codecpar->bits_per_coded_sample * st->codecpar->channels / 8;



    avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);

    return 0;

}
static int FUNC_0(AVFormatContext *VAR_0)

{

    PCMAudioDemuxerContext *s1 = VAR_0->priv_data;

    AVStream *st;

    uint8_t *mime_type = NULL;



    st = avformat_new_stream(VAR_0, NULL);

    if (!st)

        return AVERROR(ENOMEM);





    st->codecpar->codec_type  = AVMEDIA_TYPE_AUDIO;

    st->codecpar->codec_id    = VAR_0->iformat->raw_codec_id;

    st->codecpar->sample_rate = s1->sample_rate;

    st->codecpar->VAR_2    = s1->VAR_2;



    av_opt_get(VAR_0->pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type);

    if (mime_type && VAR_0->iformat->mime_type) {

        int VAR_1 = 0, VAR_2 = 0;

        size_t len = strlen(VAR_0->iformat->mime_type);

        if (!strncmp(VAR_0->iformat->mime_type, mime_type, len)) {

            uint8_t *options = mime_type + len;

            len = strlen(mime_type);

            while (options < mime_type + len) {

                options = strstr(options, ";");

                if (!options++)

                    break;

                if (!VAR_1)

                    sscanf(options, " VAR_1=%d",     &VAR_1);

                if (!VAR_2)

                    sscanf(options, " VAR_2=%d", &VAR_2);

            }

            if (VAR_1 <= 0) {

                av_log(VAR_0, AV_LOG_ERROR,

                       "Invalid sample_rate found in mime_type \"%VAR_0\"\n",

                       mime_type);


                return AVERROR_INVALIDDATA;

            }

            st->codecpar->sample_rate = VAR_1;

            if (VAR_2 > 0)

                st->codecpar->VAR_2 = VAR_2;

        }

    }




    st->codecpar->bits_per_coded_sample =

        av_get_bits_per_sample(st->codecpar->codec_id);



    av_assert0(st->codecpar->bits_per_coded_sample > 0);



    st->codecpar->block_align =

        st->codecpar->bits_per_coded_sample * st->codecpar->VAR_2 / 8;



    avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);

    return 0;

}
static int FUNC_0(AVFormatContext *VAR_0)
{ PCMAudioDemuxerContext *s1 = VAR_0->priv_data; AVStream *st; uint8_t *mime_type = NULL; st = avformat_new_stream(VAR_0, NULL); if (!st)
return AVERROR(ENOMEM); st->codecpar->codec_type  = AVMEDIA_TYPE_AUDIO; st->codecpar->codec_id    = VAR_0->iformat->raw_codec_id; st->codecpar->sample_rate = s1->sample_rate; st->codecpar->VAR_2    = s1->VAR_2; av_opt_get(VAR_0->pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type); if (mime_type && VAR_0->iformat->mime_type) { int VAR_1 = 0, VAR_2 = 0; size_t len = strlen(VAR_0->iformat->mime_type); if (!strncmp(VAR_0->iformat->mime_type, mime_type, len)) { uint8_t *options = mime_type + len; len = strlen(mime_type); while (options < mime_type + len) { options = strstr(options, ";"); if (!options++)
break; if (!VAR_1)
sscanf(options, " VAR_1=%d",     &VAR_1); if (!VAR_2)
sscanf(options, " VAR_2=%d", &VAR_2); } if (VAR_1 <= 0) { av_log(VAR_0, AV_LOG_ERROR,
"Invalid sample_rate found in mime_type \"%VAR_0\"\n",
mime_type); return AVERROR_INVALIDDATA; } st->codecpar->sample_rate = VAR_1; if (VAR_2 > 0)
st->codecpar->VAR_2 = VAR_2; } } st->codecpar->bits_per_coded_sample =
av_get_bits_per_sample(st->codecpar->codec_id); av_assert0(st->codecpar->bits_per_coded_sample > 0); st->codecpar->block_align =
st->codecpar->bits_per_coded_sample * st->codecpar->VAR_2 / 8; avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); return 0; }