Index: gst-launch.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/tools/gst-launch.c,v
retrieving revision 1.48
diff -u -r1.48 gst-launch.c
--- gst-launch.c	14 Jul 2003 08:25:16 -0000	1.48
+++ gst-launch.c	18 Aug 2003 21:42:20 -0000
@@ -114,7 +114,8 @@
     e = gst_bin_get_by_name (GST_BIN (pipeline), element);
     if (!e) {
       g_warning ("element named '%s' not found", element);
-    } else {
+    } 
+    else {
       gst_util_set_object_arg (G_OBJECT (e), property, value);
     }
     g_free (element);
@@ -138,7 +139,7 @@
   }
   else if (signum == SIGQUIT){
     g_print ("Caught SIGQUIT\n");
-  }
+  } 
   else {
     g_print ("signo:  %d\n", signum);
   }
@@ -158,7 +159,7 @@
   }
   else if (si->si_signo == SIGQUIT){
     g_print ("Caught SIGQUIT\n");
-  }
+  } 
   else {
     g_print ("signo:  %d\n", si->si_signo);
     g_print ("errno:  %d\n", si->si_errno);
@@ -248,6 +249,42 @@
   sigaction(SIGINT, &action, NULL);
 }
 
+
+static void
+play_handler(int signum)
+{
+  if (signum == SIGUSR1) {
+    g_print("Play request");
+    gst_element_set_state(pipeline, GST_STATE_PLAYING);
+  } else if (signum == SIGUSR2) {
+    g_print("Stop request");
+    gst_element_set_state(pipeline, GST_STATE_NULL);
+  }
+}
+
+static void
+play_signal_setup(void)
+{
+  struct sigaction action;
+
+  memset (&action, 0, sizeof (action));
+  action.sa_handler = play_handler;
+  sigaction(SIGUSR1, &action, NULL);
+  sigaction(SIGUSR2, &action, NULL);
+}
+
+static void
+play_signal_restore(void)
+{
+  struct sigaction action;
+
+  memset (&action, 0, sizeof (action));
+  action.sa_handler = SIG_DFL;
+  sigaction(SIGUSR1, &action, NULL);
+  sigaction(SIGUSR2, &action, NULL);
+}
+
+
 int
 main(int argc, char *argv[])
 {
@@ -308,6 +345,7 @@
     fault_setup();
 
   sigint_setup();
+  play_signal_setup();
   
   if (trace) {
     if (!gst_alloc_trace_available()) {
@@ -316,6 +354,7 @@
     gst_alloc_trace_print_all ();
   }
 
+  g_printf("Using PID %d\n", getpid());
   /* make a null-terminated version of argv */
   argvn = g_new0 (char*, argc);
   memcpy (argvn, argv+1, sizeof (char*) * (argc-1));
