Fix ts dump code. 66/58466/1 accepted/tizen/ivi/20160218.023810 accepted/tizen/mobile/20160203.052559 accepted/tizen/tv/20160203.052627 accepted/tizen/wearable/20160203.052645 submit/tizen/20160203.024614 submit/tizen_common/20160218.142243 submit/tizen_ivi/20160217.000000 submit/tizen_ivi/20160217.000003
authorSangkyu Park <sk1122.park@samsung.com>
Mon, 1 Feb 2016 09:18:38 +0000 (18:18 +0900)
committerSangkyu Park <sk1122.park@samsung.com>
Mon, 1 Feb 2016 09:18:42 +0000 (18:18 +0900)
- Issue : The parant object of pad is not unreferenced.

Change-Id: I210b6430ef04b8dcbe0d0ea94f1c65f152735f40
Signed-off-by: Sangkyu Park <sk1122.park@samsung.com>
sink/mm_wfd_sink_util.c

index c36bed0703b3b7ebe4b98c333d76e63700171844..45ed601a64152ba652d454041976e5e42eb96b6d 100755 (executable)
@@ -33,8 +33,16 @@ _mm_wfd_sink_util_dump(GstPad *pad, GstPadProbeInfo *info, gpointer u_data)
        FILE *f = NULL;
        char buf[256] = {0, };
        char path[256] = {0, };
+       GstElement * parent = NULL;
 
-       snprintf(path, sizeof(path), "%s%s_%s.ts", DUMP_TS_DATA_PATH, gst_element_get_name(gst_pad_get_parent_element(pad)), gst_pad_get_name(pad));
+       parent = gst_pad_get_parent_element(pad);
+       if (parent == NULL) {
+               wfd_sink_error("The parent of pad is NULL.");
+               return GST_PAD_PROBE_OK;
+       }
+
+       snprintf(path, sizeof(path), "%s%s_%s.ts", DUMP_TS_DATA_PATH, gst_element_get_name(parent), gst_pad_get_name(pad));
+       gst_object_unref(parent);
 
        if (info && info->type & GST_PAD_PROBE_TYPE_BUFFER) {
                GstMapInfo buf_info;