mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-27 20:58:52 +00:00
(!1714) xvmc: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so use the new screen close notify hook instead. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
14
Xext/xvmc.c
14
Xext/xvmc.c
@@ -48,7 +48,6 @@ static RESTYPE XvMCRTSubpicture;
|
||||
typedef struct {
|
||||
int num_adaptors;
|
||||
XvMCAdaptorPtr adaptors;
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
char clientDriverName[DR_CLIENT_DRIVER_NAME_SIZE];
|
||||
char busID[DR_BUSID_SIZE];
|
||||
int major;
|
||||
@@ -733,16 +732,12 @@ XvMCExtensionInit(void)
|
||||
extEntry->errorBase + XvMCBadSubpicture);
|
||||
}
|
||||
|
||||
static Bool
|
||||
XvMCCloseScreen(ScreenPtr pScreen)
|
||||
static void XvMCScreenClose(ScreenPtr pScreen, void *arg)
|
||||
{
|
||||
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pScreen);
|
||||
|
||||
pScreen->CloseScreen = pScreenPriv->CloseScreen;
|
||||
|
||||
free(pScreenPriv);
|
||||
|
||||
return (*pScreen->CloseScreen) (pScreen);
|
||||
dixSetPrivate(&pScreen->devPrivates, XvMCScreenKey, NULL);
|
||||
dixScreenUnhookClose(pScreen, XvMCScreenClose, NULL);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -758,8 +753,7 @@ XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt)
|
||||
|
||||
dixSetPrivate(&pScreen->devPrivates, XvMCScreenKey, pScreenPriv);
|
||||
|
||||
pScreenPriv->CloseScreen = pScreen->CloseScreen;
|
||||
pScreen->CloseScreen = XvMCCloseScreen;
|
||||
dixScreenHookClose(pScreen, XvMCScreenClose, NULL);
|
||||
|
||||
pScreenPriv->num_adaptors = num;
|
||||
pScreenPriv->adaptors = pAdapt;
|
||||
|
||||
Reference in New Issue
Block a user