diff --git a/libvisual/tools/lv-tool/lv-tool.cpp b/libvisual/tools/lv-tool/lv-tool.cpp index 6a7b3e1db..41b4c92a5 100644 --- a/libvisual/tools/lv-tool/lv-tool.cpp +++ b/libvisual/tools/lv-tool/lv-tool.cpp @@ -56,7 +56,7 @@ namespace { - std::string actor_name = DEFAULT_ACTOR_NONGL; + std::string actor_name; std::string input_name = DEFAULT_INPUT; std::string morph_name = DEFAULT_MORPH; std::string driver_name = DEFAULT_DRIVER; @@ -433,11 +433,6 @@ int main (int argc, char **argv) // initialize LV Libvisual main {argc, argv}; - // Upgrade default to a more appealing OpenGL actor if available - if (LV::Actor::available(DEFAULT_ACTOR_GL)) { - actor_name = DEFAULT_ACTOR_GL; - } - // parse commandline arguments int parse_result = parse_args (argc, argv); if (parse_result < 0) { @@ -457,6 +452,16 @@ int main (int argc, char **argv) bin.set_supported_depth(VISUAL_VIDEO_DEPTH_ALL); bin.use_morph(false); + // Apply dynamic actor default, as needed + if (actor_name.empty()) { + actor_name = DEFAULT_ACTOR_NONGL; + + // Upgrade default to a more appealing OpenGL actor if available + if (LV::Actor::available(DEFAULT_ACTOR_GL)) { + actor_name = DEFAULT_ACTOR_GL; + } + } + // Let the bin manage plugins. There's a bug otherwise. if (!bin.connect(actor_name, input_name)) { throw std::runtime_error ("Failed to start pipeline with actor '" + actor_name + "' and input '" + input_name + "'");