diff options
author | Clément Bœsch <ubitux@gmail.com> | 2013-04-10 02:38:07 +0200 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2013-04-10 02:38:54 +0200 |
commit | d2e051e30c0ffc1e80a7e7e76ccdfbeb2956daa6 (patch) | |
tree | 5113084c029a8ad6e49f61b8872772bf707a3c40 /libavfilter/vf_separatefields.c | |
parent | 685617ac29d7ca5fa0d83929b2b24988a2261ef9 (diff) | |
download | ffmpeg-d2e051e30c0ffc1e80a7e7e76ccdfbeb2956daa6.tar.gz |
lavfi/separatefields: adjust tb to avoid rounding errors.
Since the PTS need double accuracy, the timebase denominator is doubled
as well, and this new time base is used for the timestamp unit.
Diffstat (limited to 'libavfilter/vf_separatefields.c')
-rw-r--r-- | libavfilter/vf_separatefields.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavfilter/vf_separatefields.c b/libavfilter/vf_separatefields.c index 81f37cf7c5..5849b62b77 100644 --- a/libavfilter/vf_separatefields.c +++ b/libavfilter/vf_separatefields.c @@ -41,11 +41,13 @@ static int config_props_output(AVFilterLink *outlink) return AVERROR_INVALIDDATA; } + outlink->time_base.num = inlink->time_base.num; + outlink->time_base.den = inlink->time_base.den * 2; outlink->frame_rate.num = inlink->frame_rate.num * 2; outlink->frame_rate.den = inlink->frame_rate.den; outlink->w = inlink->w; outlink->h = inlink->h / 2; - sf->ts_unit = av_q2d(av_inv_q(av_mul_q(outlink->frame_rate, inlink->time_base))); + sf->ts_unit = av_q2d(av_inv_q(av_mul_q(outlink->frame_rate, outlink->time_base))); return 0; } |