void avfilter_unref_buffer(AVFilterBufferRef *ref)
{
    if (!ref)
        return;
    if (!(--ref->buf->refcount))
        ref->buf->free(ref->buf);
    if (ref->extended_data != ref->data)
        av_freep(&ref->extended_data);
    av_free(ref->video);
    av_free(ref->audio);
    av_free(ref);
}
['static int color_request_frame(AVFilterLink *link)\n{\n    ColorContext *color = link->src->priv;\n    AVFilterBufferRef *picref = ff_get_video_buffer(link, AV_PERM_WRITE, color->w, color->h);\n    picref->video->pixel_aspect = (AVRational) {1, 1};\n    picref->pts                 = color->pts++;\n    picref->pos                 = -1;\n    ff_start_frame(link, avfilter_ref_buffer(picref, ~0));\n    ff_draw_rectangle(picref->data, picref->linesize,\n                      color->line, color->line_step, color->hsub, color->vsub,\n                      0, 0, color->w, color->h);\n    ff_draw_slice(link, 0, color->h, 1);\n    ff_end_frame(link);\n    avfilter_unref_buffer(picref);\n    return 0;\n}', 'void ff_end_frame(AVFilterLink *link)\n{\n    void (*end_frame)(AVFilterLink *);\n    if (!(end_frame = link->dstpad->end_frame))\n        end_frame = default_end_frame;\n    end_frame(link);\n    if (link->src_buf) {\n        avfilter_unref_buffer(link->src_buf);\n        link->src_buf = NULL;\n    }\n    avfilter_unref_bufferp(&link->cur_buf);\n}', 'void avfilter_unref_bufferp(AVFilterBufferRef **ref)\n{\n    avfilter_unref_buffer(*ref);\n    *ref = NULL;\n}', 'void avfilter_unref_buffer(AVFilterBufferRef *ref)\n{\n    if (!ref)\n        return;\n    if (!(--ref->buf->refcount))\n        ref->buf->free(ref->buf);\n    if (ref->extended_data != ref->data)\n        av_freep(&ref->extended_data);\n    av_free(ref->video);\n    av_free(ref->audio);\n    av_free(ref);\n}']