summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-plugins')
-rw-r--r--media-plugins/gkrellmpc/ChangeLog6
-rw-r--r--media-plugins/gkrellmpc/Manifest9
-rw-r--r--media-plugins/gkrellmpc/files/gkrellmpc-0.1_beta10-mt.patch154
3 files changed, 164 insertions, 5 deletions
diff --git a/media-plugins/gkrellmpc/ChangeLog b/media-plugins/gkrellmpc/ChangeLog
index 6e8dfbaeba74..245d38164781 100644
--- a/media-plugins/gkrellmpc/ChangeLog
+++ b/media-plugins/gkrellmpc/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for media-plugins/gkrellmpc
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-plugins/gkrellmpc/ChangeLog,v 1.15 2012/07/20 12:13:19 angelos Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-plugins/gkrellmpc/ChangeLog,v 1.16 2012/07/20 12:32:01 angelos Exp $
+
+ 20 Jul 2012; Christoph Mende <angelos@gentoo.org>
+ +files/gkrellmpc-0.1_beta10-mt.patch, gkrellmpc-0.1_beta10.ebuild:
+ Add missing patch
*gkrellmpc-0.1_beta10 (20 Jul 2012)
diff --git a/media-plugins/gkrellmpc/Manifest b/media-plugins/gkrellmpc/Manifest
index a5740dc84a87..20d3febf1a81 100644
--- a/media-plugins/gkrellmpc/Manifest
+++ b/media-plugins/gkrellmpc/Manifest
@@ -1,17 +1,18 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
+AUX gkrellmpc-0.1_beta10-mt.patch 4392 SHA256 5f5160543bf6f176a5bdd0d58abbda481441b3881e4c241a53e03c6c45cf87b4 SHA512 5928192cde4513470f9af952d6aa8a3b5044a6bdcc8aead26420a2cc7e9ed21dd3ac0043a5d481559c6eaad770de54c44b6d5395efb1baa2de80bc26d2536cdb WHIRLPOOL 868f007f05abf2191ebfbba60d7996404d827b44c263111183c94ed3272327774047ccd0f6ab7bcd1a0978d5adf81ee8fd69ba0f5fb54c7f9b18e93599f62cf1
AUX gkrellmpc-0.1_beta9-mt.patch 4427 SHA256 7d4489d8980048fba81604b312ee5db3806296e2d249d318643d75fffd9741bd SHA512 0bf96cba88e6b2596b86318f72a87842d0641068a18bb3a07a9b5654296322bb12e58f281e8ab412e2f9a4c6fc5e0aef9714e91b97ec41d41c39cf5ec720b09b WHIRLPOOL 696511824ef6742fe77c838503890e4a54c72bea5b97e3d04b9a9c878ee640f597d6dd6c71681ef30183464dca33f1d9bc65a9794f9bad47324911e8e49e6386
DIST gkrellmpc-0.1_beta10.tar.gz 25388 SHA256 320c04cce9530d12e4cc20d58710c29a25154e3450f3e3cdee2aa3c9433312b6 SHA512 f5d687264f08146bf1eb54aee6d42a200fb97008a355d26a68be91b04e4bd622fc222725bf498c0837eacb8b94d6aede5aa1a05ed504fe5f9b790a9cd08d3973 WHIRLPOOL 4e4fc8772fb6c8a1caf405e6d045c973b37b7d03df2ded65c611268883f98a963de84a1f51cbc382dad9e39c3e0e8ba3607a5990559869817289e22b69a90f00
DIST gkrellmpc-0.1_beta9.tar.gz 22029 SHA256 b4fed5b55afdeefe978d1ab7f82a0e2f79b15ea2158110775cf6e05616ded9e2
EBUILD gkrellmpc-0.1_beta10.ebuild 991 SHA256 adf330b624aa0af24757d63fb3d8d94f09c916ef86979166901ba74ab21bd368 SHA512 9023e0b3755c35258f5d745c086ac7f9c6bdfb311e8231588f3dfc65405183b68f33a2226303824abb8f5d78f49e106d162a8a0593c40319ad8d3afacca884c5 WHIRLPOOL 5f2d286a32076402d6a9f0a84c74b74b366a4eaf3816e62619b13332a44e014c06773a5ca6fc5aad98df90d1cdfe9e9885acbf8589e644a2a53ebbde626098ae
EBUILD gkrellmpc-0.1_beta9-r1.ebuild 996 SHA256 82f9030c7d16e4b328431722c447f5c26b67790c97cf4dd5256cbf393e884059 SHA512 def629e2d30f4fd43c2e6d3f701d5d87ef0d4887d48371ecef778b9c3a178a0d805d37030b0e2e8dfc1b056877806cc3bbed3114081b5c3031d3121abbd05270 WHIRLPOOL 3630072bf19630b4eaecb5aebdceb243208241f386ab9adaf4a411df9c3ae3648b40b7864ffad1763115ef3fd960fa763ff1e9230e0db0eafae04899344490c5
-MISC ChangeLog 2472 SHA256 8d1e63013262af225f032005a914a6730753f5acda81934c16a9dc6f8690dc86 SHA512 4d5ea96f4955a998a2c07f79943e1aa062f4b685e2ed451661f207961246c872742221c1e89653a2fd7c298c183953b1167a764de2b3cc5ddd7259be9217007e WHIRLPOOL 33f7ea721a2c13d21ebd6fdad3a42d120c13a2bb65b86f9c710efdc604440677192f105f822e086b74ba38e8c9534f28e82aad1cd1b53beaddcfc83163692ea6
+MISC ChangeLog 2614 SHA256 358e024ca56c6b2cdb09c35a9b1928aa93d085ae6f5c04bed255afc4844b3889 SHA512 138536aa7c5416234cc4d218c6435ab26c72860dd62dc79f7dbde74af202c9e9a8cb605ff83364d7694fb3d0cb7fc6f27e01cdb39f00601a245c49546c81c7df WHIRLPOOL a38cbb9e00a33f06c096356e6ff83682129a2a251155bd302f7318e4312e85919bddb881506c7287be22ad856516204a7eb7d4917cb8433e331e2e7a922e8c74
MISC metadata.xml 279 SHA256 8b68c37b782f6c07fea7f5cce823fde0658a23793666aaefaf58d926733c4d93 SHA512 718b0f8961efefa722ec09ae0d4197f2dccf9223c6800e3930a9277e6ec9b1e30a33ef89cbe9bf1c7f5b95fae96209217e0ed7eecd4ef497b3cf8143278fac0b WHIRLPOOL d13728ad0ada18e4db6f761ca066ec9dea85720c1580a972f69b60a1d3a512e1f2a3c8512160b3357b8968f8ce314d08a0dc8b1a0d1a68ff583c5da1ae7558ec
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
-iF4EAREIAAYFAlAJS2UACgkQmWq1bYTyC0NvKAEAt2cBQPGE0p0qAWiTOUcJfJq7
-L/vQsYX+7HVW+4CbVdoBAKXL2Xu5IlfbIz3ZiXY2cXWGhpKjOqTKMyMImHZ16ECX
-=5Gm4
+iF4EAREIAAYFAlAJT8gACgkQmWq1bYTyC0NMCwD+JITc+fa3c3IEeCYiZkhbEP5M
+JMOVrV0KD3AcZYBUJRgA/RA+dbjUznIeXy61AkG8O+96IaH92nzvNBJzNDoVymIe
+=afAG
-----END PGP SIGNATURE-----
diff --git a/media-plugins/gkrellmpc/files/gkrellmpc-0.1_beta10-mt.patch b/media-plugins/gkrellmpc/files/gkrellmpc-0.1_beta10-mt.patch
new file mode 100644
index 000000000000..42a5848a44cb
--- /dev/null
+++ b/media-plugins/gkrellmpc/files/gkrellmpc-0.1_beta10-mt.patch
@@ -0,0 +1,154 @@
+diff --git a/gkrellmpc.c b/gkrellmpc.c
+index eb28982..08a3fb3 100644
+--- a/gkrellmpc.c
++++ b/gkrellmpc.c
+@@ -140,7 +140,7 @@ void mpc_create_plugin (GtkWidget *vbox, gint first_create) {
+ /* Create the status decal */
+ mpc_status_decal = gkrellm_create_decal_pixmap(mpc_panel, gkrellm_decal_misc_pixmap(), gkrellm_decal_misc_mask(), N_MISC_DECALS, style, 0, t);
+ mpc_status_decal->x = w - mpc_status_decal->w;
+- gkrellm_draw_decal_pixmap(mpc_panel, mpc_status_decal, (mpc_mpd ? D_MISC_LED1 : D_MISC_LED0));
++ gkrellm_draw_decal_pixmap(mpc_panel, mpc_status_decal, (mpc_mpd_connected() ? D_MISC_LED1 : D_MISC_LED0));
+
+ /* Update t */
+ t += mpc_label_decal->h > mpc_status_decal->h ? mpc_label_decal->h : mpc_status_decal->h;
+@@ -279,7 +279,7 @@ void mpc_update_plugin () {
+ static gint x_scroll;
+
+ /* Try to connect to mpd */
+- if (!mpc_mpd && mpc_ticker->ten_second_tick) {
++ if (!mpc_mpd_connected() && mpc_ticker->ten_second_tick) {
+ mpc_mpd_connect();
+ }
+
+@@ -457,7 +457,7 @@ void mpc_sync_with_mpd() {
+ status = mpc_mpd_get("status\n");
+ currentsong = mpc_mpd_get("currentsong\n");
+
+- if (!mpc_mpd) {
++ if (!mpc_mpd_connected()) {
+ mpc_update_label(_("NO MPD"));
+ mpc_update_songname("");
+ gtk_tooltips_set_tip(mpc_tooltip, mpc_panel->drawing_area, _("MPD is not running"), NULL);
+diff --git a/mpd.c b/mpd.c
+index 5918416..1d9ea6a 100644
+--- a/mpd.c
++++ b/mpd.c
+@@ -12,18 +12,32 @@
+ #include <sys/socket.h>
+ #include <netdb.h>
+
++#include <errno.h>
++#include <pthread.h>
++
+ GIOChannel * mpc_mpd = NULL;
++pthread_mutex_t mpc_mutex = { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { 0 } } }; //PTHREAD_MUTEX_INITIALIZER;
++
++gboolean mpc_mpd_connected() {
++ if(pthread_mutex_trylock(&mpc_mutex)){
++ return (FALSE);
++ }
++ pthread_mutex_unlock(&mpc_mutex);
++ return (gboolean)mpc_mpd;
++}
+
+ /*
+ * Connects to the MPD server, sets up the mpd object, sets the status decal to ON
+ */
+-gboolean mpc_mpd_connect() {
++void* mpc_mpd_connect_worker(void* arg) {
+ int sockfd;
+ struct hostent *server;
+ struct sockaddr_in serv_addr;
+ gchar * line;
+ gchar ** parts;
+ gboolean retval;
++
++ pthread_mutex_lock(&mpc_mutex);
+
+ if (mpc_mpd) {
+ /*
+@@ -33,11 +47,11 @@ gboolean mpc_mpd_connect() {
+ }
+
+ if (!mpc_conf_hostname || !mpc_conf_port) {
+- return (FALSE);
++ goto err;
+ }
+
+- if ((sockfd = socket(PF_INET, SOCK_STREAM, 0)) == -1) return(FALSE);
+- if (!(server = gethostbyname(mpc_conf_hostname))) return(FALSE);
++ if ((sockfd = socket(PF_INET, SOCK_STREAM, 0)) == -1) goto err;
++ if (!(server = gethostbyname(mpc_conf_hostname))) goto err;
+
+ bzero((char *) &serv_addr, sizeof(serv_addr));
+ serv_addr.sin_family = AF_INET;
+@@ -46,7 +60,7 @@ gboolean mpc_mpd_connect() {
+ server->h_length);
+ serv_addr.sin_port = htons(mpc_conf_port);
+
+- if (connect(sockfd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) return(FALSE);
++ if (connect(sockfd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) goto err;
+
+ /* Getup the mpd object */
+ mpc_mpd = g_io_channel_unix_new(sockfd);
+@@ -72,29 +86,39 @@ gboolean mpc_mpd_connect() {
+ retval = FALSE;
+ }
+
+- if (retval) {
+- gkrellm_draw_decal_pixmap(mpc_panel, mpc_status_decal, D_MISC_LED1);
+- mpc_update_label(_("MPD"));
+- mpc_update_songname("");
+- }
++err:
++ pthread_mutex_unlock(&mpc_mutex);
++ return NULL;
++}
+
+- return(retval);
++gboolean mpc_mpd_connect() {
++ pthread_attr_t attr;
++ pthread_t thread_id;
++
++ if(pthread_mutex_trylock(&mpc_mutex)){
++ return (FALSE);
++ }
++
++ pthread_attr_init(&attr);
++ pthread_create(&thread_id, &attr, mpc_mpd_connect_worker, NULL);
++
++ pthread_mutex_unlock(&mpc_mutex);
++
++ return (FALSE);
+ }
+
+ /*
+ * Disconnects from MPD, destroys the mpd object, sets the status decal to off
+ */
+ gboolean mpc_mpd_disconnect() {
+-
++ pthread_mutex_lock(&mpc_mutex);
+ if (mpc_mpd) {
+ g_io_channel_shutdown(mpc_mpd, FALSE, NULL);
+ free(mpc_mpd);
+ mpc_mpd = NULL;
+ }
+
+- gkrellm_draw_decal_pixmap(mpc_panel, mpc_status_decal, D_MISC_LED0);
+- mpc_update_label(_("NO MPD"));
+- mpc_update_songname("");
++ pthread_mutex_lock(&mpc_mutex);
+ return (TRUE);
+ }
+
+diff --git a/mpd.h b/mpd.h
+index efcb9f6..c6942c4 100644
+--- a/mpd.h
++++ b/mpd.h
+@@ -10,5 +10,6 @@ gboolean mpc_mpd_disconnect();
+ gboolean mpc_mpd_do(gchar *);
+ GHashTable * mpc_mpd_get(gchar *);
+ GPtrArray * mpc_mpd_get_clumps(gchar *, gboolean);
++gboolean mpc_mpd_connected();
+
+ #endif