1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

avformat/mov: Ignore the last frame for duration and fps calculation if it looks suspect

The used heuristic will potentially need to be finetuned
Fixes daemon404s fps.mov

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-01-21 18:31:54 +01:00
parent 76421982d0
commit 8e5e84c2a2

View File

@ -1940,6 +1940,12 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
av_dlog(c->fc, "sample_count=%d, sample_duration=%d\n", av_dlog(c->fc, "sample_count=%d, sample_duration=%d\n",
sample_count, sample_duration); sample_count, sample_duration);
if ( i+1 == entries
&& i
&& sample_count == 1
&& total_sample_count > 100
&& sample_duration/10 > duration / total_sample_count)
sample_duration = duration / total_sample_count;
duration+=(int64_t)sample_duration*sample_count; duration+=(int64_t)sample_duration*sample_count;
total_sample_count+=sample_count; total_sample_count+=sample_count;
} }