diff options
author | Joshua N. Pritikin <vishnu@pobox.com> | 2003-08-15 13:39:14 +0000 |
---|---|---|
committer | Joshua N. Pritikin <vishnu@pobox.com> | 2003-08-15 13:39:14 +0000 |
commit | 46eb739952ab025cb8226e8661f7addbbf3ae523 (patch) | |
tree | e77a9be68f99ea881acf95d78b8bdaa142fce6f7 /plugins/indexers/gstfileindex.c | |
parent | 1a661b320480c0b44bb85780ff0067beac7d0e84 (diff) |
Add my name to the copywrite (since I wrote most of this file).
Original commit message from CVS:
Add my name to the copywrite (since I wrote most of this file).
Don't fail if get_writer_id is called more than once for the same writer.
Rename debug category according to accepted norms.
Diffstat (limited to 'plugins/indexers/gstfileindex.c')
-rw-r--r-- | plugins/indexers/gstfileindex.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/plugins/indexers/gstfileindex.c b/plugins/indexers/gstfileindex.c index 703342f00..3806aa700 100644 --- a/plugins/indexers/gstfileindex.c +++ b/plugins/indexers/gstfileindex.c @@ -1,5 +1,6 @@ /* GStreamer * Copyright (C) 2003 Erik Walthinsen <omega@cse.ogi.edu> + * 2003 Joshua N Pritikin <jpritikin@pobox.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -253,6 +254,20 @@ gst_file_index_dispose (GObject *object) G_OBJECT_CLASS (parent_class)->dispose (object); } +struct fi_find_writer_context { + const gchar *writer_string; + GstFileIndexId *ii; +}; + +void +_fi_find_writer (gpointer key, gpointer val, gpointer data) +{ + struct fi_find_writer_context *cx = data; + GstFileIndexId *ii = val; + if (strcmp (ii->id_desc, cx->writer_string) == 0) + cx->ii = ii; +} + static gboolean gst_file_index_get_writer_id (GstIndex *_index, gint *id, gchar *writer_string) @@ -290,9 +305,21 @@ gst_file_index_get_writer_id (GstIndex *_index, g_slist_free (pending); - if (!match) - GST_CAT_WARNING_OBJECT (DC, index, "Can't resolve writer '%s'", + if (!match) { + struct fi_find_writer_context cx; + cx.writer_string = writer_string; + cx.ii = NULL; + g_hash_table_foreach (index->id_index, _fi_find_writer, &cx); + + if (cx.ii) { + match = TRUE; + GST_CAT_DEBUG_OBJECT (DC, index, "Resolved writer '%s' again", writer_string); + } + else + GST_CAT_WARNING_OBJECT (DC, index, "Can't resolve writer '%s'", + writer_string); + } return match; } @@ -970,7 +997,7 @@ gst_file_index_plugin_init (GModule *module, GstPlugin *plugin) { GstIndexFactory *factory; - GST_DEBUG_CATEGORY_INIT(DC, "fileindex", 0, NULL); + GST_DEBUG_CATEGORY_INIT(DC, "GST_FILEINDEX", 0, NULL); gst_plugin_set_longname (plugin, "A file index"); factory = gst_index_factory_new ("fileindex", |