tools/gst-launch.c (check_intr): New timeout to check the interrupt flag and stop the pipeline properly. Bling!

Original commit message from CVS:
2005-02-11  Andy Wingo  <wingo@pobox.com>

* tools/gst-launch.c (check_intr): New timeout to check the
interrupt flag and stop the pipeline properly. Bling!
This commit is contained in:
Andy Wingo 2005-02-11 16:56:31 +00:00
parent f30a7e5ea8
commit 5c30d4e66c
2 changed files with 21 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2005-02-11 Andy Wingo <wingo@pobox.com>
* tools/gst-launch.c (check_intr): New timeout to check the
interrupt flag and stop the pipeline properly. Bling!
2005-02-11 Wim Taymans <wim@fluendo.com>
* gst/gstevent.c: (gst_event_new_discontinuous_valist),

View file

@ -264,13 +264,26 @@ print_tag (const GstTagList * list, const gchar * tag, gpointer unused)
static void
sigint_handler_sighandler (int signum)
{
g_print ("Caught interrupt.\n");
g_print ("Caught interrupt -- ");
sigint_restore ();
caught_intr = TRUE;
}
static gboolean
check_intr (user_data)
{
if (!caught_intr) {
return TRUE;
} else {
g_print ("Pausing pipeline.\n");
gst_element_set_state (pipeline, GST_STATE_PAUSED);
g_main_loop_quit (loop);
return FALSE;
}
}
static void
sigint_setup (void)
{
@ -519,6 +532,8 @@ main (int argc, char *argv[])
goto end;
}
g_timeout_add (50, check_intr, NULL);
g_get_current_time (&tfthen);
g_main_loop_run (loop);
g_get_current_time (&tfnow);