summaryrefslogtreecommitdiff
path: root/avplay.c
diff options
context:
space:
mode:
Diffstat (limited to 'avplay.c')
-rw-r--r--avplay.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/avplay.c b/avplay.c
index a42a0b48b6..ee069b58dd 100644
--- a/avplay.c
+++ b/avplay.c
@@ -1235,10 +1235,7 @@ static void stream_close(VideoState *is)
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);
@@ -1287,9 +1284,7 @@ static void alloc_picture(void *opaque)
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;
@@ -1382,8 +1377,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t
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