mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-01 14:11:15 +00:00
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:
parent
f30a7e5ea8
commit
5c30d4e66c
2 changed files with 21 additions and 1 deletions
|
@ -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>
|
2005-02-11 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* gst/gstevent.c: (gst_event_new_discontinuous_valist),
|
* gst/gstevent.c: (gst_event_new_discontinuous_valist),
|
||||||
|
|
|
@ -264,13 +264,26 @@ print_tag (const GstTagList * list, const gchar * tag, gpointer unused)
|
||||||
static void
|
static void
|
||||||
sigint_handler_sighandler (int signum)
|
sigint_handler_sighandler (int signum)
|
||||||
{
|
{
|
||||||
g_print ("Caught interrupt.\n");
|
g_print ("Caught interrupt -- ");
|
||||||
|
|
||||||
sigint_restore ();
|
sigint_restore ();
|
||||||
|
|
||||||
caught_intr = TRUE;
|
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
|
static void
|
||||||
sigint_setup (void)
|
sigint_setup (void)
|
||||||
{
|
{
|
||||||
|
@ -519,6 +532,8 @@ main (int argc, char *argv[])
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_timeout_add (50, check_intr, NULL);
|
||||||
|
|
||||||
g_get_current_time (&tfthen);
|
g_get_current_time (&tfthen);
|
||||||
g_main_loop_run (loop);
|
g_main_loop_run (loop);
|
||||||
g_get_current_time (&tfnow);
|
g_get_current_time (&tfnow);
|
||||||
|
|
Loading…
Reference in a new issue