Commit 76c74ca0 authored by Thomas Guillem's avatar Thomas Guillem

libvlc: libvlc_video_set_teletext(0) to disable teletext

Since 0 is an invalid page for the zvbi plugin.

libvlc_video_get_teletext() will now return 0 if teletext is disabled. The
teletext was already disabled by default, and libvlc_video_get_teletext() could
be misleading since it returned 100 by default.
parent 0ee22e97
......@@ -1352,7 +1352,10 @@ LIBVLC_API
void libvlc_video_set_crop_geometry( libvlc_media_player_t *p_mi, const char *psz_geometry );
/**
* Get current teletext page requested.
* Get current teletext page requested or 0 if it's disabled.
*
* Teletext is disabled by default, call libvlc_video_set_teletext() to enable
* it.
*
* \param p_mi the media player
* \return the current teletext page requested.
......@@ -1365,8 +1368,8 @@ LIBVLC_API int libvlc_video_get_teletext( libvlc_media_player_t *p_mi );
* This function can also be used to send a teletext key.
*
* \param p_mi the media player
* \param i_page teletex page number requested. This value can be -1 to disable
* teletext, a number in the range [0;1000[ to show the requested page, or a
* \param i_page teletex page number requested. This value can be 0 to disable
* teletext, a number in the range ]0;1000[ to show the requested page, or a
* \ref libvlc_teletext_key_t. 100 is the default teletext page.
*/
LIBVLC_API void libvlc_video_set_teletext( libvlc_media_player_t *p_mi, int i_page );
......
......@@ -648,7 +648,7 @@ libvlc_media_player_new( libvlc_instance_t *instance )
var_Create (mp, "deinterlace-mode", VLC_VAR_STRING | VLC_VAR_DOINHERIT);
var_Create (mp, "vbi-page", VLC_VAR_INTEGER);
var_SetInteger (mp, "vbi-page", 100);
var_SetInteger (mp, "vbi-page", 0);
var_Create (mp, "video-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT);
var_Create (mp, "sub-source", VLC_VAR_STRING | VLC_VAR_DOINHERIT);
......
......@@ -518,12 +518,7 @@ void libvlc_video_set_teletext( libvlc_media_player_t *p_mi, int i_page )
if( i_page >= 0 && i_page < 1000 )
var_SetInteger( p_mi, "vbi-page", i_page );
else if( i_page < -1 )
{
libvlc_printerr("Invalid page number");
return;
}
else
else if( i_page >= 1000 )
{
switch (i_page)
{
......@@ -539,6 +534,11 @@ void libvlc_video_set_teletext( libvlc_media_player_t *p_mi, int i_page )
return;
}
}
else
{
libvlc_printerr("Invalid page number");
return;
}
p_input_thread = libvlc_get_input_thread( p_mi );
if( !p_input_thread ) return;
......@@ -549,7 +549,7 @@ void libvlc_video_set_teletext( libvlc_media_player_t *p_mi, int i_page )
return;
}
if( i_page == -1 )
if( i_page == 0 )
{
teletext_enable( p_input_thread, false );
}
......
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