chiark / gitweb /
server/gstdecode.c: Dissect the message more portably.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 10 Jul 2018 10:25:29 +0000 (11:25 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 10 Jul 2018 10:25:29 +0000 (11:25 +0100)
We can use `gst_message_get_structure' in both versions, so do that
rather than ifdeffery.  Use the `GST_MESSAGE_TYPE' macro to get the
type, for future compatibility.

server/gstdecode.c

index 7d540526c14616f648f67d2bee147ef2a596be65..0ebe83a0323d2f5d7581f92ca0ca00b92c0986f9 100644 (file)
@@ -314,16 +314,11 @@ static void prepare_pipeline(void)
 static void bus_message(GstBus UNUSED *bus, GstMessage *msg,
                         gpointer UNUSED u)
 {
-  switch(msg->type) {
+  switch(GST_MESSAGE_TYPE(msg)) {
   case GST_MESSAGE_ERROR:
-#ifdef HAVE_GSTREAMER_0_10
-    disorder_fatal(0, "%s",
-                   gst_structure_get_string(msg->structure, "debug"));
-#else
     disorder_fatal(0, "%s",
                    gst_structure_get_string(gst_message_get_structure(msg),
                                             "debug"));
-#endif
   default:
     break;
   }