[snappy] engine: Display Warnings in the printout



commit 0ef3237e833248461efc8539637ab9224760c5c7
Author: Luis de Bethencourt <luis debethencourt com>
Date:   Thu Mar 14 13:46:13 2013 -0400

    engine: Display Warnings in the printout

 src/gst_engine.c |   38 +++++++++++++++++++++++++++++++-------
 1 files changed, 31 insertions(+), 7 deletions(-)
---
diff --git a/src/gst_engine.c b/src/gst_engine.c
index 86bc01e..560836e 100644
--- a/src/gst_engine.c
+++ b/src/gst_engine.c
@@ -570,6 +570,28 @@ bus_call (GstBus * bus, GstMessage * msg, gpointer data)
       break;
     }
 
+    case GST_MESSAGE_WARNING:
+    {
+      /* Parse and share Gst Warning */
+      gchar *debug = NULL;
+      GError *err = NULL;
+
+      gst_message_parse_warning (msg, &err, &debug);
+      if (err) {
+        g_print ("Warning: %s", err->message);
+        GST_DEBUG ("Warning: %s", err->message);
+
+        g_error_free (err);
+
+        if (debug) {
+          GST_DEBUG ("Debug details: %s", debug);
+          g_free (debug);
+        }
+      }
+
+      break;
+    }
+
     case GST_MESSAGE_ERROR:
     {
       /* Parse and share Gst Error */
@@ -577,13 +599,15 @@ bus_call (GstBus * bus, GstMessage * msg, gpointer data)
       GError *err = NULL;
 
       gst_message_parse_error (msg, &err, &debug);
-
-      GST_DEBUG ("Error: %s", err->message);
-      g_error_free (err);
-
-      if (debug) {
-        GST_DEBUG ("Debug details: %s", debug);
-        g_free (debug);
+      if (err) {
+        g_print ("Error: %s", err->message);
+        GST_DEBUG ("Error: %s", err->message);
+        g_error_free (err);
+
+        if (debug) {
+          GST_DEBUG ("Debug details: %s", debug);
+          g_free (debug);
+        }
       }
 
       break;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]