static int seq_fill_buffer(SeqDemuxContext *seq, ByteIOContext *pb, int buffer_num, unsigned int data_offs, int data_size)

{

    TiertexSeqFrameBuffer *seq_buffer;



    if (buffer_num >= SEQ_NUM_FRAME_BUFFERS)

        return AVERROR_INVALIDDATA;



    seq_buffer = &seq->frame_buffers[buffer_num];

    if (seq_buffer->fill_size + data_size > seq_buffer->data_size)

        return AVERROR_INVALIDDATA;



    url_fseek(pb, seq->current_frame_offs + data_offs, SEEK_SET);

    if (get_buffer(pb, seq_buffer->data + seq_buffer->fill_size, data_size) != data_size)

        return AVERROR(EIO);



    seq_buffer->fill_size += data_size;

    return 0;

}

static int seq_fill_buffer(SeqDemuxContext *seq, ByteIOContext *pb, int buffer_num, unsigned int data_offs, int data_size)

{

    TiertexSeqFrameBuffer *seq_buffer;



    if (buffer_num >= SEQ_NUM_FRAME_BUFFERS)

        return AVERROR_INVALIDDATA;



    seq_buffer = &seq->frame_buffers[buffer_num];

    if (seq_buffer->fill_size + data_size > seq_buffer->data_size)

        return AVERROR_INVALIDDATA;



    url_fseek(pb, seq->current_frame_offs + data_offs, SEEK_SET);

    if (get_buffer(pb, seq_buffer->data + seq_buffer->fill_size, data_size) != data_size)

        return AVERROR(EIO);



    seq_buffer->fill_size += data_size;

    return 0;

}

static int FUNC_0(SeqDemuxContext *VAR_0, ByteIOContext *VAR_1, int VAR_2, unsigned int VAR_3, int VAR_4)

{

    TiertexSeqFrameBuffer *seq_buffer;



    if (VAR_2 >= SEQ_NUM_FRAME_BUFFERS)

        return AVERROR_INVALIDDATA;



    seq_buffer = &VAR_0->frame_buffers[VAR_2];

    if (seq_buffer->fill_size + VAR_4 > seq_buffer->VAR_4)

        return AVERROR_INVALIDDATA;



    url_fseek(VAR_1, VAR_0->current_frame_offs + VAR_3, SEEK_SET);

    if (get_buffer(VAR_1, seq_buffer->data + seq_buffer->fill_size, VAR_4) != VAR_4)

        return AVERROR(EIO);



    seq_buffer->fill_size += VAR_4;

    return 0;

}

static int FUNC_0(SeqDemuxContext *VAR_0, ByteIOContext *VAR_1, int VAR_2, unsigned int VAR_3, int VAR_4)
{ TiertexSeqFrameBuffer *seq_buffer; if (VAR_2 >= SEQ_NUM_FRAME_BUFFERS)
return AVERROR_INVALIDDATA; seq_buffer = &VAR_0->frame_buffers[VAR_2]; if (seq_buffer->fill_size + VAR_4 > seq_buffer->VAR_4)
return AVERROR_INVALIDDATA; url_fseek(VAR_1, VAR_0->current_frame_offs + VAR_3, SEEK_SET); if (get_buffer(VAR_1, seq_buffer->data + seq_buffer->fill_size, VAR_4) != VAR_4)
return AVERROR(EIO); seq_buffer->fill_size += VAR_4; return 0; }