]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
fix frame size, time rate is not stts duration anymore with time offset
authorbcoudurier <bcoudurier@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 11 Feb 2009 21:11:19 +0000 (21:11 +0000)
committerbcoudurier <bcoudurier@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 11 Feb 2009 21:11:19 +0000 (21:11 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17162 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavformat/mov.c

index 5f1d685700b546074aea2bcdbd8fd44d54c8964c..e40abcaf8d4442d108dfa3f7a4b1a5995281e6f2 100644 (file)
@@ -1366,8 +1366,11 @@ static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
     av_set_pts_info(st, 64, sc->time_rate, sc->time_scale);
 
     if (st->codec->codec_type == CODEC_TYPE_AUDIO &&
-        !st->codec->frame_size && sc->stts_count == 1)
-        st->codec->frame_size = av_rescale(sc->time_rate, st->codec->sample_rate, sc->time_scale);
+        !st->codec->frame_size && sc->stts_count == 1) {
+        st->codec->frame_size = av_rescale(sc->stts_data[0].duration,
+                                           st->codec->sample_rate, sc->time_scale);
+        dprintf(c->fc, "frame size %d\n", st->codec->frame_size);
+    }
 
     if(st->duration != AV_NOPTS_VALUE){
         assert(st->duration % sc->time_rate == 0);