[vlc-commits] cc: Only reset line position if rollup mode changed

Devin Heitmueller git at videolan.org
Thu Jul 26 11:23:23 CEST 2018


vlc | branch: master | Devin Heitmueller <dheitmueller at ltnglobal.com> | Fri Jul 20 14:40:29 2018 -0400| [693727d3d7a70f94cbbdc7ec983d68c1d5c2c91a] | committer: Francois Cartegnie

cc: Only reset line position if rollup mode changed

The EIA-608 parser was always resetting the line position whenever
it received a rollup code.  However this would cause the text to
be rendered improperly if the rollup code was received in the
middle of an existing line and the mode was unchanged.

Only reset the line position if the rollup mode changes from the
existing value.

This problem was exhibited in streams from the "Steve Harvey show"
where whatever EIA-608 encoder they are using would sometimes send
rollup codes mid-row (causing the leading characters on that line to
be overwritten by whatever characters followed the rollup code).

Signed-off-by: Devin Heitmueller <dheitmueller at ltnglobal.com>
Signed-off-by: Francois Cartegnie <fcvlcdev at free.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=693727d3d7a70f94cbbdc7ec983d68c1d5c2c91a
---

 modules/codec/cc.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/modules/codec/cc.c b/modules/codec/cc.c
index 72b209aff7..45b187023c 100644
--- a/modules/codec/cc.c
+++ b/modules/codec/cc.c
@@ -799,6 +799,7 @@ static eia608_status_t Eia608ParseExtended( eia608_t *h, uint8_t d1, uint8_t d2
 static eia608_status_t Eia608ParseCommand0x14( eia608_t *h, uint8_t d2 )
 {
     eia608_status_t i_status = EIA608_STATUS_DEFAULT;
+    eia608_mode_t proposed_mode;
 
     switch( d2 )
     {
@@ -826,14 +827,18 @@ static eia608_status_t Eia608ParseCommand0x14( eia608_t *h, uint8_t d2 )
         }
 
         if( d2 == 0x25 )
-            h->mode = EIA608_MODE_ROLLUP_2;
+            proposed_mode = EIA608_MODE_ROLLUP_2;
         else if( d2 == 0x26 )
-            h->mode = EIA608_MODE_ROLLUP_3;
+            proposed_mode = EIA608_MODE_ROLLUP_3;
         else
-            h->mode = EIA608_MODE_ROLLUP_4;
+            proposed_mode = EIA608_MODE_ROLLUP_4;
 
-        h->cursor.i_column = 0;
-        h->cursor.i_row = h->i_row_rollup;
+        if ( proposed_mode != h->mode )
+        {
+            h->mode = proposed_mode;
+            h->cursor.i_column = 0;
+            h->cursor.i_row = h->i_row_rollup;
+        }
         break;
     case 0x28:  /* Flash on */
         /* TODO */



More information about the vlc-commits mailing list