mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
quoting from the comment i put in gststaticautoplug.c: it is likely that the plugin is not loaded yet. thus when it l...
Original commit message from CVS: quoting from the comment i put in gststaticautoplug.c: it is likely that the plugin is not loaded yet. thus when it loads it will replace the elementfactory that gst built from the cache, and the GST_OBJECT_NAME will no longer be valid. thus we must g_strdup its name. this might be an implementation problem, i don't know, if a program keeps a reference to a cached factory after a factory has been added on plugin initialization. i really don't know though.
This commit is contained in:
parent
dfcbeb714e
commit
d1e9cc692b
1 changed files with 13 additions and 2 deletions
|
@ -354,6 +354,7 @@ gst_static_autoplug_to_caps (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *s
|
|||
while (factories[0]) {
|
||||
GstElementFactory *factory;
|
||||
GstElement *element;
|
||||
gchar *name;
|
||||
|
||||
// fase 3: add common elements
|
||||
factory = (GstElementFactory *) (factories[0]->data);
|
||||
|
@ -366,8 +367,18 @@ gst_static_autoplug_to_caps (GstAutoplug *autoplug, GstCaps *srccaps, GstCaps *s
|
|||
}
|
||||
|
||||
GST_DEBUG (0,"common factory \"%s\"\n", GST_OBJECT_NAME (factory));
|
||||
|
||||
element = gst_elementfactory_create (factory, GST_OBJECT_NAME (factory));
|
||||
|
||||
/* it is likely that the plugin is not loaded yet. thus when it loads it
|
||||
* will replace the elementfactory that gst built from the cache, and the
|
||||
* GST_OBJECT_NAME will no longer be valid. thus we must g_strdup its name.
|
||||
*
|
||||
* this might be an implementation problem, i don't know, if a program keeps
|
||||
* a reference to a cached factory after a factory has been added on plugin
|
||||
* initialization. i raelly don't know though.
|
||||
*/
|
||||
name = g_strdup (GST_OBJECT_NAME (factory));
|
||||
element = gst_elementfactory_create (factory, name);
|
||||
g_free(name);
|
||||
gst_bin_add (GST_BIN(result), element);
|
||||
|
||||
if (srcelement != NULL) {
|
||||
|
|
Loading…
Reference in a new issue