History

lavfi/framesync: use av_gcd_q().

Nicolas George committed 6 years ago

Commit 2a52f191 parent 6b65c4e1 file · +2 −12Browse files

Unified · Split

libavfilter/framesync.c+2−12
@@ -117,7 +117,6 @@ static void framesync_sync_level_update(FFFrameSync *fs) · 116 unmodified lines
117117 int ff_framesync_configure(FFFrameSync *fs)
118118 {
119119 unsigned i;
120− int64_t gcd, lcm;
121120
122121 if (!fs->opt_repeatlast || fs->opt_eof_action == EOF_ACTION_PASS) {
123122 fs->opt_repeatlast = 0;
@@ -142,17 +141,8 @@ int ff_framesync_configure(FFFrameSync *fs) · 18 unmodified lines
142141 for (i = 0; i < fs->nb_in; i++) {
143142 if (fs->in[i].sync) {
144143 if (fs->time_base.num) {
145− gcd = av_gcd(fs->time_base.den, fs->in[i].time_base.den);
146− lcm = (fs->time_base.den / gcd) * fs->in[i].time_base.den;
147− if (lcm < AV_TIME_BASE / 2) {
148− fs->time_base.den = lcm;
149− fs->time_base.num = av_gcd(fs->time_base.num,
150− fs->in[i].time_base.num);
151− } else {
152− fs->time_base.num = 1;
153− fs->time_base.den = AV_TIME_BASE;
154− break;
155− }
144+ fs->time_base = av_gcd_q(fs->time_base, fs->in[i].time_base,
145+ AV_TIME_BASE / 2, AV_TIME_BASE_Q);
156146 } else {
157147 fs->time_base = fs->in[i].time_base;
158148 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t