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
117int ff_framesync_configure(FFFrameSync *fs)117int ff_framesync_configure(FFFrameSync *fs)
118{118{
119 unsigned i;119 unsigned i;
120 int64_t gcd, lcm;
121 120
122 if (!fs->opt_repeatlast || fs->opt_eof_action == EOF_ACTION_PASS) {121 if (!fs->opt_repeatlast || fs->opt_eof_action == EOF_ACTION_PASS) {
123 fs->opt_repeatlast = 0;122 fs->opt_repeatlast = 0;
@@ -142,17 +141,8 @@ int ff_framesync_configure(FFFrameSync *fs) · 18 unmodified lines
142 for (i = 0; i < fs->nb_in; i++) {141 for (i = 0; i < fs->nb_in; i++) {
143 if (fs->in[i].sync) {142 if (fs->in[i].sync) {
144 if (fs->time_base.num) {143 if (fs->time_base.num) {
145 gcd = av_gcd(fs->time_base.den, fs->in[i].time_base.den);144 fs->time_base = av_gcd_q(fs->time_base, fs->in[i].time_base,
146 lcm = (fs->time_base.den / gcd) * fs->in[i].time_base.den;145 AV_TIME_BASE / 2, AV_TIME_BASE_Q);
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 }
156 } else {146 } else {
157 fs->time_base = fs->in[i].time_base;147 fs->time_base = fs->in[i].time_base;
158 }148 }

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