mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-19 20:46:22 +00:00
decodebin2: Check that properties have the correct type before using them
This commit is contained in:
parent
15d92392b5
commit
fe9041bd05
1 changed files with 6 additions and 3 deletions
|
@ -1770,6 +1770,7 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad,
|
||||||
GstDecodeElement *delem;
|
GstDecodeElement *delem;
|
||||||
GstElement *element;
|
GstElement *element;
|
||||||
GstPad *sinkpad;
|
GstPad *sinkpad;
|
||||||
|
GParamSpec *pspec;
|
||||||
gboolean subtitle;
|
gboolean subtitle;
|
||||||
|
|
||||||
/* Set dpad target to pad again, it might've been unset
|
/* Set dpad target to pad again, it might've been unset
|
||||||
|
@ -1948,8 +1949,9 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad,
|
||||||
connect_element (dbin, element, chain);
|
connect_element (dbin, element, chain);
|
||||||
|
|
||||||
/* try to configure the subtitle encoding property when we can */
|
/* try to configure the subtitle encoding property when we can */
|
||||||
if (g_object_class_find_property (G_OBJECT_GET_CLASS (element),
|
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (element),
|
||||||
"subtitle-encoding")) {
|
"subtitle-encoding");
|
||||||
|
if (pspec && G_PARAM_SPEC_VALUE_TYPE (pspec) == G_TYPE_STRING) {
|
||||||
SUBTITLE_LOCK (dbin);
|
SUBTITLE_LOCK (dbin);
|
||||||
GST_DEBUG_OBJECT (dbin,
|
GST_DEBUG_OBJECT (dbin,
|
||||||
"setting subtitle-encoding=%s to element", dbin->encoding);
|
"setting subtitle-encoding=%s to element", dbin->encoding);
|
||||||
|
@ -1957,8 +1959,9 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad,
|
||||||
NULL);
|
NULL);
|
||||||
SUBTITLE_UNLOCK (dbin);
|
SUBTITLE_UNLOCK (dbin);
|
||||||
subtitle = TRUE;
|
subtitle = TRUE;
|
||||||
} else
|
} else {
|
||||||
subtitle = FALSE;
|
subtitle = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Bring the element to the state of the parent */
|
/* Bring the element to the state of the parent */
|
||||||
if ((gst_element_set_state (element,
|
if ((gst_element_set_state (element,
|
||||||
|
|
Loading…
Reference in a new issue