# HG changeset patch
# User Eugene Zagidullin <e.asphyx@gmail.com>
# Date 1202094697 -10800
# Node ID 58bc8f042f692296d8a759bec30c668c323b9acb
# Parent  b1e08fcb4273450f623c0caf11d4886aab348473# Parent  254ec9932b3746a91eb9d894d2fbb4e22cd7fbe5
Automated merge with ssh://hg.atheme.org//hg/audacious

diff -r b1e08fcb4273 -r 58bc8f042f69 src/audacious/output.c
--- a/src/audacious/output.c	Mon Feb 04 06:09:51 2008 +0300
+++ b/src/audacious/output.c	Mon Feb 04 06:11:37 2008 +0300
@@ -725,7 +725,7 @@
             GTimeVal pb_abs_time;
 
             g_get_current_time(&pb_abs_time);
-            g_time_val_add(&pb_abs_time, (cfg.output_buffer_size / 2) * 1000);
+            g_time_val_add(&pb_abs_time, 10000);
 
             if (going && !*going)              /* thread stopped? */
                 return;                        /* so finish */
@@ -734,14 +734,9 @@
                 return;                        /* yes, so finish */
 
             /* else sleep for retry */
-#ifndef GDK_WINDOWING_QUARTZ
             g_mutex_lock(playback->pb_change_mutex);
             g_cond_timed_wait(playback->pb_change_cond, playback->pb_change_mutex, &pb_abs_time);
             g_mutex_unlock(playback->pb_change_mutex);
-#else
-            /* Darwin threading sucks. */
-            g_usleep(10000);
-#endif
         }
 
         if (ip_data.stop)
diff -r b1e08fcb4273 -r 58bc8f042f69 src/libid3tag/field.c
--- a/src/libid3tag/field.c	Mon Feb 04 06:09:51 2008 +0300
+++ b/src/libid3tag/field.c	Mon Feb 04 06:11:37 2008 +0300
@@ -265,7 +265,7 @@
 
       end = *ptr + length;
 
-      while (end - *ptr > 0) {
+      while (end - *ptr > 0 && **ptr != '\0') {
 	latin1 = id3_parse_latin1(ptr, end - *ptr, 0);
 	if (latin1 == 0)
 	  goto fail;
@@ -304,7 +304,7 @@
 
       end = *ptr + length;
 
-      while (end - *ptr > 0) {
+      while (end - *ptr > 0 && **ptr != '\0') {
 	ucs4 = id3_parse_string(ptr, end - *ptr, *encoding, 0);
 	if (ucs4 == 0)
 	  goto fail;