Commit 7877b50d authored by Stefano Sabatini's avatar Stefano Sabatini

ffplay: simplify code by using avfilter_unref_bufferp()

parent b0fdd348
...@@ -908,10 +908,7 @@ static void stream_close(VideoState *is) ...@@ -908,10 +908,7 @@ static void stream_close(VideoState *is)
for (i = 0; i < VIDEO_PICTURE_QUEUE_SIZE; i++) { for (i = 0; i < VIDEO_PICTURE_QUEUE_SIZE; i++) {
vp = &is->pictq[i]; vp = &is->pictq[i];
#if CONFIG_AVFILTER #if CONFIG_AVFILTER
if (vp->picref) { avfilter_unref_bufferp(&vp->picref);
avfilter_unref_buffer(vp->picref);
vp->picref = NULL;
}
#endif #endif
if (vp->bmp) { if (vp->bmp) {
SDL_FreeYUVOverlay(vp->bmp); SDL_FreeYUVOverlay(vp->bmp);
...@@ -1317,9 +1314,7 @@ static void alloc_picture(AllocEventProps *event_props) ...@@ -1317,9 +1314,7 @@ static void alloc_picture(AllocEventProps *event_props)
SDL_FreeYUVOverlay(vp->bmp); SDL_FreeYUVOverlay(vp->bmp);
#if CONFIG_AVFILTER #if CONFIG_AVFILTER
if (vp->picref) avfilter_unref_bufferp(&vp->picref);
avfilter_unref_buffer(vp->picref);
vp->picref = NULL;
#endif #endif
vp->width = frame->width; vp->width = frame->width;
...@@ -1425,8 +1420,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts1, int64_ ...@@ -1425,8 +1420,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts1, int64_
if (vp->bmp) { if (vp->bmp) {
AVPicture pict = { { 0 } }; AVPicture pict = { { 0 } };
#if CONFIG_AVFILTER #if CONFIG_AVFILTER
if (vp->picref) avfilter_unref_bufferp(&vp->picref);
avfilter_unref_buffer(vp->picref);
vp->picref = src_frame->opaque; vp->picref = src_frame->opaque;
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment