From dcadfe662118e82a8d83010e47b9b7e952cfbd02 Mon Sep 17 00:00:00 2001 From: Thijs Vermeir Date: Wed, 9 Nov 2011 11:56:07 +0100 Subject: [PATCH] dtmf: fix compiler warning for uninitialized values --- gst/dtmf/gstdtmfsrc.c | 7 ++++--- gst/dtmf/gstrtpdtmfsrc.c | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gst/dtmf/gstdtmfsrc.c b/gst/dtmf/gstdtmfsrc.c index 6bc46429d8..929147fe07 100644 --- a/gst/dtmf/gstdtmfsrc.c +++ b/gst/dtmf/gstdtmfsrc.c @@ -641,7 +641,7 @@ static void gst_dtmf_src_post_message (GstDTMFSrc * dtmfsrc, const gchar * message_name, GstDTMFSrcEvent * event) { - GstStructure *s; + GstStructure *s = NULL; switch (event->event_type) { case DTMF_EVENT_TYPE_START: @@ -661,8 +661,9 @@ gst_dtmf_src_post_message (GstDTMFSrc * dtmfsrc, const gchar * message_name, return; } - gst_element_post_message (GST_ELEMENT (dtmfsrc), - gst_message_new_element (GST_OBJECT (dtmfsrc), s)); + if (s) + gst_element_post_message (GST_ELEMENT (dtmfsrc), + gst_message_new_element (GST_OBJECT (dtmfsrc), s)); } static GstFlowReturn diff --git a/gst/dtmf/gstrtpdtmfsrc.c b/gst/dtmf/gstrtpdtmfsrc.c index 1689dc46a9..ee8703563d 100644 --- a/gst/dtmf/gstrtpdtmfsrc.c +++ b/gst/dtmf/gstrtpdtmfsrc.c @@ -665,7 +665,7 @@ static void gst_dtmf_src_post_message (GstRTPDTMFSrc * dtmfsrc, const gchar * message_name, GstRTPDTMFSrcEvent * event) { - GstStructure *s; + GstStructure *s = NULL; switch (event->event_type) { case RTP_DTMF_EVENT_TYPE_START: @@ -685,8 +685,9 @@ gst_dtmf_src_post_message (GstRTPDTMFSrc * dtmfsrc, const gchar * message_name, return; } - gst_element_post_message (GST_ELEMENT (dtmfsrc), - gst_message_new_element (GST_OBJECT (dtmfsrc), s)); + if (s) + gst_element_post_message (GST_ELEMENT (dtmfsrc), + gst_message_new_element (GST_OBJECT (dtmfsrc), s)); }