[vlc-devel] [PATCH 4/6] cea708: Fix when to scroll when in BT mode

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

When doing roll-up captions, the decision on whether to scroll
should not be based on the number of lines in the window, but
rather whether we were on the last line when we received the CR

This problem manifests as the same line being overwritten
continuously rather than scrolling when we receive a sequence
such as the following:

DefineWindow with rc=1 (i.e. two lines)
SetPenLocation Row 1 (i.e. the second row)
Write caption
SetPenLocation Row 1
Write caption

In the above example, because CEA708_Window_RowCount() would
return 1, the row number would be bumped and a scroll would
not be performed.  Hence the subsequent SetPenLocation would
proceed to overwrite the current line.

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

diff --git a/modules/codec/cea708.c b/modules/codec/cea708.c
index 0a4b40ab64..4fa9923104 100644
--- a/modules/codec/cea708.c
+++ b/modules/codec/cea708.c
@@ -749,8 +749,7 @@ static void CEA708_Window_CarriageReturn( cea708_window_t *p_w )
                        0 : CEA708_WINDOW_MAX_COLS - 1;
         case CEA708_WA_DIRECTION_BT:
-            if( p_w->row + 1 < CEA708_WINDOW_MAX_ROWS &&
-                CEA708_Window_RowCount( p_w ) < p_w->i_row_count )
+            if( p_w->row + 1 < p_w->i_row_count )
                 CEA708_Window_Scroll( p_w );

More information about the vlc-devel mailing list