[vlc-devel] [PATCH] Improve performance of zvbi subtitles
Finn Hughes
finn.hughes1 at gmail.com
Fri Jun 21 18:22:35 CEST 2013
This patch hasn't made it onto the patches website yet, I'm new to the
system so don't know whether that means it's been forgotten or just that
you're trying to finalise 2.1?
Finn
On 12/06/13 09:59, Finn Hughes wrote:
> Thanks, patch updated with "for ( int i = 0" style loops.
>
> Finn
>
> On 11/06/13 18:42, Rémi Denis-Courmont wrote:
>> Hello,
>>
>> Looks good but...
>>
>> diff --git a/modules/codec/zvbi.c b/modules/codec/zvbi.c
>> index 2a91f88..abe8c3e 100644
>> --- a/modules/codec/zvbi.c
>> +++ b/modules/codec/zvbi.c
>> @@ -567,8 +584,38 @@ static void EventHandler( vbi_event *ev, void
>> *user_data
>> )
>> msg_Dbg( p_dec, "Network ID changed" );
>> }
>> +static int get_first_visible_row( vbi_char *p_text, int rows, int
>> columns)
>> +{
>> + int i;
>> +
>> + for ( i = 0; i < rows * columns; i++ )
>>
>> Please use C++/C99 style for-loops in new code.
>>
>> + {
>> + if ( p_text[i].opacity != VBI_TRANSPARENT_SPACE )
>> + {
>> + return i / columns;
>> + }
>> + }
>> +
>> + return rows;
>> +}
>> +
>> +static int get_last_visible_row( vbi_char *p_text, int rows, int
>> columns)
>> +{
>> + int i;
>> +
>> + for ( i = rows * columns - 1; i >= 0; i-- )
>> + {
>> + if (p_text[i].opacity != VBI_TRANSPARENT_SPACE)
>> + {
>> + return ( i + columns - 1) / columns;
>> + }
>> + }
>> +
>> + return 0;
>> +}
>> +
>>
>
More information about the vlc-devel
mailing list