}
#ifdef G_OS_UNIX
+static guint signal_watch_id;
+#endif
+
+#ifdef G_OS_UNIX
/* As the interrupt handler is dispatched from GMainContext as a GSourceFunc
* handler, we can react to this by posting a message. */
static gboolean
"message", G_TYPE_STRING, "Pipeline interrupted", NULL)));
/* remove signal handler */
+ signal_watch_id = 0;
return FALSE;
}
event_loop (GstElement * pipeline, gboolean blocking, gboolean do_progress,
GstState target_state)
{
-#ifdef G_OS_UNIX
- guint signal_watch_id;
-#endif
GstBus *bus;
GstMessage *message = NULL;
EventLoopResult res = ELR_NO_ERROR;
gst_message_unref (message);
gst_object_unref (bus);
#ifdef G_OS_UNIX
- g_source_remove (signal_watch_id);
+ if (signal_watch_id > 0)
+ g_source_remove (signal_watch_id);
#endif
return res;
}