mirror of https://github.com/mpv-player/mpv
fc8c1fcfb2
This commit fixes a bug where handle for a framebuffer gets double freed. It seems to happen that the same prime fd gets two framebuffers. As the prime fd is the same the resulting prime handle is also the same. This means one handle but 2 framebuffers and can lead to the following chain: 1. The first framebuffer gets deleted the handle gets also freed via the ioctl. 2. In startup phase not all 4 dumb buffers for overlay drawing are set up. It can happen that the last dumb buffer gets the handle we freed above. 3. The second framebuffer gets freed and the handle will be freed again resulting that the 4's dumb buffer handle is not backed by a buffer. 4. Drm prime continues to assign handles to its prime fds an will lead to have this handle which was just freed to reassign again but to an prime buffer. 5.Now the overlay should be drawn into dumb buffer 4 which still has the same handle but is backed by the wrong buffer. This leads to two different behaviors: - MPV crashes as the drm prime buffers size als calculated by the decoder output format. The overlay output format differs and it takes more space. SO the size check in kernel fails. - MPV is continuing play. This happens when the decoders allocates a bigger buffer than needed for the overlay. For example overlay is Full HD and decoder output is 4k. This leads to the behavior das the overlay wil be drawn into the wrong buffer as its a drm prime buffer and results in a flicker every fourth step. |
||
---|---|---|
.. | ||
cocoa | ||
cocoa-cb | ||
d3d11 | ||
gpu | ||
hwdec | ||
opengl | ||
placebo | ||
vulkan | ||
win32 | ||
android_common.c | ||
android_common.h | ||
aspect.c | ||
aspect.h | ||
bitmap_packer.c | ||
bitmap_packer.h | ||
cocoa_cb_common.swift | ||
cocoa_common.h | ||
cocoa_common.m | ||
d3d_shader_420p.h | ||
d3d_shader_yuv.hlsl | ||
dither.c | ||
dither.h | ||
dr_helper.c | ||
dr_helper.h | ||
drm_atomic.c | ||
drm_atomic.h | ||
drm_common.c | ||
drm_common.h | ||
drm_prime.c | ||
drm_prime.h | ||
filter_kernels.c | ||
filter_kernels.h | ||
libmpv.h | ||
vo.c | ||
vo.h | ||
vo_caca.c | ||
vo_direct3d.c | ||
vo_drm.c | ||
vo_gpu.c | ||
vo_image.c | ||
vo_lavc.c | ||
vo_libmpv.c | ||
vo_mediacodec_embed.c | ||
vo_null.c | ||
vo_rpi.c | ||
vo_sdl.c | ||
vo_tct.c | ||
vo_vaapi.c | ||
vo_vdpau.c | ||
vo_wlshm.c | ||
vo_x11.c | ||
vo_xv.c | ||
w32_common.c | ||
w32_common.h | ||
wayland_common.c | ||
wayland_common.h | ||
win_state.c | ||
win_state.h | ||
x11_common.c | ||
x11_common.h |