[vlc-devel] [PATCH 2/6] cea708: Fix TB scrolling

Devin Heitmueller dheitmueller at ltnglobal.com
Wed Jan 23 23:09:11 CET 2019


The decision when to truncate was being made based on the first
row in the array, but for TB scrolling we need to be checking
the last row.  Presumably this is a cut/paste error from the
above code block for BT scrolling.

Also, the for loop for the copy needs to include the first
entry, since i_firstrow gets incremented implicitly by the
truncate operation.

Signed-off-by: Devin Heitmueller <dheitmueller at ltnglobal.com>
---
 modules/codec/cea708.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/codec/cea708.c b/modules/codec/cea708.c
index 3af226a6c6..34b2f37d4a 100644
--- a/modules/codec/cea708.c
+++ b/modules/codec/cea708.c
@@ -696,9 +696,9 @@ static void CEA708_Window_Scroll( cea708_window_t *p_w )
             break;
         case CEA708_WA_DIRECTION_TB:
             /* Move DOWN */
-            if( p_w->i_firstrow == CEA708_WINDOW_MAX_ROWS - 1 )
+            if( p_w->i_lastrow == CEA708_WINDOW_MAX_ROWS - 1 )
                 CEA708_Window_Truncate( p_w, CEA708_WA_DIRECTION_TB );
-            for( int i=p_w->i_lastrow; i > p_w->i_firstrow; i-- )
+            for( int i=p_w->i_lastrow; i >= p_w->i_firstrow; i-- )
                 p_w->rows[i+1] = p_w->rows[i];
             p_w->rows[p_w->i_firstrow] = NULL;
             p_w->i_firstrow++;
-- 
2.13.2



More information about the vlc-devel mailing list