summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-01-29 23:39:26 +0100
committerSebastian Dröge <sebastian@centricular.com>2016-01-29 23:39:26 +0100
commit129b04fad01452e18bab8b9f82e084768e88cc16 (patch)
tree3ad28ccbd0489e6c1cce0fe5d0466e4dc157b59d /gst
parent4321fd94a1c16591be14eccdd7eb8034a9a69027 (diff)
downloadgstreamer-plugins-bad-129b04fad01452e18bab8b9f82e084768e88cc16.tar.gz
mxftypes: Generate UUIDs according to RFC4122 version 4 (aka random)
Instead of fully random UUIDs, these should follow a scheme.
Diffstat (limited to 'gst')
-rw-r--r--gst/mxf/mxftypes.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gst/mxf/mxftypes.c b/gst/mxf/mxftypes.c
index a2af02e08..14e236292 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)));
}