static int ogg_new_buf(struct ogg *ogg, int idx)

{

    struct ogg_stream *os = ogg->streams + idx;

    uint8_t *nb = av_malloc(os->bufsize);

    int size = os->bufpos - os->pstart;

    if(os->buf){

        memcpy(nb, os->buf + os->pstart, size);

        av_free(os->buf);

    }

    os->buf = nb;

    os->bufpos = size;

    os->pstart = 0;



    return 0;

}

static int ogg_new_buf(struct ogg *ogg, int idx)

{

    struct ogg_stream *os = ogg->streams + idx;

    uint8_t *nb = av_malloc(os->bufsize);

    int size = os->bufpos - os->pstart;

    if(os->buf){

        memcpy(nb, os->buf + os->pstart, size);

        av_free(os->buf);

    }

    os->buf = nb;

    os->bufpos = size;

    os->pstart = 0;



    return 0;

}

    uint8_t *nb = av_malloc(os->bufsize);
static int FUNC_0(struct VAR_0 *VAR_0, int VAR_1)

{

    struct ogg_stream *VAR_2 = VAR_0->streams + VAR_1;

    uint8_t *nb = av_malloc(VAR_2->bufsize);

    int VAR_3 = VAR_2->bufpos - VAR_2->pstart;

    if(VAR_2->buf){

        memcpy(nb, VAR_2->buf + VAR_2->pstart, VAR_3);

        av_free(VAR_2->buf);

    }

    VAR_2->buf = nb;

    VAR_2->bufpos = VAR_3;

    VAR_2->pstart = 0;



    return 0;

}

static int FUNC_0(struct VAR_0 *VAR_0, int VAR_1)
{ struct ogg_stream *VAR_2 = VAR_0->streams + VAR_1; uint8_t *nb = av_malloc(VAR_2->bufsize); int VAR_3 = VAR_2->bufpos - VAR_2->pstart; if(VAR_2->buf){ memcpy(nb, VAR_2->buf + VAR_2->pstart, VAR_3); av_free(VAR_2->buf); } VAR_2->buf = nb; VAR_2->bufpos = VAR_3; VAR_2->pstart = 0; return 0; }