[Swfdec-commits] swfdec-gtk/swfdec_gtk_player.c swfdec-gtk/swfdec_gtk_player.h swfdec-gtk/swfdec_gtk_widget.c
Benjamin Otte
company at kemper.freedesktop.org
Thu Apr 10 02:26:30 PDT 2008
swfdec-gtk/swfdec_gtk_player.c | 15 ++++++++++++++-
swfdec-gtk/swfdec_gtk_player.h | 3 +++
swfdec-gtk/swfdec_gtk_widget.c | 3 ++-
3 files changed, 19 insertions(+), 2 deletions(-)
New commits:
commit 5693a35a112da5cb938dcf9a85ee7e06abcd7310
Author: Benjamin Otte <otte at gnome.org>
Date: Thu Apr 10 11:23:27 2008 +0200
higher priorities have lower numbers
Might explain why my stuff didn't work as well as I had thought.
diff --git a/swfdec-gtk/swfdec_gtk_player.c b/swfdec-gtk/swfdec_gtk_player.c
index 34bc8a2..16dae78 100644
--- a/swfdec-gtk/swfdec_gtk_player.c
+++ b/swfdec-gtk/swfdec_gtk_player.c
@@ -81,6 +81,19 @@ enum {
* The structure for the Swfdec Gtk player contains no public fields.
*/
+/**
+ * SWFDEC_GTK_PRIORITY_ITERATE:
+ *
+ * The priority used for advancing a player that is playing.
+ */
+
+/**
+ * SWFDEC_GTK_PRIORITY_REDRAW:
+ *
+ * The priority used for scheduling repaint operations resulting from advancing
+ * a player.
+ */
+
/*** MISSING PLUGINS ***/
#ifdef HAVE_GST
@@ -304,7 +317,7 @@ swfdec_gtk_player_set_playing (SwfdecGtkPlayer *player, gboolean playing)
priv = player->priv;
if (playing && priv->source == NULL) {
priv->source = swfdec_iterate_source_new (SWFDEC_PLAYER (player), priv->speed);
- g_source_set_priority (priv->source, GDK_PRIORITY_REDRAW - 5);
+ g_source_set_priority (priv->source, SWFDEC_GTK_PRIORITY_ITERATE);
g_source_attach (priv->source, NULL);
} else if (!playing && priv->source != NULL) {
g_source_destroy (priv->source);
diff --git a/swfdec-gtk/swfdec_gtk_player.h b/swfdec-gtk/swfdec_gtk_player.h
index ea342b0..a0fbf5e 100644
--- a/swfdec-gtk/swfdec_gtk_player.h
+++ b/swfdec-gtk/swfdec_gtk_player.h
@@ -29,6 +29,9 @@ typedef struct _SwfdecGtkPlayer SwfdecGtkPlayer;
typedef struct _SwfdecGtkPlayerPrivate SwfdecGtkPlayerPrivate;
typedef struct _SwfdecGtkPlayerClass SwfdecGtkPlayerClass;
+#define SWFDEC_GTK_PRIORITY_ITERATE (GDK_PRIORITY_REDRAW + 10)
+#define SWFDEC_GTK_PRIORITY_REDRAW (GDK_PRIORITY_REDRAW + 20)
+
#define SWFDEC_TYPE_GTK_PLAYER (swfdec_gtk_player_get_type())
#define SWFDEC_IS_GTK_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SWFDEC_TYPE_GTK_PLAYER))
#define SWFDEC_IS_GTK_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SWFDEC_TYPE_GTK_PLAYER))
diff --git a/swfdec-gtk/swfdec_gtk_widget.c b/swfdec-gtk/swfdec_gtk_widget.c
index b10621f..017e170 100644
--- a/swfdec-gtk/swfdec_gtk_widget.c
+++ b/swfdec-gtk/swfdec_gtk_widget.c
@@ -25,6 +25,7 @@
#include <gdk/gdkkeysyms.h>
#include "swfdec_gtk_widget.h"
#include "swfdec_gtk_keys.h"
+#include "swfdec_gtk_player.h"
struct _SwfdecGtkWidgetPrivate
{
@@ -618,7 +619,7 @@ swfdec_gtk_widget_invalidate_cb (SwfdecPlayer *player, const SwfdecRectangle *ex
gdk_region_union_with_rect (priv->invalid, (GdkRectangle *) &rect[i]);
}
if (priv->invalidator == 0) {
- priv->invalidator = g_idle_add_full (GDK_PRIORITY_REDRAW - 10,
+ priv->invalidator = g_idle_add_full (SWFDEC_GTK_PRIORITY_REDRAW,
swfdec_gtk_widget_do_invalidate, widget, NULL);
}
}
More information about the Swfdec-commits
mailing list