Merge master.
[dcpomatic.git] / src / lib / analyse_audio_job.cc
index 74491943b2eb8d0d3ebbc27a49f37e36b8b45937..f3c55b208db152bd866eed8a44f550ff2c20c957 100644 (file)
@@ -21,8 +21,7 @@
 #include "analyse_audio_job.h"
 #include "compose.hpp"
 #include "film.h"
-#include "options.h"
-#include "playlist.h"
+#include "player.h"
 
 #include "i18n.h"
 
@@ -51,18 +50,18 @@ AnalyseAudioJob::name () const
 void
 AnalyseAudioJob::run ()
 {
-       shared_ptr<Playlist> playlist = _film->playlist ();
-       playlist->disable_video ();
+       shared_ptr<Player> player = _film->player ();
+       player->disable_video ();
        
-       playlist->Audio.connect (bind (&AnalyseAudioJob::audio, this, _1));
+       player->Audio.connect (bind (&AnalyseAudioJob::audio, this, _1));
 
-       _samples_per_point = max (int64_t (1), playlist->audio_length() / _num_points);
+       _samples_per_point = max (int64_t (1), _film->audio_length() / _num_points);
 
-       _current.resize (playlist->audio_channels ());
-       _analysis.reset (new AudioAnalysis (playlist->audio_channels()));
+       _current.resize (MAX_AUDIO_CHANNELS);
+       _analysis.reset (new AudioAnalysis (MAX_AUDIO_CHANNELS));
                         
-       while (!playlist->pass()) {
-               set_progress (float (_done) / playlist->audio_length ());
+       while (!player->pass()) {
+               set_progress (float (_done) / _film->audio_length ());
        }
 
        _analysis->write (_film->audio_analysis_path ());
@@ -72,7 +71,7 @@ AnalyseAudioJob::run ()
 }
 
 void
-AnalyseAudioJob::audio (shared_ptr<AudioBuffers> b)
+AnalyseAudioJob::audio (shared_ptr<const AudioBuffers> b)
 {
        for (int i = 0; i < b->frames(); ++i) {
                for (int j = 0; j < b->channels(); ++j) {