Showing the changes to libavfilter/framesync.c (1 of 1 file). Show all
Unified · Split
| @@ -117,7 +117,6 @@ static void framesync_sync_level_update(FFFrameSync *fs) · 116 unmodified lines | |||
| 117 | int ff_framesync_configure(FFFrameSync *fs) | 117 | int 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 | } |