int best_fps = 0;
double best_error = 0.01;
- if (delta_dts >= INT64_MAX / st->time_base.num ||
- delta_packets >= INT64_MAX / st->time_base.den)
++ if (st->info->codec_info_duration >= INT64_MAX / st->time_base.num / 2||
++ st->info->codec_info_duration_fields >= INT64_MAX / st->time_base.den)
+ continue;
av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
- delta_packets*(int64_t)st->time_base.den,
- delta_dts*(int64_t)st->time_base.num, 60000);
+ st->info->codec_info_duration_fields*(int64_t)st->time_base.den,
+ st->info->codec_info_duration*2*(int64_t)st->time_base.num, 60000);
/* round guessed framerate to a "standard" framerate if it's
* within 1% of the original estimate*/