diff options
author | Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com> | 2009-04-27 20:15:07 +0200 |
---|---|---|
committer | Jan Schmidt <thaytan@noraisin.net> | 2009-06-20 15:21:32 +0100 |
commit | a94f5fe520260991206850f13bc4df578ccbbc97 (patch) | |
tree | 3f06e94ca5fc21a1ba1afd7965906c833de1cadd /sys | |
parent | 2eb479f825c3d1f02f9b91cc3f1964945be5d647 (diff) | |
download | gst-plugins-bad-a94f5fe520260991206850f13bc4df578ccbbc97.tar.gz gst-plugins-bad-a94f5fe520260991206850f13bc4df578ccbbc97.tar.bz2 gst-plugins-bad-a94f5fe520260991206850f13bc4df578ccbbc97.zip |
vdpau: use g_once_init_enter instead of g_once
Diffstat (limited to 'sys')
-rw-r--r-- | sys/vdpau/gstvdpdevice.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/vdpau/gstvdpdevice.c b/sys/vdpau/gstvdpdevice.c index 1dc42d68..d7a074a7 100644 --- a/sys/vdpau/gstvdpdevice.c +++ b/sys/vdpau/gstvdpdevice.c @@ -53,7 +53,6 @@ gst_vdp_device_finalize (GObject * object) g_free (device->display_name); G_OBJECT_CLASS (gst_vdp_device_parent_class)->finalize (object); - } static void @@ -234,21 +233,18 @@ device_destroyed_cb (gpointer data, GObject * object) } } -static gpointer -create_devices_hash (gpointer data) -{ - return g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); -} - GstVdpDevice * gst_vdp_get_device (const gchar * display_name) { - static GOnce my_once = G_ONCE_INIT; - GHashTable *devices_hash; + static gsize once = 0; + static GHashTable *devices_hash; GstVdpDevice *device; - g_once (&my_once, create_devices_hash, NULL); - devices_hash = my_once.retval; + if (g_once_init_enter (&once)) { + devices_hash = + g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + g_once_init_leave (&once, 1); + } if (display_name) device = g_hash_table_lookup (devices_hash, display_name); |