[Swfdec] 2 commits - libswfdec-gtk/swfdec_gtk_loader.c libswfdec-gtk/swfdec_gtk_widget.c

Benjamin Otte company at kemper.freedesktop.org
Sun Oct 21 12:54:50 PDT 2007


 libswfdec-gtk/swfdec_gtk_loader.c |    3 ++-
 libswfdec-gtk/swfdec_gtk_widget.c |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit a627260de1398da19cfdb93efe16bcb1fe2caef7
Author: Benjamin Otte <otte at gnome.org>
Date:   Sun Oct 21 19:09:58 2007 +0200

    only call g_thread_init() once

diff --git a/libswfdec-gtk/swfdec_gtk_loader.c b/libswfdec-gtk/swfdec_gtk_loader.c
index 0e860b9..f61a999 100644
--- a/libswfdec-gtk/swfdec_gtk_loader.c
+++ b/libswfdec-gtk/swfdec_gtk_loader.c
@@ -206,7 +206,8 @@ swfdec_gtk_loader_class_init (SwfdecGtkLoaderClass *klass)
   loader_class->load = swfdec_gtk_loader_load;
   loader_class->close = swfdec_gtk_loader_close;
   
-  g_thread_init (NULL);
+  if (!g_thread_supported ())
+    g_thread_init (NULL);
   klass->session = soup_session_async_new ();
 #endif
 }
commit 3dd1855445038e6c3793b98bbfcf77035413a4cc
Author: Benjamin Otte <otte at gnome.org>
Date:   Sun Oct 21 18:01:47 2007 +0200

    only handle keys if there's a player to handle them

diff --git a/libswfdec-gtk/swfdec_gtk_widget.c b/libswfdec-gtk/swfdec_gtk_widget.c
index a3dbd65..895d5a3 100644
--- a/libswfdec-gtk/swfdec_gtk_widget.c
+++ b/libswfdec-gtk/swfdec_gtk_widget.c
@@ -160,7 +160,7 @@ swfdec_gtk_widget_key_press (GtkWidget *gtkwidget, GdkEventKey *event)
   SwfdecGtkWidget *widget = SWFDEC_GTK_WIDGET (gtkwidget);
   SwfdecGtkWidgetPrivate *priv = widget->priv;
 
-  if (priv->interactive) {
+  if (priv->interactive && priv->player) {
     guint keycode = swfdec_gtk_event_to_keycode (event);
     if (keycode != 0) {
       swfdec_player_key_press (priv->player, keycode, 
@@ -178,7 +178,7 @@ swfdec_gtk_widget_key_release (GtkWidget *gtkwidget, GdkEventKey *event)
   SwfdecGtkWidget *widget = SWFDEC_GTK_WIDGET (gtkwidget);
   SwfdecGtkWidgetPrivate *priv = widget->priv;
 
-  if (priv->interactive) {
+  if (priv->interactive && priv->player) {
     guint keycode = swfdec_gtk_event_to_keycode (event);
     if (keycode != 0) {
       swfdec_player_key_release (priv->player, keycode, 


More information about the Swfdec mailing list