Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions libvisual/tools/lv-tool/lv-tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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 + "'");
Expand Down