summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-08-08 02:04:43 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-08-08 02:13:09 +0300
commit17d3e4b36d18f4a653f7c5f6ea2f15fcd3a2f069 (patch)
tree5d1910a2ab6381f6b4fb0ffc2834f55f7fef7129 /libass
parent2ba9df3df3d61a7cc1bde9f897bc77eaaf14b383 (diff)
parentaf76be6e197382af491fadef3fcf821a721c99f5 (diff)
downloadmpv-17d3e4b36d18f4a653f7c5f6ea2f15fcd3a2f069.tar.bz2
mpv-17d3e4b36d18f4a653f7c5f6ea2f15fcd3a2f069.tar.xz
Merge svn changes up to r27441
Conflicts: cfg-common-opts.h command.c configure input/input.c libmpcodecs/dec_video.c libmpcodecs/vd.c libmpdemux/stheader.h libvo/sub.c libvo/video_out.c libvo/vo_xv.c libvo/vosub_vidix.c libvo/x11_common.c libvo/x11_common.h mp_core.h mplayer.c stream/stream.h
Diffstat (limited to 'libass')
-rw-r--r--libass/ass.c12
-rw-r--r--libass/ass_bitmap.c3
-rw-r--r--libass/ass_font.c2
-rw-r--r--libass/ass_fontconfig.c8
-rw-r--r--libass/ass_fontconfig.h2
-rw-r--r--libass/ass_mp.c6
-rw-r--r--libass/ass_render.c19
7 files changed, 27 insertions, 25 deletions
diff --git a/libass/ass.c b/libass/ass.c
index 3f78afa994..1ee81773b3 100644
--- a/libass/ass.c
+++ b/libass/ass.c
@@ -32,7 +32,7 @@
#include <unistd.h>
#include <inttypes.h>
-#ifdef HAVE_ICONV
+#ifdef CONFIG_ICONV
#include <iconv.h>
#endif
@@ -810,7 +810,7 @@ void ass_process_chunk(ass_track_t* track, char *data, int size, long long timec
free(str);
}
-#ifdef HAVE_ICONV
+#ifdef CONFIG_ICONV
/** \brief recode buffer to utf-8
* constraint: codepage != 0
* \param data pointer to text buffer
@@ -826,7 +826,7 @@ static char* sub_recode(char* data, size_t size, char* codepage)
{
const char* cp_tmp = codepage;
-#ifdef HAVE_ENCA
+#ifdef CONFIG_ENCA
char enca_lang[3], enca_fallback[100];
if (sscanf(codepage, "enca:%2s:%99s", enca_lang, enca_fallback) == 2
|| sscanf(codepage, "ENCA:%2s:%99s", enca_lang, enca_fallback) == 2) {
@@ -991,7 +991,7 @@ ass_track_t* ass_read_memory(ass_library_t* library, char* buf, size_t bufsize,
if (!buf)
return 0;
-#ifdef HAVE_ICONV
+#ifdef CONFIG_ICONV
if (codepage)
buf = sub_recode(buf, bufsize, codepage);
if (!buf)
@@ -1017,7 +1017,7 @@ char* read_file_recode(char* fname, char* codepage, int* size)
buf = read_file(fname, &bufsize);
if (!buf)
return 0;
-#ifdef HAVE_ICONV
+#ifdef CONFIG_ICONV
if (codepage) {
char* tmpbuf = sub_recode(buf, bufsize, codepage);
free(buf);
@@ -1071,7 +1071,7 @@ int ass_read_styles(ass_track_t* track, char* fname, char* codepage)
buf = read_file(fname, &sz);
if (!buf)
return 1;
-#ifdef HAVE_ICONV
+#ifdef CONFIG_ICONV
if (codepage) {
char* tmpbuf;
tmpbuf = sub_recode(buf, sz, codepage);
diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c
index 9fb77a6924..3d85300d11 100644
--- a/libass/ass_bitmap.c
+++ b/libass/ass_bitmap.c
@@ -274,9 +274,10 @@ int glyph_to_bitmap(ass_synth_priv_t* priv, FT_Glyph glyph, FT_Glyph outline_gly
resize_tmp(priv, (*bm_g)->w, (*bm_g)->h);
if (be) {
- blur((*bm_g)->buffer, priv->tmp, (*bm_g)->w, (*bm_g)->h, (*bm_g)->w, (int*)priv->gt2, priv->g_r, priv->g_w);
if (*bm_o)
blur((*bm_o)->buffer, priv->tmp, (*bm_o)->w, (*bm_o)->h, (*bm_o)->w, (int*)priv->gt2, priv->g_r, priv->g_w);
+ else
+ blur((*bm_g)->buffer, priv->tmp, (*bm_g)->w, (*bm_g)->h, (*bm_g)->w, (int*)priv->gt2, priv->g_r, priv->g_w);
}
if (*bm_o)
diff --git a/libass/ass_font.c b/libass/ass_font.c
index f70b7c59e3..f2214a345d 100644
--- a/libass/ass_font.c
+++ b/libass/ass_font.c
@@ -284,7 +284,7 @@ FT_Glyph ass_font_get_glyph(void* fontconfig_priv, ass_font_t* font, uint32_t ch
break;
}
-#ifdef HAVE_FONTCONFIG
+#ifdef CONFIG_FONTCONFIG
if (index == 0) {
int face_idx;
mp_msg(MSGT_ASS, MSGL_INFO, MSGTR_LIBASS_GlyphNotFoundReselectingFont,
diff --git a/libass/ass_fontconfig.c b/libass/ass_fontconfig.c
index 6cf59ff144..fa15087652 100644
--- a/libass/ass_fontconfig.c
+++ b/libass/ass_fontconfig.c
@@ -37,13 +37,13 @@
#include "ass_library.h"
#include "ass_fontconfig.h"
-#ifdef HAVE_FONTCONFIG
+#ifdef CONFIG_FONTCONFIG
#include <fontconfig/fontconfig.h>
#include <fontconfig/fcfreetype.h>
#endif
struct fc_instance_s {
-#ifdef HAVE_FONTCONFIG
+#ifdef CONFIG_FONTCONFIG
FcConfig* config;
#endif
char* family_default;
@@ -51,7 +51,7 @@ struct fc_instance_s {
int index_default;
};
-#ifdef HAVE_FONTCONFIG
+#ifdef CONFIG_FONTCONFIG
// 4yo fontconfig does not have these.
// They are only needed for debug output, anyway.
@@ -474,7 +474,7 @@ fc_instance_t* fontconfig_init(ass_library_t* library, FT_Library ftlibrary, con
return priv;
}
-#else // HAVE_FONTCONFIG
+#else /* CONFIG_FONTCONFIG */
char* fontconfig_select(fc_instance_t* priv, const char* family, unsigned bold, unsigned italic, int* index,
uint32_t code)
diff --git a/libass/ass_fontconfig.h b/libass/ass_fontconfig.h
index 83e6123543..e9a1ce1567 100644
--- a/libass/ass_fontconfig.h
+++ b/libass/ass_fontconfig.h
@@ -28,7 +28,7 @@
#include <ft2build.h>
#include FT_FREETYPE_H
-#ifdef HAVE_FONTCONFIG
+#ifdef CONFIG_FONTCONFIG
#include <fontconfig/fontconfig.h>
#endif
diff --git a/libass/ass_mp.c b/libass/ass_mp.c
index 2e56a93518..ae6d3943e0 100644
--- a/libass/ass_mp.c
+++ b/libass/ass_mp.c
@@ -32,7 +32,7 @@
#include "ass_mp.h"
#include "ass_library.h"
-#ifdef HAVE_FONTCONFIG
+#ifdef CONFIG_FONTCONFIG
#include <fontconfig/fontconfig.h>
#endif
@@ -55,7 +55,7 @@ char* ass_border_color = NULL;
char* ass_styles_file = NULL;
int ass_hinting = ASS_HINTING_NATIVE + 4; // native hinting for unscaled osd
-#ifdef HAVE_FONTCONFIG
+#ifdef CONFIG_FONTCONFIG
extern int font_fontconfig;
#else
static int font_fontconfig = -1;
@@ -65,7 +65,7 @@ extern char* sub_font_name;
extern float text_font_scale_factor;
extern int subtitle_autoscale;
-#ifdef HAVE_ICONV
+#ifdef CONFIG_ICONV
extern char* sub_cp;
#else
static char* sub_cp = 0;
diff --git a/libass/ass_render.c b/libass/ass_render.c
index d6e94a7544..0ed4054ffa 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -149,8 +149,8 @@ typedef struct render_context_s {
EVENT_HSCROLL, // "Banner" transition effect, text_width is unlimited
EVENT_VSCROLL // "Scroll up", "Scroll down" transition effects
} evt_type;
- int pos_x, pos_y; // position
- int org_x, org_y; // origin
+ double pos_x, pos_y; // position
+ double org_x, org_y; // origin
char have_origin; // origin is explicitly defined; if 0, get_base_point() is used
double scale_x, scale_y;
double hspacing; // distance between letters, in pixels
@@ -456,19 +456,19 @@ static ass_image_t* render_text(text_info_t* text_info, int dst_x, int dst_y)
/**
* \brief Mapping between script and screen coordinates
*/
-static int x2scr(int x) {
+static int x2scr(double x) {
return x*frame_context.orig_width_nocrop / frame_context.track->PlayResX +
FFMAX(global_settings->left_margin, 0);
}
/**
* \brief Mapping between script and screen coordinates
*/
-static int y2scr(int y) {
+static int y2scr(double y) {
return y * frame_context.orig_height_nocrop / frame_context.track->PlayResY +
FFMAX(global_settings->top_margin, 0);
}
// the same for toptitles
-static int y2scr_top(int y) {
+static int y2scr_top(double y) {
if (global_settings->use_margins)
return y * frame_context.orig_height_nocrop / frame_context.track->PlayResY;
else
@@ -476,7 +476,7 @@ static int y2scr_top(int y) {
FFMAX(global_settings->top_margin, 0);
}
// the same for subtitles
-static int y2scr_sub(int y) {
+static int y2scr_sub(double y) {
if (global_settings->use_margins)
return y * frame_context.orig_height_nocrop / frame_context.track->PlayResY +
FFMAX(global_settings->top_margin, 0) +
@@ -727,7 +727,7 @@ static char* parse_tag(char* p, double pwr) {
} else if (mystrcmp(&p, "move")) {
int x1, x2, y1, y2;
long long t1, t2, delta_t, t;
- int x, y;
+ double x, y;
double k;
skip('(');
x1 = strtol(p, &p, 10);
@@ -888,6 +888,7 @@ static char* parse_tag(char* p, double pwr) {
render_context.org_x = v1;
render_context.org_y = v2;
render_context.have_origin = 1;
+ render_context.detect_collisions = 0;
} else if (mystrcmp(&p, "t")) {
double v[3];
int v1, v2;
@@ -1072,7 +1073,7 @@ static unsigned get_next_char(char** str)
p += 2;
*str = p;
return '\n';
- } else if (*(p+1) == 'n') {
+ } else if ((*(p+1) == 'n') || (*(p+1) == 'h')) {
p += 2;
*str = p;
return ' ';
@@ -1935,7 +1936,7 @@ static int ass_render_event(ass_event_t* event, event_images_t* event_images)
if (render_context.evt_type == EVENT_POSITIONED) {
int base_x = 0;
int base_y = 0;
- mp_msg(MSGT_ASS, MSGL_DBG2, "positioned event at %d, %d\n", render_context.pos_x, render_context.pos_y);
+ mp_msg(MSGT_ASS, MSGL_DBG2, "positioned event at %f, %f\n", render_context.pos_x, render_context.pos_y);
get_base_point(bbox, alignment, &base_x, &base_y);
device_x = x2scr(render_context.pos_x) - base_x;
device_y = y2scr(render_context.pos_y) - base_y;