In mov demuxer, set r_frame_rate for cfr files
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Tue, 11 Jan 2011 19:58:00 +0000 (19:58 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Tue, 11 Jan 2011 19:58:00 +0000 (19:58 +0000)
Originally committed as revision 26310 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/mov.c

index b602221..44e7443 100644 (file)
@@ -1788,6 +1788,10 @@ static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
 
         av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
                   sc->time_scale*st->nb_frames, st->duration, INT_MAX);
+
+        if (sc->stts_count == 1 || (sc->stts_count == 2 && sc->stts_data[1].count == 1))
+            av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den,
+                      sc->time_scale, sc->stts_data[0].duration, INT_MAX);
     }
 
     switch (st->codec->codec_id) {