X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Faudio_content.cc;h=fc295aa0185556092d769110b07bfedbe36c1e86;hb=e9edb9ffd2deee65b2ab044a4a8bc149ed44a0b4;hp=e1f435f49b4d4e16934e4559dea6639e105b8b7f;hpb=53eea12d3e0d7925d5949de92859bc358ee0adcc;p=dcpomatic.git diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc index e1f435f49..fc295aa01 100644 --- a/src/lib/audio_content.cc +++ b/src/lib/audio_content.cc @@ -18,16 +18,16 @@ */ #include "audio_content.h" -#include "analyse_audio_job.h" -#include "job_manager.h" #include "film.h" #include "exceptions.h" #include "config.h" #include "frame_rate_change.h" #include "raw_convert.h" -#include "playlist.h" +#include "compose.hpp" #include +#include #include +#include #include "i18n.h" @@ -73,7 +73,7 @@ AudioContent::AudioContent (shared_ptr film, boost::filesystem::path AudioContent::AudioContent (shared_ptr film, cxml::ConstNodePtr node) : Content (film, node) { - _audio_gain = node->number_child ("AudioGain"); + _audio_gain = node->number_child ("AudioGain"); _audio_delay = node->number_child ("AudioDelay"); } @@ -82,7 +82,7 @@ AudioContent::AudioContent (shared_ptr film, vector ref = dynamic_pointer_cast (c[0]); DCPOMATIC_ASSERT (ref); - + for (size_t i = 0; i < c.size(); ++i) { shared_ptr ac = dynamic_pointer_cast (c[i]); @@ -115,7 +115,7 @@ AudioContent::set_audio_gain (double g) boost::mutex::scoped_lock lm (_mutex); _audio_gain = g; } - + signal_changed (AudioContentProperty::AUDIO_GAIN); } @@ -126,7 +126,7 @@ AudioContent::set_audio_delay (int d) boost::mutex::scoped_lock lm (_mutex); _audio_delay = d; } - + signal_changed (AudioContentProperty::AUDIO_DELAY); } @@ -155,7 +155,7 @@ AudioContent::set_audio_mapping (AudioMapping mapping) } i->set_mapping (stream_mapping); } - + signal_changed (AudioContentProperty::AUDIO_STREAMS); } @@ -166,9 +166,9 @@ AudioContent::audio_mapping () const BOOST_FOREACH (AudioStreamPtr i, audio_streams ()) { channels += i->channels (); } - + AudioMapping merged (channels, MAX_DCP_AUDIO_CHANNELS); - + int c = 0; int s = 0; BOOST_FOREACH (AudioStreamPtr i, audio_streams ()) { @@ -191,13 +191,10 @@ AudioContent::audio_mapping () const int AudioContent::resampled_audio_frame_rate () const { - shared_ptr film = _film.lock (); - DCPOMATIC_ASSERT (film); - /* Resample to a DCI-approved sample rate */ double t = has_rate_above_48k() ? 96000 : 48000; - FrameRateChange frc = film->active_frame_rate_change (position ()); + FrameRateChange frc = film()->active_frame_rate_change (position ()); /* Compensate if the DCP is being run at a different frame rate to the source; that is, if the video is run such that it will @@ -208,7 +205,7 @@ AudioContent::resampled_audio_frame_rate () const t /= frc.speed_up; } - return rint (t); + return lrint (t); } string