mount-points: sort sequence before g_sequence_lookup
authorAleix Conchillo FlaquƩ <aleix@oblong.com>
Sat, 21 Dec 2013 00:39:07 +0000 (16:39 -0800)
committerWim Taymans <wtaymans@redhat.com>
Thu, 26 Dec 2013 09:36:48 +0000 (10:36 +0100)
* gst/rtsp-server/rtsp-mount-points.c (gst_rtsp_mount_points_remove_factory):
  sort sequence if dirty, otherwise lookup will fail.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=720855

gst/rtsp-server/rtsp-mount-points.c

index 49d8d3e..dbf5473 100644 (file)
@@ -356,6 +356,10 @@ gst_rtsp_mount_points_remove_factory (GstRTSPMountPoints * mounts,
   GST_INFO ("removing media factory for path %s", path);
 
   g_mutex_lock (&priv->lock);
+  if (priv->dirty) {
+    g_sequence_sort (priv->mounts, data_item_compare, mounts);
+    priv->dirty = FALSE;
+  }
   iter = g_sequence_lookup (priv->mounts, &item, data_item_compare, mounts);
   if (iter) {
     g_sequence_remove (iter);