void fifo_realloc(FifoBuffer *f, int new_size){

    int old_size= f->end - f->buffer;

    

    if(old_size < new_size){

        uint8_t *old= f->buffer;



        f->buffer= av_realloc(f->buffer, new_size);



        f->rptr += f->buffer - old;

        f->wptr += f->buffer - old;



        if(f->wptr < f->rptr){

            memmove(f->rptr + new_size - old_size, f->rptr, f->buffer + old_size - f->rptr);

            f->rptr += new_size - old_size;

        }

        f->end= f->buffer + new_size;

    }

}

void fifo_realloc(FifoBuffer *f, int new_size){

    int old_size= f->end - f->buffer;

    

    if(old_size < new_size){

        uint8_t *old= f->buffer;



        f->buffer= av_realloc(f->buffer, new_size);



        f->rptr += f->buffer - old;

        f->wptr += f->buffer - old;



        if(f->wptr < f->rptr){

            memmove(f->rptr + new_size - old_size, f->rptr, f->buffer + old_size - f->rptr);

            f->rptr += new_size - old_size;

        }

        f->end= f->buffer + new_size;

    }

}

void fifo_realloc(FifoBuffer *f, int new_size){     int old_size= f->end - f->buffer;
void FUNC_0(FifoBuffer *VAR_0, int VAR_1){

    int VAR_2= VAR_0->end - VAR_0->buffer;

    

    if(VAR_2 < VAR_1){

        uint8_t *old= VAR_0->buffer;



        VAR_0->buffer= av_realloc(VAR_0->buffer, VAR_1);



        VAR_0->rptr += VAR_0->buffer - old;

        VAR_0->wptr += VAR_0->buffer - old;



        if(VAR_0->wptr < VAR_0->rptr){

            memmove(VAR_0->rptr + VAR_1 - VAR_2, VAR_0->rptr, VAR_0->buffer + VAR_2 - VAR_0->rptr);

            VAR_0->rptr += VAR_1 - VAR_2;

        }

        VAR_0->end= VAR_0->buffer + VAR_1;

    }

}

void FUNC_0(FifoBuffer *VAR_0, int VAR_1){ int VAR_2= VAR_0->end - VAR_0->buffer; if(VAR_2 < VAR_1){ uint8_t *old= VAR_0->buffer; VAR_0->buffer= av_realloc(VAR_0->buffer, VAR_1); VAR_0->rptr += VAR_0->buffer - old; VAR_0->wptr += VAR_0->buffer - old; if(VAR_0->wptr < VAR_0->rptr){ memmove(VAR_0->rptr + VAR_1 - VAR_2, VAR_0->rptr, VAR_0->buffer + VAR_2 - VAR_0->rptr); VAR_0->rptr += VAR_1 - VAR_2; } VAR_0->end= VAR_0->buffer + VAR_1; } }