Truly independent web browser
Meta: Backport a fix from upstream FFmpeg's vulkan_decode.c
Zaggy1024c8e231d40009
diff --git a/Meta/CMake/flatpak/org.ladybird.Ladybird.json b/Meta/CMake/flatpak/org.ladybird.Ladybird.jsonindex 2056e131ff8..1d8e5434eb7 100644--- a/Meta/CMake/flatpak/org.ladybird.Ladybird.json+++ b/Meta/CMake/flatpak/org.ladybird.Ladybird.json@@ -631,6 +631,10 @@{"type": "patch","path": "../vcpkg/overlay-ports/ffmpeg/0100-ladybird-symbol-version-nodes.patch"+ },+ {+ "type": "patch",+ "path": "../vcpkg/overlay-ports/ffmpeg/0101-vulkan-decode-dpb-distinct-no-drm-modifiers.patch"}]},diff --git a/Meta/CMake/vcpkg/overlay-ports/ffmpeg/0101-vulkan-decode-dpb-distinct-no-drm-modifiers.patch b/Meta/CMake/vcpkg/overlay-ports/ffmpeg/0101-vulkan-decode-dpb-distinct-no-drm-modifiers.patchnew file mode 100644index 00000000000..8eab2a0c86b--- /dev/null+++ b/Meta/CMake/vcpkg/overlay-ports/ffmpeg/0101-vulkan-decode-dpb-distinct-no-drm-modifiers.patch@@ -0,0 +1,20 @@+diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c+--- a/libavcodec/vulkan_decode.c++++ b/libavcodec/vulkan_decode.c+@@ -1404,12 +1404,12 @@ int ff_vk_decode_init(AVCodecContext *avctx)+ dpb_hwfc = dpb_frames->hwctx;+ void *profile_list = (void *)ff_vk_find_struct(ctx->s.hwfc->create_pnext,+ VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR);+- /* Reference (DPB) images use the same tiling and pNext chain as output.+- * If VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR is 0, the+- * driver does not support separate output and DPB with different layouts/tiling. */++ /* With DPB_AND_OUTPUT_DISTINCT, DPB images never leave the decoder,++ * so they don't need the output's DRM modifiers. */+ void *drm_create_pnext = (void *)ff_vk_find_struct(ctx->s.hwfc->create_pnext,+ VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT);+- if (drm_create_pnext) {++ if (drm_create_pnext &&++ !(ctx->dec_caps.flags & VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR)) {+ dpb_hwfc->create_pnext = drm_create_pnext;+ dpb_hwfc->tiling = VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT;+ av_assert2(ff_vk_find_struct(drm_create_pnext, VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR));diff --git a/Meta/CMake/vcpkg/overlay-ports/ffmpeg/portfile.cmake b/Meta/CMake/vcpkg/overlay-ports/ffmpeg/portfile.cmakeindex 9f1a4470461..85e8280f7d8 100644--- a/Meta/CMake/vcpkg/overlay-ports/ffmpeg/portfile.cmake+++ b/Meta/CMake/vcpkg/overlay-ports/ffmpeg/portfile.cmake@@ -20,6 +20,7 @@ vcpkg_from_github(0051-fix-msvc-undef-flags.patch0052-fix-disable-unstable-swscale-link.patch0100-ladybird-symbol-version-nodes.patch+ 0101-vulkan-decode-dpb-distinct-no-drm-modifiers.patch)if(SOURCE_PATH MATCHES " ")diff --git a/Meta/CMake/vcpkg/overlay-ports/ffmpeg/vcpkg.json b/Meta/CMake/vcpkg/overlay-ports/ffmpeg/vcpkg.jsonindex 512cba382d3..eda4f46aacf 100644--- a/Meta/CMake/vcpkg/overlay-ports/ffmpeg/vcpkg.json+++ b/Meta/CMake/vcpkg/overlay-ports/ffmpeg/vcpkg.json@@ -1,7 +1,7 @@{"name": "ffmpeg","version": "9.0.2",- "port-version": 5,+ "port-version": 6,"description": ["A library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.","FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations."