rpms/audacious-plugins/devel audacious-plugins-2.2-streambrowser-race.patch, 1.1, 1.2

Michael Schwendt mschwendt at fedoraproject.org
Thu Feb 4 00:05:18 UTC 2010


Author: mschwendt

Update of /cvs/pkgs/rpms/audacious-plugins/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9794/devel

Modified Files:
	audacious-plugins-2.2-streambrowser-race.patch 
Log Message:
The race-condition is much worse and will require a rewrite upstream. My work-around is to track valid objects and ignore invalidated ones.

audacious-plugins-2.2-streambrowser-race.patch:
 gui/streambrowser_win.c |    2 +-
 streambrowser.c         |   14 ++++++++++++++
 streamdir.c             |   10 +++++++++-
 streamdir.h             |    1 +
 4 files changed, 25 insertions(+), 2 deletions(-)

Index: audacious-plugins-2.2-streambrowser-race.patch
===================================================================
RCS file: /cvs/pkgs/rpms/audacious-plugins/devel/audacious-plugins-2.2-streambrowser-race.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- audacious-plugins-2.2-streambrowser-race.patch	3 Feb 2010 20:51:14 -0000	1.1
+++ audacious-plugins-2.2-streambrowser-race.patch	4 Feb 2010 00:05:18 -0000	1.2
@@ -1,6 +1,6 @@
-diff -Nur audacious-plugins-2.2-orig/src/streambrowser/gui/streambrowser_win.c audacious-plugins-2.2/src/streambrowser/gui/streambrowser_win.c
+diff -Nur audacious-plugins-2.2-orig/src/streambrowser/gui/streambrowser_win.c audacious-plugins-2.2-streambrowser-race/src/streambrowser/gui/streambrowser_win.c
 --- audacious-plugins-2.2-orig/src/streambrowser/gui/streambrowser_win.c	2009-11-22 23:49:53.000000000 +0100
-+++ audacious-plugins-2.2/src/streambrowser/gui/streambrowser_win.c	2010-02-03 21:43:22.000000000 +0100
++++ audacious-plugins-2.2-streambrowser-race/src/streambrowser/gui/streambrowser_win.c	2010-02-04 00:56:19.000000000 +0100
 @@ -44,7 +44,7 @@
  static GtkWidget*		add_button;
  static GtkWidget*		bookmark_button;
@@ -10,21 +10,71 @@ diff -Nur audacious-plugins-2.2-orig/src
  static GtkCellRenderer*	cell_renderer_pixbuf;
  static GtkCellRenderer*	cell_renderer_text;
  
-@@ -236,6 +236,8 @@
- void streambrowser_win_set_category_state(streamdir_t *streamdir, category_t *category, gboolean fetching)
- {
- 	streamdir_gui_t *streamdir_gui = find_streamdir_gui_by_streamdir(streamdir);
-+    if (!streamdir_gui)
-+        return;
- 	GtkTreeView *tree_view = GTK_TREE_VIEW(streamdir_gui->tree_view);
- 	GtkTreeStore *store = GTK_TREE_STORE(gtk_tree_view_get_model(tree_view));
- 	GtkTreePath *path;
-@@ -260,6 +262,8 @@
- void streambrowser_win_set_streaminfo_state(streamdir_t *streamdir, category_t *category, streaminfo_t *streaminfo, gboolean fetching)
+diff -Nur audacious-plugins-2.2-orig/src/streambrowser/streambrowser.c audacious-plugins-2.2-streambrowser-race/src/streambrowser/streambrowser.c
+--- audacious-plugins-2.2-orig/src/streambrowser/streambrowser.c	2009-11-22 23:49:53.000000000 +0100
++++ audacious-plugins-2.2-streambrowser-race/src/streambrowser/streambrowser.c	2010-02-04 00:57:25.000000000 +0100
+@@ -474,6 +474,20 @@
+ 
+ 	/* repetitively process the queue elements, until queue is empty */
+ 	while (data != NULL && g_queue_get_length(update_thread_data_queue) > 0) {
++        if (data->streamdir && !streamdir_is_valid(data->streamdir)) {
++            printf("WARNING: Skipping invalidated streambrowser queue element!\n");
++            g_free(data);
++            g_mutex_lock(update_thread_mutex);
++            /* remove the just processed data from the queue */
++            g_queue_pop_head(update_thread_data_queue);
++            /* try to get the last item in the queue */
++            if (g_queue_get_length(update_thread_data_queue) > 0)
++                data = g_queue_peek_head(update_thread_data_queue);
++            else
++                data = NULL;
++            g_mutex_unlock(update_thread_mutex);
++            continue;
++        }
+ 	    /* update a streaminfo */
+ 		if (data->streaminfo != NULL) {
+ 	    	gdk_threads_enter();
+diff -Nur audacious-plugins-2.2-orig/src/streambrowser/streamdir.c audacious-plugins-2.2-streambrowser-race/src/streambrowser/streamdir.c
+--- audacious-plugins-2.2-orig/src/streambrowser/streamdir.c	2009-11-22 23:49:53.000000000 +0100
++++ audacious-plugins-2.2-streambrowser-race/src/streambrowser/streamdir.c	2010-02-04 00:57:07.000000000 +0100
+@@ -23,13 +23,19 @@
+ #include "streambrowser.h"
+ #include "streamdir.h"
+ 
++static GList *all_streamdirs = NULL;
++
++gboolean streamdir_is_valid(streamdir_t *streamdir) {
++    return (NULL != g_list_find(all_streamdirs,streamdir));
++}
+ 
+ streamdir_t* streamdir_new(gchar *name)
  {
- 	streamdir_gui_t *streamdir_gui = find_streamdir_gui_by_streamdir(streamdir);
-+    if (!streamdir_gui)
-+        return;
- 	GtkTreeView *tree_view = GTK_TREE_VIEW(streamdir_gui->tree_view);
- 	GtkTreeStore *store = GTK_TREE_STORE(gtk_tree_view_get_model(tree_view));
- 	GtkTreePath *path;
+ 	streamdir_t *streamdir = (streamdir_t*) g_malloc(sizeof(streamdir_t));
+ 	strncpy(streamdir->name, name, DEF_STRING_LEN);
+ 	streamdir->category_list = NULL;
+-	
++
++    all_streamdirs = g_list_append(all_streamdirs,streamdir);
+ 	return streamdir;
+ }
+ 
+@@ -45,6 +51,8 @@
+ 
+ 	g_list_free(streamdir->category_list);
+ 	g_free(streamdir);
++
++    all_streamdirs = g_list_remove(all_streamdirs,streamdir);
+ }
+ 
+ 
+diff -Nur audacious-plugins-2.2-orig/src/streambrowser/streamdir.h audacious-plugins-2.2-streambrowser-race/src/streambrowser/streamdir.h
+--- audacious-plugins-2.2-orig/src/streambrowser/streamdir.h	2009-11-22 23:49:53.000000000 +0100
++++ audacious-plugins-2.2-streambrowser-race/src/streambrowser/streamdir.h	2010-02-04 00:57:01.000000000 +0100
+@@ -48,6 +48,7 @@
+ 
+ } streamdir_t;
+ 
++gboolean streamdir_is_valid(streamdir_t *streamdir);
+ 
+ streamdir_t*		streamdir_new(gchar *name);
+ void				streamdir_delete(streamdir_t *streamdir);



More information about the scm-commits mailing list