[webkit-reviews] review requested: [Bug 185657] [GStreamer]: Do not steal GstStreamCollection's reference to GstStream : [Attachment 340434] [GStreamer]: Do not steal GstStreamCollection's reference to GstStream

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 15 14:29:42 PDT 2018


Thibault Saunier <tsaunier at gnome.org> has asked  for review:
Bug 185657: [GStreamer]: Do not steal GstStreamCollection's reference to
GstStream
https://bugs.webkit.org/show_bug.cgi?id=185657

Attachment 340434: [GStreamer]: Do not steal GstStreamCollection's reference to
GstStream

https://bugs.webkit.org/attachment.cgi?id=340434&action=review




--- Comment #1 from Thibault Saunier <tsaunier at gnome.org> ---
Created attachment 340434

  --> https://bugs.webkit.org/attachment.cgi?id=340434&action=review

[GStreamer]: Do not steal GstStreamCollection's reference to GstStream

Before GStreamer 1.14[1] GstStream's reference was not sunk when creating
it, meaning that when we were using

    `GRefPtr<GstStream> stream = gst_stream_collection_get(collection,
stream_index);`

we were actually calling `g_object_sink_ref(some_stream);` leading to taking
ownership of that (floating) reference, while we were not actually owning it as
it was
owned by the GstStreamCollection itself. In the end we were ending up
unrefing an already destroyed object randomly later on (see bug #184581)

This patchs makes sure the floating reference is sunk (giving real ownership
to the GstStreamCollection in the end) for Gst < 1.14.

Starting from 1.14, the ref is sunk in gst_stream_new and we will not do
anything
as we do not need to anymore.

[1] commit f119e93b47efb06ffc68c01d3e094d5346c30041 `gst: Clear floating flag
in constructor of all GstObject subclasses that are not owned by any parent`


More information about the webkit-reviews mailing list