diff options
author | Bastien Nocera <hadess@hadess.net> | 2006-03-09 15:27:26 +0000 |
---|---|---|
committer | Bastien Nocera <hadess@src.gnome.org> | 2006-03-09 15:27:26 +0000 |
commit | c44a8eb885146be653f59b092144cc8993e97004 (patch) | |
tree | 0057bc78db992d1cf6d26ebb94340f91aced07b9 | |
parent | b4d3fbbc1084c401481e5f90466a7befcbbde661 (diff) | |
download | totem-c44a8eb885146be653f59b092144cc8993e97004.tar.gz |
update to be able to compile with older glibs
2006-03-09 Bastien Nocera <hadess@hadess.net>
* src/backend/bacon-video-widget-xine.c:
(bacon_video_widget_queue_sort), (xine_try_error):
update to be able to compile with older glibs
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/backend/bacon-video-widget-xine.c | 26 |
2 files changed, 32 insertions, 0 deletions
@@ -1,3 +1,9 @@ +2006-03-09 Bastien Nocera <hadess@hadess.net> + + * src/backend/bacon-video-widget-xine.c: + (bacon_video_widget_queue_sort), (xine_try_error): + update to be able to compile with older glibs + 2006-02-08 Bastien Nocera <hadess@hadess.net> * src/totem-playlist.c: (totem_playlist_move_files): diff --git a/src/backend/bacon-video-widget-xine.c b/src/backend/bacon-video-widget-xine.c index 330e600d6..0d4b94c18 100644 --- a/src/backend/bacon-video-widget-xine.c +++ b/src/backend/bacon-video-widget-xine.c @@ -1436,6 +1436,28 @@ bacon_video_widget_sort_queue (gconstpointer a, gconstpointer b, gpointer data) return -1; } +#if (!(GLIB_CHECK_VERSION(2,9,1))) +static void +bacon_video_widget_queue_sort (GAsyncQueue *queue) +{ + GList *list = NULL, *l; + signal_data *data; + + while ((data = g_async_queue_try_pop (queue)) != NULL) { + list = g_list_insert_sorted (list, data, (GCompareFunc) bacon_video_widget_sort_queue); + } + + if (list == NULL) + return; + + for (l = list; l != NULL; l = l->next) { + g_async_queue_push (queue, l->data); + } + g_list_free (list); +} + +#endif /* ! GLIB_CHECK_VERSION 2.9.1 */ + static void xine_try_error (BaconVideoWidget *bvw, gboolean probe_error, GError **error) { @@ -1447,7 +1469,11 @@ xine_try_error (BaconVideoWidget *bvw, gboolean probe_error, GError **error) sched_yield (); /* Sort the queue with the errors first */ +#if GLIB_CHECK_VERSION(2,9,1) g_async_queue_sort (bvw->priv->queue, bacon_video_widget_sort_queue, bvw); +#else + bacon_video_widget_queue_sort (bvw->priv->queue); +#endif /* Steal messages from the async queue, if there's an error, * to use as the error message rather than the crappy errors from |