[Swfdec] 2 commits - player/swfplay.c

Benjamin Otte company at kemper.freedesktop.org
Fri Aug 24 06:24:19 PDT 2007


 player/swfplay.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
diff-tree 672054a7dcbd5853d9381c06d5185d13273bb2a7 (from parents)
Merge: bdc6d74104cb70c721602a1e3c164153c73efe72 b6f68c99b3532812e87e5bad2338cefa14121b8d
Author: Benjamin Otte <otte at gnome.org>
Date:   Fri Aug 24 15:23:52 2007 +0200

    Merge branch 'master' of ssh://company@git.freedesktop.org/git/swfdec/swfdec

diff-tree bdc6d74104cb70c721602a1e3c164153c73efe72 (from b319db3cbe2ce11e2d2edcf27ad44d28fa22de47)
Author: Benjamin Otte <otte at gnome.org>
Date:   Fri Aug 24 15:23:39 2007 +0200

    really make quit work

diff --git a/player/swfplay.c b/player/swfplay.c
index 7521acf..0c2ff6b 100644
--- a/player/swfplay.c
+++ b/player/swfplay.c
@@ -31,6 +31,8 @@
 
 #include "swfdec_slow_loader.h"
 
+static GMainLoop *loop = NULL;
+
 static void
 set_title (GtkWindow *window, const char *filename)
 {
@@ -62,11 +64,8 @@ static void
 do_fscommand (SwfdecPlayer *player, const char *command, const char *value, gpointer window)
 {
   if (g_str_equal (command, "quit")) {
-    static gboolean already_quit = FALSE;
-    if (!already_quit) {
-      gtk_main_quit ();
-      already_quit = TRUE;
-    }
+    g_assert (loop);
+    g_main_loop_quit (loop);
   }
   /* FIXME: add more */
 }
@@ -150,6 +149,7 @@ main (int argc, char *argv[])
     g_object_unref (loader);
     return 1;
   }
+  loop = g_main_loop_new (NULL, TRUE);
   player = swfdec_gtk_player_new (NULL);
   if (trace)
     g_signal_connect (player, "trace", G_CALLBACK (print_trace), NULL);
@@ -171,9 +171,11 @@ main (int argc, char *argv[])
 
   swfdec_gtk_player_set_playing (SWFDEC_GTK_PLAYER (player), TRUE);
 
-  gtk_main ();
+  g_main_loop_run (loop);
 
   g_object_unref (player);
+  g_main_loop_unref (loop);
+  loop = NULL;
   player = NULL;
   return 0;
 }


More information about the Swfdec mailing list