gmyth-stream/gmemcoder/src/main.c
branchtrunk
changeset 678 89bdaa9e72bf
parent 634 43f66895cc86
child 691 726550e48c21
     1.1 --- a/gmyth-stream/gmemcoder/src/main.c	Tue May 08 14:59:15 2007 +0100
     1.2 +++ b/gmyth-stream/gmemcoder/src/main.c	Wed May 16 23:52:37 2007 +0100
     1.3 @@ -26,19 +26,29 @@
     1.4  static gchar*   output_uri      = NULL;
     1.5  
     1.6  
     1.7 +
     1.8 +static gboolean
     1.9 +_quit (gpointer data)
    1.10 +{
    1.11 +	g_debug ("Quit");
    1.12 +	g_object_unref (data);
    1.13 +	g_main_loop_quit (mainloop);
    1.14 +	return FALSE;
    1.15 +}
    1.16 +
    1.17  static void
    1.18  _mencoder_eos_cb (GMencoder *mencoder, gpointer data)
    1.19 -{
    1.20 +{		
    1.21      g_print ("EOS\n");
    1.22 -    g_main_loop_quit ((GMainLoop *) data);
    1.23 +	g_idle_add (_quit, mencoder);
    1.24  }
    1.25  
    1.26 +
    1.27  static void
    1.28  _mencoder_error_cb (GMencoder *mencoder, const gchar* msg, gpointer data)
    1.29  {
    1.30      g_print ("Error: %s\n", msg);
    1.31 -	g_mencoder_close_stream (mencoder);
    1.32 -    g_main_loop_quit ((GMainLoop *) data);
    1.33 +	g_idle_add (_quit, mencoder);
    1.34  }
    1.35  
    1.36  static gboolean