diff --git a/desktop/src/cli.rs b/desktop/src/cli.rs index 119d627bf..5e8efbda5 100644 --- a/desktop/src/cli.rs +++ b/desktop/src/cli.rs @@ -44,7 +44,7 @@ pub struct Opt { pub height: Option, /// Maximum number of seconds a script can run before scripting is disabled. - #[clap(long, short, default_value = "15.0")] + #[clap(long, short, default_value = "Infinity")] pub max_execution_duration: f64, /// Base directory or URL used to resolve all relative path statements in the SWF file. diff --git a/desktop/src/player.rs b/desktop/src/player.rs index 0b111b2d6..58b748e0b 100644 --- a/desktop/src/player.rs +++ b/desktop/src/player.rs @@ -129,6 +129,12 @@ impl ActivePlayer { builder.with_external_interface(Box::::default()); } + let max_execution_duration = if opt.max_execution_duration == f64::INFINITY { + Duration::MAX + } else { + Duration::from_secs_f64(opt.max_execution_duration) + }; + builder = builder .with_navigator(navigator) .with_renderer(renderer) @@ -139,7 +145,7 @@ impl ActivePlayer { ) .with_autoplay(true) .with_letterbox(opt.letterbox) - .with_max_execution_duration(Duration::from_secs_f64(opt.max_execution_duration)) + .with_max_execution_duration(max_execution_duration) .with_quality(opt.quality) .with_warn_on_unsupported_content(opt.warn_on_unsupported_content) .with_align(opt.align, opt.force_align)