mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 07:16:55 +00:00
mxftypes: Generate UUIDs according to RFC4122 version 4 (aka random)
Instead of fully random UUIDs, these should follow a scheme.
This commit is contained in:
parent
4321fd94a1
commit
129b04fad0
1 changed files with 2 additions and 1 deletions
|
@ -216,7 +216,8 @@ mxf_uuid_init (MXFUUID * uuid, GHashTable * hashtable)
|
||||||
do {
|
do {
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
GST_WRITE_UINT32_BE (&uuid->u[i * 4], g_random_int ());
|
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) ||
|
} while (hashtable && (mxf_uuid_is_zero (uuid) ||
|
||||||
g_hash_table_lookup_extended (hashtable, uuid, NULL, NULL)));
|
g_hash_table_lookup_extended (hashtable, uuid, NULL, NULL)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue