Ignore durations which differ significantly from the previous
Fixes Ticket2018
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
int64_t codec_info_duration_fields;
int found_decoder;
+ int64_t last_duration;
+
/**
* Those are used for average framerate estimation.
*/
else
duration -= st->first_dts;
if (duration > 0) {
- if (st->duration == AV_NOPTS_VALUE || st->duration < duration)
+ if (st->duration == AV_NOPTS_VALUE || st->info->last_duration<=0 ||
+ (st->duration < duration && FFABS(duration - st->info->last_duration) < 60LL*st->time_base.den / st->time_base.num))
st->duration = duration;
+ st->info->last_duration = duration;
}
}
av_free_packet(pkt);