[Bug 707605] Need "reverse-funnel" element

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Mon Oct 7 11:41:18 CEST 2013


https://bugzilla.gnome.org/show_bug.cgi?id=707605
  GStreamer | gstreamer (core) | git

Sebastian Dröge (slomo) <slomo> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #256604|none                        |needs-work
             status|                            |

--- Comment #34 from Sebastian Dröge (slomo) <slomo at circular-chaos.org> 2013-10-07 09:41:16 UTC ---
Review of attachment 256604:
 --> (https://bugzilla.gnome.org/review?bug=707605&attachment=256604)

::: plugins/elements/gststreamiddemux.c
@@ +130,3 @@
+static void
+gst_streamid_demux_dispose (GObject * object)
+{

You should free/clear the rw lock here

@@ +178,3 @@
+
+  gst_object_ref (srcpad);
+  demux->active_srcpad = srcpad;

You leak any previously set active_srcpad here. Also you protected
active_srcpad with the object lock above, but not here

@@ +183,3 @@
+  g_hash_table_insert (demux->stream_id_pairs, g_strdup (stream_id),
+      (gpointer) srcpad);
+  g_rw_lock_writer_unlock (&demux->lock);

Note again that you can just use the object lock for protecting the hash table.
RW locks only make sense if there are many readers at once, but this never
happens here.

@@ +262,3 @@
+          gst_streamid_demux_srcpad_create (demux, pad, stream_id);
+        } else if (demux->active_srcpad != active_srcpad) {
+          demux->active_srcpad = active_srcpad;

You leak any previously set active_srcpad here. Also you protected
active_srcpad with the object lock above, but not here

@@ +284,3 @@
+no_stream_id:
+  {
+    GST_WARNING_OBJECT (demux, "no stream_id found");

GST_ELEMENT_ERROR or maybe even make this an assertion. It should not happen.

@@ +314,3 @@
+    g_hash_table_destroy (demux->stream_id_pairs);
+    demux->stream_id_pairs = NULL;
+  }

You should also unref and unset active_srcpad here

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list