st/vdpau: improve frame dumping functionality a bit
authorChristian König <deathsimple@vodafone.de>
Thu, 15 Mar 2012 10:14:47 +0000 (11:14 +0100)
committerChristian König <deathsimple@vodafone.de>
Thu, 22 Mar 2012 08:47:04 +0000 (09:47 +0100)
Just a workaround until we get a real unit-
testing tool for VDPAU.

Signed-off-by: Christian König <deathsimple@vodafone.de>
src/gallium/state_trackers/vdpau/presentation.c

index d85e656..2e3bea9 100644 (file)
@@ -286,9 +286,12 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
       static unsigned int framenum = 0;
       char cmd[256];
 
-      sprintf(cmd, "xwd -id %d -out vdpau_frame_%08d.xwd", (int)pq->drawable, ++framenum);
-      if (system(cmd) != 0)
-         VDPAU_MSG(VDPAU_ERR, "[VDPAU] Dumping surface %d failed.\n", surface);
+      if (framenum) {
+         sprintf(cmd, "xwd -id %d -silent -out vdpau_frame_%08d.xwd", (int)pq->drawable, framenum);
+         if (system(cmd) != 0)
+            VDPAU_MSG(VDPAU_ERR, "[VDPAU] Dumping surface %d failed.\n", surface);
+      }
+      framenum++;
    }
 
    pipe_resource_reference(&tex, NULL);