shithub: aacdec

Download patch

ref: 5643b9731b690376104867561becc82be4b4047e
parent: 89376cc948ebcb72572d599ae82f2baca5422344
author: menno <menno>
date: Mon Aug 7 14:47:45 EDT 2006

Added compilation changes for Beep media player

--- a/configure.in
+++ b/configure.in
@@ -29,6 +29,9 @@
 AC_ARG_WITH(xmms,[  --with-xmms             compile XMMS-1 plugin],
 	     WITHXMMS=$withval, WITHXMMS=no)
 
+AC_ARG_WITH(bmp,[  --with-bmp              compile beep media player plugin],
+	     [WITHBMP=$withval;WITHXMMS=$withval], [WITHBMP=no])
+
 AC_ARG_WITH(drm,[  --with-drm              compile libfaad with DRM support],
 	     WITHDRM=$withval, WITHDRM=no)
 
@@ -109,6 +112,12 @@
 else
  AC_MSG_NOTICE(no xmms build configured)
  AM_CONDITIONAL(HAVE_XMMS, false)
+fi
+
+if test x$WITHBMP = xyes; then
+  AC_DEFINE([HAVE_BMP], 1, [User wants beep media player plugin built])
+  AM_CONDITIONAL([HAVE_XMMS], true)
+  AM_CONDITIONAL([HAVE_BMP], true)
 fi
 
 if test x$WITHDRM = xyes; then
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -3,12 +3,15 @@
 SUBDIRS = xmms mpeg4ip
 else
 SUBDIRS = mpeg4ip
-endif
+endif #HAVE_XMMS
 else
 if HAVE_XMMS
 SUBDIRS = xmms
 else
+if HAVE_BMP
+SUBDIRS = bmp
+else
 SUBDIRS =
-endif
-endif
-
+endif #HAVE_BMP
+endif #HAVE_XMMS
+endif #HAVE_MPEG4IP_PLUG
--- a/plugins/xmms/src/Makefile.am
+++ b/plugins/xmms/src/Makefile.am
@@ -1,12 +1,20 @@
+if HAVE_BMP
+libdir=$(shell pkg-config --variable=input-plugin-dir bmp)
+local_CFLAGS=$(shell pkg-config --cflags bmp)
+local_LDFLAGS=$(shell pkg-config --libs bmp)
+else
+local_CFLAGS=`$(XMMS_CONFIG) --cflags` -Wall
+local_LDFLAGS=`$(XMMS_CONFIG) --libs`
 libdir = `$(XMMS_CONFIG) --input-plugin-dir`
+endif #HAVE_BMP
 lib_LTLIBRARIES = libmp4.la
 
-libmp4_la_CFLAGS = `$(XMMS_CONFIG) --cflags` -Wall \
+libmp4_la_CFLAGS = $(local_CFLAGS) -Wall \
        -I$(top_srcdir)/include -I$(top_srcdir)/common/mp4ff
 
 libmp4_la_LIBADD = $(top_builddir)/libfaad/libfaad.la \
        $(top_builddir)/common/mp4ff/libmp4ff.la
 
-libmp4_la_LDFLAGS = -module -avoid-version `$(XMMS_CONFIG) --libs` -lpthread
+libmp4_la_LDFLAGS = -module -avoid-version $(local_LDFLAGS) -lpthread
 
 libmp4_la_SOURCES = libmp4.c mp4_utils.c aac_utils.c
--- a/plugins/xmms/src/libmp4.c
+++ b/plugins/xmms/src/libmp4.c
@@ -11,10 +11,17 @@
 #include <stdio.h>
 #include <string.h>
 
+#if defined(HAVE_BMP)
+#include <bmp/plugin.h>
+#include <bmp/util.h>
+#include <bmp/configfile.h>
+#include <bmp/titlestring.h>
+#else
 #include <xmms/plugin.h>
 #include <xmms/util.h>
 #include <xmms/configfile.h>
 #include <xmms/titlestring.h>
+#endif /*HAVE_BMP*/
 
 #include "neaacdec.h"
 #include "mp4ff.h"
@@ -192,7 +199,7 @@
 
   (*title) = NULL;
   (*len) = -1;
-	
+
   if((mp4file = fopen(filename, "rb"))){
     mp4_get_file_type(mp4file);
     fseek(mp4file, 0, SEEK_SET);
@@ -261,13 +268,13 @@
     mp4ff_callback_t*	mp4cb;
     mp4ff_t*		infile;
     gint		mp4track;
-    
+
     mp4cb = getMP4FF_cb(mp4file);
     if(!(infile = mp4ff_open_read(mp4cb))){
       g_print("MP4 - Can't open file\n");
       goto end;
     }
-    
+
     if((mp4track = getAACTrack(infile)) < 0){
       /*
        * TODO: check here for others Audio format.....
@@ -279,7 +286,7 @@
       bPlaying = FALSE;
       pthread_mutex_unlock(&mutex);
       pthread_exit(NULL);
-    }else{  
+    }else{
       NeAACDecHandle	decoder;
       unsigned char	*buffer	= NULL;
       guint		bufferSize = 0;
@@ -336,7 +343,7 @@
 
       while(bPlaying){
 	void*			sampleBuffer;
-	faacDecFrameInfo	frameInfo;    
+	faacDecFrameInfo	frameInfo;
 	gint			rc;
 
 	if(seekPosition!=-1){
@@ -574,6 +581,6 @@
     bPlaying = FALSE;
     pthread_mutex_unlock(&mutex);
     pthread_exit(NULL);
-    
+
   }
 }