Summary: | [GStreamer]: Consider GstStream(Collection) as if if was not a GInitiallyUnowned | ||
---|---|---|---|
Product: | WebKit | Reporter: | Thibault Saunier <tsaunier> |
Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | cgarcia, commit-queue, ews-watchlist, pnormand, tsaunier, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | All | ||
OS: | All | ||
Bug Depends on: | |||
Bug Blocks: | 185787 | ||
Attachments: |
Description
Thibault Saunier
2018-05-15 14:27:09 PDT
Created attachment 340434 [details] [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` Attachment 340434 [details] did not pass style-queue:
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:635: Declaration has space between type name and * in GstStream * tmpstream [whitespace/declaration] [3]
ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1335: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3]
Total errors found: 2 in 2 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 340435 [details]
Fix previously reported styling issues.
Comment on attachment 340435 [details]
Fix previously reported styling issues.
I wonder if GRefPtrGStreamer.cpp could be patched instead?
Created attachment 340501 [details]
Fix the issue in GRefPtrGStreamer.cpp directly.
Created attachment 340505 [details]
Spelling fixes in the ChageLog.
[1] commit f119e93b47efb06ffc68c01d3e094d5346c30041 `gst: Clear floating flag in constructor of all GstObject subclasses that are not owned by any parent`
Comment on attachment 340505 [details]
Spelling fixes in the ChageLog.
LGTM but I'll let Carlos check this too.
Comment on attachment 340505 [details]
Spelling fixes in the ChageLog.
Ok
Comment on attachment 340505 [details] Spelling fixes in the ChageLog. Clearing flags on attachment: 340505 Committed r231891: <https://trac.webkit.org/changeset/231891> All reviewed patches have been landed. Closing bug. |