gst-inspect: fix unused-const-variable error in windows
[platform/upstream/gstreamer.git] / tools / gst-inspect.c
index 527d87f..1b5ed83 100644 (file)
@@ -41,7 +41,6 @@
 #   include <sys/wait.h>
 #endif
 
-#define DEFAULT_PAGER "less"
 
 /* "R" : support color
  * "X" : do not clear the screen when leaving the pager
 
 gboolean colored_output = TRUE;
 
+#ifdef G_OS_UNIX
+static const gchar DEFAULT_PAGER[] = "less";
 GPid child_pid = -1;
+#endif
 GMainLoop *loop = NULL;
 
 /* Console colors */
@@ -634,9 +636,11 @@ print_object_properties_info (GObject * obj, GObjectClass * obj_class,
               g_type_name (param->value_type), RESET_COLOR);
           if (param->value_type == GST_TYPE_STRUCTURE) {
             const GstStructure *s = gst_value_get_structure (&value);
-            if (s)
+            if (s) {
+              g_print ("\n");
               gst_structure_foreach (s, print_field,
                   (gpointer) "                           ");
+            }
           }
         } else if (G_IS_PARAM_SPEC_POINTER (param)) {
           if (param->value_type != G_TYPE_POINTER) {
@@ -1896,8 +1900,10 @@ redirect_stdout (void)
           NULL, NULL, &child_pid, &stdin_fd,
           /* pass null stdout/stderr to inherit our fds */
           NULL, NULL, &error)) {
-    g_warning ("g_spawn_async_with_pipes() failed: %s\n",
-        GST_STR_NULL (error->message));
+    if (pager != DEFAULT_PAGER) {
+      g_warning ("g_spawn_async_with_pipes() failed: %s\n",
+          GST_STR_NULL (error->message));
+    }
     g_strfreev (argv);
     g_strfreev (envp);
     g_clear_error (&error);