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