static int pcm_read_packet(AVFormatContext *s, AVPacket *pkt)

{

    int ret, size, bps;

    //    AVStream *st = s->streams[0];



    size= RAW_SAMPLES*s->streams[0]->codec->block_align;



    ret= av_get_packet(s->pb, pkt, size);



    pkt->stream_index = 0;

    if (ret < 0)

        return ret;



    bps= av_get_bits_per_sample(s->streams[0]->codec->codec_id);

    assert(bps); // if false there IS a bug elsewhere (NOT in this function)

    pkt->dts=

    pkt->pts= pkt->pos*8 / (bps * s->streams[0]->codec->channels);



    return ret;

}

static int pcm_read_packet(AVFormatContext *s, AVPacket *pkt)

{

    int ret, size, bps;

    



    size= RAW_SAMPLES*s->streams[0]->codec->block_align;



    ret= av_get_packet(s->pb, pkt, size);



    pkt->stream_index = 0;

    if (ret < 0)

        return ret;



    bps= av_get_bits_per_sample(s->streams[0]->codec->codec_id);

    assert(bps); 

    pkt->dts=

    pkt->pts= pkt->pos*8 / (bps * s->streams[0]->codec->channels);



    return ret;

}

static int FUNC_0(AVFormatContext *VAR_0, AVPacket *VAR_1)

{

    int VAR_2, VAR_3, VAR_4;

    



    VAR_3= RAW_SAMPLES*VAR_0->streams[0]->codec->block_align;



    VAR_2= av_get_packet(VAR_0->pb, VAR_1, VAR_3);



    VAR_1->stream_index = 0;

    if (VAR_2 < 0)

        return VAR_2;



    VAR_4= av_get_bits_per_sample(VAR_0->streams[0]->codec->codec_id);

    assert(VAR_4); 

    VAR_1->dts=

    VAR_1->pts= VAR_1->pos*8 / (VAR_4 * VAR_0->streams[0]->codec->channels);



    return VAR_2;

}

static int FUNC_0(AVFormatContext *VAR_0, AVPacket *VAR_1)
{ int VAR_2, VAR_3, VAR_4; VAR_3= RAW_SAMPLES*VAR_0->streams[0]->codec->block_align; VAR_2= av_get_packet(VAR_0->pb, VAR_1, VAR_3); VAR_1->stream_index = 0; if (VAR_2 < 0)
return VAR_2; VAR_4= av_get_bits_per_sample(VAR_0->streams[0]->codec->codec_id); assert(VAR_4); VAR_1->dts=
VAR_1->pts= VAR_1->pos*8 / (VAR_4 * VAR_0->streams[0]->codec->channels); return VAR_2; }