changeset 1659:eeaf62b288a3 trunk

[svn] Make the playback resume code a lot more robust.
author chainsaw
date Sat, 09 Sep 2006 18:04:36 -0700
parents fda280358660
children 4c72daee66e3
files ChangeLog audacious/main.c
diffstat 2 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Sep 09 18:02:42 2006 -0700
+++ b/ChangeLog	Sat Sep 09 18:04:36 2006 -0700
@@ -1,3 +1,11 @@
+2006-09-10 01:02:42 +0000  
+  revision [2253]
+  avoid segfaults
+
+  Changes:        Modified:
+  +1 -2           trunk/libaudacious/titlestring.c  
+
+
 2006-09-09 00:31:49 +0000  William Pitcock <nenolod@nenolod.net>
   revision [2251]
   - ensure that the module symtable is consistantly unique on Mach-O bundles
--- a/audacious/main.c	Sat Sep 09 18:02:42 2006 -0700
+++ b/audacious/main.c	Sat Sep 09 18:04:36 2006 -0700
@@ -1127,12 +1127,15 @@
 	has_x11_connection = TRUE;
 
 	if (cfg.resume_playback_on_startup) {
-		if (cfg.resume_playback_on_startup_time != -1) {
+		if (cfg.resume_playback_on_startup_time != -1 && playlist_get_length() > 0) {
+			int i;
 			while (gtk_events_pending()) gtk_main_iteration();
 			bmp_playback_initiate();
-			g_usleep(10000);	/* XXX: musepack and others need this! */
-			while (!ip_data.playing)
+			for (i = 0; i < 8; i++) {
 				g_usleep(10000);
+				if (!ip_data.playing)
+					break;
+			}
 			bmp_playback_seek(cfg.resume_playback_on_startup_time /
 					  1000);
 		}