uridecodebin: Check that properties have the correct type before using them
This commit is contained in:
parent
91b8f10a92
commit
15d92392b5
@ -1235,10 +1235,13 @@ gen_source_element (GstURIDecodeBin * decoder)
|
|||||||
|
|
||||||
/* make HTTP sources send extra headers so we get icecast
|
/* make HTTP sources send extra headers so we get icecast
|
||||||
* metadata in case the stream is an icecast stream */
|
* metadata in case the stream is an icecast stream */
|
||||||
if (!strncmp (decoder->uri, "http://", 7) &&
|
if (!strncmp (decoder->uri, "http://", 7)) {
|
||||||
g_object_class_find_property (source_class, "iradio-mode")) {
|
pspec = g_object_class_find_property (source_class, "iradio-mode");
|
||||||
GST_LOG_OBJECT (decoder, "configuring iradio-mode");
|
|
||||||
g_object_set (source, "iradio-mode", TRUE, NULL);
|
if (pspec && G_PARAM_SPEC_VALUE_TYPE (pspec) == G_TYPE_STRING) {
|
||||||
|
GST_LOG_OBJECT (decoder, "configuring iradio-mode");
|
||||||
|
g_object_set (source, "iradio-mode", TRUE, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pspec = g_object_class_find_property (source_class, "connection-speed");
|
pspec = g_object_class_find_property (source_class, "connection-speed");
|
||||||
@ -2014,9 +2017,11 @@ is_live_source (GstElement * source)
|
|||||||
{
|
{
|
||||||
GObjectClass *source_class = NULL;
|
GObjectClass *source_class = NULL;
|
||||||
gboolean is_live = FALSE;
|
gboolean is_live = FALSE;
|
||||||
|
GParamSpec *pspec;
|
||||||
|
|
||||||
source_class = G_OBJECT_GET_CLASS (source);
|
source_class = G_OBJECT_GET_CLASS (source);
|
||||||
if (!g_object_class_find_property (source_class, "is-live"))
|
pspec = g_object_class_find_property (source_class, "is-live");
|
||||||
|
if (!pspec || G_PARAM_SPEC_VALUE_TYPE (pspec) != G_TYPE_BOOLEAN)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
g_object_get (G_OBJECT (source), "is-live", &is_live, NULL);
|
g_object_get (G_OBJECT (source), "is-live", &is_live, NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user