From: Francisco Casas fcasas@codeweavers.com
Not doing this results in misaligned video scan lines on videos whose width is not multiple of 4. --- dlls/quartz/vmr7.c | 2 +- dlls/quartz/vmr9.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/quartz/vmr7.c b/dlls/quartz/vmr7.c index 7d29e38b14a..83f8b1d62d3 100644 --- a/dlls/quartz/vmr7.c +++ b/dlls/quartz/vmr7.c @@ -209,7 +209,7 @@ static HRESULT vmr_render(struct strmbase_renderer *iface, IMediaSample *sample) depth = bitmap_header->biBitCount; if (bitmap_header->biCompression == mmioFOURCC('N','V','1','2') || bitmap_header->biCompression == mmioFOURCC('Y','V','1','2')) - src_pitch = width; + src_pitch = (width + 3) & ~3; else /* packed YUV (UYVY or YUY2) or RGB */ src_pitch = ((width * depth / 8) + 3) & ~3;
diff --git a/dlls/quartz/vmr9.c b/dlls/quartz/vmr9.c index ef8c78951c8..611a1256b0e 100644 --- a/dlls/quartz/vmr9.c +++ b/dlls/quartz/vmr9.c @@ -267,7 +267,7 @@ static HRESULT vmr_render(struct strmbase_renderer *iface, IMediaSample *sample) depth = bitmap_header->biBitCount; if (bitmap_header->biCompression == mmioFOURCC('N','V','1','2') || bitmap_header->biCompression == mmioFOURCC('Y','V','1','2')) - src_pitch = width; + src_pitch = (width + 3) & ~3; else /* packed YUV (UYVY or YUY2) or RGB */ src_pitch = ((width * depth / 8) + 3) & ~3;