diff --git a/src/tools/mana_auto_replay.cc b/src/tools/mana_auto_replay.cc index f66e323..7ba3cfc 100644 --- a/src/tools/mana_auto_replay.cc +++ b/src/tools/mana_auto_replay.cc @@ -413,8 +413,9 @@ int main(int argc, char *argv[]) return 1; } - std::unique_ptr destSink; boost::dll::shared_library pluginHandle; + std::unique_ptr manaCppPlugin; + std::unique_ptr destSink; if (parser("--plugin")) { @@ -422,8 +423,27 @@ int main(int argc, char *argv[]) try { pluginHandle = boost::dll::shared_library(pluginFile); - destSink = std::make_unique( - pluginHandle.get("mana_get_sink_plugin")()); + + try + { + destSink = std::make_unique( + pluginHandle.get("mana_get_sink_plugin")()); + } + catch (const std::exception &e) + { + spdlog::debug("plugin {} is not a MANA_C_SINK_PLUGIN", pluginFile); + try + { + manaCppPlugin = std::unique_ptr( + pluginHandle.get("mana_get_plugin")()); + destSink = manaCppPlugin->makeSink(); + } + catch (const std::exception &e) + { + std::cerr << fmt::format("Error loading plugin: {}\n", e.what()); + return 1; + } + } } catch (const std::exception &e) {