mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 02:01:12 +00:00
patch 13364 from vishnu
Original commit message from CVS: patch 13364 from vishnu
This commit is contained in:
parent
d7154f9568
commit
fd1b4e1ce9
2 changed files with 32 additions and 22 deletions
|
@ -96,6 +96,7 @@ struct _GstFileIndex {
|
||||||
gchar *location;
|
gchar *location;
|
||||||
gboolean is_loaded;
|
gboolean is_loaded;
|
||||||
GSList *unresolved;
|
GSList *unresolved;
|
||||||
|
gint next_id;
|
||||||
GHashTable *id_index;
|
GHashTable *id_index;
|
||||||
|
|
||||||
GstIndexEntry *ret_entry; // hack to avoid leaking memory
|
GstIndexEntry *ret_entry; // hack to avoid leaking memory
|
||||||
|
@ -239,14 +240,18 @@ gst_file_index_get_writer_id (GstIndex *_index,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//g_warning ("resolve %d %s", *id, writer_string);
|
ii->id = *id = ++index->next_id;
|
||||||
ii->id = *id;
|
g_hash_table_insert (index->id_index, &ii->id, ii);
|
||||||
g_hash_table_insert (index->id_index, id, ii);
|
|
||||||
match = TRUE;
|
match = TRUE;
|
||||||
|
|
||||||
|
//g_warning ("resolve %d %s", *id, writer_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_slist_free (pending);
|
g_slist_free (pending);
|
||||||
|
|
||||||
|
if (!match)
|
||||||
|
g_warning ("Can't resolve writer '%s'", writer_string);
|
||||||
|
|
||||||
return match;
|
return match;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -548,7 +553,7 @@ gst_file_index_add_id (GstIndex *index, GstIndexEntry *entry)
|
||||||
// It would be useful to know the GType of the writer so
|
// It would be useful to know the GType of the writer so
|
||||||
// we can try to cope with changes in the id_desc path.
|
// 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 @@ gst_file_index_add_association (GstIndex *index, GstIndexEntry *entry)
|
||||||
gint mx;
|
gint mx;
|
||||||
GstIndexAssociation sample;
|
GstIndexAssociation sample;
|
||||||
gboolean exact;
|
gboolean exact;
|
||||||
gint fx;
|
|
||||||
|
|
||||||
id_index = g_hash_table_lookup (fileindex->id_index, &entry->id);
|
id_index = g_hash_table_lookup (fileindex->id_index, &entry->id);
|
||||||
if (!id_index)
|
if (!id_index)
|
||||||
|
@ -691,15 +695,14 @@ gst_file_index_add_association (GstIndex *index, GstIndexEntry *entry)
|
||||||
|
|
||||||
if (exact) {
|
if (exact) {
|
||||||
// maybe overwrite instead?
|
// maybe overwrite instead?
|
||||||
g_warning ("ignoring duplicate index association at %lld",
|
// g_warning ("Ignoring duplicate index association at %lld",
|
||||||
GST_INDEX_ASSOC_VALUE (entry, 0));
|
// GST_INDEX_ASSOC_VALUE (entry, 0));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// should verify that all formats are ordered XXX
|
|
||||||
|
|
||||||
{
|
{
|
||||||
gchar row_data[ARRAY_ROW_SIZE (id_index)];
|
gchar row_data[ARRAY_ROW_SIZE (id_index)];
|
||||||
|
gint fx;
|
||||||
|
|
||||||
gint32 flags_host = GST_INDEX_ASSOC_FLAGS (entry);
|
gint32 flags_host = GST_INDEX_ASSOC_FLAGS (entry);
|
||||||
ARRAY_ROW_FLAGS (row_data) = GINT32_TO_BE (flags_host);
|
ARRAY_ROW_FLAGS (row_data) = GINT32_TO_BE (flags_host);
|
||||||
|
@ -709,7 +712,7 @@ gst_file_index_add_association (GstIndex *index, GstIndexEntry *entry)
|
||||||
ARRAY_ROW_VALUE (row_data, fx) = GINT64_TO_BE (val_host);
|
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 @@ gst_file_index_get_assoc_entry (GstIndex *index,
|
||||||
if (!fileindex->ret_entry)
|
if (!fileindex->ret_entry)
|
||||||
fileindex->ret_entry = g_new0 (GstIndexEntry, 1);
|
fileindex->ret_entry = g_new0 (GstIndexEntry, 1);
|
||||||
entry = fileindex->ret_entry;
|
entry = fileindex->ret_entry;
|
||||||
if (entry->data.assoc.assocs)
|
if (entry->data.assoc.assocs) {
|
||||||
g_free (entry->data.assoc.assocs);
|
g_free (entry->data.assoc.assocs);
|
||||||
|
entry->data.assoc.assocs = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
entry->type = GST_INDEX_ENTRY_ASSOCIATION;
|
entry->type = GST_INDEX_ENTRY_ASSOCIATION;
|
||||||
|
|
||||||
|
|
|
@ -96,6 +96,7 @@ struct _GstFileIndex {
|
||||||
gchar *location;
|
gchar *location;
|
||||||
gboolean is_loaded;
|
gboolean is_loaded;
|
||||||
GSList *unresolved;
|
GSList *unresolved;
|
||||||
|
gint next_id;
|
||||||
GHashTable *id_index;
|
GHashTable *id_index;
|
||||||
|
|
||||||
GstIndexEntry *ret_entry; // hack to avoid leaking memory
|
GstIndexEntry *ret_entry; // hack to avoid leaking memory
|
||||||
|
@ -239,14 +240,18 @@ gst_file_index_get_writer_id (GstIndex *_index,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//g_warning ("resolve %d %s", *id, writer_string);
|
ii->id = *id = ++index->next_id;
|
||||||
ii->id = *id;
|
g_hash_table_insert (index->id_index, &ii->id, ii);
|
||||||
g_hash_table_insert (index->id_index, id, ii);
|
|
||||||
match = TRUE;
|
match = TRUE;
|
||||||
|
|
||||||
|
//g_warning ("resolve %d %s", *id, writer_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_slist_free (pending);
|
g_slist_free (pending);
|
||||||
|
|
||||||
|
if (!match)
|
||||||
|
g_warning ("Can't resolve writer '%s'", writer_string);
|
||||||
|
|
||||||
return match;
|
return match;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -548,7 +553,7 @@ gst_file_index_add_id (GstIndex *index, GstIndexEntry *entry)
|
||||||
// It would be useful to know the GType of the writer so
|
// It would be useful to know the GType of the writer so
|
||||||
// we can try to cope with changes in the id_desc path.
|
// 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 @@ gst_file_index_add_association (GstIndex *index, GstIndexEntry *entry)
|
||||||
gint mx;
|
gint mx;
|
||||||
GstIndexAssociation sample;
|
GstIndexAssociation sample;
|
||||||
gboolean exact;
|
gboolean exact;
|
||||||
gint fx;
|
|
||||||
|
|
||||||
id_index = g_hash_table_lookup (fileindex->id_index, &entry->id);
|
id_index = g_hash_table_lookup (fileindex->id_index, &entry->id);
|
||||||
if (!id_index)
|
if (!id_index)
|
||||||
|
@ -691,15 +695,14 @@ gst_file_index_add_association (GstIndex *index, GstIndexEntry *entry)
|
||||||
|
|
||||||
if (exact) {
|
if (exact) {
|
||||||
// maybe overwrite instead?
|
// maybe overwrite instead?
|
||||||
g_warning ("ignoring duplicate index association at %lld",
|
// g_warning ("Ignoring duplicate index association at %lld",
|
||||||
GST_INDEX_ASSOC_VALUE (entry, 0));
|
// GST_INDEX_ASSOC_VALUE (entry, 0));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// should verify that all formats are ordered XXX
|
|
||||||
|
|
||||||
{
|
{
|
||||||
gchar row_data[ARRAY_ROW_SIZE (id_index)];
|
gchar row_data[ARRAY_ROW_SIZE (id_index)];
|
||||||
|
gint fx;
|
||||||
|
|
||||||
gint32 flags_host = GST_INDEX_ASSOC_FLAGS (entry);
|
gint32 flags_host = GST_INDEX_ASSOC_FLAGS (entry);
|
||||||
ARRAY_ROW_FLAGS (row_data) = GINT32_TO_BE (flags_host);
|
ARRAY_ROW_FLAGS (row_data) = GINT32_TO_BE (flags_host);
|
||||||
|
@ -709,7 +712,7 @@ gst_file_index_add_association (GstIndex *index, GstIndexEntry *entry)
|
||||||
ARRAY_ROW_VALUE (row_data, fx) = GINT64_TO_BE (val_host);
|
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 @@ gst_file_index_get_assoc_entry (GstIndex *index,
|
||||||
if (!fileindex->ret_entry)
|
if (!fileindex->ret_entry)
|
||||||
fileindex->ret_entry = g_new0 (GstIndexEntry, 1);
|
fileindex->ret_entry = g_new0 (GstIndexEntry, 1);
|
||||||
entry = fileindex->ret_entry;
|
entry = fileindex->ret_entry;
|
||||||
if (entry->data.assoc.assocs)
|
if (entry->data.assoc.assocs) {
|
||||||
g_free (entry->data.assoc.assocs);
|
g_free (entry->data.assoc.assocs);
|
||||||
|
entry->data.assoc.assocs = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
entry->type = GST_INDEX_ENTRY_ASSOCIATION;
|
entry->type = GST_INDEX_ENTRY_ASSOCIATION;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue