diff --git a/Xext/xvdix.h b/Xext/xvdix.h index 44f8f6b..c4f1dec 100644 --- a/Xext/xvdix.h +++ b/Xext/xvdix.h @@ -146,7 +146,7 @@ typedef struct { typedef struct { unsigned long base_id; - unsigned char type; + unsigned int type; char *name; int nEncodings; XvEncodingPtr pEncodings; diff --git a/Xext/xvmain.c b/Xext/xvmain.c index 05a6890..711aee4 100644 --- a/Xext/xvmain.c +++ b/Xext/xvmain.c @@ -1113,6 +1113,10 @@ XvdiMatchPort( if (pa->pScreen != pDraw->pScreen) return BadMatch; + if (!((pDraw->type == DRAWABLE_PIXMAP && pa->type & XvPixmapMask) || + (pDraw->type == DRAWABLE_WINDOW && pa->type & XvWindowMask))) + return BadMatch; + nf = pa->nFormats; pf = pa->pFormats; diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c index bdcc4fc..270c78a 100644 --- a/hw/xfree86/common/xf86xv.c +++ b/hw/xfree86/common/xf86xv.c @@ -1359,12 +1359,6 @@ xf86XVPutVideo( XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr); int result; - /* No dumping video to pixmaps... For now anyhow */ - if(pDraw->type != DRAWABLE_WINDOW) { - pPort->pDraw = (DrawablePtr)NULL; - return BadAlloc; - } - /* If we are changing windows, unregister our port in the old window */ if(portPriv->pDraw && (portPriv->pDraw != pDraw)) xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv); @@ -1411,9 +1405,6 @@ xf86XVPutStill( int ret = Success; Bool clippedAway = FALSE; - if (pDraw->type != DRAWABLE_WINDOW) - return BadAlloc; - if(!portPriv->pScrn->vtSema) return Success; /* Success ? */ pScreen = pDraw->pScreen; @@ -1511,12 +1502,6 @@ xf86XVGetVideo( XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr); int result; - /* No pixmaps... For now anyhow */ - if(pDraw->type != DRAWABLE_WINDOW) { - pPort->pDraw = (DrawablePtr)NULL; - return BadAlloc; - } - /* If we are changing windows, unregister our port in the old window */ if(portPriv->pDraw && (portPriv->pDraw != pDraw)) xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv); @@ -1563,9 +1548,6 @@ xf86XVGetStill( int ret = Success; Bool clippedAway = FALSE; - if (pDraw->type != DRAWABLE_WINDOW) - return BadAlloc; - if(!portPriv->pScrn->vtSema) return Success; /* Success ? */ pScreen = pDraw->pScreen; @@ -1622,9 +1604,6 @@ xf86XVStopVideo( ){ XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr); - if(pDraw->type != DRAWABLE_WINDOW) - return BadAlloc; - xf86XVRemovePortFromWindow((WindowPtr)pDraw, portPriv); if(!portPriv->pScrn->vtSema) return Success; /* Success ? */ @@ -1711,9 +1690,6 @@ xf86XVPutImage( int ret = Success; Bool clippedAway = FALSE; - if (pDraw->type != DRAWABLE_WINDOW) - return BadAlloc; - if(!portPriv->pScrn->vtSema) return Success; /* Success ? */ pScreen = pDraw->pScreen;