Mercurial > libavcodec.hg
changeset 8014:07d8986fbea7 libavcodec
replacing frame_rate and frame_rate_base with an AVRational time_base
author | romansh |
---|---|
date | Tue, 07 Oct 2008 16:59:18 +0000 |
parents | 0eeb93cedecb |
children | ad3949b075ba |
files | dv.c dvdata.h |
diffstat | 2 files changed, 11 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/dv.c Tue Oct 07 16:07:15 2008 +0000 +++ b/dv.c Tue Oct 07 16:59:18 2008 +0000 @@ -1048,7 +1048,7 @@ s->picture.key_frame = 1; s->picture.pict_type = FF_I_TYPE; avctx->pix_fmt = s->sys->pix_fmt; - avctx->time_base = (AVRational){s->sys->frame_rate_base, s->sys->frame_rate}; + avctx->time_base = s->sys->time_base; avcodec_set_dimensions(avctx, s->sys->width, s->sys->height); if(avctx->get_buffer(avctx, &s->picture) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
--- a/dvdata.h Tue Oct 07 16:07:15 2008 +0000 +++ b/dvdata.h Tue Oct 07 16:59:18 2008 +0000 @@ -42,8 +42,7 @@ int frame_size; /* total size of one frame in bytes */ int difseg_size; /* number of DIF segments per DIF channel */ int n_difchan; /* number of DIF channels per frame */ - int frame_rate; - int frame_rate_base; + AVRational time_base; /* 1/framerate */ int ltc_divisor; /* FPS from the LTS standpoint */ int height; /* picture height in pixels */ int width; /* picture width in pixels */ @@ -6166,9 +6165,8 @@ .frame_size = 120000, /* IEC 61834, SMPTE-314M - 525/60 (NTSC) */ .difseg_size = 10, .n_difchan = 1, - .frame_rate = 30000, + .time_base = { 1001, 30000 }, .ltc_divisor = 30, - .frame_rate_base = 1001, .height = 480, .width = 720, .sar = {{10, 11}, {40, 33}}, @@ -6186,8 +6184,7 @@ .frame_size = 144000, /* IEC 61834 - 625/50 (PAL) */ .difseg_size = 12, .n_difchan = 1, - .frame_rate = 25, - .frame_rate_base = 1, + .time_base = { 1, 25 }, .ltc_divisor = 25, .height = 576, .width = 720, @@ -6206,8 +6203,7 @@ .frame_size = 144000, /* SMPTE-314M - 625/50 (PAL) */ .difseg_size = 12, .n_difchan = 1, - .frame_rate = 25, - .frame_rate_base = 1, + .time_base = { 1, 25 }, .ltc_divisor = 25, .height = 576, .width = 720, @@ -6226,9 +6222,8 @@ .frame_size = 240000, /* SMPTE-314M - 525/60 (NTSC) 50 Mbps */ .difseg_size = 10, /* also known as "DVCPRO50" */ .n_difchan = 2, - .frame_rate = 30000, + .time_base = { 1001, 30000 }, .ltc_divisor = 30, - .frame_rate_base = 1001, .height = 480, .width = 720, .sar = {{10, 11}, {40, 33}}, @@ -6246,8 +6241,7 @@ .frame_size = 288000, /* SMPTE-314M - 625/50 (PAL) 50 Mbps */ .difseg_size = 12, /* also known as "DVCPRO50" */ .n_difchan = 2, - .frame_rate = 25, - .frame_rate_base = 1, + .time_base = { 1, 25 }, .ltc_divisor = 25, .height = 576, .width = 720, @@ -6266,9 +6260,8 @@ .frame_size = 480000, /* SMPTE-370M - 1080i60 100 Mbps */ .difseg_size = 10, /* also known as "DVCPRO HD" */ .n_difchan = 4, - .frame_rate = 30000, + .time_base = { 1001, 30000 }, .ltc_divisor = 30, - .frame_rate_base = 1001, .height = 1080, .width = 1280, .sar = {{1, 1}, {1, 1}}, @@ -6286,8 +6279,7 @@ .frame_size = 576000, /* SMPTE-370M - 1080i50 100 Mbps */ .difseg_size = 12, /* also known as "DVCPRO HD" */ .n_difchan = 4, - .frame_rate = 25, - .frame_rate_base = 1, + .time_base = { 1, 25 }, .ltc_divisor = 25, .height = 1080, .width = 1440, @@ -6306,9 +6298,8 @@ .frame_size = 240000, /* SMPTE-370M - 720p60 100 Mbps */ .difseg_size = 10, /* also known as "DVCPRO HD" */ .n_difchan = 2, - .frame_rate = 60000, + .time_base = { 1001, 60000 }, .ltc_divisor = 60, - .frame_rate_base = 1001, .height = 720, .width = 960, .sar = {{1, 1}, {1, 1}}, @@ -6326,9 +6317,8 @@ .frame_size = 288000, /* SMPTE-370M - 720p50 100 Mbps */ .difseg_size = 12, /* also known as "DVCPRO HD" */ .n_difchan = 2, - .frame_rate = 50, + .time_base = { 1, 50 }, .ltc_divisor = 50, - .frame_rate_base = 1, .height = 720, .width = 960, .sar = {{1, 1}, {1, 1}},