[vlc-commits] Correctly process wholly translucent zvbi subtitles

Finn Hughes git at videolan.org
Mon Apr 21 20:20:31 CEST 2014


vlc | branch: master | Finn Hughes <finn.hughes at lincor.com> | Thu Apr 17 13:49:26 2014 +0100| [c84703a166f684a12601096a6d8258a517491ece] | committer: Jean-Baptiste Kempf

Correctly process wholly translucent zvbi subtitles

A completely translucent teletext subtitle is sent to clear the old
subtitle, unfortunately my zvbi patch (f520484d) messed that use case
up, this one fixes it.

Thanks to Andre De Deudwaerder for finding the problem and tracking it down.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/zvbi.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/modules/codec/zvbi.c b/modules/codec/zvbi.c
index 2a40fa9..6174e03 100644
--- a/modules/codec/zvbi.c
+++ b/modules/codec/zvbi.c
@@ -399,9 +399,13 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
 
     /* Ignore transparent rows at the beginning and end */
     int i_first_row = get_first_visible_row( p_page.text, p_page.rows, p_page.columns );
-    if ( i_first_row < 0 )
-        goto error;
-    int i_num_rows = get_last_visible_row( p_page.text, p_page.rows, p_page.columns ) - i_first_row + 1;
+    int i_num_rows;
+    if ( i_first_row < 0 ) {
+        i_first_row = p_page.rows - 1;
+        i_num_rows = 0;
+    } else {
+        i_num_rows = get_last_visible_row( p_page.text, p_page.rows, p_page.columns ) - i_first_row + 1;
+    }
 #ifdef ZVBI_DEBUG
     msg_Dbg( p_dec, "After top and tail of page we have rows %i-%i of %i",
              i_first_row + 1, i_first_row + i_num_rows, p_page.rows );
@@ -598,7 +602,7 @@ static int get_first_visible_row( vbi_char *p_text, int rows, int columns)
         }
     }
 
-    return rows;
+    return -1;
 }
 
 static int get_last_visible_row( vbi_char *p_text, int rows, int columns)
@@ -611,7 +615,7 @@ static int get_last_visible_row( vbi_char *p_text, int rows, int columns)
         }
     }
 
-    return 0;
+    return -1;
 }
 
 static int OpaquePage( picture_t *p_src, const vbi_page p_page,



More information about the vlc-commits mailing list