File opal-codecs.patch of Package opal

Index: opal.m4
===================================================================
--- opal.m4.orig
+++ opal.m4
@@ -83,7 +83,7 @@ AC_DEFUN([OPAL_GET_LIBNAME],
          [
           AC_MSG_CHECKING(filename of $2 library)
           AC_LANG_CONFTEST([int main () {return 0;}])
-          $CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS $3>&AS_MESSAGE_LOG_FD
+          $CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS -Wl,--no-as-needed $3>&AS_MESSAGE_LOG_FD
           if test \! -x conftest$ac_exeext ; then
             AC_MSG_RESULT(cannot determine - using defaults)
           else
Index: plugins/configure.ac
===================================================================
--- plugins/configure.ac.orig
+++ plugins/configure.ac
@@ -225,6 +225,7 @@ PKG_CHECK_MODULES([LIBAVCODEC],
                    AC_SUBST(LIBAVCODEC_CFLAGS)
                    AC_SUBST(LIBAVCODEC_LIBS)
                    AC_DEFINE([HAVE_LIBAVCODEC], [1], [ffmpeg])
+                   OPAL_GET_LIBNAME([LIBAVCODEC], [libavcodec], [$LIBAVCODEC_LIBS])
                    AC_SUBST(LIBAVCODEC_LIB_NAME)
                    HAVE_LIBAVCODEC=yes
                    OPAL_LIBAVCODEC_HACK
@@ -251,6 +252,16 @@ PKG_CHECK_MODULES([LIBAVCODEC],
                  )
 AC_SUBST(HAVE_LIBAVCODEC)
 
+PKG_CHECK_MODULES([LIBAVUTIL],
+                  [libavutil],
+                  [
+                   AC_SUBST(LIBAVUTIL_CFLAGS)
+                   AC_SUBST(LIBAVUTIL_LIBS)
+                   OPAL_GET_LIBNAME([LIBAVUTIL], [libavutil], [$LIBAVUTIL_LIBS])
+                   AC_SUBST(LIBAVUTIL_LIB_NAME)
+                  ]
+                 )
+
 OPAL_LIBAVCODEC_SOURCE()
 AC_SUBST(LIBAVCODEC_SOURCE_DIR)
 
@@ -423,7 +434,7 @@ AC_COMPILE_IFELSE([
                   )
                   ],
   AC_MSG_RESULT(yes)
-  AC_DEFINE(HAVE_POSIX_MEMALIGN, 1),
+  AC_DEFINE(HAVE_POSIX_MEMALIGN, 1, [Is posix_memalign supported]),
   AC_MSG_RESULT(no)
 )
 AC_LANG_POP([C++])
Index: plugins/video/common/dyna.cxx
===================================================================
--- plugins/video/common/dyna.cxx.orig
+++ plugins/video/common/dyna.cxx
@@ -98,10 +98,6 @@ bool DynaLink::InternalOpen(const char *
     return false;
   }
 
-#ifndef _WIN32
-  strcat(path, ".so");
-#endif
-
   // Load the Libary
 #ifdef _WIN32
 # ifdef UNICODE
@@ -213,6 +209,11 @@ bool FFMPEGLibrary::Load(int ver)
 
   bool seperateLibAvutil = false;
 
+#ifdef LIBAVCODEC_LIB_NAME
+  if (libAvcodec.Open(LIBAVCODEC_LIB_NAME))
+    seperateLibAvutil = true;
+  else
+#endif
   if (libAvcodec.Open("libavcodec"))
     seperateLibAvutil = false;
   else if (libAvcodec.Open("avcodec-51") || libAvcodec.Open("avcodec-52"))
@@ -222,7 +223,11 @@ bool FFMPEGLibrary::Load(int ver)
     return false;
   }
 
-  if (seperateLibAvutil && !(libAvutil.Open("avutil-50") || libAvutil.Open("avutil-49")) ) {
+  if (seperateLibAvutil && !(
+#ifdef LIBAVUTIL_LIB_NAME
+    libAvutil.Open(LIBAVUTIL_LIB_NAME) ||
+#endif
+    libAvutil.Open("avutil-50") || libAvutil.Open("avutil-49")) ) {
     TRACE (1, _codecString << "\tDYNA\tFailed to load FFMPEG libavutil library");
     return false;
   }
Index: plugins/video/H.264/gpl/x264loader_unix.cxx
===================================================================
--- plugins/video/H.264/gpl/x264loader_unix.cxx.orig
+++ plugins/video/H.264/gpl/x264loader_unix.cxx
@@ -24,6 +24,9 @@
 #include <dlfcn.h>
 #include <string.h>
 
+#define QUOTEME_(x) #x
+#define QUOTEME(x) QUOTEME_(x)
+
 X264Library::X264Library()
 {
   _dynamicLibrary = NULL;
@@ -53,7 +56,11 @@ bool X264Library::Load()
     return false;
   }
 
+#ifdef x264_encoder_open
+  if (!GetFunction(QUOTEME(x264_encoder_open), (Function &)Xx264_encoder_open)) {
+#else
   if (!GetFunction("x264_encoder_open", (Function &)Xx264_encoder_open)) {
+#endif
     TRACE (1, "H264\tDYNA\tFailed to load x264_encoder_open");
     return false;
   }
openSUSE Build Service is sponsored by