[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rockbox-cvs
Subject:    lcd-color: Fix mpeg_player regression introduced in 034b6d5b
From:       rockbox-gerrit-noreply--- via rockbox-cvs <rockbox-cvs () lists ! haxx ! se>
Date:       2023-11-21 21:50:43
Message-ID: 202311212150.3ALLohcd242275 () archos ! rockbox ! org
[Download RAW message or body]

commit 6e90bfe029fc69ad5a3b0e34b60b8a50f9105c2c
Author: Solomon Peachy <pizza@shaftnet.org>
Date:   Tue Nov 21 16:45:04 2023 -0500

    lcd-color: Fix mpeg_player regression introduced in 034b6d5b
    
    The lcd_blit_yuv() function shadowed a variable, but was "fixed" by
    removing the inner declaration entirely, causing the inner loop to
    clobber a variable used by the outer loop.
    
    Fix this by declaring these variables independently, and for clarity
    moved the inner loop declarations to a narrower scope.
    
    Change-Id: I07652199929b84298b783374b8551a49baf093f3

diff --git a/firmware/drivers/lcd-color-common.c b/firmware/drivers/lcd-color-common.c
index 44f62e4481..5f83160dab 100644
--- a/firmware/drivers/lcd-color-common.c
+++ b/firmware/drivers/lcd-color-common.c
@@ -239,10 +239,9 @@ __attribute__((weak))
 #endif
 void lcd_blit_yuv(unsigned char * const src[3],
                   int src_x, int src_y, int stride,
-                  int x, int y, int width, int height)
+                  int dst_x, int dst_y, int width, int height)
 {
     const unsigned char *ysrc, *usrc, *vsrc;
-    int cb, cr, rv, guv, bu, r, g, b;
 
     int linecounter;
     fb_data *dst, *row_end;
@@ -253,10 +252,10 @@ void lcd_blit_yuv(unsigned char * const src[3],
     linecounter = height >> 1;
 
 #if LCD_WIDTH >= LCD_HEIGHT
-    dst     = FBADDR(x, y);
+    dst     = FBADDR(dst_x, dst_y);
     row_end = dst + width;
 #else
-    dst     = FBADDR(LCD_WIDTH - y - 1, x);
+    dst     = FBADDR(LCD_WIDTH - dst_y - 1, dst_x);
     row_end = dst + LCD_WIDTH * width;
 #endif
 
@@ -272,6 +271,8 @@ void lcd_blit_yuv(unsigned char * const src[3],
 
     do
     {
+        int y, cb, cr, rv, guv, bu, r, g, b;
+
         do
         {
             y  = YFAC*(*ysrc++ - 16);
@@ -401,9 +402,9 @@ void lcd_blit_yuv(unsigned char * const src[3],
     while (--linecounter > 0);
 
 #if LCD_WIDTH >= LCD_HEIGHT
-    lcd_update_rect(x, y, width, height);
+    lcd_update_rect(dst_x, dst_y, width, height);
 #else
-    lcd_update_rect(LCD_WIDTH - y - height, x, height, width);
+    lcd_update_rect(LCD_WIDTH - dst_y - height, dst_x, height, width);
 #endif
 }
 
-- 
rockbox-cvs mailing list
rockbox-cvs@lists.haxx.se
https://lists.haxx.se/mailman/listinfo/rockbox-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic