File: load-encoder-plugins.patch

package info (click to toggle)
libheif 1.20.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,572 kB
  • sloc: cpp: 83,285; python: 3,032; sh: 952; ansic: 453; javascript: 160; makefile: 76
file content (32 lines) | stat: -rw-r--r-- 1,319 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 1bf5e6509030a048cc044def155e06703324e1f6 Mon Sep 17 00:00:00 2001
From: Joachim Bauch <bauch@struktur.de>
Date: Mon, 28 Jul 2025 11:25:57 +0200
Subject: [PATCH] Load plugins in "get_filtered_encoder_descriptors".
Forwarded: https://github.com/strukturag/libheif/pull/1563

---
 libheif/plugin_registry.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libheif/plugin_registry.cc b/libheif/plugin_registry.cc
index 3c3b59e980..863cfabe0d 100644
--- a/libheif/plugin_registry.cc
+++ b/libheif/plugin_registry.cc
@@ -273,8 +273,6 @@ void register_encoder(const heif_encoder_plugin* encoder_plugin)
 
 const struct heif_encoder_plugin* get_encoder(enum heif_compression_format type)
 {
-  load_plugins_if_not_initialized_yet();
-
   auto filtered_encoder_descriptors = get_filtered_encoder_descriptors(type, nullptr);
   if (filtered_encoder_descriptors.size() > 0) {
     return filtered_encoder_descriptors[0]->plugin;
@@ -289,6 +287,8 @@ std::vector<const struct heif_encoder_descriptor*>
 get_filtered_encoder_descriptors(enum heif_compression_format format,
                                  const char* name)
 {
+  load_plugins_if_not_initialized_yet();
+
   std::vector<const struct heif_encoder_descriptor*> filtered_descriptors;
 
   for (const auto& descr : s_encoder_descriptors) {