From: Wim T. <wt...@us...> - 2003-01-05 22:58:55
|
CVS Root: /cvsroot/gstreamer Module: gstreamer Changes by: wtay Date: Sun Jan 05 2003 14:58:54 PST Log message: patch 13364 from vishnu Modified files: gst/indexers : gstfileindex.c Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/indexers/gstfileindex.c.diff?r1=1.4&r2=1.5 ====Begin Diffs==== Index: gstfileindex.c =================================================================== RCS file: /cvsroot/gstreamer/gstreamer/gst/indexers/gstfileindex.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- gstfileindex.c 5 Jan 2003 16:51:46 -0000 1.4 +++ gstfileindex.c 5 Jan 2003 22:58:42 -0000 1.5 @@ -96,6 +96,7 @@ gchar *location; gboolean is_loaded; GSList *unresolved; + gint next_id; GHashTable *id_index; GstIndexEntry *ret_entry; // hack to avoid leaking memory @@ -239,14 +240,18 @@ continue; } - //g_warning ("resolve %d %s", *id, writer_string); - ii->id = *id; - g_hash_table_insert (index->id_index, id, ii); + ii->id = *id = ++index->next_id; + g_hash_table_insert (index->id_index, &ii->id, ii); match = TRUE; + + //g_warning ("resolve %d %s", *id, writer_string); } g_slist_free (pending); + if (!match) + g_warning ("Can't resolve writer '%s'", writer_string); + return match; } @@ -548,7 +553,7 @@ // It would be useful to know the GType of the writer so // we can try to cope with changes in the id_desc path. - g_hash_table_insert (fileindex->id_index, &entry->id, id_index); + g_hash_table_insert (fileindex->id_index, &id_index->id, id_index); } } @@ -650,7 +655,6 @@ gint mx; GstIndexAssociation sample; gboolean exact; - gint fx; id_index = g_hash_table_lookup (fileindex->id_index, &entry->id); if (!id_index) @@ -691,15 +695,14 @@ if (exact) { // maybe overwrite instead? - g_warning ("ignoring duplicate index association at %lld", - GST_INDEX_ASSOC_VALUE (entry, 0)); + // g_warning ("Ignoring duplicate index association at %lld", + // GST_INDEX_ASSOC_VALUE (entry, 0)); return; } - // should verify that all formats are ordered XXX - { gchar row_data[ARRAY_ROW_SIZE (id_index)]; + gint fx; gint32 flags_host = GST_INDEX_ASSOC_FLAGS (entry); ARRAY_ROW_FLAGS (row_data) = GINT32_TO_BE (flags_host); @@ -709,7 +712,7 @@ ARRAY_ROW_VALUE (row_data, fx) = GINT64_TO_BE (val_host); } - g_array_insert_val (id_index->array, mx, row_data); + g_array_insert_vals (id_index->array, mx, row_data, 1); } } @@ -844,8 +847,10 @@ if (!fileindex->ret_entry) fileindex->ret_entry = g_new0 (GstIndexEntry, 1); entry = fileindex->ret_entry; - if (entry->data.assoc.assocs) + if (entry->data.assoc.assocs) { g_free (entry->data.assoc.assocs); + entry->data.assoc.assocs = NULL; + } entry->type = GST_INDEX_ENTRY_ASSOCIATION; |