[vlc-commits] cea708: Fix TB scrolling

Devin Heitmueller git at videolan.org
Tue Feb 11 10:33:15 CET 2020


vlc/vlc-3.0 | branch: master | Devin Heitmueller <dheitmueller at ltnglobal.com> | Wed Jan 23 17:09:11 2019 -0500| [47d5bd72f60c718bb26571d5c3977baaa9b1743f] | committer: Francois Cartegnie

cea708: Fix TB scrolling

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>
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit db96c022fa45a7618c93dcc8d6b81ebeb2d01e0f)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=47d5bd72f60c718bb26571d5c3977baaa9b1743f
---

 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 d4ecceda41..baedd821d4 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++;



More information about the vlc-commits mailing list