aboutsummaryrefslogtreecommitdiffstats
path: root/ffplay.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-06-26 15:17:24 +0200
committerStefano Sabatini <stefasab@gmail.com>2012-06-28 22:27:05 +0200
commit7877b50d181be1e044eb8b57f203c763297651b1 (patch)
treecba7ac453ae6eb348d9510fc001864d3afb7ca61 /ffplay.c
parentb0fdd3489a6f5e63ee494245bb34eccf138b17d3 (diff)
downloadffmpeg-7877b50d181be1e044eb8b57f203c763297651b1.tar.gz
ffplay: simplify code by using avfilter_unref_bufferp()
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/ffplay.c b/ffplay.c
index c4b8f8e746..ab4eae5f6d 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -908,10 +908,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);
@@ -1317,9 +1314,7 @@ static void alloc_picture(AllocEventProps *event_props)
SDL_FreeYUVOverlay(vp->bmp);
#if CONFIG_AVFILTER
- if (vp->picref)
- avfilter_unref_buffer(vp->picref);
- vp->picref = NULL;
+ avfilter_unref_bufferp(&vp->picref);
#endif
vp->width = frame->width;
@@ -1425,8 +1420,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts1, int64_
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