~ft/aacdec

5643b9731b690376104867561becc82be4b4047e — menno 15 years ago 89376cc
Added compilation changes for Beep media player
4 files changed, 39 insertions(+), 12 deletions(-)

M configure.in
M plugins/Makefile.am
M plugins/xmms/src/Makefile.am
M plugins/xmms/src/libmp4.c
M configure.in => configure.in +9 -0
@@ 29,6 29,9 @@ AM_CONFIG_HEADER(config.h)
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)



@@ 111,6 114,12 @@ else
 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
  AC_DEFINE(DRM, 1, [Define if you want to use libfaad together with Digital Radio Mondiale (DRM)])
  AC_DEFINE(DRM_PS, 1, [Define if you want support for Digital Radio Mondiale (DRM) parametric stereo])

M plugins/Makefile.am => plugins/Makefile.am +7 -4
@@ 3,12 3,15 @@ if HAVE_XMMS
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

M plugins/xmms/src/Makefile.am => plugins/xmms/src/Makefile.am +10 -2
@@ 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

M plugins/xmms/src/libmp4.c => plugins/xmms/src/libmp4.c +13 -6
@@ 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 @@ static void	mp4_getSongTitle(char *filename, char **title, int *len) {

  (*title) = NULL;
  (*len) = -1;
	

  if((mp4file = fopen(filename, "rb"))){
    mp4_get_file_type(mp4file);
    fseek(mp4file, 0, SEEK_SET);


@@ 261,13 268,13 @@ static void *mp4Decode(void *args)
    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 @@ static void *mp4Decode(void *args)
      bPlaying = FALSE;
      pthread_mutex_unlock(&mutex);
      pthread_exit(NULL);
    }else{  
    }else{
      NeAACDecHandle	decoder;
      unsigned char	*buffer	= NULL;
      guint		bufferSize = 0;


@@ 336,7 343,7 @@ static void *mp4Decode(void *args)

      while(bPlaying){
	void*			sampleBuffer;
	faacDecFrameInfo	frameInfo;    
	faacDecFrameInfo	frameInfo;
	gint			rc;

	if(seekPosition!=-1){


@@ 574,6 581,6 @@ end:
    bPlaying = FALSE;
    pthread_mutex_unlock(&mutex);
    pthread_exit(NULL);
    

  }
}