for (uint32_t i = 0; i < _format_context->nb_streams; ++i) {
AVStream* s = _format_context->streams[i];
- if (s->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
+ if (s->codec->codec_type == AVMEDIA_TYPE_AUDIO && s->codec->codec) {
/* This is a hack; sometimes it seems that _audio_codec_context->channel_layout isn't set up,
so bodge it here. No idea why we should have to do this.
}
DCPOMATIC_ASSERT (_format_context->duration != AV_NOPTS_VALUE);
- DCPOMATIC_ASSERT (s->codec->codec);
DCPOMATIC_ASSERT (s->codec->codec->name);
_audio_streams.push_back (
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;
}
}
_rotation = *_rotation - 360 * floor (*_rotation / 360 + 0.9 / 360);
-
- DCPOMATIC_ASSERT (fabs (*_rotation - 90 * round (*_rotation / 90)) < 2);
}
LOG_GENERAL("Temporal reference was %1", temporal_reference);
{
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;
}
_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");
}