# HG changeset patch # User Yoshiki Yazawa # Date 1196197288 -32400 # Node ID 17bf734f8187a7e126a67f7aaf0f059cd2e03643 # Parent 66529edae49d15a3eb839ec045fdc9c5a6015340 avoid crash when audacious is launched with -p option. diff -r 66529edae49d -r 17bf734f8187 src/audacious/auddrct.c --- a/src/audacious/auddrct.c Tue Nov 27 17:42:52 2007 +0300 +++ b/src/audacious/auddrct.c Wed Nov 28 06:01:28 2007 +0900 @@ -123,7 +123,7 @@ if (playback_get_paused()) playback_pause(); else if (playlist_get_length(playlist_get_active())) - playback_initiate(); + event_queue("playback initiate", (gpointer)0xdeadbeef); // to avoid crash at startup. --yaz else mainwin_eject_pushed(); return; diff -r 66529edae49d -r 17bf734f8187 src/audacious/main.c --- a/src/audacious/main.c Tue Nov 27 17:42:52 2007 +0300 +++ b/src/audacious/main.c Wed Nov 28 06:01:28 2007 +0900 @@ -1206,10 +1206,10 @@ audacious_remote_activate(session); exit(EXIT_SUCCESS); - } + } /* is_running */ else #endif - { + { /* !is_running */ if (filenames != NULL) { gint pos = 0; @@ -1297,7 +1297,7 @@ if (options->activate) drct_activate(); - } + } /* !is_running */ } static void diff -r 66529edae49d -r 17bf734f8187 src/audacious/ui_main_evlisteners.c --- a/src/audacious/ui_main_evlisteners.c Tue Nov 27 17:42:52 2007 +0300 +++ b/src/audacious/ui_main_evlisteners.c Wed Nov 28 06:01:28 2007 +0900 @@ -70,11 +70,18 @@ equalizerwin_set_balance_slider(b); } +static void +ui_main_evlistener_playback_initiate(gpointer hook_data, gpointer user_data) +{ + playback_initiate(); +} + void ui_main_evlistener_init(void) { hook_associate("title change", ui_main_evlistener_title_change, NULL); hook_associate("hide seekbar", ui_main_evlistener_hide_seekbar, NULL); hook_associate("volume set", ui_main_evlistener_volume_change, NULL); + hook_associate("playback initiate", ui_main_evlistener_playback_initiate, NULL); }