[PATCH 4/4] mp3dmod: Link to libmpg123.

Zebediah Figura z.figura12 at gmail.com
Wed May 9 17:31:34 CDT 2018


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 configure.ac             | 9 ++++++---
 dlls/mp3dmod/Makefile.in | 2 ++
 dlls/mp3dmod/mp3dmod.c   | 7 +++++++
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index b1c02ed..a4f2348 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1753,9 +1753,12 @@ then
             MPG123_LIBS=""
         fi])
 fi
-WINE_NOTICE_WITH(mpg123,[test "x$ac_cv_lib_mpg123_mpg123_feed" != xyes -a x"$ac_cv_header_CoreAudio_CoreAudio_h" != xyes],
-                 [libmpg123 ${notice_platform}development files not found (or too old), mp3 codec won't be supported.],
-                 [enable_l3codeca_acm])
+if test "x$ac_cv_lib_mpg123_mpg123_feed" != xyes -a x"$ac_cv_header_CoreAudio_CoreAudio_h" != xyes
+then
+    WINE_NOTICE([libmpg123 ${notice_platform}development files not found (or too old), mp3 codec won't be supported.])
+    enable_l3codeca_acm=${enable_l3codeca_acm:-no}
+    enable_mp3dmod=${enable_mp3dmod:-no}
+fi
 
 dnl **** Check for OpenAL 1.1 ****
 if test "$ac_cv_header_AL_al_h" = "yes"
diff --git a/dlls/mp3dmod/Makefile.in b/dlls/mp3dmod/Makefile.in
index d892751..5bcef48 100644
--- a/dlls/mp3dmod/Makefile.in
+++ b/dlls/mp3dmod/Makefile.in
@@ -1,5 +1,7 @@
 MODULE    = mp3dmod.dll
 IMPORTS   = dmoguids uuid wmcodecdspuuid
+EXTRAINCL = $(MPG123_CFLAGS)
+EXTRALIBS = $(MPG123_LIBS)
 
 C_SRCS = \
 	mp3dmod.c
diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c
index c6cb0ad..0f1f069 100644
--- a/dlls/mp3dmod/mp3dmod.c
+++ b/dlls/mp3dmod/mp3dmod.c
@@ -19,6 +19,7 @@
  */
 
 #include <stdarg.h>
+#include <mpg123.h>
 #include "windef.h"
 #include "winbase.h"
 #define COBJMACROS
@@ -35,6 +36,7 @@ static HINSTANCE mp3dmod_instance;
 struct mp3_decoder {
     IMediaObject IMediaObject_iface;
     LONG ref;
+    mpg123_handle *mh;
 };
 
 static inline struct mp3_decoder *impl_from_IMediaObject(IMediaObject *iface)
@@ -80,6 +82,7 @@ static ULONG WINAPI MediaObject_Release(IMediaObject *iface)
 
     if (!refcount)
     {
+        mpg123_delete(This->mh);
         heap_free(This);
     }
     return refcount;
@@ -264,6 +267,7 @@ static const IMediaObjectVtbl IMediaObject_vtbl = {
 static HRESULT create_mp3_decoder(REFIID iid, void **obj)
 {
     struct mp3_decoder *This;
+    int err;
 
     if (!(This = heap_alloc(sizeof(*This))))
         return E_OUTOFMEMORY;
@@ -271,6 +275,9 @@ static HRESULT create_mp3_decoder(REFIID iid, void **obj)
     This->IMediaObject_iface.lpVtbl = &IMediaObject_vtbl;
     This->ref = 0;
 
+    mpg123_init();
+    This->mh = mpg123_new(NULL, &err);
+
     return IMediaObject_QueryInterface(&This->IMediaObject_iface, iid, obj);
 }
 
-- 
2.7.4




More information about the wine-devel mailing list