mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-07-01 12:20:42 +00:00
playbin3: fix leaks of collection returned by message parse API
gst_message_parse_stream_collection() and gst_message_parse_streams_selected() actually return a reffed GstStreamCollection. https://bugzilla.gnome.org/show_bug.cgi?id=768776
This commit is contained in:
parent
657a9c23d6
commit
c1d55f29a1
|
@ -1182,6 +1182,8 @@ gst_decodebin3_handle_message (GstBin * bin, GstMessage * message)
|
||||||
gst_message_unref (message);
|
gst_message_unref (message);
|
||||||
message = new_msg;
|
message = new_msg;
|
||||||
}
|
}
|
||||||
|
if (collection)
|
||||||
|
gst_object_unref (collection);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -3102,6 +3102,7 @@ gst_play_bin3_handle_message (GstBin * bin, GstMessage * msg)
|
||||||
GST_PLAY_BIN3_UNLOCK (playbin);
|
GST_PLAY_BIN3_UNLOCK (playbin);
|
||||||
|
|
||||||
notify_all_streams (playbin, collection);
|
notify_all_streams (playbin, collection);
|
||||||
|
gst_object_unref (collection);
|
||||||
}
|
}
|
||||||
} else if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_STREAMS_SELECTED) {
|
} else if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_STREAMS_SELECTED) {
|
||||||
GstStreamCollection *collection = NULL;
|
GstStreamCollection *collection = NULL;
|
||||||
|
@ -3138,6 +3139,7 @@ gst_play_bin3_handle_message (GstBin * bin, GstMessage * msg)
|
||||||
GST_PLAY_BIN3_UNLOCK (playbin);
|
GST_PLAY_BIN3_UNLOCK (playbin);
|
||||||
|
|
||||||
notify_all_streams (playbin, collection);
|
notify_all_streams (playbin, collection);
|
||||||
|
gst_object_unref (collection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -223,6 +223,7 @@ _on_bus_message (GstBus * bus, GstMessage * message, MyDataStruct * data)
|
||||||
/* In 5s try to change streams */
|
/* In 5s try to change streams */
|
||||||
data->timeout_id =
|
data->timeout_id =
|
||||||
g_timeout_add_seconds (5, (GSourceFunc) switch_streams, data);
|
g_timeout_add_seconds (5, (GSourceFunc) switch_streams, data);
|
||||||
|
gst_object_unref (collection);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,6 +217,7 @@ _on_bus_message (GstBus * bus, GstMessage * message, MyDataStruct * data)
|
||||||
/* In 5s try to change streams */
|
/* In 5s try to change streams */
|
||||||
data->timeout_id =
|
data->timeout_id =
|
||||||
g_timeout_add_seconds (5, (GSourceFunc) switch_streams, data);
|
g_timeout_add_seconds (5, (GSourceFunc) switch_streams, data);
|
||||||
|
gst_object_unref (collection);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue