Skip to content

Commit

Permalink
Use min duration instead of mean duration if gcd cannot be determined
Browse files Browse the repository at this point in the history
  • Loading branch information
laggykiller committed Mar 27, 2024
1 parent 35605c7 commit 8e597a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sticker_convert/utils/media/codec_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def durations_gcd(*durations: Union[int, float]) -> Union[float, Fraction]:
):
return Fraction(gcd(*(int(rounding(i * x)) for i in durations)), x)
else:
return sum(durations) / len(durations)
return min(durations)
else:
return Fraction(gcd(*durations), 1) # type: ignore

Expand Down

0 comments on commit 8e597a9

Please sign in to comment.