[vlc-commits] Contribs: fix libass compilation for WIndows

Jean-Baptiste Kempf git at videolan.org
Tue Oct 11 11:17:12 CEST 2016


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Oct 11 11:15:47 2016 +0200| [b597991dcece079a2cd5815137e0231939d61d85] | committer: Jean-Baptiste Kempf

Contribs: fix libass compilation for WIndows

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b597991dcece079a2cd5815137e0231939d61d85
---

 contrib/src/ass/use-topendir.patch | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/contrib/src/ass/use-topendir.patch b/contrib/src/ass/use-topendir.patch
index cf0dd68..2d99ca6 100644
--- a/contrib/src/ass/use-topendir.patch
+++ b/contrib/src/ass/use-topendir.patch
@@ -1,5 +1,5 @@
---- libass/libass/ass_fontselect.c.orig	2016-04-07 14:00:48.412620215 +0200
-+++ libass/libass/ass_fontselect.c	2016-04-07 14:51:29.220686538 +0200
+--- libass-0.13.4/libass/ass_fontselect.c.orig	2016-07-11 23:29:00.000000000 +0200
++++ libass-0.13.4/libass/ass_fontselect.c	2016-10-11 11:14:24.387661958 +0200
 @@ -47,6 +47,9 @@
  #include "ass_font.h"
  #include "ass_string.h"
@@ -10,10 +10,11 @@
  #define ABS(x) ((x) < 0 ? -(x) : (x))
  #define MAX_FULLNAME 100
  
-@@ -161,28 +164,61 @@
+@@ -161,28 +164,63 @@
      .destroy_font      = destroy_font_ft,
  };
  
++#ifdef _WIN32
 +static inline char *FromWide (const wchar_t *wide)
 +{
 +    size_t len = WideCharToMultiByte (CP_UTF8, 0, wide, -1, NULL, 0, NULL, NULL);
@@ -39,6 +40,7 @@
 +        MultiByteToWideChar (CP_UTF8, 0, utf8, -1, out, len);
 +    return out;
 +}
++#endif
 +
  static void load_fonts_from_dir(ASS_Library *library, const char *dir)
  {
@@ -63,7 +65,7 @@
 -        snprintf(fullname, sizeof(fullname), "%s/%s", dir, entry->d_name);
 +        _snprintf(fullname, sizeof(fullname), "%s/%s", dir, d_name);
          size_t bufsize = 0;
-         ass_msg(library, MSGL_WARN, "Loading font file '%s'", fullname);
+         ass_msg(library, MSGL_INFO, "Loading font file '%s'", fullname);
          void *data = read_file(library, fullname, &bufsize);
          if (data) {
 -            ass_add_font(library, entry->d_name, data, bufsize);



More information about the vlc-commits mailing list