compositor/blend.c: fix MT fill_checker for YUY2
authorMathieu Duponchelle <mathieu@centricular.com>
Tue, 29 Dec 2020 22:42:08 +0000 (23:42 +0100)
committerMathieu Duponchelle <mduponchelle1@gmail.com>
Tue, 29 Dec 2020 22:48:08 +0000 (22:48 +0000)
The initial byte offset should be calculated from the stride,
not from the dest_add variable

Example pipeline:

gst-launch-1.0 videotestsrc ! video/x-raw, width=1920, height=1080, format=YUY2 ! \
  queue ! compositor sink_0::xpos=200 ! video/x-raw, format=YUY2 ! xvimagesink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/988>

gst/compositor/blend.c

index bd6573d..0d54335 100644 (file)
@@ -1026,7 +1026,7 @@ fill_checker_##name##_c (GstVideoFrame * frame, guint y_start, guint y_end) \
   dest_add = GST_VIDEO_FRAME_COMP_STRIDE (frame, 0) - width * 2; \
   width /= 2; \
   \
-  dest += dest_add * y_start; \
+  dest += GST_VIDEO_FRAME_COMP_STRIDE (frame, 0) * y_start; \
   for (i = 0; i < height; i++) { \
     for (j = 0; j < width; j++) { \
       dest[Y1] = tab[((i & 0x8) >> 3) + (((2 * j + 0) & 0x8) >> 3)]; \