static int xa_read_packet(AVFormatContext *s,

                          AVPacket *pkt)

{

    MaxisXADemuxContext *xa = s->priv_data;

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

    ByteIOContext *pb = s->pb;

    unsigned int packet_size;

    int ret;



    if(xa->sent_bytes > xa->out_size)

        return AVERROR(EIO);

    /* 1 byte header and 14 bytes worth of samples * number channels per block */

    packet_size = 15*st->codec->channels;



    ret = av_get_packet(pb, pkt, packet_size);

    if(ret != packet_size)

        return AVERROR(EIO);



    pkt->stream_index = st->index;

    xa->sent_bytes += packet_size;

    pkt->pts = xa->audio_frame_counter;

    /* 14 bytes Samples per channel with 2 samples per byte */

    xa->audio_frame_counter += 28 * st->codec->channels;



    return ret;

}

static int xa_read_packet(AVFormatContext *s,

                          AVPacket *pkt)

{

    MaxisXADemuxContext *xa = s->priv_data;

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

    ByteIOContext *pb = s->pb;

    unsigned int packet_size;

    int ret;



    if(xa->sent_bytes > xa->out_size)

        return AVERROR(EIO);

    

    packet_size = 15*st->codec->channels;



    ret = av_get_packet(pb, pkt, packet_size);

    if(ret != packet_size)

        return AVERROR(EIO);



    pkt->stream_index = st->index;

    xa->sent_bytes += packet_size;

    pkt->pts = xa->audio_frame_counter;

    

    xa->audio_frame_counter += 28 * st->codec->channels;



    return ret;

}

    if(ret != packet_size)         return AVERROR(EIO);
static int FUNC_0(AVFormatContext *VAR_0,

                          AVPacket *VAR_1)

{

    MaxisXADemuxContext *xa = VAR_0->priv_data;

    AVStream *st = VAR_0->streams[0];

    ByteIOContext *pb = VAR_0->pb;

    unsigned int VAR_2;

    int VAR_3;



    if(xa->sent_bytes > xa->out_size)

        return AVERROR(EIO);

    

    VAR_2 = 15*st->codec->channels;



    VAR_3 = av_get_packet(pb, VAR_1, VAR_2);

    if(VAR_3 != VAR_2)

        return AVERROR(EIO);



    VAR_1->stream_index = st->index;

    xa->sent_bytes += VAR_2;

    VAR_1->pts = xa->audio_frame_counter;

    

    xa->audio_frame_counter += 28 * st->codec->channels;



    return VAR_3;

}

static int FUNC_0(AVFormatContext *VAR_0,
AVPacket *VAR_1)
{ MaxisXADemuxContext *xa = VAR_0->priv_data; AVStream *st = VAR_0->streams[0]; ByteIOContext *pb = VAR_0->pb; unsigned int VAR_2; int VAR_3; if(xa->sent_bytes > xa->out_size)
return AVERROR(EIO); VAR_2 = 15*st->codec->channels; VAR_3 = av_get_packet(pb, VAR_1, VAR_2); if(VAR_3 != VAR_2)
return AVERROR(EIO); VAR_1->stream_index = st->index; xa->sent_bytes += VAR_2; VAR_1->pts = xa->audio_frame_counter; xa->audio_frame_counter += 28 * st->codec->channels; return VAR_3; }