for (i = 0; i < VIDEO_PICTURE_QUEUE_SIZE; i++) {
vp = &is->pictq[i];
#if CONFIG_AVFILTER
- if (vp->picref) {
- avfilter_unref_buffer(vp->picref);
- vp->picref = NULL;
- }
+ avfilter_unref_bufferp(&vp->picref);
#endif
if (vp->bmp) {
SDL_FreeYUVOverlay(vp->bmp);
SDL_FreeYUVOverlay(vp->bmp);
#if CONFIG_AVFILTER
- if (vp->picref)
- avfilter_unref_buffer(vp->picref);
- vp->picref = NULL;
+ avfilter_unref_bufferp(&vp->picref);
vp->width = is->out_video_filter->inputs[0]->w;
vp->height = is->out_video_filter->inputs[0]->h;
if (vp->bmp) {
AVPicture pict = { { 0 } };
#if CONFIG_AVFILTER
- if (vp->picref)
- avfilter_unref_buffer(vp->picref);
+ avfilter_unref_bufferp(&vp->picref);
vp->picref = src_frame->opaque;
#endif
for (i = 0; i < ctx->nb_inputs; i++) {
av_freep(&ctx->input_pads[i].name);
- avfilter_unref_buffer(s->input_frames[i]);
+ avfilter_unref_bufferp(&s->input_frames[i]);
}
av_freep(&s->channels);
int i;
for (i = 0; i < priv->nb_in_buffers; i++)
- avfilter_unref_buffer(priv->in_buffers[i]);
+ avfilter_unref_bufferp(&priv->in_buffers[i]);
av_freep(&priv->in_buffers);
av_freep(&buf->priv);
for (buf = fifo->root.next; buf; buf = tmp) {
tmp = buf->next;
- avfilter_unref_buffer(buf->buf);
+ avfilter_unref_bufferp(&buf->buf);
av_free(buf);
}
- avfilter_unref_buffer(fifo->buf_out);
+ avfilter_unref_bufferp(&fifo->buf_out);
}
static int add_to_queue(AVFilterLink *inlink, AVFilterBufferRef *buf)
{
OverlayContext *over = ctx->priv;
- if (over->overpicref)
- avfilter_unref_buffer(over->overpicref);
+ avfilter_unref_bufferp(&over->overpicref);
}
static int query_formats(AVFilterContext *ctx)
if (yadif->auto_enable && !yadif->cur->video->interlaced) {
yadif->out = avfilter_ref_buffer(yadif->cur, AV_PERM_READ);
- avfilter_unref_buffer(yadif->prev);
- yadif->prev = NULL;
+ avfilter_unref_bufferp(&yadif->prev);
if (yadif->out->pts != AV_NOPTS_VALUE)
yadif->out->pts *= 2;
return ff_start_frame(ctx->outputs[0], yadif->out);
{
YADIFContext *yadif = ctx->priv;
- if (yadif->prev) avfilter_unref_buffer(yadif->prev);
- if (yadif->cur ) avfilter_unref_buffer(yadif->cur );
- if (yadif->next) avfilter_unref_buffer(yadif->next);
+ if (yadif->prev) avfilter_unref_bufferp(&yadif->prev);
+ if (yadif->cur ) avfilter_unref_bufferp(&yadif->cur );
+ if (yadif->next) avfilter_unref_bufferp(&yadif->next);
}
static int query_formats(AVFilterContext *ctx)
ret = ff_end_frame(outlink);
fail:
- avfilter_unref_buffer(movie->picref);
- movie->picref = NULL;
+ avfilter_unref_bufferp(&movie->picref);
return ret;
}