# HG changeset patch # User nenolod # Date 1165561015 28800 # Node ID 0b0a12ea9dd92b7c7bcd18258e2f99bae1f3a473 # Parent 4f750b8d0127bb4d5bff6edc2d157661cc3cfcbd [svn] - allow the output plugin to be changed while playing. diff -r 4f750b8d0127 -r 0b0a12ea9dd9 ChangeLog --- a/ChangeLog Thu Dec 07 22:42:22 2006 -0800 +++ b/ChangeLog Thu Dec 07 22:56:55 2006 -0800 @@ -1,3 +1,16 @@ +2006-12-08 06:42:22 +0000 Yoshiki Yazawa + revision [3135] + Do not install signal handler for SIGSEGV if environmental variable + AUD_ENSURE_BACKTRACE is defined. + + In particular environment (maybe with glibc 2.5), core file through + signal handler does not contain application's backtrace but signal + handler's backtrace. :( + + trunk/audacious/main.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + + 2006-12-07 08:22:55 +0000 William Pitcock revision [3133] - no, this is not going to work diff -r 4f750b8d0127 -r 0b0a12ea9dd9 audacious/output.c --- a/audacious/output.c Thu Dec 07 22:42:22 2006 -0800 +++ b/audacious/output.c Thu Dec 07 22:56:55 2006 -0800 @@ -1,4 +1,7 @@ -/* BMP - Cross-platform multimedia player +/* Audacious + * Copyright (C) 2005-2007 Audacious team + * + * BMP - Cross-platform multimedia player * Copyright (C) 2003-2004 BMP development team. * * Based on XMMS: @@ -74,11 +77,10 @@ void set_current_output_plugin(gint i) { -#if 0 gint time; gint pos; gboolean playing; -#endif + OutputPlugin *op = get_current_output_plugin(); GList *node = g_list_nth(op_data.output_list, i); if (!node) { @@ -88,44 +90,48 @@ op_data.current_output_plugin = node->data; + playing = bmp_playback_get_playing(); -#if 0 - playing = bmp_playback_get_playing(); - if (playing) { - /* FIXME: we do all on our own here */ - - guint min = 0, sec = 0, params, time, pos; - gchar timestr[10]; - - bmp_playback_pause(); - pos = get_playlist_position(); - time = bmp_playback_get_time() / 1000; - g_snprintf(timestr, sizeof(timestr), "%u:%2.2u", - time / 60, time % 60); - - params = sscanf(timestr, "%u:%u", &min, &sec); - if (params == 2) - time = (min * 60) + sec; - else if (params == 1) - time = min; - else - return; - - bmp_playback_stop(); + if (playing == TRUE) + { + gint i = 99; + guint time, pos; + PlaylistEntry *entry; + + /* don't stop yet, get the seek time and playlist position first */ + pos = playlist_get_position(); + time = op->output_time(); + + /* reset the audio system */ + mainwin_stop_pushed(); + op->close_audio(); + + g_usleep(300000); + + /* wait for the playback thread to come online */ + while (bmp_playback_get_playing()) + g_message("waiting for audio system shutdown..."); + + /* wait for the playback thread to come online */ playlist_set_position(pos); - bmp_playback_play_file(playlist_get_filename(pos)); - - while (!bmp_playback_get_playing()) - g_message("waiting..."); + entry = playlist_get_entry_to_play(); + bmp_playback_play_file(entry); + while (!bmp_playback_get_playing()) + { + gtk_main_iteration(); + g_message("waiting for audio system startup..."); + } + + /* and signal a reseek */ if (playlist_get_current_length() > -1 && - time <= (playlist_get_current_length() / 1000)) { - /* Some time for things to cool down and heat up */ - g_usleep(1000000); - bmp_playback_seek(time); + time <= (playlist_get_current_length())) + { + gint i; + + bmp_playback_seek(time / 1000); } } -#endif } GList * diff -r 4f750b8d0127 -r 0b0a12ea9dd9 audacious/prefswin.c --- a/audacious/prefswin.c Thu Dec 07 22:42:22 2006 -0800 +++ b/audacious/prefswin.c Thu Dec 07 22:56:55 2006 -0800 @@ -397,10 +397,6 @@ gint selected; selected = gtk_combo_box_get_active(combobox); - /* Force playback to stop. There is NO way to change the output - plugin in the middle of a playback, and NO way to know when the - user closes the output plugin settings dialog. */ - mainwin_stop_pushed(); set_current_output_plugin(selected); }