- AVFilterBufferRef *inpicref = inlink->cur_buf;
- AVFilterBufferRef *outpicref = outlink->out_buf;
- int ret;
-
- frei0r->update(frei0r->instance, inpicref->pts * av_q2d(inlink->time_base) * 1000,
- (const uint32_t *)inpicref->data[0],
- (uint32_t *)outpicref->data[0]);
- if ((ret = ff_draw_slice(outlink, 0, outlink->h, 1)) ||
- (ret = ff_end_frame(outlink)) < 0)
- return ret;
- return 0;
+ AVFilterBufferRef *out;
+
+ out = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
+ if (!out) {
+ avfilter_unref_bufferp(&in);
+ return AVERROR(ENOMEM);
+ }
+ avfilter_copy_buffer_ref_props(out, in);
+
+ frei0r->update(frei0r->instance, in->pts * av_q2d(inlink->time_base) * 1000,
+ (const uint32_t *)in->data[0],
+ (uint32_t *)out->data[0]);
+
+ avfilter_unref_bufferp(&in);
+
+ return ff_filter_frame(outlink, out);