You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-06-14 22:15:12 +02:00
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.
This commit is contained in:
@ -41,11 +41,13 @@ static int config_props_output(AVFilterLink *outlink)
|
|||||||
return AVERROR_INVALIDDATA;
|
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.num = inlink->frame_rate.num * 2;
|
||||||
outlink->frame_rate.den = inlink->frame_rate.den;
|
outlink->frame_rate.den = inlink->frame_rate.den;
|
||||||
outlink->w = inlink->w;
|
outlink->w = inlink->w;
|
||||||
outlink->h = inlink->h / 2;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user