Package: xmms
Severity: wishlist
Tags: patch

Dear xmms maintainer,

forwarding an excerpt from the README of the upcoming xmms-crossfade
release:

|   * There is a serious problem on some systems: Users who have the
|     NPTL (Native Posix Thread Libary) version of glibc instaleld on
|     their systems will experience a lockup or SEGFAULT when exitting
|     XMMS while a song is being played using XMMS-crossfade. This is
|     because of a bug in the NPTL implementation:
| 
|     http://sources.redhat.com/bugzilla/show_bug.cgi?id=654
| 
|     Fortunatelly, there is a workaround, which (unfortunatelly) requires
|     a patch to XMMS itself. As of version 0.3.9 of XMMS-crossfade, these
|     patches (for BMP and Audacious as well) are included in the
|     distribution. It is now up to the developers and/or maintainers of
|     the players to incorporate the (fully transparent) patch into their
|     programs.

Further background can be found at
<http://groups.google.de/group/comp.programming.threads/browse_thread/thread/9e4e6cd0e95f9a1/17b4c7a4f35bd1c5>.

For reference, the bug that raised this issue was initially reported as
<http://bugs.debian.org/240186> (X-Debbugs-CC'd).

I can confirm that the attached patch by Peter Eisenlohr
<[EMAIL PROTECTED]> (xmms-crossfade upstream) fixes this particular
segfault on my system, so please consider including it while this bug
is not yet fixed in glibc. However, as this is not a bug in xmms per
se, perhaps you'll prefer to tag this wontfix and we better wait for
glibc...

Cheers,
Flo
diff -ur xmms-1.2.10/xmms/input.c xmms-1.2.10.patched/xmms/input.c
--- xmms-1.2.10/xmms/input.c    2003-08-08 19:10:44.000000000 +0200
+++ xmms-1.2.10.patched/xmms/input.c    2005-11-25 00:12:36.000000000 +0100
@@ -285,6 +285,14 @@
        }
 }
 
+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())
diff -ur xmms-1.2.10/xmms/input.h xmms-1.2.10.patched/xmms/input.h
--- xmms-1.2.10/xmms/input.h    2000-02-16 22:05:57.000000000 +0100
+++ xmms-1.2.10.patched/xmms/input.h    2005-11-25 00:12:36.000000000 +0100
@@ -34,6 +34,7 @@
 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);
diff -ur xmms-1.2.10/xmms/main.c xmms-1.2.10.patched/xmms/main.c
--- xmms-1.2.10/xmms/main.c     2004-02-23 21:31:43.000000000 +0100
+++ xmms-1.2.10.patched/xmms/main.c     2005-11-25 00:12:36.000000000 +0100
@@ -881,8 +881,10 @@
        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 @@
                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();
diff -ur xmms-1.2.10/xmms/playlist.c xmms-1.2.10.patched/xmms/playlist.c
--- xmms-1.2.10/xmms/playlist.c 2004-02-23 21:31:43.000000000 +0100
+++ xmms-1.2.10.patched/xmms/playlist.c 2005-11-25 00:12:36.000000000 +0100
@@ -124,7 +124,7 @@
                if (get_input_playing())
                {
                        PL_UNLOCK();
-                       input_stop();
+                       input_stop_for_restart();
                        PL_LOCK();
                        *restart_playing = TRUE;
                }
@@ -570,7 +570,7 @@
        }
 
        if (get_input_playing())
-               input_stop();
+               input_stop_for_restart();
 
        vis_clear_data(mainwin_vis);
        vis_clear_data(playlistwin_vis);
@@ -668,7 +668,7 @@
        {
                /* We need to stop before changing playlist_position */
                PL_UNLOCK();
-               input_stop();
+               input_stop_for_restart();
                PL_LOCK();
                restart_playing = TRUE;
        }
@@ -723,7 +723,7 @@
        {
                /* We need to stop before changing playlist_position */
                PL_UNLOCK();
-               input_stop();
+               input_stop_for_restart();
                PL_LOCK();
                restart_playing = TRUE;
        }
@@ -852,7 +852,7 @@
        {
                /* We need to stop before changing playlist_position */
                PL_UNLOCK();
-               input_stop();
+               input_stop_for_restart();
                PL_LOCK();
                restart_playing = TRUE;
        }

Attachment: signature.asc
Description: Digital signature

Reply via email to