Mercurial > libavformat.hg
diff dv.c @ 3992:36f92f77c85e libavformat
replacing frame_rate and frame_rate_base with an AVRational time_base
author | romansh |
---|---|
date | Tue, 07 Oct 2008 16:59:18 +0000 |
parents | 3cc570fdebbf |
children | 8c5a32f0d479 |
line wrap: on
line diff
--- a/dv.c Tue Oct 07 16:14:33 2008 +0000 +++ b/dv.c Tue Oct 07 16:59:18 2008 +0000 @@ -241,8 +241,8 @@ if (c->sys) { avctx = c->vst->codec; - av_set_pts_info(c->vst, 64, c->sys->frame_rate_base, c->sys->frame_rate); - avctx->time_base= (AVRational){c->sys->frame_rate_base, c->sys->frame_rate}; + av_set_pts_info(c->vst, 64, c->sys->time_base.num, c->sys->time_base.den); + avctx->time_base= c->sys->time_base; if(!avctx->width){ avctx->width = c->sys->width; avctx->height = c->sys->height; @@ -255,9 +255,8 @@ is16_9 = (vsc_pack && ((vsc_pack[2] & 0x07) == 0x02 || (!apt && (vsc_pack[2] & 0x07) == 0x07))); c->vst->sample_aspect_ratio = c->sys->sar[is16_9]; - avctx->bit_rate = av_rescale(c->sys->frame_size * 8, - c->sys->frame_rate, - c->sys->frame_rate_base); + avctx->bit_rate = av_rescale_q(c->sys->frame_size, (AVRational){8,1}, + c->sys->time_base); size = c->sys->frame_size; } return size; @@ -379,9 +378,8 @@ { c->frames= frame_offset; if (c->ach) - c->abytes= av_rescale(c->frames, - c->ast[0]->codec->bit_rate * (int64_t)c->sys->frame_rate_base, - 8*c->sys->frame_rate); + c->abytes= av_rescale_q(c->frames, c->sys->time_base, + (AVRational){8, c->ast[0]->codec->bit_rate}); c->audio_pkt[0].size = c->audio_pkt[1].size = 0; c->audio_pkt[2].size = c->audio_pkt[3].size = 0; } @@ -414,9 +412,8 @@ return -1; } - s->bit_rate = av_rescale(c->dv_demux->sys->frame_size * 8, - c->dv_demux->sys->frame_rate, - c->dv_demux->sys->frame_rate_base); + s->bit_rate = av_rescale_q(c->dv_demux->sys->frame_size, (AVRational){8,1}, + c->dv_demux->sys->time_base); return 0; }