summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-04 17:58:09 +0000
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-04 17:58:09 +0000
commita5876880e6030067e4879fd1815234c313028ed6 (patch)
treec6c453692feb0c7e3d3202cf0de5008873e4cebe /libass
parenteed98361befc05a44bae35f68a6348e49b9ecabc (diff)
downloadlibass-a5876880e6030067e4879fd1815234c313028ed6.tar.bz2
libass-a5876880e6030067e4879fd1815234c313028ed6.tar.xz
More precise bounding box calculation for karaoke effects.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20669 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libass')
-rw-r--r--libass/ass_render.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index f10e3d59..aa3918b9 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -39,6 +39,7 @@
#include "ass_library.h"
#include "libvo/sub.h" // for utf8_get_char
+#include "libavutil/common.h"
#define MAX_GLYPHS 1000
#define MAX_LINES 100
@@ -1495,8 +1496,12 @@ static void process_karaoke_effects(void)
tm_start = timing + s1->effect_skip_timing;
tm_end = tm_start + s1->effect_timing;
timing = tm_end;
- x_start = s1->bbox.xMin + s1->pos.x;
- x_end = e1->bbox.xMax + e1->pos.x;
+ x_start = 1000000;
+ x_end = -1000000;
+ for (cur2 = s1; cur2 <= e1; ++cur2) {
+ x_start = FFMIN(x_start, cur2->bbox.xMin + cur2->pos.x);
+ x_end = FFMAX(x_end, cur2->bbox.xMax + cur2->pos.x);
+ }
dt = (tm_current - tm_start);
if ((s1->effect_type == EF_KARAOKE) || (s1->effect_type == EF_KARAOKE_KO)) {