GNOME Bugzilla – Bug 608877
[typefind] Access to internal fields not threadsafe
Last modified: 2011-01-28 10:24:32 UTC
I have an application that is using playbin2. Sometimes when changing the state of playbin2 from PAUSED to READY I get the following error: GStreamer-CRITICAL **: gst_caps_unref: assertion `GST_CAPS_REFCOUNT_VALUE (caps) > 0' failed I have traced the error to gsttypefindelement.c->gst_type_find_element_change_state()->gst_caps_replace(). The error only seems to appear when I do the PASUSED to READY state change shortly after I have set playbin to PLAYING (and before the first frame has reached the audio/video sink). Looking in the code it's clear that it isn't thread safe. For example gst_type_find_element_have_type() is called from one thread and gst_type_find_element_change_state from another, since they both unref the typefind->caps variable I guess this could be the cause of this error.
Right, there are some thread safety issues with the caps and with some other fields of the typefind element. I'm working on it.
Created attachment 153077 [details] [review] typefindelement: Protect internal fields from concurrent changes from different threads Fixes bug #608877.
commit 88736cd6752a9ae49b25ed00ccaf4dbe86b22935 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Thu Feb 4 21:11:25 2010 +0100 typefindelement: Protect internal fields from concurrent changes from differ Fixes bug #608877.
Created attachment 178124 [details] [review] skip object lock in data flow path I believe the locking is overprotective. Am I overlooking something?
Created attachment 178141 [details] [review] skip object lock in data flow path Previous patch contained unrelated edits.