mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
playbin2: Use gst_object_has_ancestor() instead of our own implementation of it
This commit is contained in:
parent
02cbde648c
commit
2b3741403e
1 changed files with 2 additions and 28 deletions
|
@ -1810,32 +1810,6 @@ static const gchar *blacklisted_mimes[] = {
|
||||||
"video/x-dvd-subpicture", "subpicture/x-pgs", NULL
|
"video/x-dvd-subpicture", "subpicture/x-pgs", NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* Returns TRUE if child is object or any parent (transitive)
|
|
||||||
* of child is object */
|
|
||||||
static gboolean
|
|
||||||
_gst_object_contains_object (GstObject * object, GstObject * child)
|
|
||||||
{
|
|
||||||
GstObject *parent, *tmp;
|
|
||||||
|
|
||||||
if (!object || !child)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
parent = gst_object_ref (child);
|
|
||||||
do {
|
|
||||||
if (parent == object) {
|
|
||||||
gst_object_unref (parent);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
tmp = gst_object_get_parent (parent);
|
|
||||||
gst_object_unref (parent);
|
|
||||||
parent = tmp;
|
|
||||||
} while (parent);
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_play_bin_handle_message (GstBin * bin, GstMessage * msg)
|
gst_play_bin_handle_message (GstBin * bin, GstMessage * msg)
|
||||||
{
|
{
|
||||||
|
@ -1864,8 +1838,8 @@ gst_play_bin_handle_message (GstBin * bin, GstMessage * msg)
|
||||||
if (group && group->pending && group->suburidecodebin) {
|
if (group && group->pending && group->suburidecodebin) {
|
||||||
GstObject *srcparent = gst_object_get_parent (GST_OBJECT_CAST (msg->src));
|
GstObject *srcparent = gst_object_get_parent (GST_OBJECT_CAST (msg->src));
|
||||||
|
|
||||||
if (G_UNLIKELY (_gst_object_contains_object (GST_OBJECT_CAST
|
if (G_UNLIKELY (gst_object_has_ancestor (msg->src, GST_OBJECT_CAST
|
||||||
(group->suburidecodebin), msg->src)
|
(group->suburidecodebin))
|
||||||
&& GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ERROR)) {
|
&& GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ERROR)) {
|
||||||
GError *err;
|
GError *err;
|
||||||
gchar *debug = NULL;
|
gchar *debug = NULL;
|
||||||
|
|
Loading…
Reference in a new issue