--- xmms-1.2.10.orig/xmms/input.c 2003-08-08 19:10:44.000000000 +0200 +++ xmms-1.2.10/xmms/input.c 2006-07-06 17:01:27.000000000 +0200 @@ -285,6 +285,14 @@ void input_seek(int time) } } +gboolean input_stopped_for_restart = FALSE; /* crossfade */ +void input_stop_for_restart() /* crossfade */ +{ + input_stopped_for_restart = TRUE; + input_stop(); + input_stopped_for_restart = FALSE; +} + void input_stop(void) { if (ip_data->playing && get_current_input_plugin()) --- xmms-1.2.10.orig/xmms/input.h 2000-02-16 22:05:57.000000000 +0100 +++ xmms-1.2.10/xmms/input.h 2006-07-06 17:01:27.000000000 +0200 @@ -34,6 +34,7 @@ InputVisType input_get_vis_type(); gboolean input_check_file(gchar * filename); void input_play(char *filename); void input_stop(void); +void input_stop_for_restart(void); void input_pause(void); int input_get_time(void); void input_set_eq(int on, float preamp, float *bands); --- xmms-1.2.10.orig/xmms/main.c 2004-02-23 21:31:43.000000000 +0100 +++ xmms-1.2.10/xmms/main.c 2006-07-07 11:18:36.000000000 +0200 @@ -881,8 +881,10 @@ void mainwin_shade_toggle(void) mainwin_set_shade(!cfg.player_shaded); } +gboolean is_quitting = FALSE; /* crossfade */ void mainwin_quit_cb(void) { + is_quitting = TRUE; /* crossfade */ input_stop(); gtk_widget_hide(equalizerwin); gtk_widget_hide(playlistwin); @@ -1523,7 +1525,8 @@ static void mainwin_jump_to_file_real_cb int *pos; if (get_input_playing()) - input_stop(); + input_stop_for_restart(); + pos = gtk_clist_get_row_data(clist, GPOINTER_TO_INT(clist->selection->data)); playlist_set_position(*pos); playlist_play(); --- xmms-1.2.10.orig/xmms/playlist.c 2004-02-23 21:31:43.000000000 +0100 +++ xmms-1.2.10/xmms/playlist.c 2006-07-07 11:11:47.000000000 +0200 @@ -77,9 +77,10 @@ void playlist_clear(void) { GList *node; PlaylistEntry *entry; - + + /* always assume that there is another song comming up */ if (get_input_playing()) - input_stop(); + input_stop_for_restart(); pthread_mutex_lock(&playlist_mutex); if (playlist) @@ -124,7 +125,7 @@ void playlist_delete_node(GList *node, g if (get_input_playing()) { PL_UNLOCK(); - input_stop(); + input_stop_for_restart(); PL_LOCK(); *restart_playing = TRUE; } @@ -570,7 +571,7 @@ void playlist_play(void) } if (get_input_playing()) - input_stop(); + input_stop_for_restart(); vis_clear_data(mainwin_vis); vis_clear_data(playlistwin_vis); @@ -668,7 +669,7 @@ void playlist_next(void) { /* We need to stop before changing playlist_position */ PL_UNLOCK(); - input_stop(); + input_stop_for_restart(); PL_LOCK(); restart_playing = TRUE; } @@ -723,7 +724,7 @@ void playlist_prev(void) { /* We need to stop before changing playlist_position */ PL_UNLOCK(); - input_stop(); + input_stop_for_restart(); PL_LOCK(); restart_playing = TRUE; } @@ -852,7 +853,7 @@ void playlist_set_position(int pos) { /* We need to stop before changing playlist_position */ PL_UNLOCK(); - input_stop(); + input_stop_for_restart(); PL_LOCK(); restart_playing = TRUE; } @@ -879,11 +880,25 @@ void playlist_set_position(int pos) void playlist_eof_reached(void) { GList *plist_pos_list; - - input_stop(); + gboolean stop_for_restart = TRUE; PL_LOCK(); + + /* + * First, determine if we are going to play another song after + * this one and call input_stop() / input_stop_for_restart() + * accordingly. + */ plist_pos_list = find_playlist_position_list(); + if (!queued_list && !g_list_next(plist_pos_list) && !cfg.repeat) + stop_for_restart = FALSE; + + PL_UNLOCK(); + if (stop_for_restart) + input_stop_for_restart(); + else + input_stop(); + PL_LOCK(); if (cfg.no_playlist_advance) {