contribs: Fix ffmpeg build on UWP
authorHugo Beauzée-Luyssen <hugo@beauzee.fr>
Fri, 2 Jun 2017 13:38:42 +0000 (15:38 +0200)
committerHugo Beauzée-Luyssen <hugo@beauzee.fr>
Fri, 2 Jun 2017 15:56:28 +0000 (17:56 +0200)
The patch was also sent upstream

contrib/src/ffmpeg/force-unicode.patch [new file with mode: 0644]
contrib/src/ffmpeg/rules.mak

diff --git a/contrib/src/ffmpeg/force-unicode.patch b/contrib/src/ffmpeg/force-unicode.patch
new file mode 100644 (file)
index 0000000..25679cf
--- /dev/null
@@ -0,0 +1,14 @@
+--- ffmpeg/compat/w32dlfcn.h.old       2017-06-02 14:35:36.726230731 +0200
++++ ffmpeg/compat/w32dlfcn.h   2017-06-02 15:14:38.472865111 +0200
+@@ -71,7 +71,11 @@
+ #ifndef LOAD_LIBRARY_SEARCH_SYSTEM32
+ #   define LOAD_LIBRARY_SEARCH_SYSTEM32        0x00000800
+ #endif
++#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
+     return LoadLibraryExA(name, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR | LOAD_LIBRARY_SEARCH_SYSTEM32);
++#else
++    return NULL;
++#endif
+ }
+ #define dlopen(name, flags) win32_dlopen(name)
+ #define dlclose FreeLibrary
index 5725e8f..eabf605 100644 (file)
@@ -224,6 +224,9 @@ ffmpeg: ffmpeg-$(FFMPEG_BASENAME).tar.xz .sum-ffmpeg
        rm -Rf $@ $@-$(FFMPEG_BASENAME)
        mkdir -p $@-$(FFMPEG_BASENAME)
        tar xvJf "$<" --strip-components=1 -C $@-$(FFMPEG_BASENAME)
+ifdef USE_FFMPEG
+       $(APPLY) $(SRC)/ffmpeg/force-unicode.patch
+endif
        $(MOVE)
 
 .ffmpeg: ffmpeg