changeset 2249:a95b6a94682d

Automated merge with ssh://hg.atheme.org//hg/audacious-plugins
author William Pitcock <nenolod@atheme.org>
date Mon, 17 Dec 2007 19:45:15 -0600
parents ff0a27216c6a (current diff) 58b89671b395 (diff)
children 708f89aaee06 e253d4b1849b
files src/modplug/fastmix.cxx src/modplug/it_defs.h src/modplug/load_669.cxx src/modplug/load_amf.cxx src/modplug/load_ams.cxx src/modplug/load_dbm.cxx src/modplug/load_dmf.cxx src/modplug/load_dsm.cxx src/modplug/load_far.cxx src/modplug/load_it.cxx src/modplug/load_mdl.cxx src/modplug/load_med.cxx src/modplug/load_mod.cxx src/modplug/load_mt2.cxx src/modplug/load_mtm.cxx src/modplug/load_okt.cxx src/modplug/load_psm.cxx src/modplug/load_ptm.cxx src/modplug/load_s3m.cxx src/modplug/load_stm.cxx src/modplug/load_ult.cxx src/modplug/load_wav.cxx src/modplug/load_xm.cxx src/modplug/snd_dsp.cxx src/modplug/snd_flt.cxx src/modplug/snd_fx.cxx src/modplug/tables.cxx
diffstat 37 files changed, 334 insertions(+), 299 deletions(-) [+]
line wrap: on
line diff
--- a/src/adplug/adplug-xmms.cc	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/adplug/adplug-xmms.cc	Mon Dec 17 19:45:15 2007 -0600
@@ -139,6 +139,7 @@
   return GTK_WIDGET (label);
 }
 
+#if 0
 static void
 MessageBox (const char *title, const char *text, const char *button)
 {
@@ -158,6 +159,7 @@
   free (tmptxt);
   free (tmpbutton);
 }
+#endif
 
 /***** Dialog boxes *****/
 
--- a/src/adplug/core/dmo.cxx	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/adplug/core/dmo.cxx	Mon Dec 17 19:45:15 2007 -0600
@@ -349,8 +349,10 @@
       if (opos + cx >= oend)
         return -1;
 
-      for (int i = 0; i < cx; i++)
-        *opos++ = *(opos - ax);
+      for (int i = 0; i < cx; i++) {
+        *opos = *(opos - ax);
+        opos++;
+      }
 
       continue;
     }
@@ -370,8 +372,10 @@
       if (opos + bx + cx >= oend)
         return -1;
 
-      for (i = 0; i < cx; i++)
-        *opos++ = *(opos - ax);
+      for (i = 0; i < cx; i++) {
+        *opos = *(opos - ax);
+        opos++;
+      }
 
       for (i = 0; i < bx; i++)
         *opos++ = *ipos++;
@@ -395,8 +399,10 @@
       if (opos + ax + cx >= oend)
         return -1;
 
-      for (i = 0; i < cx; i++)
-        *opos++ = *(opos - bx);
+      for (i = 0; i < cx; i++) {
+        *opos = *(opos - bx);
+        opos++;
+      }
 
       for (i = 0; i < ax; i++)
         *opos++ = *ipos++;
--- a/src/adplug/core/jbm.cxx	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/adplug/core/jbm.cxx	Mon Dec 17 19:45:15 2007 -0600
@@ -75,7 +75,7 @@
   // Allocate memory buffer m[] and read entire file into it
 
   m = new unsigned char[filelen];
-  if (f->readString((char *)m, filelen) != filelen) goto loaderr;
+  if (f->readString((char *)m, filelen) != (unsigned int)filelen) goto loaderr;
 
   fp.close(f);
 
--- a/src/alsa/alsa.h	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/alsa/alsa.h	Mon Dec 17 19:45:15 2007 -0600
@@ -21,6 +21,8 @@
 #ifndef ALSA_H
 #define ALSA_H
 
+#define NDEBUG
+
 #include "config.h"
 
 #include <audacious/util.h>
--- a/src/alsa/audio.c	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/alsa/audio.c	Mon Dec 17 19:45:15 2007 -0600
@@ -294,6 +294,7 @@
 }
 
 /* reopen ALSA PCM */
+#if 0
 static int alsa_reopen(struct snd_format *f)
 {
 	/* remember the current position */
@@ -304,6 +305,7 @@
 
 	return alsa_setup(f);
 }
+#endif
 
 /* do flush (drop) operation */
 static void alsa_do_flush(int time)
--- a/src/aosd/aosd_osd.c	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/aosd/aosd_osd.c	Mon Dec 17 19:45:15 2007 -0600
@@ -179,6 +179,7 @@
 aosd_osd_create ( void )
 {
   gint max_width, layout_width, layout_height;
+  PangoRectangle ink;
   GdkScreen *screen = gdk_screen_get_default();
   gint pos_x = 0, pos_y = 0;
   gint pad_left = 0 , pad_right = 0 , pad_top = 0 , pad_bottom = 0;
@@ -228,7 +229,9 @@
   pango_layout_set_ellipsize( osd_data->pango_layout , PANGO_ELLIPSIZE_NONE );
   pango_layout_set_justify( osd_data->pango_layout , FALSE );
   pango_layout_set_width( osd_data->pango_layout , PANGO_SCALE * max_width );
-  pango_layout_get_pixel_size( osd_data->pango_layout , &layout_width , &layout_height );
+  pango_layout_get_pixel_extents( osd_data->pango_layout , &ink , NULL );
+  layout_width = ink.x + ink.width;
+  layout_height = ink.y + ink.height;
 
   /* osd position */
   switch ( osd_data->cfg_osd->position.placement )
--- a/src/console/Blip_Buffer.cxx	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/console/Blip_Buffer.cxx	Mon Dec 17 19:45:15 2007 -0600
@@ -27,7 +27,7 @@
 
 Blip_Buffer::Blip_Buffer()
 {
-	factor_       = LONG_MAX;
+	factor_       = UINT_MAX;
 	offset_       = 0;
 	buffer_       = 0;
 	buffer_size_  = 0;
--- a/src/console/Blip_Buffer.h	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/console/Blip_Buffer.h	Mon Dec 17 19:45:15 2007 -0600
@@ -8,7 +8,7 @@
 	#include <limits.h>
 	#if INT_MAX >= 0x7FFFFFFF
 		typedef int blip_long;
-		typedef unsigned blip_ulong;
+		typedef unsigned int blip_ulong;
 	#else
 		typedef long blip_long;
 		typedef unsigned long blip_ulong;
--- a/src/console/Hes_Cpu.h	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/console/Hes_Cpu.h	Mon Dec 17 19:45:15 2007 -0600
@@ -8,7 +8,7 @@
 
 typedef blargg_long hes_time_t; // clock cycle count
 typedef unsigned hes_addr_t; // 16-bit address
-enum { future_hes_time = LONG_MAX / 2 + 1 };
+enum { future_hes_time = INT_MAX / 2 + 1 };
 
 class Hes_Cpu {
 public:
--- a/src/console/Music_Emu.cxx	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/console/Music_Emu.cxx	Mon Dec 17 19:45:15 2007 -0600
@@ -33,7 +33,7 @@
 	emu_time         = 0;
 	emu_track_ended_ = true;
 	track_ended_     = true;
-	fade_start       = LONG_MAX / 2 + 1;
+	fade_start       = INT_MAX / 2 + 1;
 	fade_step        = 1;
 	silence_time     = 0;
 	silence_count    = 0;
--- a/src/console/Nes_Apu.h	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/console/Nes_Apu.h	Mon Dec 17 19:45:15 2007 -0600
@@ -78,7 +78,7 @@
 	// Get time that APU-generated IRQ will occur if no further register reads
 	// or writes occur. If IRQ is already pending, returns irq_waiting. If no
 	// IRQ will occur, returns no_irq.
-	enum { no_irq = LONG_MAX / 2 + 1 };
+	enum { no_irq = INT_MAX / 2 + 1 };
 	enum { irq_waiting = 0 };
 	nes_time_t earliest_irq( nes_time_t ) const;
 	
--- a/src/console/Nes_Cpu.h	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/console/Nes_Cpu.h	Mon Dec 17 19:45:15 2007 -0600
@@ -8,7 +8,7 @@
 
 typedef blargg_long nes_time_t; // clock cycle count
 typedef unsigned nes_addr_t; // 16-bit address
-enum { future_nes_time = LONG_MAX / 2 + 1 };
+enum { future_nes_time = INT_MAX / 2 + 1 };
 
 class Nes_Cpu {
 public:
--- a/src/console/Sap_Cpu.h	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/console/Sap_Cpu.h	Mon Dec 17 19:45:15 2007 -0600
@@ -8,7 +8,7 @@
 
 typedef blargg_long sap_time_t; // clock cycle count
 typedef unsigned sap_addr_t; // 16-bit address
-enum { future_sap_time = LONG_MAX / 2 + 1 };
+enum { future_sap_time = INT_MAX / 2 + 1 };
 
 class Sap_Cpu {
 public:
--- a/src/demac/ape.h	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/demac/ape.h	Mon Dec 17 19:45:15 2007 -0600
@@ -224,6 +224,12 @@
   return tmp;
 }
 
+#ifdef ARCH_X86_64
+#  define LEGACY_REGS "=Q"
+#else
+#  define LEGACY_REGS "=q"
+#endif
+
 static inline uint32_t bswap_32(uint32_t x)
 {
 #if defined(ARCH_X86)
--- a/src/evdev-plug/ed_bindings_store.c	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/evdev-plug/ed_bindings_store.c	Mon Dec 17 19:45:15 2007 -0600
@@ -82,7 +82,7 @@
   return;
 }
 
-gint
+void
 ed_bindings_store_foreach ( gpointer hashtable_gp ,
                             ed_bindings_store_foreach_func callback ,
                             gpointer user_data1 ,
--- a/src/evdev-plug/ed_bindings_store.h	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/evdev-plug/ed_bindings_store.h	Mon Dec 17 19:45:15 2007 -0600
@@ -29,7 +29,7 @@
 
 gpointer ed_bindings_store_new ( void );
 gint ed_bindings_store_insert ( gpointer , ed_inputevent_t * , gint );
-gint ed_bindings_store_foreach ( gpointer , ed_bindings_store_foreach_func , gpointer , gpointer );
+void ed_bindings_store_foreach ( gpointer , ed_bindings_store_foreach_func , gpointer , gpointer );
 guint ed_bindings_store_size ( gpointer );
 gboolean ed_bindings_store_lookup( gpointer , ed_inputevent_t * , gint * );
 gint ed_bindings_store_delete ( gpointer );
--- a/src/evdev-plug/ed_internals.c	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/evdev-plug/ed_internals.c	Mon Dec 17 19:45:15 2007 -0600
@@ -38,7 +38,8 @@
 #include <stdarg.h>
 
 #include <audacious/i18n.h>
-
+#include <glib.h>
+#include <glib/gstdio.h>
 
 static gboolean ed_device_giofunc ( GIOChannel * , GIOCondition , gpointer );
 
@@ -240,7 +241,7 @@
 }
 
 
-gint
+void
 ed_device_stop_listening_all ( gboolean delete_bindings )
 {
   /* convenience function that stops listening for all
--- a/src/evdev-plug/ed_internals.h	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/evdev-plug/ed_internals.h	Mon Dec 17 19:45:15 2007 -0600
@@ -48,7 +48,7 @@
 void ed_device_start_listening_from_config ( void );
 gint ed_device_stop_listening ( ed_device_t * );
 gint ed_device_stop_listening_from_info ( ed_device_info_t * );
-gint ed_device_stop_listening_all ( gboolean );
+void ed_device_stop_listening_all ( gboolean );
 gboolean ed_device_check_listening_from_info ( ed_device_info_t * );
 
 gboolean ed_inputevent_check_equality( ed_inputevent_t * , ed_inputevent_t * );
--- a/src/filewriter/filewriter.c	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/filewriter/filewriter.c	Mon Dec 17 19:45:15 2007 -0600
@@ -135,9 +135,9 @@
 static void file_init(void)
 {
     ConfigDb *db;
-    GtkWidget *menu_root;
+    /*GtkWidget *menu_root;
 
-    /*menu_root = gtk_menu_item_new_with_label(_("FileWriter"));
+    menu_root = gtk_menu_item_new_with_label(_("FileWriter"));
     gtk_widget_show(menu_root);
     audacious_menu_plugin_item_add(AUDACIOUS_MENU_PLAYLIST_RCLICK, menu_root);*/
 
--- a/src/madplug/plugin.c	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/madplug/plugin.c	Mon Dec 17 19:45:15 2007 -0600
@@ -610,7 +610,6 @@
 {
     Tuple *tuple = NULL;
     gchar *string = NULL;
-    gchar *realfn = NULL;
 
     struct id3_file *id3file = NULL;
     struct id3_tag *tag = NULL;
@@ -709,11 +708,10 @@
                 g_free(string);
                 string = NULL;
             }
-            realfn = g_filename_from_uri(filename, NULL, NULL);
-            __set_and_free(tuple, FIELD_FILE_NAME, NULL, g_path_get_basename(realfn ? realfn : filename));
-            __set_and_free(tuple, FIELD_FILE_PATH, NULL, g_path_get_dirname(realfn ? realfn : filename));
-            aud_tuple_associate_string(tuple, FIELD_FILE_EXT, NULL, extname(realfn ? realfn : filename));
-            g_free(realfn); realfn = NULL;
+
+            __set_and_free(tuple, FIELD_FILE_NAME, NULL, aud_uri_to_display_basename(filename));
+            __set_and_free(tuple, FIELD_FILE_PATH, NULL, aud_uri_to_display_dirname(filename));
+            aud_tuple_associate_string(tuple, FIELD_FILE_EXT, NULL, extname(filename));
 
             // length
             length = mad_timer_count(myinfo.duration, MAD_UNITS_MILLISECONDS);
@@ -734,11 +732,9 @@
         id3_file_close(id3file);
     } // id3file
     else { // no id3tag
-        realfn = g_filename_from_uri(filename, NULL, NULL);
-        __set_and_free(tuple, FIELD_FILE_NAME, NULL, g_path_get_basename(realfn ? realfn : filename));
-        __set_and_free(tuple, FIELD_FILE_PATH, NULL, g_path_get_dirname(realfn ? realfn : filename));
-        aud_tuple_associate_string(tuple, FIELD_FILE_EXT, NULL, extname(realfn ? realfn : filename));
-        g_free(realfn); realfn = NULL;
+        __set_and_free(tuple, FIELD_FILE_NAME, NULL, aud_uri_to_display_basename(filename));
+        __set_and_free(tuple, FIELD_FILE_PATH, NULL, aud_uri_to_display_dirname(filename));
+        aud_tuple_associate_string(tuple, FIELD_FILE_EXT, NULL, extname(filename));
         // length
         length = mad_timer_count(myinfo.duration, MAD_UNITS_MILLISECONDS);
         aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL, length);
--- a/src/paranormal/plugin.c	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/paranormal/plugin.c	Mon Dec 17 19:45:15 2007 -0600
@@ -267,13 +267,6 @@
 }
 
 static void
-about_close_clicked(GtkWidget *w, GtkWidget **window)
-{
-	gtk_widget_destroy(*window);
-	*window=NULL;
-}
-
-static void
 pn_xmms_about (void)
 {
   audacious_info_dialog("About Paranormal Visualization Studio", 
--- a/src/rootvis/config_frontend_widgets.c	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/rootvis/config_frontend_widgets.c	Mon Dec 17 19:45:15 2007 -0600
@@ -371,8 +371,7 @@
 
 	{
 		GtkWidget *vbox_0, *notebook_1, *button_box_1,
-			*vbox_2[4], *frame_3[4], *vbox_3[1], *hbox_4[5],
-			*check_debug, *check_stereo,
+			*vbox_2[4], *frame_3[4], *hbox_4[5],
 			*close_button, *revert_button;
 
 		vbox_0 = frontend_create_box(VBOX, window, "rootvis_config_vbox", ATTACH_TO_CONTAINER);
@@ -427,7 +426,7 @@
 {
 	GtkWidget *window, *channel_button[2],
 		  *button_box[2], *channels_frame, *main_frame, *vbox,
-		  *main_vbox, *channels_hbox, *channel_vbox[2],
+		  *main_vbox, *channel_vbox[2],
 		  *save_button, *revert_button, *close_button;
 
 	window = frontend_create_window(GTK_WINDOW_TOPLEVEL, "Main");
--- a/src/rootvis/rootvis.c	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/rootvis/rootvis.c	Mon Dec 17 19:45:15 2007 -0600
@@ -13,7 +13,6 @@
 // Forward declarations
 static void rootvis_init(void);
 static void rootvis_cleanup(void);
-static void rootvis_about(void);
 static void rootvis_configure(void);
 static void rootvis_playback_start(void);
 static void rootvis_playback_stop(void);
@@ -416,11 +415,6 @@
   }
 }
 
-static void rootvis_about(void)
-{
-	print_status("About");
-}
-
 static void rootvis_configure(void)
 {
 	print_status("Configuration trigger");
--- a/src/scrobbler/fmt.c	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/scrobbler/fmt.c	Mon Dec 17 19:45:15 2007 -0600
@@ -6,6 +6,7 @@
 #include <ctype.h>
 #include "fmt.h"
 #include <curl/curl.h>
+#include <glib.h>
 
 char *fmt_escape(const char *str)
 {
--- a/src/scrobbler/scrobbler.c	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/scrobbler/scrobbler.c	Mon Dec 17 19:45:15 2007 -0600
@@ -674,9 +674,9 @@
 	/*cfa(&post, &last, "debug", "failed");*/
 
 	entry = g_strdup_printf("s=%s&a=%s&t=%s&b=%s&l=%d&n=%d&m=", sc_session_id,
-		aud_tuple_get_string(tuple, FIELD_ARTIST, NULL),
-		aud_tuple_get_string(tuple, FIELD_TITLE, NULL),
-		aud_tuple_get_string(tuple, FIELD_ALBUM, NULL) ? aud_tuple_get_string(tuple, FIELD_ALBUM, NULL) : "",
+		fmt_escape(aud_tuple_get_string(tuple, FIELD_ARTIST, NULL)),
+		fmt_escape(aud_tuple_get_string(tuple, FIELD_TITLE, NULL)),
+		aud_tuple_get_string(tuple, FIELD_ALBUM, NULL) ? fmt_escape(aud_tuple_get_string(tuple, FIELD_ALBUM, NULL)) : "",
 		aud_tuple_get_int(tuple, FIELD_LENGTH, NULL) / 1000,
 		aud_tuple_get_int(tuple, FIELD_TRACK_NUMBER, NULL));
 
--- a/src/sexypsf/PsxBios.c	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/sexypsf/PsxBios.c	Mon Dec 17 19:45:15 2007 -0600
@@ -269,12 +269,14 @@
 }
 
 static void bios_atoi() { // 0x10
-	v0 = atoi((char *)Ra0);
+	char *p0 = Ra0;
+	v0 = atoi(p0);
 	pc0 = ra;
 }
 
 static void bios_atol() { // 0x11
-	v0 = atoi((char *)Ra0);
+	char *p0 = Ra0;
+	v0 = atoi(p0);
 	pc0 = ra;
 }
 
@@ -300,7 +302,7 @@
 	sp = BFLIP32(jmp_buf[1]); /* sp */
 	fp = BFLIP32(jmp_buf[2]); /* fp */
 	for (i=0; i<8; i++) // s0-s7
-	   psxRegs.GPR.r[16+i] =  BFLIP32(jmp_buf[3+i]);
+		psxRegs.GPR.r[16+i] =  BFLIP32(jmp_buf[3+i]);
 	gp = BFLIP32(jmp_buf[11]); /* gp */
 
 	v0 = a1; pc0 = ra;
@@ -315,10 +317,10 @@
 	while(PSXMu8(dest) != 0) dest++; /* Move to end of first string. */
 	while(PSXMu8(src) != 0) 
 	{
-	 if(PSXM(dest) && PSXM(src))
-	  PSXMu8(dest)=PSXMu8(src);
-	 src++;
-	 dest++;
+		if(PSXM(dest) && PSXM(src))
+			PSXMu8(dest)=PSXMu8(src);
+		src++;
+		dest++;
 	}
 	PSXMu8(dest) = 0;	/* Append null character. */
 	//strcat(Ra0, Ra1);
@@ -339,21 +341,22 @@
         while(PSXMu8(dest) != 0) dest++; /* Move to end of first string. */
         while(PSXMu8(src) != 0 && count)
         {
-         if(PSXM(dest) && PSXM(src))
-          PSXMu8(dest)=PSXMu8(src);
-         src++;
-         dest++;
-	 count--;
+		if(PSXM(dest) && PSXM(src))
+			PSXMu8(dest)=PSXMu8(src);
+		src++;
+		dest++;
+		count--;
         }
         PSXMu8(dest) = 0;       /* Append null character. */
 
- //strncat(Ra0, Ra1, a2); 
- v0 = a0; 
- pc0 = ra;
+	//strncat(Ra0, Ra1, a2); 
+	v0 = a0; 
+	pc0 = ra;
 }
 
 static void bios_strcmp() { // 0x17
-	v0 = strcmp(Ra0, Ra1);
+	char *p0 = Ra0, *p1 = Ra1;
+	v0 = strcmp(p0, p1);
 	pc0 = ra;
 }
 
@@ -365,18 +368,18 @@
 
 	while(max>0)
 	{
-	 u8 tmp1=PSXMuR8(string1);
-	 u8 tmp2=PSXMuR8(string2);
+		u8 tmp1=PSXMuR8(string1);
+		u8 tmp2=PSXMuR8(string2);
 
-	 if(!tmp1 || !tmp2) break;
+		if(!tmp1 || !tmp2) break;
 
-	 tmpv=tmp1-tmp2;
-	 if(tmpv) break;
-         if(!tmp1 || !tmp2) break;
-	 if(!PSXM(string1) || !PSXM(string2)) break;
-	 max--;
-	 string1++;
-	 string2++;
+		tmpv=tmp1-tmp2;
+		if(tmpv) break;
+		if(!tmp1 || !tmp2) break;
+		if(!PSXM(string1) || !PSXM(string2)) break;
+		max--;
+		string1++;
+		string2++;
 	}
 	if(tmpv>0) v0=1;
 	else if(tmpv<0) v0=-1;
@@ -389,49 +392,49 @@
 /*0x19*/
 static void bios_strcpy()  
 { 
- u32 src=a1,dest=a0;
- u8 val;
+	u32 src=a1,dest=a0;
+	u8 val;
 
- do
- {
-  val=PSXMu8(src);
-  PSXMu8(dest)=val;
-  src++; 
-  dest++;
- } while(val);
- //strcpy(Ra0, Ra1); 
- v0 = a0; 
- pc0 = ra;
+	do
+	{
+		val=PSXMu8(src);
+		PSXMu8(dest)=val;
+		src++; 
+		dest++;
+	} while(val);
+	//strcpy(Ra0, Ra1); 
+	v0 = a0; 
+	pc0 = ra;
 }
 /*0x1a*/
 static void bios_strncpy() 
 { 
- u32 src=a1,dest=a0,max=a2;
- u8 val;  
+	u32 src=a1,dest=a0,max=a2;
+	u8 val;  
  
- do
- {
-  val=PSXMu8(src); 
-  PSXMu8(dest)=val;
-  src++;   
-  dest++;
-  max--;
- } while(val && max);
+	do
+	{
+		val=PSXMu8(src); 
+		PSXMu8(dest)=val;
+		src++;   
+		dest++;
+		max--;
+	} while(val && max);
 
- //strncpy(Ra0, Ra1, a2);  
- v0 = a0; 
- pc0 = ra;
+	//strncpy(Ra0, Ra1, a2);  
+	v0 = a0; 
+	pc0 = ra;
 }
 
 /*0x1b*/
 static void bios_strlen()  
 { 
- u32 src=a0;
+	u32 src=a0;
 
- while(PSXMu8(src)) src++;
+	while(PSXMu8(src)) src++;
 
- v0 = src-a0;  
- pc0 = ra;
+	v0 = src-a0;  
+	pc0 = ra;
 }
 
 static void bios_index() { // 0x1c
@@ -441,7 +444,7 @@
 		v0 = a0 + pcRet - pcA0; 
 	else 
 		v0 = 0;
-    pc0 = ra;
+	pc0 = ra;
 }
 
 static void bios_rindex() { // 0x1d
@@ -451,7 +454,7 @@
 		v0 = a0 + pcRet - pcA0; 
 	else 
 		v0 = 0;
-    pc0 = ra;  
+	pc0 = ra;  
 }
 
 static void bios_strchr() { // 0x1e
@@ -461,7 +464,7 @@
 		v0 = a0 + pcRet - pcA0; 
 	else 
 		v0 = 0;
-    pc0 = ra;
+	pc0 = ra;
 }
 
 static void bios_strrchr() { // 0x1f
@@ -471,42 +474,50 @@
 		v0 = a0 + pcRet - pcA0; 
 	else 
 		v0 = 0;
-    pc0 = ra;
+	pc0 = ra;
 }
 
 static void bios_strpbrk() { // 0x20
-	char *pcA0 = (char *)Ra0; 
-	char *pcRet = strpbrk(pcA0, (char *)Ra1); 
+	char *pcA0 = Ra0, *pcA1 = Ra1;
+	char *pcRet = strpbrk(pcA0, pcA1); 
 	if(pcRet) 
 		v0 = a0 + pcRet - pcA0; 
 	else 
 		v0 = 0;
-    pc0 = ra;
+	pc0 = ra;
 }
 
-static void bios_strspn()  { v0 = strspn ((char *)Ra0, (char *)Ra1); pc0 = ra;}/*21*/ 
-static void bios_strcspn() { v0 = strcspn((char *)Ra0, (char *)Ra1); pc0 = ra;}/*22*/ 
+static void bios_strspn() { /*21*/
+	char *p0 = Ra0, *p1 = Ra1;
+	v0 = strspn (p0, p1);
+	pc0 = ra;
+}
+static void bios_strcspn() { /*22*/
+	char *p0 = Ra0, *p1 = Ra1;
+	v0 = strcspn(p0, p1);
+	pc0 = ra;
+}
 
 #ifdef MOO
 static void bios_strtok() { // 0x23
-	char *pcA0 = (char *)Ra0;
-	char *pcRet = strtok(pcA0, (char *)Ra1);
+	char *pcA0 = Ra0, *pcA1 = Ra1;
+	char *pcRet = strtok(pcA0, pcA1);
 	if(pcRet)
 		v0 = a0 + pcRet - pcA0;
 	else
 		v0 = 0;
-    pc0 = ra;
+	pc0 = ra;
 }
 #endif
 
 static void bios_strstr() { // 0x24
-	char *pcA0 = (char *)Ra0;
-	char *pcRet = strstr(pcA0, (char *)Ra1);
+	char *pcA0 = Ra0, *pcA1 = Ra1;
+	char *pcRet = strstr(pcA0, pcA1);
 	if(pcRet)
 		v0 = a0 + pcRet - pcA0;
 	else
 		v0 = 0;
-    pc0 = ra;
+	pc0 = ra;
 }
 
 /*0x25*/
@@ -518,81 +529,91 @@
 /*0x27*/
 static void bios_bcopy()   
 {
- u32 dest=a1, src=a0, len=a2;
+	u32 dest=a1, src=a0, len=a2;
 
- while(len--)
- {
-  PSXMu8(dest)=PSXMu8(src);
-  dest++;
-  src++;
- }
- //memcpy(Ra1,Ra0,a2); 
- pc0=ra;
+	while(len--)
+	{
+		PSXMu8(dest)=PSXMu8(src);
+		dest++;
+		src++;
+	}
+	//memcpy(Ra1,Ra0,a2); 
+	pc0=ra;
 }
 
 /*0x28*/
 static void bios_bzero()   
 {
- u32 dest=a0, len=a1;
+	u32 dest=a0, len=a1;
  
- while(len--)
- {
-  PSXMu8(dest)=0;
-  dest++;
- }
+	while(len--)
+	{
+		PSXMu8(dest)=0;
+		dest++;
+	}
 
- //memset(Ra0,0,a1); 
- pc0=ra;
+	//memset(Ra0,0,a1); 
+	pc0=ra;
 }
 
 /*0x29*/
-static void bios_bcmp()    {v0 = memcmp(Ra0,Ra1,a2); pc0=ra; }
+static void bios_bcmp() {
+	char *p0 = Ra0, *p1 = Ra1;
+	v0 = memcmp(p0, p1, a2);
+	pc0=ra;
+}
 
 /*0x2a*/
 static void bios_memcpy()  
 {
- u32 dest=a0, src=a1, len=a2;
+	u32 dest=a0, src=a1, len=a2;
  
- while(len--)
- {
-  PSXMu8(dest)=PSXMu8(src);
-  dest++;
-  src++;
- }
- //memcpy(Ra0, Ra1, a2); 
- v0 = a0; 
- pc0 = ra;
+	while(len--)
+	{
+		PSXMu8(dest)=PSXMu8(src);
+		dest++;
+		src++;
+	}
+	//memcpy(Ra0, Ra1, a2); 
+	v0 = a0; 
+	pc0 = ra;
 }
 
 static void bios_memset()  /*0x2b*/
 {
- u32 len=a2;
- u32 dest=a0;
+	u32 len=a2;
+	u32 dest=a0;
 
- while(len--)
- {
-  if(PSXM(dest)) PSXMu8(dest)=a1;
-  dest++;
- }
- //memset(Ra0, a1, a2);
- v0 = a0; 
- pc0 = ra;
+	while(len--)
+	{
+		if(PSXM(dest)) PSXMu8(dest)=a1;
+		dest++;
+	}
+	//memset(Ra0, a1, a2);
+	v0 = a0; 
+	pc0 = ra;
 }
 
 #ifdef MOO
-/*0x2c*/void bios_memmove() {memmove(Ra0, Ra1, a2); v0 = a0; pc0 = ra;}
+/*0x2c*/void bios_memmove() {
+	char *p0 = Ra0, *p1 = Ra1;
+	memmove(p0, p1, a2);
+	v0 = a0;
+	pc0 = ra;
+}
 #endif
 
 /*0x2d*/
-static void bios_memcmp()  
-{
- v0 = memcmp(Ra0, Ra1, a2); 
- pc0 = ra;
+static void bios_memcmp() {
+	char *p0 = Ra0, *p1 = Ra1;
+	v0 = memcmp(p0, p1, a2); 
+	pc0 = ra;
 }
 
 static void bios_memchr() { // 2e
-	void *ret = memchr(Ra0, a1, a2);
-	if (ret != NULL) v0 = (u32)((char*)ret - Ra0) + a0;
+	char *p0 = Ra0;
+	void *ret = memchr(p0, a1, a2);
+	if (ret != NULL) v0 = (u32)((char*)ret - p0) + a0;
 	else v0 = 0;
 	pc0 = ra;
 }
@@ -603,7 +624,8 @@
 }
 
 static void bios_srand() { // 30
-	srand(a0); pc0 = ra;
+	srand(a0);
+	pc0 = ra;
 }
 
 static void bios_malloc() { // 33
@@ -618,7 +640,7 @@
 	   being used.
 	*/
 	while( (a0 > BFLIP32(((malloc_chunk*)PSXM(chunk)) ->size)) ||
-		(BFLIP32( ((malloc_chunk*)PSXM(chunk))->stat  ) == INUSE)
+	       (BFLIP32( ((malloc_chunk*)PSXM(chunk))->stat  ) == INUSE)
 		)
 		chunk=((malloc_chunk*)PSXM(chunk)) -> fd;
 	//printf("%08x\n",chunk);
@@ -649,7 +671,7 @@
 	chunk = (malloc_chunk *)PSXM(heap_addr);
 	chunk->stat = 0;
 	if (((a0 & 0x1fffff) + a1)>= 0x200000) 
-	 chunk->size = BFLIP32(0x1ffffc - (a0 & 0x1fffff));
+		chunk->size = BFLIP32(0x1ffffc - (a0 & 0x1fffff));
 	else chunk->size = BFLIP32(a1);
 	chunk->fd = 0;
 	chunk->bk = 0;
@@ -737,21 +759,21 @@
 
 
 /* gets ev for use with Event */
-#define GetEv() \
-	ev = (a0 >> 24) & 0xf; \
-	if (ev == 0xf) ev = 0x5; \
-	ev*= 32; \
+#define GetEv()					\
+	ev = (a0 >> 24) & 0xf;			\
+	if (ev == 0xf) ev = 0x5;		\
+	ev*= 32;				\
 	ev+= a0&0x1f;
 
 /* gets spec for use with Event */
-#define GetSpec() \
-	spec = 0; \
-	switch (a1) { \
-		case 0x0301: spec = 16; break; \
-		case 0x0302: spec = 17; break; \
-		default: \
-			for (i=0; i<16; i++) if (a1 & (1 << i)) { spec = i; break; } \
-			break; \
+#define GetSpec()							\
+	spec = 0;							\
+	switch (a1) {							\
+	case 0x0301: spec = 16; break;					\
+	case 0x0302: spec = 17; break;					\
+	default:							\
+		for (i=0; i<16; i++) if (a1 & (1 << i)) { spec = i; break; } \
+		break;							\
 	}
 
 static void bios_DeliverEvent() { // 07
@@ -909,7 +931,7 @@
 	if (psxRegs.CP0.n.Cause & 0x80000000) pc0+=4;
 
 	psxRegs.CP0.n.Status = (psxRegs.CP0.n.Status & 0xfffffff0) |
-						  ((psxRegs.CP0.n.Status & 0x3c) >> 2);
+		((psxRegs.CP0.n.Status & 0x3c) >> 2);
 }
 
 static void bios_ResetEntryInt() { // 18
@@ -932,8 +954,8 @@
 	GetSpec();
 
 	if (Event[ev][spec].status == BFLIP32S(EvStALREADY) &&
-		Event[ev][spec].mode == BFLIP32S(EvMdNOINTR))
-			Event[ev][spec].status = BFLIP32S(EvStACTIVE);
+	    Event[ev][spec].mode == BFLIP32S(EvMdNOINTR))
+		Event[ev][spec].status = BFLIP32S(EvStACTIVE);
 
 	pc0 = ra;
 }
@@ -1302,66 +1324,66 @@
 	int i;
 
 	switch (psxRegs.CP0.n.Cause & 0x3c) {
-		case 0x00: // Interrupt
+	case 0x00: // Interrupt
 #ifdef PSXCPU_LOG
 //			PSXCPU_LOG("interrupt\n");
 #endif
-			SaveRegs();
+		SaveRegs();
 
-			biosInterrupt();
+		biosInterrupt();
 
-			for (i=0; i<8; i++) {
-				if (SysIntRP[i]) {
-					u32 *queue = (u32*)PSXM(SysIntRP[i]);
+		for (i=0; i<8; i++) {
+			if (SysIntRP[i]) {
+				u32 *queue = (u32*)PSXM(SysIntRP[i]);
 
-					s0 = BFLIP32(queue[2]);
-					softCall(BFLIP32(queue[1]));
-				}
+				s0 = BFLIP32(queue[2]);
+				softCall(BFLIP32(queue[1]));
 			}
+		}
 
-			if (jmp_int != NULL) {
-				int i;
+		if (jmp_int != NULL) {
+			int i;
 
-				psxHwWrite32(0x1f801070, 0xffffffff);
+			psxHwWrite32(0x1f801070, 0xffffffff);
 
-				ra = BFLIP32(jmp_int[0]);
-				sp = BFLIP32(jmp_int[1]);
-				fp = BFLIP32(jmp_int[2]);
-				for (i=0; i<8; i++) // s0-s7
-					 psxRegs.GPR.r[16+i] = BFLIP32(jmp_int[3+i]);
-				gp = BFLIP32(jmp_int[11]);
+			ra = BFLIP32(jmp_int[0]);
+			sp = BFLIP32(jmp_int[1]);
+			fp = BFLIP32(jmp_int[2]);
+			for (i=0; i<8; i++) // s0-s7
+				psxRegs.GPR.r[16+i] = BFLIP32(jmp_int[3+i]);
+			gp = BFLIP32(jmp_int[11]);
 
-				v0 = 1;
-				pc0 = ra;
-				return;
-			}
-			psxHwWrite16(0x1f801070, 0);
-			break;
-		case 0x20: // Syscall
+			v0 = 1;
+			pc0 = ra;
+			return;
+		}
+		psxHwWrite16(0x1f801070, 0);
+		break;
+	case 0x20: // Syscall
 #ifdef PSXCPU_LOG
 //			PSXCPU_LOG("syscall exp %x\n", a0);
 #endif
-			switch (a0) {
-				case 1: // EnterCritical - disable irq's
-					psxRegs.CP0.n.Status&=~0x404; break;
-				case 2: // ExitCritical - enable irq's
-					psxRegs.CP0.n.Status|= 0x404; break;
-			}
-			pc0 = psxRegs.CP0.n.EPC + 4;
+		switch (a0) {
+		case 1: // EnterCritical - disable irq's
+			psxRegs.CP0.n.Status&=~0x404; break;
+		case 2: // ExitCritical - enable irq's
+			psxRegs.CP0.n.Status|= 0x404; break;
+		}
+		pc0 = psxRegs.CP0.n.EPC + 4;
 
-			psxRegs.CP0.n.Status = (psxRegs.CP0.n.Status & 0xfffffff0) |
-								  ((psxRegs.CP0.n.Status & 0x3c) >> 2);
-			return;
-		default:
+		psxRegs.CP0.n.Status = (psxRegs.CP0.n.Status & 0xfffffff0) |
+			((psxRegs.CP0.n.Status & 0x3c) >> 2);
+		return;
+	default:
 #ifdef PSXCPU_LOG
-			PSXCPU_LOG("unk exp\n");
+		PSXCPU_LOG("unk exp\n");
 #endif
-			break;
+		break;
 	}
 
 	pc0 = psxRegs.CP0.n.EPC;
 	if (psxRegs.CP0.n.Cause & 0x80000000) pc0+=4;
 
 	psxRegs.CP0.n.Status = (psxRegs.CP0.n.Status & 0xfffffff0) |
-						  ((psxRegs.CP0.n.Status & 0x3c) >> 2);
+		((psxRegs.CP0.n.Status & 0x3c) >> 2);
 }
--- a/src/statusicon/si_ui.c	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/statusicon/si_ui.c	Mon Dec 17 19:45:15 2007 -0600
@@ -34,6 +34,9 @@
 #include <gdk/gdkx.h>
 #include <gtk/gtk.h>
 
+#ifndef MAX
+# define MAX(a,b) ((a) > (b) ? (a) : (b))
+#endif
 
 static void si_ui_statusicon_popup_timer_start ( GtkWidget * );
 static void si_ui_statusicon_popup_timer_stop ( GtkWidget * );
@@ -139,6 +142,8 @@
       }
       break;
     }
+
+    default: ;
   }
 
   return FALSE;
@@ -330,6 +335,8 @@
   GdkPixbuf *si_pixbuf, *si_scaled_pixbuf;
   gint size = GPOINTER_TO_INT(g_object_get_data( G_OBJECT(image) , "size" ));
   static gchar *wmname = NULL;
+  
+  AUDDBG("WM reported proposed icon size: %d\n", size);
 
   /* sometimes, KDE won't give the correct size-allocation; workaround this */
   if ( wmname == NULL )
@@ -337,8 +344,9 @@
     GdkScreen *screen = gdk_screen_get_default();
     if ( screen != NULL )
       wmname = (gchar*)gdk_x11_screen_get_window_manager_name( screen );
+      AUDDBG("WM name: %s\n", wmname);
   }
-  if ( ( size > 22 ) && ( wmname != NULL ) && ( !strcmp("KWin",wmname) ) )
+  if ( ( size <= 1 || size > 22 ) && ( wmname != NULL ) && !strcmp("KWin",wmname) )
     size = 22;
 
   si_pixbuf = gdk_pixbuf_new_from_xpm_data( (const char**)si_xpm );
@@ -354,15 +362,17 @@
 static void
 si_ui_statusicon_cb_image_sizalloc ( GtkWidget * image , GtkAllocation * allocation , gpointer si_applet )
 {
-  GtkOrientation orientation;
+  /*GtkOrientation orientation;*/
   static gint prev_size = 0;
   gint size = 0;
 
-  orientation = _aud_gtk_tray_icon_get_orientation( AUD_GTK_TRAY_ICON(si_applet) );
+  /*orientation = _aud_gtk_tray_icon_get_orientation( AUD_GTK_TRAY_ICON(si_applet) );
   if ( orientation == GTK_ORIENTATION_HORIZONTAL )
     size = allocation->height;
   else
-    size = allocation->width;
+    size = allocation->width;*/
+  
+  size = MAX(allocation->height, allocation->width); /* some WMs doesn't report orientation correctly --asphyx */
 
   if ( prev_size != size )
   {
--- a/src/statusicon/si_ui.h	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/statusicon/si_ui.h	Mon Dec 17 19:45:15 2007 -0600
@@ -21,12 +21,14 @@
 #ifndef _I_SI_UI_H
 #define _I_SI_UI_H 1
 
-#include "si_ui.h"
+#include <glib.h>
 
 
 void si_ui_statusicon_show( void );
 void si_ui_statusicon_hide( void );
 void si_ui_about_show( void );
+void si_ui_statusicon_enable ( gboolean );
+void si_ui_prefs_show ( void );
 
 
 #endif /* !_I_SI_UI_H */
--- a/src/tta/ttadec.c	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/tta/ttadec.c	Mon Dec 17 19:45:15 2007 -0600
@@ -476,7 +476,7 @@
 	byte *p = buffer;
 	decoder *dec = tta;
 	int *prev = cache;
-	int value, res;
+	int value, value_tmp, res;
 
 	for (res = 0; p < buffer + pcm_buffer_size;) {
 		fltst *fst = &dec->fst;
@@ -529,8 +529,8 @@
 			else if (rice->sum0 > shift_16[rice->k0 + 1])
 			rice->k0++;
 		}
-
-		value = DEC(value);
+		value_tmp = DEC(value);
+		value = value_tmp;
 
 		// decompress stage 1: adaptive hybrid filter
 		hybrid_filter(fst, &value);
--- a/src/vtx/lh5dec.c	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/vtx/lh5dec.c	Mon Dec 17 19:45:15 2007 -0600
@@ -92,7 +92,10 @@
     start[i] >>= jutbits;
     weight[i] = 1U << (tablebits - i);
   }
-  while (i <= 16) weight[i++] = 1U << (16 - i);
+  while (i <= 16) {
+      weight[i] = 1U << (16 - i);
+      i++;
+  }
 
   i = start[tablebits + 1] >> jutbits;
   if (i != (unsigned short)(1U << 16)) {
--- a/src/vtx/vtx.c	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/vtx/vtx.c	Mon Dec 17 19:45:15 2007 -0600
@@ -96,7 +96,6 @@
 vtx_get_song_tuple_from_vtx(const gchar *filename, ayemu_vtx_t *in)
 {
   Tuple *out = aud_tuple_new_from_filename(filename);
-  gchar *string;
 
   aud_tuple_associate_string(out, FIELD_ARTIST, NULL, in->hdr.author);
   aud_tuple_associate_string(out, FIELD_TITLE, NULL, in->hdr.title);
@@ -159,7 +158,7 @@
 	  }
 	else
 	  {			/* get next AY register frame */
-	    if (ayemu_vtx_get_next_frame (&vtx, regs) == 0)
+	    if (ayemu_vtx_get_next_frame (&vtx, (char *)regs) == 0)
 	      {
 		playback->eof = TRUE;
 		donow = need;
--- a/src/vtx/vtxfile.c	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/vtx/vtxfile.c	Mon Dec 17 19:45:15 2007 -0600
@@ -192,11 +192,11 @@
   aud_vfs_fclose (vtx->fp);
   vtx->fp = NULL;
   if ((vtx->regdata = (char *) malloc (vtx->hdr.regdata_size)) == NULL) {
-    fprintf (stderr, "ayemu_vtx_load_data: Can allocate %d bytes for unpack register data\n", vtx->hdr.regdata_size);
+    fprintf (stderr, "ayemu_vtx_load_data: Can allocate %d bytes for unpack register data\n", (int)(vtx->hdr.regdata_size));
     free (packed_data);
     return NULL;
   }
-  lh5_decode (packed_data, vtx->regdata, vtx->hdr.regdata_size, packed_size);
+  lh5_decode ((unsigned char *)packed_data, (unsigned char *)(vtx->regdata), vtx->hdr.regdata_size, packed_size);
   free (packed_data);
   vtx->pos = 0;
   return vtx->regdata;
--- a/src/wavpack/libwavpack.cxx	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/wavpack/libwavpack.cxx	Mon Dec 17 19:45:15 2007 -0600
@@ -1,3 +1,5 @@
+// #define AUD_DEBUG 1
+
 #include <string>
 
 #include <assert.h>
@@ -24,12 +26,6 @@
 #define M_LN10   2.3025850929940456840179914546843642
 #endif
 
-#ifdef DEBUG
-# define DBG(format, args...) fprintf(stderr, format, ## args)
-#else
-# define DBG(format, args...)
-#endif
-
 #define BUFFER_SIZE 256 // read buffer size, in samples
 
 static void wv_load_config();
@@ -42,7 +38,7 @@
 static int wv_get_time(InputPlayback *);
 static void wv_get_song_info(char *, char **, int *);
 static char *generate_title(const char *, WavpackContext *ctx);
-static double isSeek;
+static int isSeek;
 static short paused;
 static bool killDecodeThread;
 static bool AudioError;
@@ -305,11 +301,10 @@
 static void *
 DecodeThread(InputPlayback *playback)
 {
-    ape_tag tag;
+    int bps;
+#ifdef AUD_DEBUG
     char *filename = playback->filename;
-    int bps_updateCounter = 0;
-    int bps;
-    int i;
+#endif
     WavpackDecoder d(&mod);
 
     if (!d.attach_to_play(playback)) {
@@ -317,25 +312,26 @@
         return end_thread();
     }
     bps = WavpackGetBytesPerSample(d.ctx) * d.num_channels;
-    DBG("reading %s at %d rate with %d channels\n", filename, d.sample_rate, d.num_channels);
+    AUDDBG("reading %s at %d rate with %d channels\n", filename, d.sample_rate, d.num_channels);
 
     if (!d.open_audio()) {
-        DBG("error opening audio channel\n");
+        AUDDBG("error opening audio channel\n");
         killDecodeThread = true;
         AudioError = true;
         openedAudio = false;
     }
     else {
-        DBG("opened audio channel\n");
+        AUDDBG("opened audio channel\n");
         openedAudio = true;
     }
     unsigned status;
+#if 0
     char *display = generate_title(filename, d.ctx);
     int length = (int) (1000 * WavpackGetNumSamples(d.ctx));
-
+#endif
     while (!killDecodeThread) {
         if (isSeek != -1) {
-            DBG("seeking to position %d\n", isSeek);
+            AUDDBG("seeking to position %d\n", isSeek);
             WavpackSeekSample(d.ctx, (int)(isSeek * d.sample_rate));
             isSeek = -1;
         }
@@ -477,12 +473,14 @@
     }
 
     int sample_rate = WavpackGetSampleRate(d.ctx);
+#ifdef AUD_DEBUG
     int num_channels = WavpackGetNumChannels(d.ctx);
-    DBG("reading %s at %d rate with %d channels\n", filename, sample_rate, num_channels);
+#endif
+    AUDDBG("reading %s at %d rate with %d channels\n", filename, sample_rate, num_channels);
 
     *length = (int)(WavpackGetNumSamples(d.ctx) / sample_rate) * 1000,
     *title = generate_title(filename, d.ctx);
-    DBG("title for %s = %s\n", filename, *title);
+    AUDDBG("title for %s = %s\n", filename, *title);
 }
 
 static int
--- a/src/wavpack/tags.cxx	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/wavpack/tags.cxx	Mon Dec 17 19:45:15 2007 -0600
@@ -9,6 +9,35 @@
 #include <audacious/plugin.h>
 #include "tags.h"
 
+static const char*  GenreList [] = {
+    "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge",
+    "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", "Other", "Pop", "R&B",
+    "Rap", "Reggae", "Rock", "Techno", "Industrial", "Alternative", "Ska",
+    "Death Metal", "Pranks", "Soundtrack", "Euro-Techno", "Ambient",
+    "Trip-Hop", "Vocal", "Jazz+Funk", "Fusion", "Trance", "Classical",
+    "Instrumental", "Acid", "House", "Game", "Sound Clip", "Gospel", "Noise",
+    "AlternRock", "Bass", "Soul", "Punk", "Space", "Meditative",
+    "Instrumental Pop", "Instrumental Rock", "Ethnic", "Gothic", "Darkwave",
+    "Techno-Industrial", "Electronic", "Pop-Folk", "Eurodance", "Dream",
+    "Southern Rock", "Comedy", "Cult", "Gangsta", "Top 40", "Christian Rap",
+    "Pop/Funk", "Jungle", "Native American", "Cabaret", "New Wave",
+    "Psychadelic", "Rave", "Showtunes", "Trailer", "Lo-Fi", "Tribal",
+    "Acid Punk", "Acid Jazz", "Polka", "Retro", "Musical", "Rock & Roll",
+    "Hard Rock", "Folk", "Folk/Rock", "National Folk", "Swing", "Fast-Fusion",
+    "Bebob", "Latin", "Revival", "Celtic", "Bluegrass", "Avantgarde",
+    "Gothic Rock", "Progressive Rock", "Psychedelic Rock", "Symphonic Rock",
+    "Slow Rock", "Big Band", "Chorus", "Easy Listening", "Acoustic", "Humour",
+    "Speech", "Chanson", "Opera", "Chamber Music", "Sonata", "Symphony",
+    "Booty Bass", "Primus", "Porn Groove", "Satire", "Slow Jam", "Club",
+    "Tango", "Samba", "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul",
+    "Freestyle", "Duet", "Punk Rock", "Drum Solo", "A capella", "Euro-House",
+    "Dance Hall", "Goa", "Drum & Bass", "Club House", "Hardcore", "Terror",
+    "Indie", "BritPop", "NegerPunk", "Polsk Punk", "Beat", "Christian Gangsta",
+    "Heavy Metal", "Black Metal", "Crossover", "Contemporary C",
+    "Christian Rock", "Merengue", "Salsa", "Thrash Metal", "Anime", "JPop",
+    "SynthPop"
+};
+
 struct APETagFooterStruct {
     unsigned char ID[8];
     unsigned char Version[4];
--- a/src/wavpack/tags.h	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/wavpack/tags.h	Mon Dec 17 19:45:15 2007 -0600
@@ -20,35 +20,6 @@
     int     _genre;
 } ape_tag;
 
-static const char*  GenreList [] = {
-    "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge",
-    "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", "Other", "Pop", "R&B",
-    "Rap", "Reggae", "Rock", "Techno", "Industrial", "Alternative", "Ska",
-    "Death Metal", "Pranks", "Soundtrack", "Euro-Techno", "Ambient",
-    "Trip-Hop", "Vocal", "Jazz+Funk", "Fusion", "Trance", "Classical",
-    "Instrumental", "Acid", "House", "Game", "Sound Clip", "Gospel", "Noise",
-    "AlternRock", "Bass", "Soul", "Punk", "Space", "Meditative",
-    "Instrumental Pop", "Instrumental Rock", "Ethnic", "Gothic", "Darkwave",
-    "Techno-Industrial", "Electronic", "Pop-Folk", "Eurodance", "Dream",
-    "Southern Rock", "Comedy", "Cult", "Gangsta", "Top 40", "Christian Rap",
-    "Pop/Funk", "Jungle", "Native American", "Cabaret", "New Wave",
-    "Psychadelic", "Rave", "Showtunes", "Trailer", "Lo-Fi", "Tribal",
-    "Acid Punk", "Acid Jazz", "Polka", "Retro", "Musical", "Rock & Roll",
-    "Hard Rock", "Folk", "Folk/Rock", "National Folk", "Swing", "Fast-Fusion",
-    "Bebob", "Latin", "Revival", "Celtic", "Bluegrass", "Avantgarde",
-    "Gothic Rock", "Progressive Rock", "Psychedelic Rock", "Symphonic Rock",
-    "Slow Rock", "Big Band", "Chorus", "Easy Listening", "Acoustic", "Humour",
-    "Speech", "Chanson", "Opera", "Chamber Music", "Sonata", "Symphony",
-    "Booty Bass", "Primus", "Porn Groove", "Satire", "Slow Jam", "Club",
-    "Tango", "Samba", "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul",
-    "Freestyle", "Duet", "Punk Rock", "Drum Solo", "A capella", "Euro-House",
-    "Dance Hall", "Goa", "Drum & Bass", "Club House", "Hardcore", "Terror",
-    "Indie", "BritPop", "NegerPunk", "Polsk Punk", "Beat", "Christian Gangsta",
-    "Heavy Metal", "Black Metal", "Crossover", "Contemporary C",
-    "Christian Rock", "Merengue", "Salsa", "Thrash Metal", "Anime", "JPop",
-    "SynthPop"
-};
-
 int utf8ToUnicode ( const char* lpMultiByteStr, wchar_t* lpWideCharStr, int cmbChars );
 
 int GetTageType ( FILE *fp );
--- a/src/wavpack/ui.cxx	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/wavpack/ui.cxx	Mon Dec 17 19:45:15 2007 -0600
@@ -1,3 +1,5 @@
+// #define AUD_DEBUG 1
+
 #include <assert.h>
 #include <string.h>
 #include <stdio.h>
@@ -21,8 +23,6 @@
 #define M_LN10   2.3025850929940456840179914546843642
 #endif
 
-#define DBG(format, args...) fprintf(stderr, format, ## args)
-
 void load_tag(ape_tag *tag, WavpackContext *ctx);
 gboolean clipPreventionEnabled;
 gboolean dynBitrateEnabled;
@@ -118,10 +118,12 @@
         printf("wavpack: Error opening file: \"%s: %s\"\n", fn, error_buff);
         return;
     }
+#ifdef AUD_DEBUG
     int sample_rate = WavpackGetSampleRate(ctx);
     int num_channels = WavpackGetNumChannels(ctx);
+#endif
     load_tag(&tag, ctx);
-    DBG("opened %s at %d rate with %d channels\n", fn, sample_rate, num_channels);
+    AUDDBG("opened %s at %d rate with %d channels\n", fn, sample_rate, num_channels);
 
     filename = g_strdup(fn);
     static GtkWidget *info_frame, *info_box, *bitrate_label, *rate_label;
--- a/src/xspf/xspf.c	Mon Dec 17 15:53:26 2007 -0600
+++ b/src/xspf/xspf.c	Mon Dec 17 19:45:15 2007 -0600
@@ -76,6 +76,7 @@
     { FIELD_YEAR,         "year",         TUPLE_INT,      TRUE,   CMP_DEF },
     { FIELD_DATE,         "date",         TUPLE_STRING,   TRUE,   CMP_DEF },
     { FIELD_GENRE,        "genre",        TUPLE_STRING,   TRUE,   CMP_DEF },
+    { FIELD_MTIME,        "mtime",        TUPLE_INT,      TRUE,   CMP_DEF },
     { FIELD_FORMATTER,    "formatter",    TUPLE_STRING,   TRUE,   CMP_DEF },
 };
 
@@ -165,6 +166,7 @@
                             break;
                         
                         case TUPLE_INT:
+                            AUDDBG("field=%s val=%s\n", xspf_entries[i].xspfName, str);
                             aud_tuple_associate_int(tuple, xspf_entries[i].tupleField, NULL, atol((char *)str));
                             break;
                         
@@ -181,29 +183,24 @@
     }
 
     if (location) {
-        gchar *realfn = NULL, *scratch = NULL;
+        gchar *scratch = NULL;
 
         /* filename and path in tuple must be unescaped. */
-        scratch = g_filename_from_uri(location, NULL, NULL);
-        realfn = aud_str_to_utf8(scratch ? scratch : location);
-        g_free(scratch);
-
-        scratch = g_path_get_basename(realfn);
+        scratch = aud_uri_to_display_basename(location);
         aud_tuple_associate_string(tuple, FIELD_FILE_NAME, NULL, scratch);
         g_free(scratch);
 
-        scratch = g_path_get_dirname(realfn);
+        scratch = aud_uri_to_display_dirname(location);
         aud_tuple_associate_string(tuple, FIELD_FILE_PATH, NULL, scratch);
         g_free(scratch);
 
-        aud_tuple_associate_string(tuple, FIELD_FILE_EXT, NULL, strrchr(realfn, '.'));
+        aud_tuple_associate_string(tuple, FIELD_FILE_EXT, NULL, strrchr(location, '.'));
 
         AUDDBG("tuple->file_name = %s\n", aud_tuple_get_string(tuple, FIELD_FILE_NAME, NULL));
         AUDDBG("tuple->file_path = %s\n", aud_tuple_get_string(tuple, FIELD_FILE_PATH, NULL));
 
         /* add file to playlist */
         aud_playlist_load_ins_file_tuple(playlist, location, filename, pos, tuple);
-        g_free(realfn);
         pos++;
     }
 
@@ -520,9 +517,6 @@
                     xspf_add_node(track, xs->type, xs->isMeta, xs->xspfName, scratch, scratchi);
             }
 
-            /* Write mtime unconditionally to support staticlist */
-            xspf_add_node(track, TUPLE_INT, TRUE, "mtime", NULL,
-                aud_tuple_get_int(entry->tuple, FIELD_MTIME, NULL));
         } else {
 
             if (entry->title != NULL && g_utf8_validate(entry->title, -1, NULL))