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 660156 - rtpbin: free_stream() does not remove the stream reference from the associated client's stream list
rtpbin: free_stream() does not remove the stream reference from the associate...
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
Other All
: Normal normal
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 667810 (view as bug list)
Depends on:
Reported: 2011-09-26 17:19 UTC by Sujay
Modified: 2013-02-07 13:58 UTC
See Also:
GNOME target: ---
GNOME version: ---

A proposed patch for the fix (1.95 KB, patch)
2011-09-26 21:49 UTC, Sujay
none Details | Review

Description Sujay 2011-09-26 17:19:45 UTC
In free_stream() function, the stream is freed, but the stream reference is not removed from  the client->streams list and the client->nstreams counter is not decremented.The stream cleanup logic exists in free_session(). But there are cases when free_stream() is called without removing the session. One such case is when the "autoremove" property is set on gstrtpbin. If this property is set, the rtpjitterbuffer and the ptdemuxer associated with the stream is cleaned up, but the session might still be receiving media from another SSRC. Now if a new stream is received from the same client (same cname) as which was removed, the client->nstreams counter is incremented and now refelcts incorrect number of streams belonging to this client. As a result in gst_rtp_bin_associate() while walking the client->streams list, the stale stream is operated upon, causing assertion failures downstream since the stream's jitterbuffer has already been cleaned up and is no longer a valid GObject.
Comment 1 Sujay 2011-09-26 21:49:21 UTC
Created attachment 197520 [details] [review]
A proposed patch for the fix
Comment 2 Wim Taymans 2013-02-07 10:54:33 UTC
Some things are wrong:

 * BIN_LOCK is taken while free_stream is sometimes called with the lock.
 * When a client is removed, client_walk is set to NULL and it doesn't check
   if other clients contain the stream.
Comment 3 Wim Taymans 2013-02-07 12:11:22 UTC
commit 978cc9f538647414c116c464c4001f5ab19a90e9
Author: Wim Taymans <>
Date:   Mon Sep 26 14:42:51 2011 -0700

    rtpbin: rework cleanup of streams
    Move the work of cleaning up the client streams in the free_stream
    function. This allows us to properly clean up the client streams when we
    remove an RTP stream as well.
    Based on patch by Sujay <>
Comment 4 Wim Taymans 2013-02-07 13:58:58 UTC
*** Bug 667810 has been marked as a duplicate of this bug. ***