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:
parent
4d368c6be4
commit
d61de13690
15
Xext/xvmc.c
15
Xext/xvmc.c
|
@ -5,6 +5,7 @@
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include <X11/Xproto.h>
|
#include <X11/Xproto.h>
|
||||||
|
|
||||||
|
#include "dix/screen_hooks_priv.h"
|
||||||
#include "Xext/xvdix_priv.h"
|
#include "Xext/xvdix_priv.h"
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
@ -48,7 +49,6 @@ static RESTYPE XvMCRTSubpicture;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int num_adaptors;
|
int num_adaptors;
|
||||||
XvMCAdaptorPtr adaptors;
|
XvMCAdaptorPtr adaptors;
|
||||||
CloseScreenProcPtr CloseScreen;
|
|
||||||
char clientDriverName[DR_CLIENT_DRIVER_NAME_SIZE];
|
char clientDriverName[DR_CLIENT_DRIVER_NAME_SIZE];
|
||||||
char busID[DR_BUSID_SIZE];
|
char busID[DR_BUSID_SIZE];
|
||||||
int major;
|
int major;
|
||||||
|
@ -733,16 +733,12 @@ XvMCExtensionInit(void)
|
||||||
extEntry->errorBase + XvMCBadSubpicture);
|
extEntry->errorBase + XvMCBadSubpicture);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static void XvMCScreenClose(CallbackListPtr *pcbl, ScreenPtr pScreen, void *unused)
|
||||||
XvMCCloseScreen(ScreenPtr pScreen)
|
|
||||||
{
|
{
|
||||||
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pScreen);
|
XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pScreen);
|
||||||
|
|
||||||
pScreen->CloseScreen = pScreenPriv->CloseScreen;
|
|
||||||
|
|
||||||
free(pScreenPriv);
|
free(pScreenPriv);
|
||||||
|
dixSetPrivate(&pScreen->devPrivates, XvMCScreenKey, NULL);
|
||||||
return (*pScreen->CloseScreen) (pScreen);
|
dixScreenUnhookClose(pScreen, XvMCScreenClose);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -758,8 +754,7 @@ XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt)
|
||||||
|
|
||||||
dixSetPrivate(&pScreen->devPrivates, XvMCScreenKey, pScreenPriv);
|
dixSetPrivate(&pScreen->devPrivates, XvMCScreenKey, pScreenPriv);
|
||||||
|
|
||||||
pScreenPriv->CloseScreen = pScreen->CloseScreen;
|
dixScreenHookClose(pScreen, XvMCScreenClose);
|
||||||
pScreen->CloseScreen = XvMCCloseScreen;
|
|
||||||
|
|
||||||
pScreenPriv->num_adaptors = num;
|
pScreenPriv->num_adaptors = num;
|
||||||
pScreenPriv->adaptors = pAdapt;
|
pScreenPriv->adaptors = pAdapt;
|
||||||
|
|
Loading…
Reference in New Issue