#include "analyse_audio_job.h"
#include "audio_content.h"
#include "compose.hpp"
+#include "dcpomatic_log.h"
#include "film.h"
#include "player.h"
#include "playlist.h"
using std::max;
using std::min;
using std::cout;
-using boost::shared_ptr;
-using boost::dynamic_pointer_cast;
+using std::shared_ptr;
+using std::dynamic_pointer_cast;
using namespace dcpomatic;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
int const AnalyseAudioJob::_num_points = 1024;
, _ebur128 (new AudioFilterGraph (film->audio_frame_rate(), film->audio_channels()))
#endif
{
+ LOG_DEBUG_AUDIO_ANALYSIS_NC("AnalyseAudioJob::AnalyseAudioJob");
+
#ifdef DCPOMATIC_HAVE_EBUR128_PATCHED_FFMPEG
_filters.push_back (new Filter ("ebur128", "ebur128", "audio", "ebur128=peak=true"));
_ebur128->setup (_filters);
void
AnalyseAudioJob::run ()
{
+ LOG_DEBUG_AUDIO_ANALYSIS_NC("AnalyseAudioJob::run");
+
shared_ptr<Player> player (new Player(_film, _playlist));
player->set_ignore_video ();
player->set_ignore_text ();
}
if (has_any_audio) {
+ LOG_DEBUG_AUDIO_ANALYSIS("Seeking to %1", to_string(_start));
player->seek (_start, true);
_done = 0;
+ LOG_DEBUG_AUDIO_ANALYSIS("Starting loop for playlist of length %1", to_string(length));
while (!player->pass ()) {}
}
+ LOG_DEBUG_AUDIO_ANALYSIS_NC("Loop complete");
+
vector<AudioAnalysis::PeakTime> sample_peak;
for (int i = 0; i < _film->audio_channels(); ++i) {
sample_peak.push_back (
_analysis->set_leqm (_leqm->leq_m());
_analysis->write (_path);
+ LOG_DEBUG_AUDIO_ANALYSIS_NC("Job finished");
set_progress (1);
set_state (FINISHED_OK);
}
void
AnalyseAudioJob::analyse (shared_ptr<const AudioBuffers> b, DCPTime time)
{
+ LOG_DEBUG_AUDIO_ANALYSIS("Received %1 frames at %2", b->frames(), to_string(time));
DCPOMATIC_ASSERT (time >= _start);
#ifdef DCPOMATIC_HAVE_EBUR128_PATCHED_FFMPEG
DCPTime const length = _playlist->length (_film);
set_progress ((time.seconds() - _start.seconds()) / (length.seconds() - _start.seconds()));
+ LOG_DEBUG_AUDIO_ANALYSIS_NC("Frames processed");
}