From: Sebastian Dröge Date: Fri, 29 Jan 2016 22:39:26 +0000 (+0100) Subject: mxftypes: Generate UUIDs according to RFC4122 version 4 (aka random) X-Git-Tag: 1.19.3~507^2~7149 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=129b04fad01452e18bab8b9f82e084768e88cc16;p=platform%2Fupstream%2Fgstreamer.git mxftypes: Generate UUIDs according to RFC4122 version 4 (aka random) Instead of fully random UUIDs, these should follow a scheme. --- diff --git a/gst/mxf/mxftypes.c b/gst/mxf/mxftypes.c index a2af02e..14e2362 100644 --- a/gst/mxf/mxftypes.c +++ b/gst/mxf/mxftypes.c @@ -216,7 +216,8 @@ mxf_uuid_init (MXFUUID * uuid, GHashTable * hashtable) do { for (i = 0; i < 4; i++) GST_WRITE_UINT32_BE (&uuid->u[i * 4], g_random_int ()); - + uuid->u[6] = 0x40 | (uuid->u[6] & 0x0f); + uuid->u[8] = (uuid->u[8] & 0xbf) | 0x80; } while (hashtable && (mxf_uuid_is_zero (uuid) || g_hash_table_lookup_extended (hashtable, uuid, NULL, NULL))); }