0d932ec
From: Michel Dänzer <michel@tungstengraphics.com>
0d932ec
Date: Thu, 24 May 2007 10:10:05 +0000 (+0200)
0d932ec
Subject: Consolidate portPriv->pDraw assignments into xf86XVEnlistPortInWindow.
0d932ec
X-Git-Url: http://gitweb.freedesktop.org/?p=xorg/xserver.git;a=commitdiff;h=649e7f82d8d4333443493056b81eb20d6cf022bc
0d932ec
0d932ec
Consolidate portPriv->pDraw assignments into xf86XVEnlistPortInWindow.
0d932ec
0d932ec
This avoids a crash in xf86XVReputVideo and also cleans up the code slightly.
0d932ec
---
0d932ec
0d932ec
--- a/hw/xfree86/common/xf86xv.c
0d932ec
+++ b/hw/xfree86/common/xf86xv.c
0d932ec
@@ -979,6 +979,9 @@ xf86XVEnlistPortInWindow(WindowPtr pWin,
0d932ec
 	winPriv->next = PrivRoot;
0d932ec
 	pWin->devPrivates[XF86XVWindowIndex].ptr = (pointer)winPriv;
0d932ec
    }
0d932ec
+
0d932ec
+   portPriv->pDraw = (DrawablePtr)pWin;
0d932ec
+
0d932ec
    return Success;
0d932ec
 }
0d932ec
 
0d932ec
@@ -1375,7 +1378,6 @@ xf86XVPutVideo(
0d932ec
   result =  xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
0d932ec
   if(result != Success) return result;
0d932ec
 
0d932ec
-  portPriv->pDraw = pDraw;
0d932ec
   portPriv->type = XvInputMask;
0d932ec
 
0d932ec
   /* save a copy of these parameters */
0d932ec
@@ -1479,7 +1481,6 @@ xf86XVPutStill(
0d932ec
 
0d932ec
      xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
0d932ec
      portPriv->isOn = XV_ON;
0d932ec
-     portPriv->pDraw = pDraw;
0d932ec
      portPriv->drw_x = drw_x;  portPriv->drw_y = drw_y;
0d932ec
      portPriv->drw_w = drw_w;  portPriv->drw_h = drw_h;
0d932ec
      portPriv->type = 0;  /* no mask means it's transient and should
0d932ec
@@ -1529,7 +1530,6 @@ xf86XVGetVideo(
0d932ec
   result =  xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
0d932ec
   if(result != Success) return result;
0d932ec
 
0d932ec
-  portPriv->pDraw = pDraw;
0d932ec
   portPriv->type = XvOutputMask;
0d932ec
 
0d932ec
   /* save a copy of these parameters */
0d932ec
@@ -1784,7 +1784,6 @@ xf86XVPutImage(
0d932ec
 	(portPriv->AdaptorRec->flags & VIDEO_OVERLAID_IMAGES)) {
0d932ec
 
0d932ec
      portPriv->isOn = XV_ON;
0d932ec
-     portPriv->pDraw = pDraw;
0d932ec
      portPriv->drw_x = drw_x;  portPriv->drw_y = drw_y;
0d932ec
      portPriv->drw_w = drw_w;  portPriv->drw_h = drw_h;
0d932ec
      portPriv->type = 0;  /* no mask means it's transient and should