Commit c84703a1 authored by Finn Hughes's avatar Finn Hughes Committed by 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: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent a797da47
...@@ -399,9 +399,13 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block ) ...@@ -399,9 +399,13 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
/* Ignore transparent rows at the beginning and end */ /* 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 ); int i_first_row = get_first_visible_row( p_page.text, p_page.rows, p_page.columns );
if ( i_first_row < 0 ) int i_num_rows;
goto error; if ( i_first_row < 0 ) {
int i_num_rows = get_last_visible_row( p_page.text, p_page.rows, p_page.columns ) - i_first_row + 1; 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 #ifdef ZVBI_DEBUG
msg_Dbg( p_dec, "After top and tail of page we have rows %i-%i of %i", 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 ); 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) ...@@ -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) 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) ...@@ -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, static int OpaquePage( picture_t *p_src, const vbi_page p_page,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment