From 48decac25ee767a98d8dffd79215181b84335cee Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Thu, 30 Nov 2023 17:08:44 +0100 Subject: [PATCH] opengl_utils: Fix UYVY frame uploading --- src/video_display/opengl_utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video_display/opengl_utils.cpp b/src/video_display/opengl_utils.cpp index 5c54e9de0..dc8f9db13 100644 --- a/src/video_display/opengl_utils.cpp +++ b/src/video_display/opengl_utils.cpp @@ -357,7 +357,7 @@ void Texture::upload_frame(video_frame *f, bool pbo_frame){ switch(f->color_spec){ case UYVY: //Two UYVY pixels get uploaded as one RGBA pixel - width /= 2; + width = (width + 1) / 2; fmt = GL_RGBA; break; case RGB: @@ -431,7 +431,7 @@ void Yuv_convertor::put_frame(video_frame *f, bool pbo_frame){ glClear(GL_COLOR_BUFFER_BIT); glBindTexture(GL_TEXTURE_2D, yuv_tex.get()); - yuv_tex.allocate(f->tiles[0].width / 2, f->tiles[0].height, GL_RGBA); + yuv_tex.allocate((f->tiles[0].width + 1) / 2, f->tiles[0].height, GL_RGBA); yuv_tex.upload_frame(f, pbo_frame);