Use drop-frame sound hack for 30 fps drop as well.
authorCarl Hetherington <cth@carlh.net>
Tue, 2 Oct 2012 21:08:29 +0000 (22:08 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 2 Oct 2012 21:08:29 +0000 (22:08 +0100)
src/lib/film_state.cc

index 0c1ac87dc76d28f6470fd624300d15d6c8db8a60..d7d9a1462a7896e2581838f855b575e4d232bbb7 100644 (file)
@@ -285,8 +285,8 @@ FilmState::target_sample_rate () const
 {
        double t = dcp_audio_sample_rate (audio_sample_rate);
        if (rint (frames_per_second) != frames_per_second) {
-               if (fabs (frames_per_second - 23.976) < 1e-6) {
-                       /* 24fps drop-frame ie 24 * 1000 / 1001 frames per second;
+               if (fabs (frames_per_second - 23.976) < 1e-6 || (fabs (frames_per_second - 29.97) < 1e-6)) {
+                       /* 24fps or 30fps drop-frame ie {24,30} * 1000 / 1001 frames per second;
                           hence we need to resample the audio to dcp_audio_sample_rate * 1000 / 1001
                           so that when we play it back at dcp_audio_sample_rate it is sped up
                           by the same amount that the video is