Consolidate portPriv->pDraw assignments into xf86XVEnlistPortInWindow.
This avoids a crash in xf86XVReputVideo and also cleans up the code slightly.
This commit is contained in:
@@ -979,6 +979,9 @@ xf86XVEnlistPortInWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv)
|
|||||||
winPriv->next = PrivRoot;
|
winPriv->next = PrivRoot;
|
||||||
pWin->devPrivates[XF86XVWindowIndex].ptr = (pointer)winPriv;
|
pWin->devPrivates[XF86XVWindowIndex].ptr = (pointer)winPriv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
portPriv->pDraw = (DrawablePtr)pWin;
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1375,7 +1378,6 @@ xf86XVPutVideo(
|
|||||||
result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
|
result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
|
||||||
if(result != Success) return result;
|
if(result != Success) return result;
|
||||||
|
|
||||||
portPriv->pDraw = pDraw;
|
|
||||||
portPriv->type = XvInputMask;
|
portPriv->type = XvInputMask;
|
||||||
|
|
||||||
/* save a copy of these parameters */
|
/* save a copy of these parameters */
|
||||||
@@ -1479,7 +1481,6 @@ xf86XVPutStill(
|
|||||||
|
|
||||||
xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
|
xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
|
||||||
portPriv->isOn = XV_ON;
|
portPriv->isOn = XV_ON;
|
||||||
portPriv->pDraw = pDraw;
|
|
||||||
portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
|
portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
|
||||||
portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
|
portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
|
||||||
portPriv->type = 0; /* no mask means it's transient and should
|
portPriv->type = 0; /* no mask means it's transient and should
|
||||||
@@ -1529,7 +1530,6 @@ xf86XVGetVideo(
|
|||||||
result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
|
result = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
|
||||||
if(result != Success) return result;
|
if(result != Success) return result;
|
||||||
|
|
||||||
portPriv->pDraw = pDraw;
|
|
||||||
portPriv->type = XvOutputMask;
|
portPriv->type = XvOutputMask;
|
||||||
|
|
||||||
/* save a copy of these parameters */
|
/* save a copy of these parameters */
|
||||||
@@ -1784,7 +1784,6 @@ xf86XVPutImage(
|
|||||||
(portPriv->AdaptorRec->flags & VIDEO_OVERLAID_IMAGES)) {
|
(portPriv->AdaptorRec->flags & VIDEO_OVERLAID_IMAGES)) {
|
||||||
|
|
||||||
portPriv->isOn = XV_ON;
|
portPriv->isOn = XV_ON;
|
||||||
portPriv->pDraw = pDraw;
|
|
||||||
portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
|
portPriv->drw_x = drw_x; portPriv->drw_y = drw_y;
|
||||||
portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
|
portPriv->drw_w = drw_w; portPriv->drw_h = drw_h;
|
||||||
portPriv->type = 0; /* no mask means it's transient and should
|
portPriv->type = 0; /* no mask means it's transient and should
|
||||||
|
|||||||
Reference in New Issue
Block a user