Fix failure to display audio analysis in some cases.
authorCarl Hetherington <cth@carlh.net>
Tue, 15 Sep 2015 14:08:36 +0000 (15:08 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 15 Sep 2015 14:08:36 +0000 (15:08 +0100)
Before we were checking existing AnalyseAudioJobs by
their audio analysis path, which may change after they
have been run since they use up-to-date info such
as the Film's processor.

e.g.
Run audio analysis for content.
Enable processor.
Re-run analysis for film; now before it would think that
the existing job has done the *new* analysis because its
path would be the same as the one we now want.

ChangeLog
src/lib/job_manager.cc

index 80e48ac87dea6666b3c07eb2fabaeea130861b81..569ea9e8d9874435266b7391f5249cc6cab1decf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-09-15  c.hetherington  <cth@carlh.net>
+
+       * Fix failure to display audio analysis
+       in some cases.
+
 2015-09-15  Carl Hetherington  <cth@carlh.net>
 
        * Version 2.3.2 released.
index 0597983db355ddb7855310fa708ca916683f9608..545fd956c11548bdc409525c93d8bce5454b0fe3 100644 (file)
@@ -180,18 +180,22 @@ JobManager::analyse_audio (
        function<void()> ready
        )
 {
-       shared_ptr<AnalyseAudioJob> job;
-
        {
                boost::mutex::scoped_lock lm (_mutex);
 
                BOOST_FOREACH (shared_ptr<Job> i, _jobs) {
                        shared_ptr<AnalyseAudioJob> a = dynamic_pointer_cast<AnalyseAudioJob> (i);
-                       if (a && film->audio_analysis_path (a->playlist ()) == film->audio_analysis_path (playlist)) {
+                       if (a && a->playlist () == playlist) {
                                i->when_finished (connection, ready);
                                return;
                        }
                }
+       }
+
+       shared_ptr<AnalyseAudioJob> job;
+
+       {
+               boost::mutex::scoped_lock lm (_mutex);
 
                job.reset (new AnalyseAudioJob (film, playlist));
                connection = job->Finished.connect (ready);