Fix build.
[dcpomatic.git] / src / lib / analyse_audio_job.cc
index 872947b55d3d56cac4a957ca561bc5944a81d34c..fc0abe0a3b5914fa953d1c06247e1f60d20759da 100644 (file)
@@ -18,6 +18,7 @@
 */
 
 #include "audio_analysis.h"
+#include "audio_buffers.h"
 #include "analyse_audio_job.h"
 #include "compose.hpp"
 #include "film.h"
@@ -48,6 +49,12 @@ AnalyseAudioJob::name () const
        return _("Analyse audio");
 }
 
+string
+AnalyseAudioJob::json_name () const
+{
+       return N_("analyse_audio");
+}
+
 void
 AnalyseAudioJob::run ()
 {
@@ -63,13 +70,13 @@ AnalyseAudioJob::run ()
        
        player->Audio.connect (bind (&AnalyseAudioJob::audio, this, _1, _2));
 
-       _samples_per_point = max (int64_t (1), _film->time_to_audio_frames (_film->length()) / _num_points);
+       int64_t const len = _film->length().frames (_film->audio_frame_rate());
+       _samples_per_point = max (int64_t (1), len / _num_points);
 
        _current.resize (_film->audio_channels ());
        _analysis.reset (new AudioAnalysis (_film->audio_channels ()));
 
        _done = 0;
-       AudioFrame const len = _film->time_to_audio_frames (_film->length ());
        while (!player->pass ()) {
                set_progress (double (_done) / len);
        }