From: Mark Wooding Date: Tue, 10 Jul 2018 10:25:29 +0000 (+0100) Subject: server/gstdecode.c: Dissect the message more portably. X-Git-Tag: 5.2~36 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/0b47d5168900dcf3ba40d7abc7942cd8049818d7 server/gstdecode.c: Dissect the message more portably. 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. --- diff --git a/server/gstdecode.c b/server/gstdecode.c index 7d54052..0ebe83a 100644 --- a/server/gstdecode.c +++ b/server/gstdecode.c @@ -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; }