static int epaf_read_header(AVFormatContext *s)

{

    int le, sample_rate, codec, channels;

    AVStream *st;



    avio_skip(s->pb, 4);

    if (avio_rl32(s->pb))

        return AVERROR_INVALIDDATA;



    le = avio_rl32(s->pb);

    if (le && le != 1)

        return AVERROR_INVALIDDATA;



    if (le) {

        sample_rate = avio_rl32(s->pb);

        codec       = avio_rl32(s->pb);

        channels    = avio_rl32(s->pb);

    } else {

        sample_rate = avio_rb32(s->pb);

        codec       = avio_rb32(s->pb);

        channels    = avio_rb32(s->pb);

    }



    if (!channels || !sample_rate)

        return AVERROR_INVALIDDATA;



    st = avformat_new_stream(s, NULL);

    if (!st)

        return AVERROR(ENOMEM);



    st->codecpar->codec_type  = AVMEDIA_TYPE_AUDIO;

    st->codecpar->channels    = channels;

    st->codecpar->sample_rate = sample_rate;

    switch (codec) {

    case 0:

        st->codecpar->codec_id = le ? AV_CODEC_ID_PCM_S16LE : AV_CODEC_ID_PCM_S16BE;

        break;

    case 2:

        st->codecpar->codec_id = AV_CODEC_ID_PCM_S8;

        break;

    case 1:

        avpriv_request_sample(s, "24-bit Paris PCM format");

    default:

        return AVERROR_INVALIDDATA;

    }



    st->codecpar->bits_per_coded_sample = av_get_bits_per_sample(st->codecpar->codec_id);

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



    if (avio_skip(s->pb, 2024) < 0)

        return AVERROR_INVALIDDATA;

    return 0;

}

static int epaf_read_header(AVFormatContext *s)

{

    int le, sample_rate, codec, channels;

    AVStream *st;



    avio_skip(s->pb, 4);

    if (avio_rl32(s->pb))

        return AVERROR_INVALIDDATA;



    le = avio_rl32(s->pb);

    if (le && le != 1)

        return AVERROR_INVALIDDATA;



    if (le) {

        sample_rate = avio_rl32(s->pb);

        codec       = avio_rl32(s->pb);

        channels    = avio_rl32(s->pb);

    } else {

        sample_rate = avio_rb32(s->pb);

        codec       = avio_rb32(s->pb);

        channels    = avio_rb32(s->pb);

    }



    if (!channels || !sample_rate)

        return AVERROR_INVALIDDATA;



    st = avformat_new_stream(s, NULL);

    if (!st)

        return AVERROR(ENOMEM);



    st->codecpar->codec_type  = AVMEDIA_TYPE_AUDIO;

    st->codecpar->channels    = channels;

    st->codecpar->sample_rate = sample_rate;

    switch (codec) {

    case 0:

        st->codecpar->codec_id = le ? AV_CODEC_ID_PCM_S16LE : AV_CODEC_ID_PCM_S16BE;

        break;

    case 2:

        st->codecpar->codec_id = AV_CODEC_ID_PCM_S8;

        break;

    case 1:

        avpriv_request_sample(s, "24-bit Paris PCM format");

    default:

        return AVERROR_INVALIDDATA;

    }



    st->codecpar->bits_per_coded_sample = av_get_bits_per_sample(st->codecpar->codec_id);

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



    if (avio_skip(s->pb, 2024) < 0)

        return AVERROR_INVALIDDATA;

    return 0;

}

    if (!channels || !sample_rate)
static int FUNC_0(AVFormatContext *VAR_0)

{

    int VAR_1, VAR_2, VAR_3, VAR_4;

    AVStream *st;



    avio_skip(VAR_0->pb, 4);

    if (avio_rl32(VAR_0->pb))

        return AVERROR_INVALIDDATA;



    VAR_1 = avio_rl32(VAR_0->pb);

    if (VAR_1 && VAR_1 != 1)

        return AVERROR_INVALIDDATA;



    if (VAR_1) {

        VAR_2 = avio_rl32(VAR_0->pb);

        VAR_3       = avio_rl32(VAR_0->pb);

        VAR_4    = avio_rl32(VAR_0->pb);

    } else {

        VAR_2 = avio_rb32(VAR_0->pb);

        VAR_3       = avio_rb32(VAR_0->pb);

        VAR_4    = avio_rb32(VAR_0->pb);

    }



    if (!VAR_4 || !VAR_2)

        return AVERROR_INVALIDDATA;



    st = avformat_new_stream(VAR_0, NULL);

    if (!st)

        return AVERROR(ENOMEM);



    st->codecpar->codec_type  = AVMEDIA_TYPE_AUDIO;

    st->codecpar->VAR_4    = VAR_4;

    st->codecpar->VAR_2 = VAR_2;

    switch (VAR_3) {

    case 0:

        st->codecpar->codec_id = VAR_1 ? AV_CODEC_ID_PCM_S16LE : AV_CODEC_ID_PCM_S16BE;

        break;

    case 2:

        st->codecpar->codec_id = AV_CODEC_ID_PCM_S8;

        break;

    case 1:

        avpriv_request_sample(VAR_0, "24-bit Paris PCM format");

    default:

        return AVERROR_INVALIDDATA;

    }



    st->codecpar->bits_per_coded_sample = av_get_bits_per_sample(st->codecpar->codec_id);

    st->codecpar->block_align = st->codecpar->bits_per_coded_sample * st->codecpar->VAR_4 / 8;



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



    if (avio_skip(VAR_0->pb, 2024) < 0)

        return AVERROR_INVALIDDATA;

    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0)
{ int VAR_1, VAR_2, VAR_3, VAR_4; AVStream *st; avio_skip(VAR_0->pb, 4); if (avio_rl32(VAR_0->pb))
return AVERROR_INVALIDDATA; VAR_1 = avio_rl32(VAR_0->pb); if (VAR_1 && VAR_1 != 1)
return AVERROR_INVALIDDATA; if (VAR_1) { VAR_2 = avio_rl32(VAR_0->pb); VAR_3       = avio_rl32(VAR_0->pb); VAR_4    = avio_rl32(VAR_0->pb); } else { VAR_2 = avio_rb32(VAR_0->pb); VAR_3       = avio_rb32(VAR_0->pb); VAR_4    = avio_rb32(VAR_0->pb); } if (!VAR_4 || !VAR_2)
return AVERROR_INVALIDDATA; st = avformat_new_stream(VAR_0, NULL); if (!st)
return AVERROR(ENOMEM); st->codecpar->codec_type  = AVMEDIA_TYPE_AUDIO; st->codecpar->VAR_4    = VAR_4; st->codecpar->VAR_2 = VAR_2; switch (VAR_3) { case 0:
st->codecpar->codec_id = VAR_1 ? AV_CODEC_ID_PCM_S16LE : AV_CODEC_ID_PCM_S16BE; break; case 2:
st->codecpar->codec_id = AV_CODEC_ID_PCM_S8; break; case 1:
avpriv_request_sample(VAR_0, "24-bit Paris PCM format"); default:
return AVERROR_INVALIDDATA; } st->codecpar->bits_per_coded_sample = av_get_bits_per_sample(st->codecpar->codec_id); st->codecpar->block_align = st->codecpar->bits_per_coded_sample * st->codecpar->VAR_4 / 8; avpriv_set_pts_info(st, 64, 1, st->codecpar->VAR_2); if (avio_skip(VAR_0->pb, 2024) < 0)
return AVERROR_INVALIDDATA; return 0; }