static int wav_read_header(AVFormatContext *s,

                           AVFormatParameters *ap)

{

    int size;

    unsigned int tag;

    ByteIOContext *pb = s->pb;

    AVStream *st;

    WAVContext *wav = s->priv_data;



    /* check RIFF header */

    tag = get_le32(pb);



    if (tag != MKTAG('R', 'I', 'F', 'F'))

        return -1;

    get_le32(pb); /* file size */

    tag = get_le32(pb);

    if (tag != MKTAG('W', 'A', 'V', 'E'))

        return -1;



    /* parse fmt header */

    size = find_tag(pb, MKTAG('f', 'm', 't', ' '));

    if (size < 0)

        return -1;

    st = av_new_stream(s, 0);

    if (!st)

        return AVERROR(ENOMEM);



    get_wav_header(pb, st->codec, size);

    st->need_parsing = AVSTREAM_PARSE_FULL;



    av_set_pts_info(st, 64, 1, st->codec->sample_rate);



    size = find_tag(pb, MKTAG('d', 'a', 't', 'a'));

    if (size < 0)

        return -1;

    wav->data_end= url_ftell(pb) + size;

    return 0;

}

static int wav_read_header(AVFormatContext *s,

                           AVFormatParameters *ap)

{

    int size;

    unsigned int tag;

    ByteIOContext *pb = s->pb;

    AVStream *st;

    WAVContext *wav = s->priv_data;



    

    tag = get_le32(pb);



    if (tag != MKTAG('R', 'I', 'F', 'F'))

        return -1;

    get_le32(pb); 

    tag = get_le32(pb);

    if (tag != MKTAG('W', 'A', 'V', 'E'))

        return -1;



    

    size = find_tag(pb, MKTAG('f', 'm', 't', ' '));

    if (size < 0)

        return -1;

    st = av_new_stream(s, 0);

    if (!st)

        return AVERROR(ENOMEM);



    get_wav_header(pb, st->codec, size);

    st->need_parsing = AVSTREAM_PARSE_FULL;



    av_set_pts_info(st, 64, 1, st->codec->sample_rate);



    size = find_tag(pb, MKTAG('d', 'a', 't', 'a'));

    if (size < 0)

        return -1;

    wav->data_end= url_ftell(pb) + size;

    return 0;

}

    int size;     if (size < 0)     int size;
static int FUNC_0(AVFormatContext *VAR_0,

                           AVFormatParameters *VAR_1)

{

    int VAR_2;

    unsigned int VAR_3;

    ByteIOContext *pb = VAR_0->pb;

    AVStream *st;

    WAVContext *wav = VAR_0->priv_data;



    

    VAR_3 = get_le32(pb);



    if (VAR_3 != MKTAG('R', 'I', 'F', 'F'))

        return -1;

    get_le32(pb); 

    VAR_3 = get_le32(pb);

    if (VAR_3 != MKTAG('W', 'A', 'V', 'E'))

        return -1;



    

    VAR_2 = find_tag(pb, MKTAG('f', 'm', 't', ' '));

    if (VAR_2 < 0)

        return -1;

    st = av_new_stream(VAR_0, 0);

    if (!st)

        return AVERROR(ENOMEM);



    get_wav_header(pb, st->codec, VAR_2);

    st->need_parsing = AVSTREAM_PARSE_FULL;



    av_set_pts_info(st, 64, 1, st->codec->sample_rate);



    VAR_2 = find_tag(pb, MKTAG('d', 'a', 't', 'a'));

    if (VAR_2 < 0)

        return -1;

    wav->data_end= url_ftell(pb) + VAR_2;

    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0,
AVFormatParameters *VAR_1)
{ int VAR_2; unsigned int VAR_3; ByteIOContext *pb = VAR_0->pb; AVStream *st; WAVContext *wav = VAR_0->priv_data; VAR_3 = get_le32(pb); if (VAR_3 != MKTAG('R', 'I', 'F', 'F'))
return -1; get_le32(pb); VAR_3 = get_le32(pb); if (VAR_3 != MKTAG('W', 'A', 'V', 'E'))
return -1; VAR_2 = find_tag(pb, MKTAG('f', 'm', 't', ' ')); if (VAR_2 < 0)
return -1; st = av_new_stream(VAR_0, 0); if (!st)
return AVERROR(ENOMEM); get_wav_header(pb, st->codec, VAR_2); st->need_parsing = AVSTREAM_PARSE_FULL; av_set_pts_info(st, 64, 1, st->codec->sample_rate); VAR_2 = find_tag(pb, MKTAG('d', 'a', 't', 'a')); if (VAR_2 < 0)
return -1; wav->data_end= url_ftell(pb) + VAR_2; return 0; }