recorder: Always initialize prev when computing the run-length
authorKristian Høgsberg <krh@bitplanet.net>
Wed, 20 Jun 2012 04:28:16 +0000 (00:28 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 20 Jun 2012 04:28:19 +0000 (00:28 -0400)
We need to initialize prev when we handle the initial pixel in a
rectangle, or we may detect the following pixel as identical or different
when it's not.  This causes the top-left pixel in a rectangle to
occasionally be wrong leaving a trail of "dirty pixels" in the capture.

src/screenshooter.c

index 2808f03..542425e 100644 (file)
@@ -307,8 +307,8 @@ weston_recorder_frame_notify(struct wl_listener *listener, void *data)
                                } else {
                                        p = output_run(p, prev, run);
                                        run = 1;
-                                       prev = delta;
                                }
+                               prev = delta;
                        }
                }