summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-06-01 17:26:11 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-06-01 20:03:43 -0700
commitedfb6fc397686c1892603d0f86a9aadf14dbc12e (patch)
treefd51c05c0580ab769d0925264d2bf19591d94bd0
parent179ed259e75a62e74532e36f52f3838deb2aac92 (diff)
XvQueryPortAttributes: add a comment explaining memory strategy
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/Xv.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Xv.c b/src/Xv.c
index f268f8e..15c0bfd 100644
--- a/src/Xv.c
+++ b/src/Xv.c
@@ -850,6 +850,17 @@ XvQueryPortAttributes(Display *dpy, XvPortID port, int *num)
return ret;
}
+ /*
+ * X server sends data packed as:
+ * attribute1, name1, attribute2, name2, ...
+ * We allocate a single buffer large enough to hold them all and
+ * then de-interleave the data so we return it to clients as:
+ * attribute1, attribute2, ..., name1, name2, ...
+ * so that clients may refer to attributes as a simple array of
+ * structs: attributes[0], attributes[1], ...
+ * and free it as a single/simple buffer.
+ */
+
if(rep.num_attributes) {
unsigned long size;
/* limit each part to no more than one half the max size */