[MPlayer-cvslog] r20645 - in trunk: cfg-common.h libass/ass.c libass/ass_bitmap.c libass/ass_cache.c libass/ass_fontconfig.c libass/ass_mp.c libass/ass_render.c libass/ass_utils.c libmpcodecs/vf_ass.c mp_msg.h
eugeni
subversion at mplayerhq.hu
Fri Nov 3 19:15:33 CET 2006
Author: eugeni
Date: Fri Nov 3 19:15:33 2006
New Revision: 20645
Modified:
trunk/cfg-common.h
trunk/libass/ass.c
trunk/libass/ass_bitmap.c
trunk/libass/ass_cache.c
trunk/libass/ass_fontconfig.c
trunk/libass/ass_mp.c
trunk/libass/ass_render.c
trunk/libass/ass_utils.c
trunk/libmpcodecs/vf_ass.c
trunk/mp_msg.h
Log:
Introduce MSGT_ASS, use it for all libass messages.
Modified: trunk/cfg-common.h
==============================================================================
--- trunk/cfg-common.h (original)
+++ trunk/cfg-common.h Fri Nov 3 19:15:33 2006
@@ -612,6 +612,7 @@
{ "muxer", &mp_msg_levels[MSGT_MUXER], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL },
{ "osd-menu", &mp_msg_levels[MSGT_OSD_MENU], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL },
{ "identify", &mp_msg_levels[MSGT_IDENTIFY], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL },
+ { "ass", &mp_msg_levels[MSGT_ASS], CONF_TYPE_INT, CONF_RANGE, -1, 9, NULL },
{"help", "Available msg modules:\n"
" global - common player errors/information\n"
" cplayer - console player (mplayer.c)\n"
@@ -655,6 +656,7 @@
" netst - Netstream\n"
" muxer - muxer layer\n"
" identify - identify output\n"
+ " ass - libass messages\n"
"\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
{NULL, NULL, 0, 0, 0, 0, NULL}
Modified: trunk/libass/ass.c
==============================================================================
--- trunk/libass/ass.c (original)
+++ trunk/libass/ass.c Fri Nov 3 19:15:33 2006
@@ -172,7 +172,7 @@
return i;
}
i = track->default_style;
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "[%p] Warning: no style named '%s' found, using '%s'\n", track, name, track->styles[i].Name);
+ mp_msg(MSGT_ASS, MSGL_WARN, "[%p] Warning: no style named '%s' found, using '%s'\n", track, name, track->styles[i].Name);
return i; // use the first style
}
@@ -187,7 +187,7 @@
long long tm;
int res = sscanf(p, "%1d:%2d:%2d.%2d", &h, &m, &s, &ms);
if (res < 4) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "bad timestamp\n");
+ mp_msg(MSGT_ASS, MSGL_WARN, "bad timestamp\n");
return 0;
}
tm = ((h * 60 + m) * 60 + s) * 1000 + ms * 10;
@@ -213,13 +213,13 @@
#define ANYVAL(name,func) \
} else if (strcasecmp(tname, #name) == 0) { \
target->name = func(token); \
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "%s = %s\n", #name, token);
+ mp_msg(MSGT_ASS, MSGL_DBG2, "%s = %s\n", #name, token);
#define STRVAL(name) \
} else if (strcasecmp(tname, #name) == 0) { \
if (target->name != NULL) free(target->name); \
target->name = strdup(token); \
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "%s = %s\n", #name, token);
+ mp_msg(MSGT_ASS, MSGL_DBG2, "%s = %s\n", #name, token);
#define COLORVAL(name) ANYVAL(name,string2color)
#define INTVAL(name) ANYVAL(name,atoi)
@@ -228,7 +228,7 @@
#define STYLEVAL(name) \
} else if (strcasecmp(tname, #name) == 0) { \
target->name = lookup_style(track, token); \
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "%s = %s\n", #name, token);
+ mp_msg(MSGT_ASS, MSGL_DBG2, "%s = %s\n", #name, token);
#define ALIAS(alias,name) \
if (strcasecmp(tname, #alias) == 0) {tname = #name;}
@@ -290,7 +290,7 @@
if (last >= event->Text && *last == '\r')
*last = 0;
}
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "Text = %s\n", event->Text);
+ mp_msg(MSGT_ASS, MSGL_DBG2, "Text = %s\n", event->Text);
event->Duration -= event->Start;
free(format);
return 0; // "Text" is always the last
@@ -411,7 +411,7 @@
q = format = strdup(track->style_format);
- mp_msg(MSGT_GLOBAL, MSGL_V, "[%p] Style: %s\n", track, str);
+ mp_msg(MSGT_ASS, MSGL_V, "[%p] Style: %s\n", track, str);
sid = ass_alloc_style(track);
@@ -478,7 +478,7 @@
char* p = str + 7;
skip_spaces(&p);
track->style_format = strdup(p);
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "Style format: %s\n", track->style_format);
+ mp_msg(MSGT_ASS, MSGL_DBG2, "Style format: %s\n", track->style_format);
} else if (!strncmp(str,"Style:", 6)) {
char* p = str + 6;
skip_spaces(&p);
@@ -507,7 +507,7 @@
char* p = str + 7;
skip_spaces(&p);
track->event_format = strdup(p);
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "Event format: %s\n", track->event_format);
+ mp_msg(MSGT_ASS, MSGL_DBG2, "Event format: %s\n", track->event_format);
} else if (!strncmp(str, "Dialogue:", 9)) {
// This should never be reached for embedded subtitles.
// They have slightly different format and are parsed in ass_process_chunk,
@@ -523,7 +523,7 @@
process_event_tail(track, event, str, 0);
} else {
- mp_msg(MSGT_GLOBAL, MSGL_V, "Not understood: %s \n", str);
+ mp_msg(MSGT_ASS, MSGL_V, "Not understood: %s \n", str);
}
return 0;
}
@@ -555,10 +555,10 @@
int dsize; // decoded size
unsigned char* buf = 0;
- mp_msg(MSGT_GLOBAL, MSGL_V, "font: %d bytes encoded data \n", track->parser_priv->fontdata_used);
+ mp_msg(MSGT_ASS, MSGL_V, "font: %d bytes encoded data \n", track->parser_priv->fontdata_used);
size = track->parser_priv->fontdata_used;
if (size % 4 == 1) {
- mp_msg(MSGT_GLOBAL, MSGL_ERR, "bad encoded data size\n");
+ mp_msg(MSGT_ASS, MSGL_ERR, "bad encoded data size\n");
goto error_decode_font;
}
buf = malloc(size / 4 * 3 + 2);
@@ -601,18 +601,18 @@
decode_font(track);
}
track->parser_priv->fontname = validate_fname(p);
- mp_msg(MSGT_GLOBAL, MSGL_V, "fontname: %s\n", track->parser_priv->fontname);
+ mp_msg(MSGT_ASS, MSGL_V, "fontname: %s\n", track->parser_priv->fontname);
return 0;
}
if (!track->parser_priv->fontname) {
- mp_msg(MSGT_GLOBAL, MSGL_V, "Not understood: %s \n", str);
+ mp_msg(MSGT_ASS, MSGL_V, "Not understood: %s \n", str);
return 0;
}
len = strlen(str);
if (len > 80) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "Font line too long: %d, %s\n", len, str);
+ mp_msg(MSGT_ASS, MSGL_WARN, "Font line too long: %d, %s\n", len, str);
return 0;
}
if (track->parser_priv->fontdata_used + len > track->parser_priv->fontdata_size) {
@@ -752,14 +752,14 @@
ass_event_t* event;
if (!track->event_format) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "Event format header missing\n");
+ mp_msg(MSGT_ASS, MSGL_WARN, "Event format header missing\n");
return;
}
str = malloc(size + 1);
memcpy(str, data, size);
str[size] = '\0';
- mp_msg(MSGT_GLOBAL, MSGL_V, "event at %" PRId64 ", +%" PRId64 ": %s \n", (int64_t)timecode, (int64_t)duration, str);
+ mp_msg(MSGT_ASS, MSGL_V, "event at %" PRId64 ", +%" PRId64 ": %s \n", (int64_t)timecode, (int64_t)duration, str);
eid = ass_alloc_event(track);
event = track->events + eid;
@@ -814,9 +814,9 @@
}
#endif
if ((icdsc = iconv_open (tocp, cp_tmp)) != (iconv_t)(-1)){
- mp_msg(MSGT_SUBREADER,MSGL_V,"LIBSUB: opened iconv descriptor.\n");
+ mp_msg(MSGT_ASS,MSGL_V,"LIBSUB: opened iconv descriptor.\n");
} else
- mp_msg(MSGT_SUBREADER,MSGL_ERR,"LIBSUB: error opening iconv descriptor.\n");
+ mp_msg(MSGT_ASS,MSGL_ERR,"LIBSUB: error opening iconv descriptor.\n");
#ifdef HAVE_ENCA
if (cp_tmp) free(cp_tmp);
#endif
@@ -844,7 +844,7 @@
osize += size;
oleft += size;
} else {
- mp_msg(MSGT_SUBREADER, MSGL_WARN, "LIBSUB: error recoding file.\n");
+ mp_msg(MSGT_ASS, MSGL_WARN, "LIBSUB: error recoding file.\n");
return NULL;
}
}
@@ -855,7 +855,7 @@
if (icdsc != (iconv_t)(-1)) {
(void)iconv_close(icdsc);
icdsc = (iconv_t)(-1);
- mp_msg(MSGT_SUBREADER,MSGL_V,"LIBSUB: closed iconv descriptor.\n");
+ mp_msg(MSGT_ASS,MSGL_V,"LIBSUB: closed iconv descriptor.\n");
}
return outbuf;
@@ -877,12 +877,12 @@
FILE* fp = fopen(fname, "rb");
if (!fp) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "ass_read_file(%s): fopen failed\n", fname);
+ mp_msg(MSGT_ASS, MSGL_WARN, "ass_read_file(%s): fopen failed\n", fname);
return 0;
}
res = fseek(fp, 0, SEEK_END);
if (res == -1) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "ass_read_file(%s): fseek failed\n", fname);
+ mp_msg(MSGT_ASS, MSGL_WARN, "ass_read_file(%s): fseek failed\n", fname);
fclose(fp);
return 0;
}
@@ -891,12 +891,12 @@
rewind(fp);
if (sz > 10*1024*1024) {
- mp_msg(MSGT_GLOBAL, MSGL_INFO, "ass_read_file(%s): Refusing to load subtitles larger than 10M\n", fname);
+ mp_msg(MSGT_ASS, MSGL_INFO, "ass_read_file(%s): Refusing to load subtitles larger than 10M\n", fname);
fclose(fp);
return 0;
}
- mp_msg(MSGT_GLOBAL, MSGL_V, "file size: %ld\n", sz);
+ mp_msg(MSGT_ASS, MSGL_V, "file size: %ld\n", sz);
buf = malloc(sz + 1);
assert(buf);
@@ -904,7 +904,7 @@
do {
res = fread(buf + bytes_read, 1, sz - bytes_read, fp);
if (res <= 0) {
- mp_msg(MSGT_GLOBAL, MSGL_INFO, "Read failed, %d: %s\n", errno, strerror(errno));
+ mp_msg(MSGT_ASS, MSGL_INFO, "Read failed, %d: %s\n", errno, strerror(errno));
fclose(fp);
free(buf);
return 0;
@@ -980,7 +980,7 @@
if (!track)
return 0;
- mp_msg(MSGT_GLOBAL, MSGL_INFO, "LIBASS: added subtitle file: <memory> (%d styles, %d events)\n", track->n_styles, track->n_events);
+ mp_msg(MSGT_ASS, MSGL_INFO, "LIBASS: added subtitle file: <memory> (%d styles, %d events)\n", track->n_styles, track->n_events);
return track;
}
@@ -1017,7 +1017,7 @@
track->name = strdup(fname);
- mp_msg(MSGT_GLOBAL, MSGL_INFO, "LIBASS: added subtitle file: %s (%d styles, %d events)\n", fname, track->n_styles, track->n_events);
+ mp_msg(MSGT_ASS, MSGL_INFO, "LIBASS: added subtitle file: %s (%d styles, %d events)\n", fname, track->n_styles, track->n_events);
// dump_events(forced_tid);
return track;
@@ -1116,10 +1116,10 @@
res = mkdir(fonts_dir);
#endif
if (res) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "Failed to create: %s\n", fonts_dir);
+ mp_msg(MSGT_ASS, MSGL_WARN, "Failed to create: %s\n", fonts_dir);
}
} else if (!S_ISDIR(st.st_mode)) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "Not a directory: %s\n", fonts_dir);
+ mp_msg(MSGT_ASS, MSGL_WARN, "Not a directory: %s\n", fonts_dir);
}
fname = validate_fname((char*)name);
Modified: trunk/libass/ass_bitmap.c
==============================================================================
--- trunk/libass/ass_bitmap.c (original)
+++ trunk/libass/ass_bitmap.c Fri Nov 3 19:15:33 2006
@@ -164,14 +164,14 @@
error = FT_Glyph_To_Bitmap(&glyph, FT_RENDER_MODE_NORMAL, 0, 0);
if (error) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "FT_Glyph_To_Bitmap error %d \n", error);
+ mp_msg(MSGT_ASS, MSGL_WARN, "FT_Glyph_To_Bitmap error %d \n", error);
return 0;
}
bg = (FT_BitmapGlyph)glyph;
bit = &(bg->bitmap);
if (bit->pixel_mode != FT_PIXEL_MODE_GRAY) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "Unsupported pixel mode: %d\n", (int)(bit->pixel_mode));
+ mp_msg(MSGT_ASS, MSGL_WARN, "Unsupported pixel mode: %d\n", (int)(bit->pixel_mode));
FT_Done_Glyph(glyph);
return 0;
}
Modified: trunk/libass/ass_cache.c
==============================================================================
--- trunk/libass/ass_cache.c (original)
+++ trunk/libass/ass_cache.c Fri Nov 3 19:15:33 2006
@@ -78,7 +78,7 @@
}
if (face_cache_size == MAX_FACE_CACHE_SIZE) {
- mp_msg(MSGT_GLOBAL, MSGL_FATAL, "Too many fonts\n");
+ mp_msg(MSGT_ASS, MSGL_FATAL, "Too many fonts\n");
return 1;
}
@@ -87,7 +87,7 @@
error = FT_New_Face(library, path, index, face);
if (error) {
if (!no_more_font_messages)
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "Error opening font: %s, %d\n", path, index);
+ mp_msg(MSGT_ASS, MSGL_WARN, "Error opening font: %s, %d\n", path, index);
no_more_font_messages = 1;
return 1;
}
Modified: trunk/libass/ass_fontconfig.c
==============================================================================
--- trunk/libass/ass_fontconfig.c (original)
+++ trunk/libass/ass_fontconfig.c Fri Nov 3 19:15:33 2006
@@ -101,7 +101,7 @@
return 0;
if (strcasecmp((const char*)val_s, family) != 0)
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "fontconfig: selected font family is not the requested one: '%s' != '%s'\n",
+ mp_msg(MSGT_ASS, MSGL_WARN, "fontconfig: selected font family is not the requested one: '%s' != '%s'\n",
(const char*)val_s, family);
result = FcPatternGetString(rpat, FC_FILE, 0, &val_s);
@@ -128,24 +128,24 @@
if (!res && priv->family_default) {
res = _select_font(priv, priv->family_default, bold, italic, index);
if (res && !no_more_font_messages)
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "fontconfig_select: using default font family: (%s, %d, %d) -> %s, %d\n",
+ mp_msg(MSGT_ASS, MSGL_WARN, "fontconfig_select: using default font family: (%s, %d, %d) -> %s, %d\n",
family, bold, italic, res, *index);
}
if (!res && priv->path_default) {
res = priv->path_default;
*index = priv->index_default;
if (!no_more_font_messages)
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "fontconfig_select: using default font: (%s, %d, %d) -> %s, %d\n",
+ mp_msg(MSGT_ASS, MSGL_WARN, "fontconfig_select: using default font: (%s, %d, %d) -> %s, %d\n",
family, bold, italic, res, *index);
}
if (!res) {
res = _select_font(priv, "Arial", bold, italic, index);
if (res && !no_more_font_messages)
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "fontconfig_select: using 'Arial' font family: (%s, %d, %d) -> %s, %d\n",
+ mp_msg(MSGT_ASS, MSGL_WARN, "fontconfig_select: using 'Arial' font family: (%s, %d, %d) -> %s, %d\n",
family, bold, italic, res, *index);
}
if (res)
- mp_msg(MSGT_GLOBAL, MSGL_V, "fontconfig_select: (%s, %d, %d) -> %s, %d\n",
+ mp_msg(MSGT_ASS, MSGL_V, "fontconfig_select: (%s, %d, %d) -> %s, %d\n",
family, bold, italic, res, *index);
return res;
}
@@ -168,15 +168,15 @@
priv->config = FcConfigGetCurrent();
if (!priv->config) {
- mp_msg(MSGT_GLOBAL, MSGL_FATAL, "FcInitLoadConfigAndFonts failed\n");
+ mp_msg(MSGT_ASS, MSGL_FATAL, "FcInitLoadConfigAndFonts failed\n");
return 0;
}
if (FcDirCacheValid((const FcChar8 *)dir) == FcFalse)
{
- mp_msg(MSGT_GLOBAL, MSGL_INFO, "[ass] Updating font cache\n");
+ mp_msg(MSGT_ASS, MSGL_INFO, "[ass] Updating font cache\n");
if (FcGetVersion() >= 20390 && FcGetVersion() < 20400)
- mp_msg(MSGT_GLOBAL, MSGL_WARN,
+ mp_msg(MSGT_ASS, MSGL_WARN,
"[ass] beta versions of fontconfig are not supported\n"
" update before reporting any bugs\n");
// FontConfig >= 2.4.0 updates cache automatically in FcConfigAppFontAddDir()
@@ -187,19 +187,19 @@
fss = FcStrSetCreate();
rc = FcStrSetAdd(fss, (const FcChar8*)dir);
if (!rc) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "FcStrSetAdd failed\n");
+ mp_msg(MSGT_ASS, MSGL_WARN, "FcStrSetAdd failed\n");
goto ErrorFontCache;
}
rc = FcDirScan(fcs, fss, NULL, FcConfigGetBlanks(priv->config), (const FcChar8 *)dir, FcFalse);
if (!rc) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "FcDirScan failed\n");
+ mp_msg(MSGT_ASS, MSGL_WARN, "FcDirScan failed\n");
goto ErrorFontCache;
}
rc = FcDirSave(fcs, fss, (const FcChar8 *)dir);
if (!rc) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "FcDirSave failed\n");
+ mp_msg(MSGT_ASS, MSGL_WARN, "FcDirSave failed\n");
goto ErrorFontCache;
}
ErrorFontCache:
@@ -209,7 +209,7 @@
rc = FcConfigAppFontAddDir(priv->config, (const FcChar8*)dir);
if (!rc) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "FcConfigAppFontAddDir failed\n");
+ mp_msg(MSGT_ASS, MSGL_WARN, "FcConfigAppFontAddDir failed\n");
}
priv->family_default = family ? strdup(family) : 0;
@@ -236,7 +236,7 @@
{
fc_instance_t* priv;
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "Fontconfig disabled, only default font will be used\n");
+ mp_msg(MSGT_ASS, MSGL_WARN, "Fontconfig disabled, only default font will be used\n");
priv = calloc(1, sizeof(fc_instance_t));
Modified: trunk/libass/ass_mp.c
==============================================================================
--- trunk/libass/ass_mp.c (original)
+++ trunk/libass/ass_mp.c Fri Nov 3 19:15:33 2006
@@ -176,7 +176,7 @@
return -1;
}
- mp_msg(MSGT_GLOBAL, MSGL_V, "plaintext event at %" PRId64 ", +%" PRId64 ": %s \n",
+ mp_msg(MSGT_ASS, MSGL_V, "plaintext event at %" PRId64 ", +%" PRId64 ": %s \n",
(int64_t)event->Start, (int64_t)event->Duration, event->Text);
return eid;
Modified: trunk/libass/ass_render.c
==============================================================================
--- trunk/libass/ass_render.c (original)
+++ trunk/libass/ass_render.c Fri Nov 3 19:15:33 2006
@@ -205,7 +205,7 @@
if (track->PlayResX && track->PlayResY)
return;
if (!track->PlayResX && !track->PlayResY) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "Neither PlayResX nor PlayResY defined. Assuming 384x288. \n");
+ mp_msg(MSGT_ASS, MSGL_WARN, "Neither PlayResX nor PlayResY defined. Assuming 384x288. \n");
track->PlayResX = 384;
track->PlayResY = 288;
} else {
@@ -213,10 +213,10 @@
frame_context.orig_height / frame_context.width;
if (!track->PlayResY) {
track->PlayResY = track->PlayResX / orig_aspect + .5;
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "PlayResY undefined, setting %d \n", track->PlayResY);
+ mp_msg(MSGT_ASS, MSGL_WARN, "PlayResY undefined, setting %d \n", track->PlayResY);
} else if (!track->PlayResX) {
track->PlayResX = track->PlayResY * orig_aspect + .5;
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "PlayResX undefined, setting %d \n", track->PlayResX);
+ mp_msg(MSGT_ASS, MSGL_WARN, "PlayResX undefined, setting %d \n", track->PlayResX);
}
}
}
@@ -233,7 +233,7 @@
error = FT_Init_FreeType( &ft );
if ( error ) {
- mp_msg(MSGT_GLOBAL, MSGL_FATAL, "FT_Init_FreeType failed\n");
+ mp_msg(MSGT_ASS, MSGL_FATAL, "FT_Init_FreeType failed\n");
goto ass_init_exit;
}
@@ -255,8 +255,8 @@
text_info.glyphs = calloc(MAX_GLYPHS, sizeof(glyph_info_t));
ass_init_exit:
- if (priv) mp_msg(MSGT_GLOBAL, MSGL_INFO, "[ass] Init\n");
- else mp_msg(MSGT_GLOBAL, MSGL_ERR, "[ass] Init failed\n");
+ if (priv) mp_msg(MSGT_ASS, MSGL_INFO, "[ass] Init\n");
+ else mp_msg(MSGT_ASS, MSGL_ERR, "[ass] Init failed\n");
return priv;
}
@@ -333,22 +333,22 @@
tmp = dst_x - clip_x0;
if (tmp < 0) {
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "clip left\n");
+ mp_msg(MSGT_ASS, MSGL_DBG2, "clip left\n");
b_x0 = - tmp;
}
tmp = dst_y - clip_y0;
if (tmp < 0) {
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "clip top\n");
+ mp_msg(MSGT_ASS, MSGL_DBG2, "clip top\n");
b_y0 = - tmp;
}
tmp = clip_x1 - dst_x - bm->w;
if (tmp < 0) {
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "clip right\n");
+ mp_msg(MSGT_ASS, MSGL_DBG2, "clip right\n");
b_x1 = bm->w + tmp;
}
tmp = clip_y1 - dst_y - bm->h;
if (tmp < 0) {
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "clip bottom\n");
+ mp_msg(MSGT_ASS, MSGL_DBG2, "clip bottom\n");
b_y1 = bm->h + tmp;
}
@@ -623,7 +623,7 @@
error = FT_Stroker_New( render_context.face->memory, &render_context.stroker );
#endif
if (error) {
- mp_msg(MSGT_GLOBAL, MSGL_V, "failed to get stroker\n");
+ mp_msg(MSGT_ASS, MSGL_V, "failed to get stroker\n");
render_context.stroker = 0;
}
}
@@ -771,12 +771,12 @@
t1 = strtoll(p, &p, 10);
skip(',');
t2 = strtoll(p, &p, 10);
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "movement6: (%d, %d) -> (%d, %d), (%" PRId64 " .. %" PRId64 ")\n",
+ mp_msg(MSGT_ASS, MSGL_DBG2, "movement6: (%d, %d) -> (%d, %d), (%" PRId64 " .. %" PRId64 ")\n",
x1, y1, x2, y2, (int64_t)t1, (int64_t)t2);
} else {
t1 = 0;
t2 = render_context.event->Duration;
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "movement: (%d, %d) -> (%d, %d)\n", x1, y1, x2, y2);
+ mp_msg(MSGT_ASS, MSGL_DBG2, "movement: (%d, %d) -> (%d, %d)\n", x1, y1, x2, y2);
}
skip(')');
delta_t = t2 - t1;
@@ -795,12 +795,12 @@
} else if (mystrcmp(&p, "frx") || mystrcmp(&p, "fry")) {
double val;
mystrtod(&p, &val);
- mp_msg(MSGT_GLOBAL, MSGL_V, "frx/fry unimplemented \n");
+ mp_msg(MSGT_ASS, MSGL_V, "frx/fry unimplemented \n");
} else if (mystrcmp(&p, "frz") || mystrcmp(&p, "fr")) {
double angle;
double val;
mystrtod(&p, &val);
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "setting rotation to %.2f\n", val * pwr);
+ mp_msg(MSGT_ASS, MSGL_DBG2, "setting rotation to %.2f\n", val * pwr);
angle = M_PI * val / 180;
render_context.rotation = angle * pwr;
} else if (mystrcmp(&p, "fn")) {
@@ -831,11 +831,11 @@
} else if (mystrcmp(&p, "an")) {
int val = strtol(p, &p, 10);
int v = (val - 1) / 3; // 0, 1 or 2 for vertical alignment
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "an %d\n", val);
+ mp_msg(MSGT_ASS, MSGL_DBG2, "an %d\n", val);
if (v != 0) v = 3 - v;
val = ((val - 1) % 3) + 1; // horizontal alignment
val += v*4;
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "align %d\n", val);
+ mp_msg(MSGT_ASS, MSGL_DBG2, "align %d\n", val);
render_context.alignment = val;
} else if (mystrcmp(&p, "a")) {
int val = strtol(p, &p, 10);
@@ -847,7 +847,7 @@
skip(',');
v2 = strtol(p, &p, 10);
skip(')');
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "pos(%d, %d)\n", v1, v2);
+ mp_msg(MSGT_ASS, MSGL_DBG2, "pos(%d, %d)\n", v1, v2);
render_context.evt_type = EVENT_POSITIONED;
render_context.detect_collisions = 0;
render_context.pos_x = v1;
@@ -893,7 +893,7 @@
skip(',');
v2 = strtol(p, &p, 10);
skip(')');
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "org(%d, %d)\n", v1, v2);
+ mp_msg(MSGT_ASS, MSGL_DBG2, "org(%d, %d)\n", v1, v2);
// render_context.evt_type = EVENT_POSITIONED;
render_context.org_x = v1;
render_context.org_y = v2;
@@ -960,7 +960,7 @@
uint32_t val;
if (!strtocolor(&p, &val))
val = render_context.style->PrimaryColour;
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "color: %X\n", val);
+ mp_msg(MSGT_ASS, MSGL_DBG2, "color: %X\n", val);
change_color(&render_context.c[0], val, pwr);
} else if ((*p >= '1') && (*p <= '4') && (++p) && (mystrcmp(&p, "c") || mystrcmp(&p, "a"))) {
char n = *(p-2);
@@ -979,9 +979,9 @@
switch (cmd) {
case 'c': change_color(render_context.c + cidx, val, pwr); break;
case 'a': change_alpha(render_context.c + cidx, val >> 24, pwr); break;
- default: mp_msg(MSGT_GLOBAL, MSGL_WARN, "Bad command: %c%c\n", n, cmd); break;
+ default: mp_msg(MSGT_ASS, MSGL_WARN, "Bad command: %c%c\n", n, cmd); break;
}
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "single c/a at %f: %c%c = %X \n", pwr, n, cmd, render_context.c[cidx]);
+ mp_msg(MSGT_ASS, MSGL_DBG2, "single c/a at %f: %c%c = %X \n", pwr, n, cmd, render_context.c[cidx]);
} else if (mystrcmp(&p, "r")) {
reset_render_context();
} else if (mystrcmp(&p, "be")) {
@@ -1058,7 +1058,7 @@
} else
break;
} else if (*p != '\\')
- mp_msg(MSGT_GLOBAL, MSGL_V, "Unable to parse: \"%s\" \n", p);
+ mp_msg(MSGT_ASS, MSGL_V, "Unable to parse: \"%s\" \n", p);
if (*p == 0)
break;
}
@@ -1100,7 +1100,7 @@
if (strncmp(event->Effect, "Banner;", 7) == 0) {
int delay;
if (cnt < 1) {
- mp_msg(MSGT_GLOBAL, MSGL_V, "Error parsing effect: %s \n", event->Effect);
+ mp_msg(MSGT_ASS, MSGL_V, "Error parsing effect: %s \n", event->Effect);
return;
}
if (cnt >= 2 && v[1] == 0) // right-to-left
@@ -1120,7 +1120,7 @@
} else if (strncmp(event->Effect, "Scroll down;", 12) == 0) {
render_context.scroll_direction = SCROLL_TB;
} else {
- mp_msg(MSGT_GLOBAL, MSGL_V, "Unknown transition effect: %s \n", event->Effect);
+ mp_msg(MSGT_ASS, MSGL_V, "Unknown transition effect: %s \n", event->Effect);
return;
}
// parse scroll up/down parameters
@@ -1128,7 +1128,7 @@
int delay;
int y0, y1;
if (cnt < 3) {
- mp_msg(MSGT_GLOBAL, MSGL_V, "Error parsing effect: %s \n", event->Effect);
+ mp_msg(MSGT_ASS, MSGL_V, "Error parsing effect: %s \n", event->Effect);
return;
}
delay = v[2];
@@ -1254,11 +1254,11 @@
}
// not found, get a new outline glyph from face
-// mp_msg(MSGT_GLOBAL, MSGL_INFO, "miss, index = %d, symbol = %c, adv = (%d, %d)\n", index, symbol, advance->x, advance->y);
+// mp_msg(MSGT_ASS, MSGL_INFO, "miss, index = %d, symbol = %c, adv = (%d, %d)\n", index, symbol, advance->x, advance->y);
error = FT_Load_Glyph(render_context.face, index, FT_LOAD_NO_BITMAP );
if (error) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "Error loading glyph\n");
+ mp_msg(MSGT_ASS, MSGL_WARN, "Error loading glyph\n");
return error;
}
@@ -1273,7 +1273,7 @@
#endif
error = FT_Get_Glyph(render_context.face->glyph, &(info->glyph));
if (error) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "Error getting glyph\n");
+ mp_msg(MSGT_ASS, MSGL_WARN, "Error getting glyph\n");
return error;
}
@@ -1284,7 +1284,7 @@
info->outline_glyph = info->glyph;
error = FT_Glyph_Stroke( &(info->outline_glyph), render_context.stroker, 0 ); // don't destroy original
if (error) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "FT_Glyph_Stroke error %d \n", error);
+ mp_msg(MSGT_ASS, MSGL_WARN, "FT_Glyph_Stroke error %d \n", error);
}
} else {
info->outline_glyph = 0;
@@ -1361,7 +1361,7 @@
if (cur->symbol == '\n') {
break_type = 2;
break_at = i;
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "forced line break at %d\n", break_at);
+ mp_msg(MSGT_ASS, MSGL_DBG2, "forced line break at %d\n", break_at);
}
if (len >= max_text_width) {
@@ -1371,8 +1371,8 @@
break_at = i - 1;
if (break_at == -1)
break_at = 0;
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "overfill at %d\n", i);
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "line break at %d\n", break_at);
+ mp_msg(MSGT_ASS, MSGL_DBG2, "overfill at %d\n", i);
+ mp_msg(MSGT_ASS, MSGL_DBG2, "line break at %d\n", break_at);
}
if (break_at != -1) {
@@ -1451,7 +1451,7 @@
cur_line ++;
pen_shift_x = - cur->pos.x;
pen_shift_y += (height >> 6) + global_settings->line_spacing;
- mp_msg(MSGT_GLOBAL, MSGL_DBG2, "shifting from %d to %d by (%d, %d)\n", i, text_info.length - 1, pen_shift_x, pen_shift_y);
+ mp_msg(MSGT_ASS, MSGL_DBG2, "shifting from %d to %d by (%d, %d)\n", i, text_info.length - 1, pen_shift_x, pen_shift_y);
}
cur->pos.x += pen_shift_x;
cur->pos.y += pen_shift_y;
@@ -1508,7 +1508,7 @@
dt /= (tm_end - tm_start);
x = x_start + (x_end - x_start) * dt;
} else {
- mp_msg(MSGT_GLOBAL, MSGL_ERR, "Unknown effect type (internal error) \n");
+ mp_msg(MSGT_ASS, MSGL_ERR, "Unknown effect type (internal error) \n");
continue;
}
@@ -1601,11 +1601,11 @@
int device_x = 0, device_y = 0;
if (event->Style >= frame_context.track->n_styles) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "No style found!\n");
+ mp_msg(MSGT_ASS, MSGL_WARN, "No style found!\n");
return 1;
}
if (!event->Text) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "Empty event!\n");
+ mp_msg(MSGT_ASS, MSGL_WARN, "Empty event!\n");
return 1;
}
@@ -1635,7 +1635,7 @@
use_kerning = FT_HAS_KERNING(render_context.face);
if (text_info.length >= MAX_GLYPHS) {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "\nMAX_GLYPHS reached: event %d, start = %llu, duration = %llu\n Text = %s\n",
+ mp_msg(MSGT_ASS, MSGL_WARN, "\nMAX_GLYPHS reached: event %d, start = %llu, duration = %llu\n Text = %s\n",
(int)(event - frame_context.track->events), event->Start, event->Duration, event->Text);
break;
}
@@ -1796,7 +1796,7 @@
} else { // subtitle
int scr_y;
if (valign != VALIGN_SUB)
- mp_msg(MSGT_GLOBAL, MSGL_V, "Invalid valign, supposing 0 (subtitle)\n");
+ mp_msg(MSGT_ASS, MSGL_V, "Invalid valign, supposing 0 (subtitle)\n");
scr_y = y2scr_sub(frame_context.track->PlayResY - MarginV);
device_y = scr_y;
device_y -= (text_info.height >> 6);
@@ -1813,7 +1813,7 @@
if (render_context.evt_type == EVENT_POSITIONED) {
int base_x = 0;
int base_y = 0;
- mp_msg(MSGT_GLOBAL, 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 %d, %d\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;
@@ -2146,7 +2146,7 @@
s.a = priv->top;
s.b = priv->top + priv->height;
if (priv->height != imgs[i].height) { // no, it's not
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "Achtung! Event height has changed! \n");
+ mp_msg(MSGT_ASS, MSGL_WARN, "Achtung! Event height has changed! \n");
priv->top = 0;
priv->height = 0;
}
@@ -2212,7 +2212,7 @@
rc = ass_render_event(event, eimg + cnt);
if (!rc) ++cnt;
} else {
- mp_msg(MSGT_GLOBAL, MSGL_WARN, "Too many simultaneous events \n");
+ mp_msg(MSGT_ASS, MSGL_WARN, "Too many simultaneous events \n");
break;
}
}
Modified: trunk/libass/ass_utils.c
==============================================================================
--- trunk/libass/ass_utils.c (original)
+++ trunk/libass/ass_utils.c Fri Nov 3 19:15:33 2006
@@ -59,7 +59,7 @@
char* p = *q;
if (*p == '&') ++p;
- else mp_msg(MSGT_GLOBAL, MSGL_DBG2, "suspicious color format: \"%s\"\n", p);
+ else mp_msg(MSGT_ASS, MSGL_DBG2, "suspicious color format: \"%s\"\n", p);
if (*p == 'H' || *p == 'h') {
++p;
Modified: trunk/libmpcodecs/vf_ass.c
==============================================================================
--- trunk/libmpcodecs/vf_ass.c (original)
+++ trunk/libmpcodecs/vf_ass.c Fri Nov 3 19:15:33 2006
@@ -113,7 +113,7 @@
if((vf->dmpi->flags & MP_IMGFLAG_DRAW_CALLBACK) &&
!(vf->dmpi->flags & MP_IMGFLAG_DIRECT)){
- mp_msg(MSGT_VFILTER, MSGL_INFO, MSGTR_MPCODECS_FullDRNotPossible);
+ mp_msg(MSGT_ASS, MSGL_INFO, MSGTR_MPCODECS_FullDRNotPossible);
return;
}
@@ -162,7 +162,7 @@
{
if(mpi->flags&MP_IMGFLAG_DIRECT || mpi->flags&MP_IMGFLAG_DRAW_CALLBACK){
vf->dmpi = mpi->priv;
- if (!vf->dmpi) { mp_msg(MSGT_VFILTER, MSGL_WARN, MSGTR_MPCODECS_FunWhydowegetNULL); return 0; }
+ if (!vf->dmpi) { mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_MPCODECS_FunWhydowegetNULL); return 0; }
mpi->priv = NULL;
// we've used DR, so we're ready...
if (ass_top_margin)
@@ -390,7 +390,7 @@
}
if (vf->priv->auto_insert)
- mp_msg(MSGT_VFILTER, MSGL_INFO, "[ass] auto-open\n");
+ mp_msg(MSGT_ASS, MSGL_INFO, "[ass] auto-open\n");
vf->config = config;
vf->query_format = query_format;
Modified: trunk/mp_msg.h
==============================================================================
--- trunk/mp_msg.h (original)
+++ trunk/mp_msg.h Fri Nov 3 19:15:33 2006
@@ -99,6 +99,8 @@
#define MSGT_RADIO 42
+#define MSGT_ASS 43 // libass messages
+
#define MSGT_MAX 64
void mp_msg_init(void);
More information about the MPlayer-cvslog
mailing list