+
+/** @return Number of bytes per sample of a single channel */
+int
+FilmState::bytes_per_sample () const
+{
+ switch (audio_sample_format) {
+ case AV_SAMPLE_FMT_S16:
+ return 2;
+ default:
+ return 0;
+ }
+
+ return 0;
+}
+
+int
+FilmState::target_sample_rate () const
+{
+ /* Resample to a DCI-approved sample rate */
+ double t = dcp_audio_sample_rate (audio_sample_rate);
+
+ /* Compensate for the fact that video will be rounded to the
+ nearest integer number of frames per second.
+ */
+ if (rint (frames_per_second) != frames_per_second) {
+ t *= frames_per_second / rint (frames_per_second);
+ }
+
+ return rint (t);
+}
+
+int
+FilmState::dcp_length () const
+{
+ if (dcp_frames) {
+ return dcp_frames;
+ }
+
+ return length;
+}
+
+