Skip to content

Commit

Permalink
more implicit plugin initialization even without heif_context (#974)
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Oct 11, 2023
1 parent 5da626c commit c5207b5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libheif/plugin_registry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ void register_decoder(const heif_decoder_plugin* decoder_plugin)

const struct heif_decoder_plugin* get_decoder(enum heif_compression_format type, const char* name_id)
{
load_plugins_if_not_initialized_yet();

int highest_priority = 0;
const struct heif_decoder_plugin* best_plugin = nullptr;

Expand Down Expand Up @@ -229,6 +231,8 @@ 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;
Expand Down

0 comments on commit c5207b5

Please sign in to comment.