int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)

{

    DynBuffer *d = s->opaque;

    int size;

    static const char padbuf[FF_INPUT_BUFFER_PADDING_SIZE] = {0};

    int padding = 0;



    if (!s) {

        *pbuffer = NULL;

        return 0;

    }



    /* don't attempt to pad fixed-size packet buffers */

    if (!s->max_packet_size) {

        avio_write(s, padbuf, sizeof(padbuf));

        padding = FF_INPUT_BUFFER_PADDING_SIZE;

    }



    avio_flush(s);



    *pbuffer = d->buffer;

    size = d->size;

    av_free(d);

    av_free(s);

    return size - padding;

}

int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)

{

    DynBuffer *d = s->opaque;

    int size;

    static const char padbuf[FF_INPUT_BUFFER_PADDING_SIZE] = {0};

    int padding = 0;



    if (!s) {

        *pbuffer = NULL;

        return 0;

    }



    

    if (!s->max_packet_size) {

        avio_write(s, padbuf, sizeof(padbuf));

        padding = FF_INPUT_BUFFER_PADDING_SIZE;

    }



    avio_flush(s);



    *pbuffer = d->buffer;

    size = d->size;

    av_free(d);

    av_free(s);

    return size - padding;

}

    DynBuffer *d = s->opaque;
int FUNC_0(AVIOContext *VAR_0, uint8_t **VAR_1)

{

    DynBuffer *d = VAR_0->opaque;

    int VAR_2;

    static const char VAR_3[FF_INPUT_BUFFER_PADDING_SIZE] = {0};

    int VAR_4 = 0;



    if (!VAR_0) {

        *VAR_1 = NULL;

        return 0;

    }



    

    if (!VAR_0->max_packet_size) {

        avio_write(VAR_0, VAR_3, sizeof(VAR_3));

        VAR_4 = FF_INPUT_BUFFER_PADDING_SIZE;

    }



    avio_flush(VAR_0);



    *VAR_1 = d->buffer;

    VAR_2 = d->VAR_2;

    av_free(d);

    av_free(VAR_0);

    return VAR_2 - VAR_4;

}

int FUNC_0(AVIOContext *VAR_0, uint8_t **VAR_1)
{ DynBuffer *d = VAR_0->opaque; int VAR_2; static const char VAR_3[FF_INPUT_BUFFER_PADDING_SIZE] = {0}; int VAR_4 = 0; if (!VAR_0) { *VAR_1 = NULL; return 0; } if (!VAR_0->max_packet_size) { avio_write(VAR_0, VAR_3, sizeof(VAR_3)); VAR_4 = FF_INPUT_BUFFER_PADDING_SIZE; } avio_flush(VAR_0); *VAR_1 = d->buffer; VAR_2 = d->VAR_2; av_free(d); av_free(VAR_0); return VAR_2 - VAR_4; }