projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove some unnecessary using statements.
[dcpomatic.git]
/
src
/
lib
/
analyse_audio_job.cc
diff --git
a/src/lib/analyse_audio_job.cc
b/src/lib/analyse_audio_job.cc
index 03497b91e4208140864d562b442d7eb563a1bd8a..1fc09b9055d0a9155960fc5d8470657a076e5428 100644
(file)
--- a/
src/lib/analyse_audio_job.cc
+++ b/
src/lib/analyse_audio_job.cc
@@
-47,6
+47,7
@@
using std::min;
using std::cout;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
using std::cout;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
+using namespace dcpomatic;
int const AnalyseAudioJob::_num_points = 1024;
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)
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)
, _from_zero (from_zero)
, _done (0)
, _samples_per_point (1)
@@
-81,6
+83,7
@@
AnalyseAudioJob::AnalyseAudioJob (shared_ptr<const Film> film, shared_ptr<const
AnalyseAudioJob::~AnalyseAudioJob ()
{
AnalyseAudioJob::~AnalyseAudioJob ()
{
+ stop_thread ();
BOOST_FOREACH (Filter const * i, _filters) {
delete const_cast<Filter*> (i);
}
BOOST_FOREACH (Filter const * i, _filters) {
delete const_cast<Filter*> (i);
}
@@
-92,7
+95,7
@@
AnalyseAudioJob::~AnalyseAudioJob ()
string
AnalyseAudioJob::name () const
{
string
AnalyseAudioJob::name () const
{
- return _("Analys
e
audio");
+ return _("Analys
ing
audio");
}
string
}
string
@@
-104,14
+107,14
@@
AnalyseAudioJob::json_name () const
void
AnalyseAudioJob::run ()
{
void
AnalyseAudioJob::run ()
{
- shared_ptr<Player> player (new Player
(_film, _playlist
));
+ shared_ptr<Player> player (new Player
(_film, _playlist, _playlist->length(_film)
));
player->set_ignore_video ();
player->set_ignore_video ();
- player->set_ignore_
caption
();
+ player->set_ignore_
text
();
player->set_fast ();
player->set_play_referenced ();
player->Audio.connect (bind (&AnalyseAudioJob::analyse, this, _1, _2));
player->set_fast ();
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);
Frame const len = DCPTime (length - _start).frames_round (_film->audio_frame_rate());
_samples_per_point = max (int64_t (1), len / _num_points);
@@
-159,13
+162,14
@@
AnalyseAudioJob::run ()
gain was when we analysed it.
*/
shared_ptr<const AudioContent> ac = _playlist->content().front()->audio;
gain was when we analysed it.
*/
shared_ptr<const AudioContent> ac = _playlist->content().front()->audio;
- DCPOMATIC_ASSERT (ac);
- _analysis->set_analysis_gain (ac->gain ());
+ if (ac) {
+ _analysis->set_analysis_gain (ac->gain());
+ }
}
_analysis->set_samples_per_point (_samples_per_point);
_analysis->set_sample_rate (_film->audio_frame_rate ());
}
_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);
set_progress (1);
set_state (FINISHED_OK);
@@
-213,6
+217,6
@@
AnalyseAudioJob::analyse (shared_ptr<const AudioBuffers> b, DCPTime time)
_done += frames;
_done += frames;
- DCPTime const length = _playlist->length ();
+ DCPTime const length = _playlist->length (
_film
);
set_progress ((time.seconds() - _start.seconds()) / (length.seconds() - _start.seconds()));
}
set_progress ((time.seconds() - _start.seconds()) / (length.seconds() - _start.seconds()));
}