Merge branch '1.0' into 1.0-seek
[dcpomatic.git] / src / lib / analyse_audio_job.cc
index b278a47b6877504b9e14ef7a1a590ed8a9d65d95..3f84bf16d7cc819240b8695a3628f962cd013ab0 100644 (file)
@@ -45,12 +45,7 @@ AnalyseAudioJob::AnalyseAudioJob (shared_ptr<const Film> f, shared_ptr<AudioCont
 string
 AnalyseAudioJob::name () const
 {
-       shared_ptr<AudioContent> content = _content.lock ();
-       if (!content) {
-               return "";
-       }
-       
-       return String::compose (_("Analyse audio of %1"), content->path().filename().string());
+       return _("Analyse audio");
 }
 
 void
@@ -74,8 +69,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 ());
@@ -85,7 +81,7 @@ AnalyseAudioJob::run ()
 }
 
 void
-AnalyseAudioJob::audio (shared_ptr<const AudioBuffers> b, Time)
+AnalyseAudioJob::audio (shared_ptr<const AudioBuffers> b, DCPTime)
 {
        for (int i = 0; i < b->frames(); ++i) {
                for (int j = 0; j < b->channels(); ++j) {