diff options
author | LongChair <longchair@hotmail.com> | 2018-03-04 19:01:48 +0100 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2018-03-05 23:33:45 -0800 |
commit | dae88644e62db3ca8ef96fa204d9a2ad924b5b28 (patch) | |
tree | 57ab5877b48bd1a168a61b8618a1dab42aba7c7e /video | |
parent | ca2c5c26d54fdcfa1ca3e921e6cf0bfa21110af3 (diff) | |
download | mpv-dae88644e62db3ca8ef96fa204d9a2ad924b5b28.tar.bz2 mpv-dae88644e62db3ca8ef96fa204d9a2ad924b5b28.tar.xz |
hwdec_drmprime_drm: Fix a DRM buffer memory leakage
We use triple buffering for this interop and we were only unreffing the
data structures, which doesn't destroy the drm buffers.
This patch allows to make sure that we release the drm buffers on
playback end.
Diffstat (limited to 'video')
-rw-r--r-- | video/out/opengl/hwdec_drmprime_drm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/video/out/opengl/hwdec_drmprime_drm.c b/video/out/opengl/hwdec_drmprime_drm.c index 69e9d1eb00..b1d5e98c1f 100644 --- a/video/out/opengl/hwdec_drmprime_drm.c +++ b/video/out/opengl/hwdec_drmprime_drm.c @@ -83,8 +83,6 @@ static void set_current_frame(struct ra_hwdec *hw, struct drm_frame *frame) } else { memset(&p->current_frame.fb, 0, sizeof(p->current_frame.fb)); mp_image_setrefp(&p->current_frame.image, NULL); - mp_image_setrefp(&p->last_frame.image, NULL); - mp_image_setrefp(&p->old_frame.image, NULL); } } @@ -180,6 +178,9 @@ static int overlay_frame(struct ra_hwdec *hw, struct mp_image *hw_image, } } } + } else { + while (p->old_frame.fb.fb_id) + set_current_frame(hw, NULL); } set_current_frame(hw, &next_frame); |