提交 2a52f19a 编写于 作者: N Nicolas George

lavfi/framesync: use av_gcd_q().

上级 6b65c4ec
...@@ -117,7 +117,6 @@ static void framesync_sync_level_update(FFFrameSync *fs) ...@@ -117,7 +117,6 @@ static void framesync_sync_level_update(FFFrameSync *fs)
int ff_framesync_configure(FFFrameSync *fs) int ff_framesync_configure(FFFrameSync *fs)
{ {
unsigned i; unsigned i;
int64_t gcd, lcm;
if (!fs->opt_repeatlast || fs->opt_eof_action == EOF_ACTION_PASS) { if (!fs->opt_repeatlast || fs->opt_eof_action == EOF_ACTION_PASS) {
fs->opt_repeatlast = 0; fs->opt_repeatlast = 0;
...@@ -142,17 +141,8 @@ int ff_framesync_configure(FFFrameSync *fs) ...@@ -142,17 +141,8 @@ int ff_framesync_configure(FFFrameSync *fs)
for (i = 0; i < fs->nb_in; i++) { for (i = 0; i < fs->nb_in; i++) {
if (fs->in[i].sync) { if (fs->in[i].sync) {
if (fs->time_base.num) { if (fs->time_base.num) {
gcd = av_gcd(fs->time_base.den, fs->in[i].time_base.den); fs->time_base = av_gcd_q(fs->time_base, fs->in[i].time_base,
lcm = (fs->time_base.den / gcd) * fs->in[i].time_base.den; AV_TIME_BASE / 2, AV_TIME_BASE_Q);
if (lcm < AV_TIME_BASE / 2) {
fs->time_base.den = lcm;
fs->time_base.num = av_gcd(fs->time_base.num,
fs->in[i].time_base.num);
} else {
fs->time_base.num = 1;
fs->time_base.den = AV_TIME_BASE;
break;
}
} else { } else {
fs->time_base = fs->in[i].time_base; fs->time_base = fs->in[i].time_base;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册