summaryrefslogtreecommitdiff
path: root/libavfilter/vf_tinterlace.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-04-27 22:16:06 +0200
committerStefano Sabatini <stefasab@gmail.com>2012-04-27 22:45:11 +0200
commitcf9f7e40cc8c6fceb79bd3d11eab87b3244f06d7 (patch)
tree945d0073ed6efd1569ede3be83b0fcc530605493 /libavfilter/vf_tinterlace.c
parenta853e88af2cecc5594365b8143e3ac87a3bea331 (diff)
lavfi/tinterlace: use avfilter_unref_bufferp()
Diffstat (limited to 'libavfilter/vf_tinterlace.c')
-rw-r--r--libavfilter/vf_tinterlace.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c
index 9a11fe8fca..ac8350300d 100644
--- a/libavfilter/vf_tinterlace.c
+++ b/libavfilter/vf_tinterlace.c
@@ -82,8 +82,8 @@ static av_cold void uninit(AVFilterContext *ctx)
{
TInterlaceContext *tinterlace = ctx->priv;
- if (tinterlace->cur ) avfilter_unref_buffer(tinterlace->cur );
- if (tinterlace->next) avfilter_unref_buffer(tinterlace->next);
+ if (tinterlace->cur ) avfilter_unref_bufferp(&tinterlace->cur );
+ if (tinterlace->next) avfilter_unref_bufferp(&tinterlace->next);
av_freep(&tinterlace->black_data[0]);
}
@@ -204,15 +204,13 @@ static void end_frame(AVFilterLink *inlink)
next->data, next->linesize,
inlink->format, inlink->w, inlink->h,
FIELD_UPPER_AND_LOWER, 1, FIELD_LOWER);
- avfilter_unref_buffer(tinterlace->next);
- tinterlace->next = NULL;
+ avfilter_unref_bufferp(&tinterlace->next);
break;
case 1: /* only output even frames, odd frames are dropped; height unchanged, half framerate */
case 2: /* only output odd frames, even frames are dropped; height unchanged, half framerate */
out = avfilter_ref_buffer(tinterlace->mode == 2 ? cur : next, AV_PERM_READ);
- avfilter_unref_buffer(tinterlace->next);
- tinterlace->next = NULL;
+ avfilter_unref_bufferp(&tinterlace->next);
break;
case 3: /* expand each frame to double height, but pad alternate
@@ -254,8 +252,7 @@ static void end_frame(AVFilterLink *inlink)
next->data, next->linesize,
inlink->format, inlink->w, inlink->h,
tff ? FIELD_LOWER : FIELD_UPPER, 1, tff ? FIELD_LOWER : FIELD_UPPER);
- avfilter_unref_buffer(tinterlace->next);
- tinterlace->next = NULL;
+ avfilter_unref_bufferp(&tinterlace->next);
break;
}