diff options
author | Rodger Combs <rodger.combs@gmail.com> | 2015-03-12 04:45:00 -0500 |
---|---|---|
committer | Rodger Combs <rodger.combs@gmail.com> | 2015-03-12 04:45:00 -0500 |
commit | e5b86309cf3117cb0a3a4523ae42d483c5356f15 (patch) | |
tree | 08cea45d0d704a310b79b1fa3eee677f52d4a7d2 /libass | |
parent | 0d94ff48077ba683bfd4d0b9ff7ded895ba20919 (diff) | |
download | libass-e5b86309cf3117cb0a3a4523ae42d483c5356f15.tar.bz2 libass-e5b86309cf3117cb0a3a4523ae42d483c5356f15.tar.xz |
Fix degrees/radians cache confusion; avoid a fixed-point overflow
Also fix an incorrect comment
Diffstat (limited to 'libass')
-rw-r--r-- | libass/ass_cache_template.h | 6 | ||||
-rw-r--r-- | libass/ass_utils.h | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/libass/ass_cache_template.h b/libass/ass_cache_template.h index dbf724c..da49f50 100644 --- a/libass/ass_cache_template.h +++ b/libass/ass_cache_template.h @@ -70,9 +70,9 @@ // describes an outline bitmap START(outline_bitmap, outline_bitmap_hash_key) GENERIC(OutlineHashValue *, outline) - GENERIC(int, frx) // signed 16.16 - GENERIC(int, fry) // signed 16.16 - GENERIC(int, frz) // signed 16.16 + GENERIC(int, frx) // signed 10.22 + GENERIC(int, fry) // signed 10.22 + GENERIC(int, frz) // signed 10.22 GENERIC(int, fax) // signed 16.16 GENERIC(int, fay) // signed 16.16 // shift vector that was added to glyph before applying rotation diff --git a/libass/ass_utils.h b/libass/ass_utils.h index 579ac40..b9af979 100644 --- a/libass/ass_utils.h +++ b/libass/ass_utils.h @@ -26,6 +26,7 @@ #include <string.h> #include <assert.h> #include <errno.h> +#include <math.h> #include "config.h" @@ -162,8 +163,7 @@ static inline int double_to_d22(double x) // Calculate cache key for a rotational angle in degrees static inline int rot_key(double a) { - const int m = double_to_d22(360.0); - return double_to_d22(a) % m; + return double_to_d22(fmod(a, M_PI)); } #define FNV1_32A_INIT 0x811c9dc5U |