[PATCH videoproto] Xvproto: fix xvEncodingInfo to match actual wire protocol

Alan Coopersmith alan.coopersmith at oracle.com
Tue Jun 11 21:57:48 PDT 2013


On 06/ 9/13 10:00 AM, Julien Cristau wrote:
> The padding is *before* the rate field, so the rate is placed on a 32bit
> boundary.  This change adds explicit padding between height and rate,
> and removes extraneous padding after the rate field, which the server
> never sent and xlib never read.
>
> This changes sizeof(xvEncodingInfo).  Hopefully that's not a big deal as
> clients only see the Xlib structure XvEncodingInfo.
>
> Debian bug#657215
>
> Reported-by: Kevin Ryde <user42 at zip.com.au>
> Signed-off-by: Julien Cristau <jcristau at debian.org>

This looked reasonable to me, but just to be sure, I threw together the
attached test program and confirmed it doesn't change where in the
struct the rate data appears, due to the compiler silently inserting
padding to reach 32-bit alignment.

In both 32-bit & 64-bit, on both SPARC & x86, all 4 returned:

                  OLD  NEW
offsetof(rate):   12  12
offsetof(pad):    20  10
sizeof(struct):   24  20

which matches my expectations, so:

Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 961 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20130611/a3a9f249/attachment.c>


More information about the xorg-devel mailing list