From 124baa8f3f061d81b5d71cb01bd1ee0dd56a0fef Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 4 Sep 2024 17:22:58 +0700 Subject: [PATCH] #4345 nvenc produces frames with bigger padding now --- xpra/codecs/openh264/decoder.pyx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xpra/codecs/openh264/decoder.pyx b/xpra/codecs/openh264/decoder.pyx index 9a8c7bad72..838083c612 100644 --- a/xpra/codecs/openh264/decoder.pyx +++ b/xpra/codecs/openh264/decoder.pyx @@ -190,9 +190,12 @@ cdef class Decoder: strides = [ystride, uvstride, uvstride] cdef int width = buf_info.UsrData.sSystemBuffer.iWidth cdef int height = buf_info.UsrData.sSystemBuffer.iHeight - if abs(width-self.width) > 1 or abs(height-self.height) > 1: - log.warn("Warning: image bigger than expected") - log.warn(f" {width}x{height} instead of {self.width}x{self.height}") + cdef int wdelta = width - self.width + cdef int hdelta = height - self.height + if abs(wdelta) > 1 or abs(hdelta) > 1: + if (wdelta & 0xffe0) > 0 or (hdelta & 0xfffe0) > 0: + log.warn("Warning: image bigger than expected") + log.warn(f" {width}x{height} instead of {self.width}x{self.height}") pixels = [ yuv[0][:ystride*height], yuv[1][:uvstride*(height//2)],