#include "film.h"
#include "exceptions.h"
#include "config.h"
+#include "frame_rate_change.h"
#include "i18n.h"
using std::string;
+using std::cout;
using std::vector;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
}
boost::filesystem::path p = film->audio_analysis_dir ();
- p /= digest ();
+ p /= digest() + "_" + audio_mapping().digest();
return p;
}
{
return String::compose ("audio: channels %1, length %2, raw rate %3, out rate %4", audio_channels(), audio_length(), content_audio_frame_rate(), output_audio_frame_rate());
}
+
+int
+AudioContent::output_audio_frame_rate () const
+{
+ shared_ptr<const Film> film = _film.lock ();
+ assert (film);
+
+ /* Resample to a DCI-approved sample rate */
+ double t = dcp_audio_frame_rate (content_audio_frame_rate ());
+
+ 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
+ look different in the DCP compared to the source (slower or faster).
+ skip/repeat doesn't come into effect here.
+ */
+
+ if (frc.change_speed) {
+ t /= frc.speed_up;
+ }
+
+ return rint (t);
+}
+