From 6fef7a200fea4795e207d0a9d860a495f469b87f Mon Sep 17 00:00:00 2001 From: eugeni Date: Fri, 3 Nov 2006 18:15:33 +0000 Subject: Introduce MSGT_ASS, use it for all libass messages. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20645 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass.c | 60 +++++++++++++++++------------------ libass/ass_bitmap.c | 4 +-- libass/ass_cache.c | 4 +-- libass/ass_fontconfig.c | 26 +++++++-------- libass/ass_mp.c | 2 +- libass/ass_render.c | 84 ++++++++++++++++++++++++------------------------- libass/ass_utils.c | 2 +- 7 files changed, 91 insertions(+), 91 deletions(-) (limited to 'libass') diff --git a/libass/ass.c b/libass/ass.c index 86b36d8a60..dba3f38caa 100644 --- a/libass/ass.c +++ b/libass/ass.c @@ -172,7 +172,7 @@ static int lookup_style(ass_track_t* track, char* name) { 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 @@ static long long string2timecode(char* p) { 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 @@ static int numpad2align(int val) { #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 @@ static int numpad2align(int val) { #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 @@ static int process_event_tail(ass_track_t* track, ass_event_t* event, char* str, 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 @@ static int process_style(ass_track_t* track, char *str) 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 @@ static int process_styles_line(ass_track_t* track, char *str) 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 @@ static int process_events_line(ass_track_t* track, char *str) 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 @@ static int process_events_line(ass_track_t* track, char *str) 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 @@ static int decode_font(ass_track_t* track) 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 @@ static int process_fonts_line(ass_track_t* track, char *str) 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 @@ void ass_process_chunk(ass_track_t* track, char *data, int size, long long timec 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 @@ static char* sub_recode(char* data, size_t size, char* codepage) } #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 @@ static char* sub_recode(char* data, size_t size, char* codepage) 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 @@ static char* sub_recode(char* data, size_t size, char* codepage) 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 @@ static char* read_file(char* fname, size_t *bufsize) 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 @@ static char* read_file(char* fname, size_t *bufsize) 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 @@ static char* read_file(char* fname, size_t *bufsize) 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 @@ ass_track_t* ass_read_memory(ass_library_t* library, char* buf, size_t bufsize, if (!track) return 0; - mp_msg(MSGT_GLOBAL, MSGL_INFO, "LIBASS: added subtitle file: (%d styles, %d events)\n", track->n_styles, track->n_events); + mp_msg(MSGT_ASS, MSGL_INFO, "LIBASS: added subtitle file: (%d styles, %d events)\n", track->n_styles, track->n_events); return track; } @@ -1017,7 +1017,7 @@ ass_track_t* ass_read_file(ass_library_t* library, char* fname, char* codepage) 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 @@ void ass_process_font(ass_library_t* library, const char* name, char* data, int 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); diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c index 244bfbf305..3076713a66 100644 --- a/libass/ass_bitmap.c +++ b/libass/ass_bitmap.c @@ -164,14 +164,14 @@ static bitmap_t* glyph_to_bitmap_internal(FT_Glyph glyph, int bord) 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; } diff --git a/libass/ass_cache.c b/libass/ass_cache.c index 16d67b5f00..a2f5bf2807 100644 --- a/libass/ass_cache.c +++ b/libass/ass_cache.c @@ -78,7 +78,7 @@ int ass_new_face(FT_Library library, void* fontconfig_priv, face_desc_t* desc, / } 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 @@ int ass_new_face(FT_Library library, void* fontconfig_priv, face_desc_t* desc, / 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; } diff --git a/libass/ass_fontconfig.c b/libass/ass_fontconfig.c index 6850215a74..53a2d8405e 100644 --- a/libass/ass_fontconfig.c +++ b/libass/ass_fontconfig.c @@ -101,7 +101,7 @@ static char* _select_font(fc_instance_t* priv, const char* family, unsigned bold 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 @@ char* fontconfig_select(fc_instance_t* priv, const char* family, unsigned bold, 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 @@ fc_instance_t* fontconfig_init(const char* dir, const char* family, const char* 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 @@ fc_instance_t* fontconfig_init(const char* dir, const char* family, const char* 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 @@ fc_instance_t* fontconfig_init(const char* dir, const char* family, const char* 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* fontconfig_init(const char* dir, const char* family, const char* { 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)); diff --git a/libass/ass_mp.c b/libass/ass_mp.c index 4695bf6d9e..cb4f7f2e01 100644 --- a/libass/ass_mp.c +++ b/libass/ass_mp.c @@ -176,7 +176,7 @@ int ass_process_subtitle(ass_track_t* track, subtitle* sub) 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; diff --git a/libass/ass_render.c b/libass/ass_render.c index 73d3cfba27..f10e3d59ec 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -205,7 +205,7 @@ static void ass_lazy_track_init(void) 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 @@ static void ass_lazy_track_init(void) 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 @@ ass_renderer_t* ass_renderer_init(ass_library_t* library) 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 @@ ass_renderer_t* ass_renderer_init(ass_library_t* library) 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 @@ static ass_image_t** render_glyph(bitmap_t* bm, int dst_x, int dst_y, uint32_t c 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 @@ static void change_border(double border) 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 @@ static char* parse_tag(char* p, double pwr) { 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 @@ static char* parse_tag(char* p, double pwr) { } 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 @@ static char* parse_tag(char* p, double pwr) { } 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 @@ static char* parse_tag(char* p, double pwr) { 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 @@ static char* parse_tag(char* p, double pwr) { 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 @@ static char* parse_tag(char* p, double pwr) { 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 @@ static char* parse_tag(char* p, double pwr) { 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 @@ static unsigned get_next_char(char** str) } 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 @@ static void apply_transition_effects(ass_event_t* event) 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 @@ static void apply_transition_effects(ass_event_t* event) } 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 @@ static void apply_transition_effects(ass_event_t* event) 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 @@ static int get_glyph(int index, int symbol, glyph_info_t* info, FT_Vector* advan } // 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 @@ static int get_glyph(int index, int symbol, glyph_info_t* info, FT_Vector* advan #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 @@ static int get_glyph(int index, int symbol, glyph_info_t* info, FT_Vector* advan 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 @@ static void wrap_lines_smart(int max_text_width) 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 @@ static void wrap_lines_smart(int max_text_width) 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 @@ static void wrap_lines_smart(int max_text_width) 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 @@ static void process_karaoke_effects(void) 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 @@ static int ass_render_event(ass_event_t* event, event_images_t* event_images) 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 @@ static int ass_render_event(ass_event_t* event, event_images_t* event_images) 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 @@ static int ass_render_event(ass_event_t* event, event_images_t* event_images) } 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 @@ 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_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 @@ static void fix_collisions(event_images_t* imgs, int cnt) 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 @@ ass_image_t* ass_render_frame(ass_renderer_t *priv, ass_track_t* track, long lon 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; } } diff --git a/libass/ass_utils.c b/libass/ass_utils.c index 0758f7dbb7..01225dcf06 100644 --- a/libass/ass_utils.c +++ b/libass/ass_utils.c @@ -59,7 +59,7 @@ int strtocolor(char** q, uint32_t* res) 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; -- cgit v1.2.3