Akihiro Sagawa : winegstreamer: Unref the GstCaps object in init_new_decoded_pad().

Alexandre Julliard julliard at winehq.org
Tue May 12 16:59:27 CDT 2020


Module: wine
Branch: master
Commit: 49c33c920ecff329d7e2ea5b4a2ebd67234f25d8
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=49c33c920ecff329d7e2ea5b4a2ebd67234f25d8

Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date:   Tue May 12 22:34:09 2020 +0900

winegstreamer: Unref the GstCaps object in init_new_decoded_pad().

Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winegstreamer/gstdemux.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c
index 7038cef9b3..299a7ddf56 100644
--- a/dlls/winegstreamer/gstdemux.c
+++ b/dlls/winegstreamer/gstdemux.c
@@ -1003,7 +1003,7 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct gstdemux *
     if (!(pin = create_pin(This, nameW)))
     {
         ERR("Failed to allocate memory.\n");
-        return;
+        goto out;
     }
 
     if (!strcmp(typename, "video/x-raw"))
@@ -1017,7 +1017,7 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct gstdemux *
         {
             ERR("Failed to create videoconvert, are %u-bit GStreamer \"base\" plugins installed?\n",
                     8 * (int)sizeof(void *));
-            return;
+            goto out;
         }
 
         /* GStreamer outputs RGB video top-down, but DirectShow expects bottom-up. */
@@ -1025,7 +1025,7 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct gstdemux *
         {
             ERR("Failed to create videoflip, are %u-bit GStreamer \"good\" plugins installed?\n",
                     8 * (int)sizeof(void *));
-            return;
+            goto out;
         }
 
         gst_bin_add(GST_BIN(This->container), vconv); /* bin takes ownership */
@@ -1051,7 +1051,7 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct gstdemux *
         {
             ERR("Failed to create audioconvert, are %u-bit GStreamer \"base\" plugins installed?\n",
                     8 * (int)sizeof(void *));
-            return;
+            goto out;
         }
 
         gst_bin_add(GST_BIN(This->container), convert);
@@ -1069,7 +1069,7 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct gstdemux *
                     gst_pad_link_get_name(ret));
             gst_object_unref(pin->post_sink);
             pin->post_sink = NULL;
-            return;
+            goto out;
         }
 
         if ((ret = gst_pad_link(pin->post_src, pin->my_sink)) < 0)
@@ -1080,18 +1080,20 @@ static void init_new_decoded_pad(GstElement *bin, GstPad *pad, struct gstdemux *
             pin->post_src = NULL;
             gst_object_unref(pin->post_sink);
             pin->post_sink = NULL;
-            return;
+            goto out;
         }
     }
     else if ((ret = gst_pad_link(pad, pin->my_sink)) < 0)
     {
         ERR("Failed to link decodebin source pad to our sink pad, error %s.\n",
                 gst_pad_link_get_name(ret));
-        return;
+        goto out;
     }
 
     gst_pad_set_active(pin->my_sink, 1);
     gst_object_ref(pin->their_src = pad);
+out:
+    gst_caps_unref(caps);
 }
 
 static void existing_new_pad(GstElement *bin, GstPad *pad, gpointer user)




More information about the wine-cvs mailing list