|
|
5a74c64 |
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
|
|
|
1f3aa51 |
--- audacious-plugins-2.2-orig/src/streambrowser/gui/streambrowser_win.c 2009-11-22 23:49:53.000000000 +0100
|
|
|
5a74c64 |
+++ audacious-plugins-2.2-streambrowser-race/src/streambrowser/gui/streambrowser_win.c 2010-02-04 00:56:19.000000000 +0100
|
|
|
1f3aa51 |
@@ -44,7 +44,7 @@
|
|
|
1f3aa51 |
static GtkWidget* add_button;
|
|
|
1f3aa51 |
static GtkWidget* bookmark_button;
|
|
|
1f3aa51 |
static GtkWidget* streambrowser_window;
|
|
|
1f3aa51 |
-static GList* streamdir_gui_list;
|
|
|
1f3aa51 |
+static GList* streamdir_gui_list = NULL;
|
|
|
1f3aa51 |
static GtkCellRenderer* cell_renderer_pixbuf;
|
|
|
1f3aa51 |
static GtkCellRenderer* cell_renderer_text;
|
|
|
1f3aa51 |
|
|
|
5a74c64 |
diff -Nur audacious-plugins-2.2-orig/src/streambrowser/streambrowser.c audacious-plugins-2.2-streambrowser-race/src/streambrowser/streambrowser.c
|
|
|
5a74c64 |
--- audacious-plugins-2.2-orig/src/streambrowser/streambrowser.c 2009-11-22 23:49:53.000000000 +0100
|
|
|
5a74c64 |
+++ audacious-plugins-2.2-streambrowser-race/src/streambrowser/streambrowser.c 2010-02-04 00:57:25.000000000 +0100
|
|
|
5a74c64 |
@@ -474,6 +474,20 @@
|
|
|
5a74c64 |
|
|
|
5a74c64 |
/* repetitively process the queue elements, until queue is empty */
|
|
|
5a74c64 |
while (data != NULL && g_queue_get_length(update_thread_data_queue) > 0) {
|
|
|
5a74c64 |
+ if (data->streamdir && !streamdir_is_valid(data->streamdir)) {
|
|
|
5a74c64 |
+ printf("WARNING: Skipping invalidated streambrowser queue element!\n");
|
|
|
5a74c64 |
+ g_free(data);
|
|
|
5a74c64 |
+ g_mutex_lock(update_thread_mutex);
|
|
|
5a74c64 |
+ /* remove the just processed data from the queue */
|
|
|
5a74c64 |
+ g_queue_pop_head(update_thread_data_queue);
|
|
|
5a74c64 |
+ /* try to get the last item in the queue */
|
|
|
5a74c64 |
+ if (g_queue_get_length(update_thread_data_queue) > 0)
|
|
|
5a74c64 |
+ data = g_queue_peek_head(update_thread_data_queue);
|
|
|
5a74c64 |
+ else
|
|
|
5a74c64 |
+ data = NULL;
|
|
|
5a74c64 |
+ g_mutex_unlock(update_thread_mutex);
|
|
|
5a74c64 |
+ continue;
|
|
|
5a74c64 |
+ }
|
|
|
5a74c64 |
/* update a streaminfo */
|
|
|
5a74c64 |
if (data->streaminfo != NULL) {
|
|
|
5a74c64 |
gdk_threads_enter();
|
|
|
5a74c64 |
diff -Nur audacious-plugins-2.2-orig/src/streambrowser/streamdir.c audacious-plugins-2.2-streambrowser-race/src/streambrowser/streamdir.c
|
|
|
5a74c64 |
--- audacious-plugins-2.2-orig/src/streambrowser/streamdir.c 2009-11-22 23:49:53.000000000 +0100
|
|
|
5a74c64 |
+++ audacious-plugins-2.2-streambrowser-race/src/streambrowser/streamdir.c 2010-02-04 00:57:07.000000000 +0100
|
|
|
5a74c64 |
@@ -23,13 +23,19 @@
|
|
|
5a74c64 |
#include "streambrowser.h"
|
|
|
5a74c64 |
#include "streamdir.h"
|
|
|
5a74c64 |
|
|
|
5a74c64 |
+static GList *all_streamdirs = NULL;
|
|
|
5a74c64 |
+
|
|
|
5a74c64 |
+gboolean streamdir_is_valid(streamdir_t *streamdir) {
|
|
|
5a74c64 |
+ return (NULL != g_list_find(all_streamdirs,streamdir));
|
|
|
5a74c64 |
+}
|
|
|
5a74c64 |
|
|
|
5a74c64 |
streamdir_t* streamdir_new(gchar *name)
|
|
|
1f3aa51 |
{
|
|
|
5a74c64 |
streamdir_t *streamdir = (streamdir_t*) g_malloc(sizeof(streamdir_t));
|
|
|
5a74c64 |
strncpy(streamdir->name, name, DEF_STRING_LEN);
|
|
|
5a74c64 |
streamdir->category_list = NULL;
|
|
|
5a74c64 |
-
|
|
|
5a74c64 |
+
|
|
|
5a74c64 |
+ all_streamdirs = g_list_append(all_streamdirs,streamdir);
|
|
|
5a74c64 |
return streamdir;
|
|
|
5a74c64 |
}
|
|
|
5a74c64 |
|
|
|
5a74c64 |
@@ -45,6 +51,8 @@
|
|
|
5a74c64 |
|
|
|
5a74c64 |
g_list_free(streamdir->category_list);
|
|
|
5a74c64 |
g_free(streamdir);
|
|
|
5a74c64 |
+
|
|
|
5a74c64 |
+ all_streamdirs = g_list_remove(all_streamdirs,streamdir);
|
|
|
5a74c64 |
}
|
|
|
5a74c64 |
|
|
|
5a74c64 |
|
|
|
5a74c64 |
diff -Nur audacious-plugins-2.2-orig/src/streambrowser/streamdir.h audacious-plugins-2.2-streambrowser-race/src/streambrowser/streamdir.h
|
|
|
5a74c64 |
--- audacious-plugins-2.2-orig/src/streambrowser/streamdir.h 2009-11-22 23:49:53.000000000 +0100
|
|
|
5a74c64 |
+++ audacious-plugins-2.2-streambrowser-race/src/streambrowser/streamdir.h 2010-02-04 00:57:01.000000000 +0100
|
|
|
5a74c64 |
@@ -48,6 +48,7 @@
|
|
|
5a74c64 |
|
|
|
5a74c64 |
} streamdir_t;
|
|
|
5a74c64 |
|
|
|
5a74c64 |
+gboolean streamdir_is_valid(streamdir_t *streamdir);
|
|
|
5a74c64 |
|
|
|
5a74c64 |
streamdir_t* streamdir_new(gchar *name);
|
|
|
5a74c64 |
void streamdir_delete(streamdir_t *streamdir);
|