x264: Use __declspec(dllimport) with MinGW too
authorNirbheek Chauhan <nirbheek@centricular.com>
Thu, 27 Apr 2017 07:12:34 +0000 (12:42 +0530)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 27 Apr 2017 09:20:42 +0000 (12:20 +0300)
x264.h says this isn't needed with MinGW, but it looks like it is.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=779249

ext/x264/gstx264enc.h

index 732e124..6f4ad48 100644 (file)
 #include <stdint.h>
 #endif
 
+/* The x264.h header says this isn't needed with MinGW, but sometimes the
+ * compiler is unable to correctly do the pointer indirection for us, which
+ * leads to a segfault when you try to dereference any const values provided
+ * by x264.dll. See: https://bugzilla.gnome.org/show_bug.cgi?id=779249 */
+#if defined(_WIN32) && !defined(X264_API_IMPORTS)
+# define X264_API_IMPORTS
+#endif
 #include <x264.h>
 
 G_BEGIN_DECLS