[vlc-devel] [PATCH] teletext: Check spu-es instead of teletext-es

Julian Scheel julian at jusst.de
Thu Feb 6 22:06:36 CET 2014


Am 06/02/14 20:57, schrieb Rémi Denis-Courmont:
> Le jeudi 6 février 2014, 15:29:58 Julian Scheel a écrit :
>> toggle_teletext sets spu-es to the first subtitle track listed in
>> teletext-es. teletext-es itself is not set and hence returns -1 if more
>> than one track is available. So query for spu-es and also check for it to
>> be unequal to -1, as a spu-es of -1 causes a segfault.
>
> Where is teletext-es set at all? Don't the UI plugins have the same bug?

Just double-checked the code. There is a VarListSelect in input event.c 
which is called by es-out, so the last teletext track seen should be 
selected.

Having a quick look at the qt UI plugin it checks for teletext_es >= 0 
before calling input_GetEsObjects. So in contrast to libvlc it would not 
crash. Also the teletext controls in the UI are limited to the 
autoselected teletext subtitle, which might not be wanted when using libvlc.
But maybe it would be the cleaner approach to actually set teletext-es 
in libvlc and stay with that one. It's just a little bit redundant to 
have both spu-es and teletext-es set.

Anyhow the check for telx >= 0 is absolutely necessary to avoid 
segmentation faults.

Regards,
Julian

>> Signed-off-by: Julian Scheel <julian at jusst.de>
>> ---
>>   lib/video.c | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/lib/video.c b/lib/video.c
>> index 43471b9..fc4a565 100644
>> --- a/lib/video.c
>> +++ b/lib/video.c
>> @@ -464,8 +464,9 @@ void libvlc_video_set_teletext( libvlc_media_player_t
>> *p_mi, int i_page ) return;
>>       }
>>
>> -    telx = var_GetInteger( p_input_thread, "teletext-es" );
>> -    if( input_GetEsObjects( p_input_thread, telx, &p_zvbi, NULL, NULL )
>> +    telx = var_GetInteger( p_input_thread, "spu-es" );
>> +    if( telx > -1 &&
>> +        input_GetEsObjects( p_input_thread, telx, &p_zvbi, NULL, NULL )
>>           == VLC_SUCCESS )
>>       {
>>           var_SetInteger( p_zvbi, "vbi-page", i_page );
>




More information about the vlc-devel mailing list