Fix comment.
[dcpomatic.git] / src / lib / analyse_audio_job.cc
index 5994bc71a7ec7338bed1e9457de2a4b04c9f53f2..9d0882b3ad22b3061f243d53ae78f91146042d3d 100644 (file)
@@ -47,6 +47,7 @@ using std::min;
 using std::cout;
 using boost::shared_ptr;
 using boost::dynamic_pointer_cast;
+using namespace dcpomatic;
 
 int const AnalyseAudioJob::_num_points = 1024;
 
@@ -54,6 +55,7 @@ int const AnalyseAudioJob::_num_points = 1024;
 AnalyseAudioJob::AnalyseAudioJob (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist, bool from_zero)
        : Job (film)
        , _playlist (playlist)
+       , _path (film->audio_analysis_path(playlist))
        , _from_zero (from_zero)
        , _done (0)
        , _samples_per_point (1)
@@ -92,7 +94,7 @@ AnalyseAudioJob::~AnalyseAudioJob ()
 string
 AnalyseAudioJob::name () const
 {
-       return _("Analyse audio");
+       return _("Analysing audio");
 }
 
 string
@@ -111,7 +113,7 @@ AnalyseAudioJob::run ()
        player->set_play_referenced ();
        player->Audio.connect (bind (&AnalyseAudioJob::analyse, this, _1, _2));
 
-       DCPTime const length = _playlist->length ();
+       DCPTime const length = _playlist->length (_film);
 
        Frame const len = DCPTime (length - _start).frames_round (_film->audio_frame_rate());
        _samples_per_point = max (int64_t (1), len / _num_points);
@@ -166,7 +168,7 @@ AnalyseAudioJob::run ()
 
        _analysis->set_samples_per_point (_samples_per_point);
        _analysis->set_sample_rate (_film->audio_frame_rate ());
-       _analysis->write (_film->audio_analysis_path (_playlist));
+       _analysis->write (_path);
 
        set_progress (1);
        set_state (FINISHED_OK);
@@ -214,6 +216,6 @@ AnalyseAudioJob::analyse (shared_ptr<const AudioBuffers> b, DCPTime time)
 
        _done += frames;
 
-       DCPTime const length = _playlist->length ();
+       DCPTime const length = _playlist->length (_film);
        set_progress ((time.seconds() - _start.seconds()) / (length.seconds() - _start.seconds()));
 }