From 231333461e2ca1b904de4865b0fc3617d305ad02 Mon Sep 17 00:00:00 2001 From: Jeongmo Yang Date: Thu, 16 Jul 2015 15:20:27 +0900 Subject: [PATCH] Fix build warnings Change-Id: I7b753c6b5017b5ece6c545d02457a49b1a83d10b Signed-off-by: Jeongmo Yang --- src/mm_camcorder_gstcommon.c | 13 +++++++++++-- src/mm_camcorder_util.c | 7 ++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/mm_camcorder_gstcommon.c b/src/mm_camcorder_gstcommon.c index 45bb18b..845e970 100644 --- a/src/mm_camcorder_gstcommon.c +++ b/src/mm_camcorder_gstcommon.c @@ -1466,6 +1466,7 @@ static GstPadProbeReturn __mmcamcorder_video_dataprobe_preview(GstPad *pad, GstP unsigned int fourcc = 0; MMCamcorderVideoStreamDataType stream; MMVideoBuffer *mm_buf = NULL; + const gchar *string_format = NULL; state = _mmcamcorder_get_state((MMHandleType)hcamcorder); if (state < MM_CAMCORDER_STATE_PREPARE) { @@ -1485,9 +1486,17 @@ static GstPadProbeReturn __mmcamcorder_video_dataprobe_preview(GstPad *pad, GstP structure = gst_caps_get_structure( caps, 0 ); gst_structure_get_int(structure, "width", &(stream.width)); gst_structure_get_int(structure, "height", &(stream.height)); - fourcc = _mmcamcorder_convert_fourcc_string_to_value(gst_structure_get_string(structure, "format")); + string_format = gst_structure_get_string(structure, "format"); + if (string_format == NULL) { + gst_caps_unref(caps); + caps = NULL; + _mmcam_dbg_warn("get string error!!"); + return GST_PAD_PROBE_OK; + } + + fourcc = _mmcamcorder_convert_fourcc_string_to_value(string_format); stream.format = _mmcamcorder_get_pixtype(fourcc); - gst_caps_unref( caps ); + gst_caps_unref(caps); caps = NULL; /* diff --git a/src/mm_camcorder_util.c b/src/mm_camcorder_util.c index 87da365..2f1740e 100644 --- a/src/mm_camcorder_util.c +++ b/src/mm_camcorder_util.c @@ -121,9 +121,10 @@ static int __gdbus_method_call_sync(const char* bus_name, const char* object, co _mmcam_dbg_log("Dbus call with obj : '%s' iface : '%s' method : '%s'", object, iface, method); if (is_sync) { - if (dbus_reply = g_dbus_connection_call_sync(conn, bus_name, object, iface, \ - method, args,\ - NULL, G_DBUS_CALL_FLAGS_NONE, G_DBUS_REPLY_TIMEOUT, NULL, &err )) { + dbus_reply = g_dbus_connection_call_sync(conn, bus_name, object, iface, + method, args, NULL, G_DBUS_CALL_FLAGS_NONE, + G_DBUS_REPLY_TIMEOUT, NULL, &err); + if (dbus_reply) { _mmcam_dbg_log("Method Call '%s.%s' Success", iface, method); *result = dbus_reply; } else { -- 2.7.4