From cd6c6a693f19fcaa6c75ed60f48a54a8cae51352 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 9 Jan 2022 23:44:00 +0100 Subject: Speed up hints tests by not running a pointless audio analysis. --- src/lib/hints.cc | 2 +- src/lib/hints.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/hints.cc b/src/lib/hints.cc index 46704ebf8..40b51e817 100644 --- a/src/lib/hints.cc +++ b/src/lib/hints.cc @@ -407,7 +407,7 @@ try auto player = make_shared(film, Image::Alignment::COMPACT); player->set_ignore_video (); - if (check_loudness_done) { + if (check_loudness_done || _disable_audio_analysis) { /* We don't need to analyse audio because we already loaded a suitable analysis */ player->set_ignore_audio (); } diff --git a/src/lib/hints.h b/src/lib/hints.h index 2a5e8d4a0..6553593a0 100644 --- a/src/lib/hints.h +++ b/src/lib/hints.h @@ -51,6 +51,9 @@ public: /* For tests only */ void join (); + void disable_audio_analysis () { + _disable_audio_analysis = true; + } private: friend struct hint_subtitle_too_early; @@ -103,4 +106,6 @@ private: boost::optional _last_subtitle; boost::atomic _stop; + + bool _disable_audio_analysis = false; }; -- cgit v1.2.3