From b4016cefa26fbb31655aaa431ba28368fe9e8da0 Mon Sep 17 00:00:00 2001 From: Austin Yuan Date: Wed, 31 Mar 2010 14:34:12 +0800 Subject: [PATCH] fix build issue Signed-off-by: Austin Yuan --- va/x11/va_x11.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/va/x11/va_x11.c b/va/x11/va_x11.c index 491f7c3..ab6bf68 100644 --- a/va/x11/va_x11.c +++ b/va/x11/va_x11.c @@ -216,6 +216,15 @@ VADisplay vaGetDisplay ( return dpy; } +#define CTX(dpy) (((VADisplayContextP)dpy)->pDriverContext) +#define CHECK_DISPLAY(dpy) if( !vaDisplayIsValid(dpy) ) { return VA_STATUS_ERROR_INVALID_DISPLAY; } + +static int vaDisplayIsValid(VADisplay dpy) +{ + VADisplayContextP pDisplayContext = (VADisplayContextP)dpy; + return pDisplayContext && (pDisplayContext->vadpy_magic == VA_DISPLAY_MAGIC) && pDisplayContext->vaIsValid(pDisplayContext); +} + VAStatus vaPutSurface ( VADisplay dpy, VASurfaceID surface, @@ -234,6 +243,7 @@ VAStatus vaPutSurface ( ) { VADriverContextP ctx; + CHECK_DISPLAY(dpy); ctx = CTX(dpy); -- 2.7.4