On Arch Linux x86_64, gcc 7.2.0-3, -Og -g3:
gstdevicemonitor.c: In function ‘bus_sync_message’:
gstdevicemonitor.c:276:8: error: ‘matches’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
This commit also simplifies the code a bit.
https://bugzilla.gnome.org/show_bug.cgi?id=789983
GstMessageType type = GST_MESSAGE_TYPE (message);
if (type == GST_MESSAGE_DEVICE_ADDED || type == GST_MESSAGE_DEVICE_REMOVED) {
- gboolean matches;
+ gboolean matches = TRUE;
GstDevice *device;
GstDeviceProvider *provider;
GST_DEVICE_PROVIDER (gst_object_get_parent (GST_OBJECT (device)));
if (is_provider_hidden (monitor, monitor->priv->hidden, provider)) {
matches = FALSE;
- } else if (monitor->priv->filters->len) {
+ } else {
guint i;
for (i = 0; i < monitor->priv->filters->len; i++) {
if (matches)
break;
}
- } else {
- matches = TRUE;
}
GST_OBJECT_UNLOCK (monitor);