Small optimisation.
authorCarl Hetherington <cth@carlh.net>
Thu, 25 Jul 2013 12:22:44 +0000 (13:22 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 25 Jul 2013 12:22:44 +0000 (13:22 +0100)
src/lib/analyse_audio_job.cc

index b278a47b6877504b9e14ef7a1a590ed8a9d65d95..9939220149d16986bcfbaa1e33daebbac6e780fd 100644 (file)
@@ -74,8 +74,9 @@ AnalyseAudioJob::run ()
        _analysis.reset (new AudioAnalysis (_film->audio_channels ()));
 
        _done = 0;
+       OutputAudioFrame const len = _film->time_to_audio_frames (_film->length ());
        while (!player->pass ()) {
-               set_progress (double (_film->audio_frames_to_time (_done)) / _film->length ());
+               set_progress (double (_done) / len);
        }
 
        _analysis->write (content->audio_analysis_path ());