changeset 1240:d4501b0e98b4

merge
author Cristi Magherusan <majeru@atheme-project.org>
date Thu, 12 Jul 2007 02:07:09 +0300
parents 8af27e02e7b7 (current diff) 0d5b0f861bf0 (diff)
children cbd7a81ac8ea
files
diffstat 8 files changed, 41 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Thu Jul 12 02:04:43 2007 +0300
+++ b/configure.ac	Thu Jul 12 02:07:09 2007 +0300
@@ -160,11 +160,16 @@
     [AC_MSG_ERROR([Cannot find pango >= 1.8.0])]
 )
 
-PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60 dbus-glib-1 >= 0.60],
-    [ADD_PC_REQUIRES([dbus-1 >= 0.60 dbus-glib-1 >= 0.60])
-     AC_DEFINE(USE_DBUS, 1, [Define if D-Bus support enabled])],
-    [AC_MSG_ERROR([Cannot find dbus-glib >= 0.60])]
-])
+AC_ARG_ENABLE(dbus,
+	[  --enable-dbus		  enable DBus support (default=yes)],
+			enable_dbus=$enableval, enable_dbus=yes)
+if test "x$enable_dbus" == "xyes"; then
+	PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60 dbus-glib-1 >= 0.60],
+	    [ADD_PC_REQUIRES([dbus-1 >= 0.60 dbus-glib-1 >= 0.60])
+	     AC_DEFINE(USE_DBUS, 1, [Define if D-Bus support enabled])],
+	    [AC_MSG_ERROR([Cannot find dbus-glib >= 0.60])]
+	])
+fi
 
 PKG_CHECK_MODULES(MOWGLI, [libmowgli >= 0.2.0],
     [ADD_PC_REQUIRES([libmowgli >= 0.2.0])],
@@ -212,7 +217,7 @@
 		PICFLAGS="-fPIC -DPIC"
 		PICLDFLAGS="-fPIC -DPIC -shared"
 		LIBLDFLAGS="-fPIC -DPIC -shared"
-		AUDLDFLAGS="-Wl,-export-dynamic -Wl,-rpath=\${libdir}"
+		AUDLDFLAGS="-Wl,-export-dynamic -Wl,-rpath=\${libdir},-rpath=\${plugindir}"
 		SHARED_SUFFIX=".so"
 		;;
 esac
--- a/src/cue/cuesheet.c	Thu Jul 12 02:04:43 2007 +0300
+++ b/src/cue/cuesheet.c	Thu Jul 12 02:07:09 2007 +0300
@@ -447,7 +447,7 @@
 	cur_cue_track = track;
 	cache_cue_file(path2);
 
-    if (cue_file == NULL || !g_file_test(cue_file, G_FILE_TEST_EXISTS))
+    if (cue_file == NULL || !vfs_file_test(cue_file, G_FILE_TEST_EXISTS))
         return;
 
 	real_ip_plugin = input_check_file(cue_file, FALSE);
--- a/src/flac/libflac/memory.c	Thu Jul 12 02:04:43 2007 +0300
+++ b/src/flac/libflac/memory.c	Thu Jul 12 02:07:09 2007 +0300
@@ -35,7 +35,11 @@
 
 #include "private/memory.h"
 #include "FLAC/assert.h"
-#include <malloc.h>
+#include <stdlib.h>
+
+#ifdef __DARWIN
+# undef FLAC__ALIGN_MALLOC_DATA
+#endif
 
 void *FLAC__memory_alloc_aligned(size_t bytes, void **aligned_address)
 {
@@ -43,25 +47,9 @@
 
 	FLAC__ASSERT(0 != aligned_address);
 
-#ifdef FLAC__ALIGN_MALLOC_DATA
-	/* align on 32-byte (256-bit) boundary */
-#if 0
-	x = malloc(bytes+31);
-	/* there's got to be a better way to do this right for all archs */
-	if(sizeof(void*) == sizeof(unsigned))
-		*aligned_address = (void*)(((unsigned)x + 31) & -32);
-	else if(sizeof(void*) == sizeof(FLAC__uint64))
-		*aligned_address = (void*)(((FLAC__uint64)x + 31) & (FLAC__uint64)(-((FLAC__int64)32)));
-	else
-		return 0;
-#endif
-	x = memalign(32, bytes);
+	x = malloc(bytes);
 	*aligned_address = x;
 
-#else
-	x = malloc(bytes);
-	*aligned_address = x;
-#endif
 	return x;
 }
 
--- a/src/madplug/Makefile	Thu Jul 12 02:04:43 2007 +0300
+++ b/src/madplug/Makefile	Thu Jul 12 02:07:09 2007 +0300
@@ -19,8 +19,7 @@
 
 CFLAGS   += $(PICFLAGS) $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) $(ARCH_DEFINES) $(SIMD_CFLAGS) -I../../intl -I../.. -Wall
 
-LDFLAGS += -Wl,-rpath=$(plugindir)
-
-LIBADD = -L$(plugindir) -laudid3tag -lmad $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
+LDFLAGS += $(AUDLDFLAGS)
+LIBADD = -L/opt/local/lib -L$(plugindir) -laudid3tag -lmad $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
 
 include ../../mk/objective.mk
--- a/src/tta/Makefile	Thu Jul 12 02:04:43 2007 +0300
+++ b/src/tta/Makefile	Thu Jul 12 02:07:09 2007 +0300
@@ -1,7 +1,7 @@
 include ../../mk/rules.mk
 include ../../mk/init.mk
 
-OBJECTIVE_LIBS = libtta.so
+OBJECTIVE_LIBS = libtta$(SHARED_SUFFIX)
 
 LIBDIR = $(plugindir)/$(INPUT_PLUGIN_DIR)
 
@@ -11,8 +11,7 @@
 
 CFLAGS += -fPIC -DPIC $(GTK_CFLAGS) $(GLIB_CFLAGS) $(PANGO_CFLAGS) -I../../intl -I../..
 
-LDFLAGS += -Wl,-rpath=$(plugindir)
-
+LDFLAGS += $(AUDLDFLAGS)
 LIBADD = -L$(plugindir) -laudid3tag $(GTK_LIBS) $(GLIB_LIBS) $(PANGO_LIBS)
 
 include ../../mk/objective.mk
--- a/src/tta/libtta.c	Thu Jul 12 02:04:43 2007 +0300
+++ b/src/tta/libtta.c	Thu Jul 12 02:07:09 2007 +0300
@@ -460,7 +460,7 @@
 static void
 play_file (InputPlayback *playback)
 {
-	char *filename = playback->filename;
+	gchar *filename = playback->filename;
 	char *title;
 	int datasize, origsize, bitrate;
 	TitleInput *tuple = NULL;
@@ -469,7 +469,7 @@
 
 	////////////////////////////////////////
 	// open TTA file
-	if (open_tta_file (filename, &info, 0) < 0)
+	if (open_tta_file (filename, &info, 0) > 0)
 	{
 	    tta_error (info.STATE);
 	    close_tta_file (&info);
--- a/src/tta/ttadec.c	Thu Jul 12 02:04:43 2007 +0300
+++ b/src/tta/ttadec.c	Thu Jul 12 02:07:09 2007 +0300
@@ -87,7 +87,7 @@
 __inline void get_binary(unsigned int *value, unsigned int bits) {
 	while (bit_count < bits) {
 		if (bitpos == iso_buffers_end) {
-			int res = fread(isobuffers, 1,
+			int res = vfs_fread(isobuffers, 1,
 				ISO_BUFFERS_SIZE, ttainfo->HANDLE);
 			if (!res) {
 				ttainfo->STATE = READ_ERROR;
@@ -113,7 +113,7 @@
 
 	while (!(bit_cache ^ bit_mask[bit_count])) {
 		if (bitpos == iso_buffers_end) {
-			int res = fread(isobuffers, 1,
+			int res = vfs_fread(isobuffers, 1,
 				ISO_BUFFERS_SIZE, ttainfo->HANDLE);
 			if (!res) {
 				ttainfo->STATE = READ_ERROR;
@@ -145,7 +145,7 @@
 	rbytes = iso_buffers_end - bitpos;
 	if (rbytes < sizeof(int)) {
 		memcpy(isobuffers, bitpos, 4);
-		res = fread(isobuffers + rbytes, 1,
+		res = vfs_fread(isobuffers + rbytes, 1,
 			ISO_BUFFERS_SIZE - rbytes, ttainfo->HANDLE);
 		if (!res) {
 			ttainfo->STATE = READ_ERROR;
@@ -260,7 +260,7 @@
 	} __ATTRIBUTE_PACKED__ id3v2;
 	unsigned int len = 0;
 
-	if (!fread(&id3v2, sizeof(id3v2), 1, ttainfo->HANDLE) || 
+	if (!vfs_fread(&id3v2, sizeof(id3v2), 1, ttainfo->HANDLE) || 
 	    memcmp(id3v2.id, "ID3", 3) ||
 	    id3v2.size[0] & 0x80)
 	{
@@ -279,14 +279,14 @@
 }
 
 int open_tta_file (const char *filename, tta_info *info, unsigned int data_offset) {
-	FILE *infile;
+	VFSFile *infile;
 	tta_hdr ttahdr;
 	unsigned int checksum;
 
 	// clear the memory
 	memset (info, 0, sizeof(tta_info));
 
-	info->HANDLE = infile = fopen(filename, "rb");
+	info->HANDLE = infile = vfs_fopen(filename, "rb");
 	if (!infile) return OPEN_ERROR;
 
 	// read id3v2 header
@@ -294,18 +294,18 @@
 //		data_offset = id3v2_header_length(info);
 
 	data_offset = get_id3_tags (filename, info);
-	fseek (infile, data_offset, SEEK_SET);
+	vfs_fseek (infile, data_offset, SEEK_SET);
 
 	// read TTA header
-	if (fread (&ttahdr, 1, sizeof (ttahdr), infile) == 0) {
-		fclose (infile);
+	if (vfs_fread (&ttahdr, 1, sizeof (ttahdr), infile) == 0) {
+		vfs_fclose (infile);
 		info->STATE = READ_ERROR;
 		return -1;
 	}
 
 	// check for TTA3 signature
 	if (ENDSWAP_INT32(ttahdr.TTAid) != TTA1_SIGN) {
-		fclose (infile);
+		vfs_fclose (infile);
 		info->STATE = FORMAT_ERROR;
 		return -1;
 	}
@@ -314,7 +314,7 @@
 	checksum = crc32((unsigned char *) &ttahdr,
 	sizeof(tta_hdr) - sizeof(int));
 	if (checksum != ttahdr.CRC32) {
-		fclose (infile);
+		vfs_fclose (infile);
 		info->STATE = FILE_ERROR;
 		return -1;
 	}
@@ -338,7 +338,7 @@
 		ttahdr.SampleRate != 64000 &&
 		ttahdr.SampleRate != 88200 &&
 		ttahdr.SampleRate != 96000)) {
-		fclose (infile);
+		vfs_fclose (infile);
 		info->STATE = FORMAT_ERROR;
 		return FORMAT_ERROR;
 	}
@@ -398,7 +398,7 @@
 	}
 
 	seek_pos = ttainfo->DATAPOS + seek_table[data_pos = pos];
-	fseek(ttainfo->HANDLE, seek_pos, SEEK_SET);
+	vfs_fseek(ttainfo->HANDLE, seek_pos, SEEK_SET);
 
 	data_cur = 0;
 	framelen = 0;
@@ -432,7 +432,7 @@
 	}
 
 	// read seek table
-	if (!fread(seek_table, st_size, 1, ttainfo->HANDLE)) {
+	if (!vfs_fread(seek_table, st_size, 1, ttainfo->HANDLE)) {
 		ttainfo->STATE = READ_ERROR;
 		return -1;
 	}
@@ -455,7 +455,7 @@
 
 void close_tta_file (tta_info *info) {
 	if (info->HANDLE) {
-		fclose (info->HANDLE);
+		vfs_fclose (info->HANDLE);
 		info->HANDLE = NULL;
 	}
 }
@@ -530,8 +530,7 @@
 			rice->k0++;
 		}
 
-        // DEC is not defined??
-//		value = DEC(value);
+		value = DEC(value);
 
 		// decompress stage 1: adaptive hybrid filter
 		hybrid_filter(fst, &value);
--- a/src/tta/ttalib.h	Thu Jul 12 02:04:43 2007 +0300
+++ b/src/tta/ttalib.h	Thu Jul 12 02:07:09 2007 +0300
@@ -80,7 +80,7 @@
 } id3_info;
 
 typedef struct {
-	FILE		*HANDLE;	// file handle
+	VFSFile		*HANDLE;	// file handle
 	unsigned short	NCH;		// number of channels
 	unsigned short	BPS;		// bits per sample
 	unsigned short	BSIZE;		// byte size