Fix number of frames in the pulldown check.
[dcpomatic.git] / src / lib / ffmpeg_examiner.cc
index d439b0eb68ba54e27b3ce779071d3096c6967177..3b907ea54d650a6e613cf7ff663b7dc3a985c96d 100644 (file)
@@ -151,7 +151,7 @@ FFmpegExaminer::FFmpegExaminer (shared_ptr<const FFmpegContent> c, shared_ptr<Jo
 
                av_packet_unref (&_packet);
 
-               if (_first_video && got_all_audio && temporal_reference.size() >= PULLDOWN_CHECK_FRAMES) {
+               if (_first_video && got_all_audio && temporal_reference.size() >= (PULLDOWN_CHECK_FRAMES * 2)) {
                        /* All done */
                        break;
                }
@@ -206,7 +206,7 @@ FFmpegExaminer::video_packet (AVCodecContext* context, string& temporal_referenc
 {
        DCPOMATIC_ASSERT (_video_stream);
 
-       if (_first_video && !_need_video_length && temporal_reference.size() >= PULLDOWN_CHECK_FRAMES) {
+       if (_first_video && !_need_video_length && temporal_reference.size() >= (PULLDOWN_CHECK_FRAMES * 2)) {
                return;
        }
 
@@ -220,7 +220,7 @@ FFmpegExaminer::video_packet (AVCodecContext* context, string& temporal_referenc
                                _format_context->streams[_video_stream.get()]
                                ).get_value_or (ContentTime ()).frames_round (video_frame_rate().get ());
                }
-               if (temporal_reference.size() < PULLDOWN_CHECK_FRAMES) {
+               if (temporal_reference.size() < (PULLDOWN_CHECK_FRAMES * 2)) {
                        temporal_reference += (_frame->top_field_first ? "T" : "B");
                        temporal_reference += (_frame->repeat_pict ? "3" : "2");
                }