# HG changeset patch # User nhjm449 # Date 1154390804 25200 # Node ID 6fe7ba6e5489c128bc38d592594c504729d46784 # Parent 04730ff1693de6fe36c31a131290a097462accf7 [svn] - Don't poll the config database if not using TCP sockets. diff -r 04730ff1693d -r 6fe7ba6e5489 ChangeLog --- a/ChangeLog Sat Jul 29 16:23:16 2006 -0700 +++ b/ChangeLog Mon Jul 31 17:06:44 2006 -0700 @@ -1,3 +1,13 @@ +2006-07-29 23:23:16 +0000 Yoshiki Yazawa + revision [1824] + changes link order to avoid linkage with installed library. + + + Changes: Modified: + +3 -3 trunk/audacious/Makefile + +3 -3 trunk/audtool/Makefile + + 2006-07-28 21:13:59 +0000 William Pitcock revision [1822] - fix the other bug exposed by strace diff -r 04730ff1693d -r 6fe7ba6e5489 audacious/controlsocket.c --- a/audacious/controlsocket.c Sat Jul 29 16:23:16 2006 -0700 +++ b/audacious/controlsocket.c Mon Jul 31 17:06:44 2006 -0700 @@ -98,6 +98,8 @@ gint i; gint fd; + audacious_set_session_type((gint *) AUDACIOUS_TYPE_UNIX); + if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { g_critical("ctrlsocket_setup(): Failed to open socket: %s", strerror(errno)); @@ -154,6 +156,8 @@ gint i; gint fd; + audacious_set_session_type((gint *) AUDACIOUS_TYPE_TCP); + if ((fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) { g_critical("ctrlsocket_setup(): Failed to open socket: %s", strerror(errno)); diff -r 04730ff1693d -r 6fe7ba6e5489 libaudacious/beepctrl.c --- a/libaudacious/beepctrl.c Sat Jul 29 16:23:16 2006 -0700 +++ b/libaudacious/beepctrl.c Mon Jul 31 17:06:44 2006 -0700 @@ -39,6 +39,7 @@ /* overrides audacious_get_session_uri(). */ gchar *audacious_session_uri = NULL; +gint *audacious_session_type = NULL; #ifdef HAVE_UNISTD_H #include @@ -314,11 +315,14 @@ return audacious_session_uri; } - db = bmp_cfg_db_open(); + if (audacious_session_type != AUDACIOUS_TYPE_UNIX) + { + db = bmp_cfg_db_open(); - bmp_cfg_db_get_string(db, NULL, "listen_uri_base", &value); + bmp_cfg_db_get_string(db, NULL, "listen_uri_base", &value); - bmp_cfg_db_close(db); + bmp_cfg_db_close(db); + } if (value == NULL) return g_strdup_printf("unix://localhost/%s/%s_%s.%d", g_get_tmp_dir(), @@ -329,19 +333,33 @@ return value; } -gint +void +audacious_set_session_type(gint *type) +{ + audacious_session_type = type; +} + +gint * audacious_determine_session_type(gint session) { gchar *uri; + if (audacious_session_type != NULL) + { + return audacious_session_type; + } + uri = audacious_get_session_uri(session); if (!g_strncasecmp(uri, "tcp://", 6)) - return AUDACIOUS_TYPE_TCP; + audacious_session_type = (gint *) AUDACIOUS_TYPE_TCP; else - return AUDACIOUS_TYPE_UNIX; + audacious_session_type = (gint *) AUDACIOUS_TYPE_UNIX; - return AUDACIOUS_TYPE_UNIX; + if (audacious_session_type == NULL) + audacious_session_type = (gint *) AUDACIOUS_TYPE_UNIX; + + return audacious_session_type; } /* tcp://192.168.100.1:5900/zyzychynxi389xvmfewqaxznvnw */ @@ -400,7 +418,7 @@ xmms_connect_to_session(gint session) { gint fd; - gint type = audacious_determine_session_type(session); + gint *type = audacious_determine_session_type(session); gchar *uri = audacious_get_session_uri(session); if (type == AUDACIOUS_TYPE_UNIX) diff -r 04730ff1693d -r 6fe7ba6e5489 libaudacious/beepctrl.h --- a/libaudacious/beepctrl.h Sat Jul 29 16:23:16 2006 -0700 +++ b/libaudacious/beepctrl.h Mon Jul 31 17:06:44 2006 -0700 @@ -117,6 +117,7 @@ /* Added in Audacious 1.2 */ void audacious_set_session_uri(gchar *uri); gchar *audacious_get_session_uri(gint session); + void audacious_set_session_type(gint *type); #ifdef __cplusplus };