diff options
author | Zaheer Merali <zaheerabbas@merali.org> | 2009-03-16 17:29:16 +0000 |
---|---|---|
committer | Zaheer Merali <zaheerabbas@merali.org> | 2009-03-16 17:33:45 +0000 |
commit | 43117a8d8699ca1b6522d473e7996978c36b7de7 (patch) | |
tree | 7dcee372376dccea835a2cf8f77fa44cb36129d6 | |
parent | 1f7d3aa35d50a9056b08c3107a606ee2648e701d (diff) | |
download | gst-plugins-bad-43117a8d8699ca1b6522d473e7996978c36b7de7.tar.gz gst-plugins-bad-43117a8d8699ca1b6522d473e7996978c36b7de7.tar.bz2 gst-plugins-bad-43117a8d8699ca1b6522d473e7996978c36b7de7.zip |
mxf: Replace g_hash_table_get_values with code working with glib 2.6.
Fixes #575565
-rw-r--r-- | gst/mxf/mxfdemux.c | 15 | ||||
-rw-r--r-- | gst/mxf/mxfmetadata.c | 25 |
2 files changed, 27 insertions, 13 deletions
diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c index 902d89ed..cd3ed8ad 100644 --- a/gst/mxf/mxfdemux.c +++ b/gst/mxf/mxfdemux.c @@ -489,6 +489,15 @@ gst_mxf_demux_handle_primer_pack (GstMXFDemux * demux, const MXFUL * key, return GST_FLOW_OK; } +#if !GLIB_CHECK_VERSION (2, 16, 0) +static void +set_resolve_state_none (gpointer key, gpointer value, gpointer user_data) +{ + MXFMetadataBase *m = (MXFMetadataBase *) value; + m->resolved = MXF_METADATA_BASE_RESOLVE_STATE_NONE; +} +#endif + static GstFlowReturn gst_mxf_demux_resolve_references (GstMXFDemux * demux) { @@ -515,11 +524,7 @@ gst_mxf_demux_resolve_references (GstMXFDemux * demux) m->resolved = MXF_METADATA_BASE_RESOLVE_STATE_NONE; } #else - values = g_hash_table_get_values (demux->metadata); - for (l = values; l; l = l->next) { - m = l->data; - m->resolved = MXF_METADATA_BASE_RESOLVE_STATE_NONE; - } + g_hash_table_foreach (demux->metadata, set_resolve_state_none, NULL); #endif #if GLIB_CHECK_VERSION (2, 16, 0) diff --git a/gst/mxf/mxfmetadata.c b/gst/mxf/mxfmetadata.c index 7e724ae0..3fa52f81 100644 --- a/gst/mxf/mxfmetadata.c +++ b/gst/mxf/mxfmetadata.c @@ -62,6 +62,14 @@ mxf_metadata_base_resolve_default (MXFMetadataBase * self, return TRUE; } +#if !GLIB_CHECK_VERSION (2, 16, 0) +static void +build_values_in_hash_table (gpointer key, gpointer value, GList ** valuelist) +{ + *valuelist = g_list_prepend (*valuelist, value); +} +#endif + static GstStructure * mxf_metadata_base_to_structure_default (MXFMetadataBase * self) { @@ -96,9 +104,10 @@ mxf_metadata_base_to_structure_default (MXFMetadataBase * self) g_hash_table_iter_init (&iter, self->other_tags); #else - GList *l, *values; + GList *l, *values = NULL; - values = g_hash_table_get_values (self->other_tags); + g_hash_table_foreach (self->other_tags, build_values_in_hash_table, + &values); #endif g_value_init (&va, GST_TYPE_ARRAY); @@ -1227,9 +1236,9 @@ mxf_metadata_essence_container_data_resolve (MXFMetadataBase * m, g_hash_table_iter_init (&iter, metadata); #else - GList *l, *values; + GList *l, *values = NULL; - values = g_hash_table_get_values (metadata); + g_hash_table_foreach (metadata, build_values_in_hash_table, &values); #endif #if GLIB_CHECK_VERSION (2, 16, 0) @@ -2586,9 +2595,9 @@ mxf_metadata_source_clip_resolve (MXFMetadataBase * m, GHashTable * metadata) g_hash_table_iter_init (&iter, metadata); #else - GList *l, *values; + GList *l, *values = NULL; - values = g_hash_table_get_values (metadata); + g_hash_table_foreach (metadata, build_values_in_hash_table, &values); #endif #if GLIB_CHECK_VERSION (2, 16, 0) @@ -3457,8 +3466,8 @@ mxf_metadata_generic_picture_essence_descriptor_to_structure (MXFMetadataBase * { GstStructure *ret = MXF_METADATA_BASE_CLASS - (mxf_metadata_generic_picture_essence_descriptor_parent_class)->to_structure - (m); + (mxf_metadata_generic_picture_essence_descriptor_parent_class)-> + to_structure (m); MXFMetadataGenericPictureEssenceDescriptor *self = MXF_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR (m); gchar str[48]; |