Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -117,7 +117,6 @@ static void framesync_sync_level_update(FFFrameSync *fs) · 116 unmodified lines | ||
| 117 | 117 | int ff_framesync_configure(FFFrameSync *fs) |
| 118 | 118 | { |
| 119 | 119 | unsigned i; |
| 120 | − int64_t gcd, lcm; | |
| 121 | 120 | |
| 122 | 121 | if (!fs->opt_repeatlast || fs->opt_eof_action == EOF_ACTION_PASS) { |
| 123 | 122 | fs->opt_repeatlast = 0; |
| @@ -142,17 +141,8 @@ int ff_framesync_configure(FFFrameSync *fs) · 18 unmodified lines | ||
| 142 | 141 | for (i = 0; i < fs->nb_in; i++) { |
| 143 | 142 | if (fs->in[i].sync) { |
| 144 | 143 | 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); | |
| 156 | 146 | } else { |
| 157 | 147 | fs->time_base = fs->in[i].time_base; |
| 158 | 148 | } |