After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 731768 - gstsrtpenc: unref event when needed
gstsrtpenc: unref event when needed
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.3.2
Other Linux
: Normal normal
: 1.3.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-06-17 09:50 UTC by Miguel París Díaz
Modified: 2014-06-18 14:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A patch to solve the issue (747 bytes, patch)
2014-06-17 09:51 UTC, Miguel París Díaz
reviewed Details | Review
A patch to solve the bug (743 bytes, patch)
2014-06-18 14:08 UTC, Miguel París Díaz
committed Details | Review

Description Miguel París Díaz 2014-06-17 09:50:52 UTC
Event must be unreferenced if it is not forwarded.
Comment 1 Miguel París Díaz 2014-06-17 09:51:19 UTC
Created attachment 278580 [details] [review]
A patch to solve the issue
Comment 2 Wim Taymans 2014-06-18 13:55:13 UTC
The unref is indeed needed but *after* using the event inside it, pushed a modified patch:

commit bf003caf9d75d05aed9cfefda3cde025520edc89
Author: Miguel París Díaz <mparisdiaz@gmail.com>
Date:   Tue Jun 17 11:48:12 2014 +0200

    gstsrtpenc: unref event when needed
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=731768
Comment 3 Wim Taymans 2014-06-18 13:55:44 UTC
Comment on attachment 278580 [details] [review]
A patch to solve the issue

unref needs to be after setcaps
Comment 4 Miguel París Díaz 2014-06-18 13:59:48 UTC
At the beginning, I did it as you say, but I changed it because gst_event_parse_caps (event, &caps) gives to the caps var the ownership of the caps ref.
Comment 5 Wim Taymans 2014-06-18 14:03:29 UTC
(In reply to comment #4)
> At the beginning, I did it as you say, but I changed it because
> gst_event_parse_caps (event, &caps) gives to the caps var the ownership of the
> caps ref.

It does not, the ref to the caps only remains valid for as long as the event is alive. 

If you would get an additional ref to the caps, the caps would be leaked in the set_caps function then.
Comment 6 Miguel París Díaz 2014-06-18 14:07:06 UTC
OK, you are right.
Comment 7 Miguel París Díaz 2014-06-18 14:08:06 UTC
Created attachment 278684 [details] [review]
A patch to solve the bug