Mercurial > libavformat.hg
diff img2.c @ 743:af4e24d6310c libavformat
switch to native time bases
| author | michael |
|---|---|
| date | Sat, 30 Apr 2005 21:43:59 +0000 |
| parents | 119ac74d1c49 |
| children | cdb845a57ae4 |
line wrap: on
line diff
--- a/img2.c Tue Apr 26 21:46:46 2005 +0000 +++ b/img2.c Sat Apr 30 21:43:59 2005 +0000 @@ -186,12 +186,10 @@ st->need_parsing= 1; } - if (!ap || !ap->frame_rate) { - st->codec.frame_rate = 25; - st->codec.frame_rate_base = 1; + if (!ap || !ap->time_base.num) { + av_set_pts_info(st, 60, 1, 25); } else { - st->codec.frame_rate = ap->frame_rate; - st->codec.frame_rate_base = ap->frame_rate_base; + av_set_pts_info(st, 60, ap->time_base.num, ap->time_base.den); } if(ap && ap->width && ap->height){ @@ -207,9 +205,7 @@ s->img_number = first_index; /* compute duration */ st->start_time = 0; - st->duration = ((int64_t)AV_TIME_BASE * - (last_index - first_index + 1) * - st->codec.frame_rate_base) / st->codec.frame_rate; + st->duration = last_index - first_index + 1; } if(ap->video_codec_id){
