memindex: avoid busy loop when doing EXACT lookup
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Thu, 18 Feb 2010 16:15:35 +0000 (17:15 +0100)
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Thu, 18 Feb 2010 16:17:34 +0000 (17:17 +0100)
Fixes #610367.

plugins/indexers/gstmemindex.c

index 8cf5a38..2ea0822 100644 (file)
@@ -421,8 +421,8 @@ gst_mem_index_get_assoc_entry (GstIndex * index, gint id,
     }
   }
 
-  if (entry) {
-    if ((GST_INDEX_ASSOC_FLAGS (entry) & flags) != flags) {
+  if (entry && ((GST_INDEX_ASSOC_FLAGS (entry) & flags) != flags)) {
+    if (method != GST_INDEX_LOOKUP_EXACT) {
       GList *l_entry = g_list_find (memindex->associations, entry);
 
       entry = NULL;
@@ -439,6 +439,8 @@ gst_mem_index_get_assoc_entry (GstIndex * index, gint id,
           l_entry = g_list_previous (l_entry);
         }
       }
+    } else {
+      entry = NULL;
     }
   }