diff src/xmms-sid.h @ 241:291715a519e2

Compile-time setting to enable/disable use of dynamically allocated buffers.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 21 Dec 2004 15:05:03 +0000
parents d04191d1ea64
children 1c743dcd6d84
line wrap: on
line diff
--- a/src/xmms-sid.h	Tue Dec 21 15:04:04 2004 +0000
+++ b/src/xmms-sid.h	Tue Dec 21 15:05:03 2004 +0000
@@ -40,27 +40,39 @@
 extern "C" {
 #endif
 
-/* Some defines
+/*
+ * Some constants and defines
  */
-#define DEBUG
+/* Define for spurious debugging messages */
+#undef DEBUG
 
-#undef HAVE_HARDSID_BUILDER	/* HardSID-support is not working and is untested */
+/* Define to enable non-portable thread and mutex debugging code
+ * (Works probably with Linux glibc only) */
+#undef XS_MUTEX_DEBUG
 
-#define XS_BUFSIZE		(4096)		/* Size for some buffers */
+/* HardSID-support is not working and is untested,
+ * thus we disable it here.  */
+#undef HAVE_HARDSID_BUILDER
+
+/* Size for some small buffers (always static variables) */
+#define XS_BUF_SIZE		(1024)
 
-#define XS_SIDBUF_SIZE		(80*1024)	/* Size of data buffer used for SID-tune
-						MD5 hash calculation. If this is too small,
-						the computed hash will be incorrect.
-						Largest SID files I've seen are ~70kB.
-						*/
+/* If defined, dynamically allocated temp. buffers are used.
+ * Static (#undef) are probably faster than allocating/deallocating
+ * from heap, but fails on systems with limited stack space. */
+#define XS_BUF_DYNAMIC
+
+/* Size of audio buffer */
+#define XS_AUDIOBUF_SIZE	(16*1024)
 
-#define XS_SIDBUF_DYNAMIC			/* If not defined, static buffer is used.
-						Probably faster than allocating/deallocating
-						from heap, but fails on systems with limited
-						stack space.
-						*/
+/* Size of data buffer used for SID-tune MD5 hash calculation.
+ * If this is too small, the computed hash will be incorrect.
+ * Largest SID files I've seen are ~70kB. */
+#define XS_SIDBUF_SIZE		(80*1024)
 
-#define XS_STIL_MAXENTRY	(128)		/* Max number of sub-songs in STIL/SLDB node */
+
+
+#define XS_STIL_MAXENTRY	(128)	/* Max number of sub-songs in STIL/SLDB node */
 
 
 #define XS_CONFIG_IDENT		"XMMS-SID"	/* Configuration file identifier */
@@ -74,14 +86,17 @@
  * easily change from pthreads to glib threads, etc, if necessary.
  */
 #define XS_MPP(M)	M ## _mutex
-#ifdef DEBUG
-#define XS_MUTEX(M)	pthread_mutex_t	XS_MPP(M) = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP; int M ## _qq;
-#else
-#define XS_MUTEX(M)	pthread_mutex_t	XS_MPP(M) = PTHREAD_MUTEX_INITIALIZER
-#endif
-#define XS_MUTEX_H(M)	extern pthread_mutex_t XS_MPP(M); extern int M ## _qq;
+#if XS_MUTEX_DEBUG
+#define XS_MUTEX(M)		pthread_mutex_t	XS_MPP(M) = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP; int M ## _qq;
+#define XS_MUTEX_H(M)		extern pthread_mutex_t XS_MPP(M); extern int M ## _qq;
 #define XS_MUTEX_LOCK(M)	{ M ## _qq = pthread_mutex_lock(&XS_MPP(M)); if (M ## _qq) XSDEBUG("XS_MUTEX_LOCK(" #M ") == %i\n", M ## _qq); }
 #define XS_MUTEX_UNLOCK(M)	{ M ## _qq = pthread_mutex_unlock(&XS_MPP(M)); if (M ## _qq) XSDEBUG("XS_MUTEX_UNLOCK(" #M ") == %i\n", M ## _qq); }
+#else
+#define XS_MUTEX(M)		pthread_mutex_t	XS_MPP(M) = PTHREAD_MUTEX_INITIALIZER
+#define XS_MUTEX_H(M)		extern pthread_mutex_t XS_MPP(M);
+#define XS_MUTEX_LOCK(M)	pthread_mutex_lock(&XS_MPP(M))
+#define XS_MUTEX_UNLOCK(M)	pthread_mutex_unlock(&XS_MPP(M))
+#endif
 
 /* Shorthands for linked lists
  */