comparison mov.c @ 4454:7d1460900c59 libavformat

fix frame size, time rate is not stts duration anymore with time offset
author bcoudurier
date Wed, 11 Feb 2009 21:11:19 +0000
parents f9ab71b3ace7
children 9267b8cf7918
comparison
equal deleted inserted replaced
4453:f9ab71b3ace7 4454:7d1460900c59
1364 if(!sc->time_scale) 1364 if(!sc->time_scale)
1365 sc->time_scale= c->time_scale; 1365 sc->time_scale= c->time_scale;
1366 av_set_pts_info(st, 64, sc->time_rate, sc->time_scale); 1366 av_set_pts_info(st, 64, sc->time_rate, sc->time_scale);
1367 1367
1368 if (st->codec->codec_type == CODEC_TYPE_AUDIO && 1368 if (st->codec->codec_type == CODEC_TYPE_AUDIO &&
1369 !st->codec->frame_size && sc->stts_count == 1) 1369 !st->codec->frame_size && sc->stts_count == 1) {
1370 st->codec->frame_size = av_rescale(sc->time_rate, st->codec->sample_rate, sc->time_scale); 1370 st->codec->frame_size = av_rescale(sc->stts_data[0].duration,
1371 st->codec->sample_rate, sc->time_scale);
1372 dprintf(c->fc, "frame size %d\n", st->codec->frame_size);
1373 }
1371 1374
1372 if(st->duration != AV_NOPTS_VALUE){ 1375 if(st->duration != AV_NOPTS_VALUE){
1373 assert(st->duration % sc->time_rate == 0); 1376 assert(st->duration % sc->time_rate == 0);
1374 st->duration /= sc->time_rate; 1377 st->duration /= sc->time_rate;
1375 } 1378 }