diff options
author | marha <marha@users.sourceforge.net> | 2010-06-11 14:16:16 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-06-11 14:16:16 +0000 |
commit | d1e4f4b8546c7955c66dd023bfd6ef437db9d21d (patch) | |
tree | 529985e77bfc95aa95fe5b540e8f42b0ef041206 /xorg-server/Xext/xvmc.c | |
parent | 13919cf85a6ca41d97238de13344aba59e0f7680 (diff) | |
parent | 4c61bf84b11e26e6f22648668c95ea760a379163 (diff) | |
download | vcxsrv-d1e4f4b8546c7955c66dd023bfd6ef437db9d21d.tar.gz vcxsrv-d1e4f4b8546c7955c66dd023bfd6ef437db9d21d.tar.bz2 vcxsrv-d1e4f4b8546c7955c66dd023bfd6ef437db9d21d.zip |
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/Xext/xvmc.c')
-rw-r--r-- | xorg-server/Xext/xvmc.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/xorg-server/Xext/xvmc.c b/xorg-server/Xext/xvmc.c index 4866d1d45..9b9dd0bc2 100644 --- a/xorg-server/Xext/xvmc.c +++ b/xorg-server/Xext/xvmc.c @@ -33,8 +33,9 @@ #define DR_CLIENT_DRIVER_NAME_SIZE 48
#define DR_BUSID_SIZE 48
-static int XvMCScreenKeyIndex;
-static DevPrivateKey XvMCScreenKey;
+static DevPrivateKeyRec XvMCScreenKeyRec;
+#define XvMCScreenKey (&XvMCScreenKeyRec)
+static Bool XvMCInUse;
unsigned long XvMCGeneration = 0;
@@ -138,7 +139,7 @@ ProcXvMCListSurfaceTypes(ClientPtr client) VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
- if(XvMCScreenKey) { /* any adaptors at all */
+ if(XvMCInUse) { /* any adaptors at all */
ScreenPtr pScreen = pPort->pAdaptor->pScreen;
if((pScreenPriv = XVMC_GET_PRIVATE(pScreen))) { /* any this screen */
for(i = 0; i < pScreenPriv->num_adaptors; i++) {
@@ -193,7 +194,7 @@ ProcXvMCCreateContext(ClientPtr client) pScreen = pPort->pAdaptor->pScreen;
- if(XvMCScreenKey == NULL) /* no XvMC adaptors */
+ if(!XvMCInUse) /* no XvMC adaptors */
return BadMatch;
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen))) /* none this screen */
@@ -258,8 +259,7 @@ ProcXvMCCreateContext(ClientPtr client) WriteToClient(client, dwords << 2, (char*)data);
AddResource(pContext->context_id, XvMCRTContext, pContext);
- if(data)
- free(data);
+ free(data);
return Success;
}
@@ -326,8 +326,7 @@ ProcXvMCCreateSurface(ClientPtr client) WriteToClient(client, dwords << 2, (char*)data);
AddResource(pSurface->surface_id, XvMCRTSurface, pSurface);
- if(data)
- free(data);
+ free(data);
pContext->refcnt++;
@@ -443,8 +442,7 @@ ProcXvMCCreateSubpicture(ClientPtr client) WriteToClient(client, dwords << 2, (char*)data);
AddResource(pSubpicture->subpicture_id, XvMCRTSubpicture, pSubpicture);
- if(data)
- free(data);
+ free(data);
pContext->refcnt++;
@@ -716,7 +714,8 @@ XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt) {
XvMCScreenPtr pScreenPriv;
- XvMCScreenKey = &XvMCScreenKeyIndex;
+ if (!dixRegisterPrivateKey(&XvMCScreenKeyRec, PRIVATE_SCREEN, 0))
+ return BadAlloc;
if(!(pScreenPriv = malloc(sizeof(XvMCScreenRec))))
return BadAlloc;
@@ -734,6 +733,8 @@ XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt) pScreenPriv->minor = 0;
pScreenPriv->patchLevel = 0;
+ XvMCInUse = TRUE;
+
return Success;
}
|