[0.6.236] Fix memory leak due to without unref caps
[platform/core/multimedia/libmm-player.git] / src / mm_player_priv.c
index 7107352..d10bfa4 100644 (file)
@@ -1720,7 +1720,8 @@ __mmplayer_gst_create_sink_bin(GstElement *elem, GstPad *pad, GstCaps *ref_caps,
                MMPLAYER_GST_GET_CAPS_INFO(ref_caps, str, name, caps_ret);
                if (!caps_ret)
                        goto ERROR;
-
+               if (caps)
+                       gst_caps_unref(caps);
                caps = gst_caps_ref(ref_caps);
        }
 
@@ -2309,10 +2310,6 @@ __mmplayer_gst_caps_notify_cb(GstPad *pad, GParamSpec *unused, gpointer data)
        MMPLAYER_RETURN_IF_FAIL(unused);
        MMPLAYER_RETURN_IF_FAIL(data);
 
-       caps = gst_pad_get_current_caps(pad);
-       if (!caps)
-               return;
-
        MMPLAYER_GST_GET_CAPS_INFO_FROM_PAD(pad, caps, str, name, caps_ret);
        if (!caps_ret)
                goto ERROR;