Commit 6a77f290 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Don't misuse p_this->p_libvlc for putting modules variables of zvbi.

parent c366075e
...@@ -204,12 +204,12 @@ static int Open( vlc_object_t *p_this ) ...@@ -204,12 +204,12 @@ static int Open( vlc_object_t *p_this )
event_handler, p_dec ); event_handler, p_dec );
/* Create the var on vlc_global. */ /* Create the var on vlc_global. */
p_sys->i_wanted_page = var_CreateGetInteger( p_dec->p_libvlc, "vbi-page" ); p_sys->i_wanted_page = var_CreateGetInteger( p_dec, "vbi-page" );
var_AddCallback( p_dec->p_libvlc, "vbi-page", var_AddCallback( p_dec, "vbi-page",
RequestPage, p_sys ); RequestPage, p_sys );
p_sys->b_opaque = var_CreateGetBool( p_dec->p_libvlc, "vbi-opaque" ); p_sys->b_opaque = var_CreateGetBool( p_dec, "vbi-opaque" );
var_AddCallback( p_dec->p_libvlc, "vbi-opaque", Opaque, p_sys ); var_AddCallback( p_dec, "vbi-opaque", Opaque, p_sys );
p_sys->i_align = var_CreateGetInteger( p_dec, "vbi-position" ); p_sys->i_align = var_CreateGetInteger( p_dec, "vbi-position" );
var_AddCallback( p_dec, "vbi-position", Position, p_sys ); var_AddCallback( p_dec, "vbi-position", Position, p_sys );
...@@ -237,10 +237,10 @@ static void Close( vlc_object_t *p_this ) ...@@ -237,10 +237,10 @@ static void Close( vlc_object_t *p_this )
decoder_t *p_dec = (decoder_t*) p_this; decoder_t *p_dec = (decoder_t*) p_this;
decoder_sys_t *p_sys = p_dec->p_sys; decoder_sys_t *p_sys = p_dec->p_sys;
var_Destroy( p_dec->p_libvlc, "vbi-opaque" ); var_Destroy( p_dec, "vbi-opaque" );
var_Destroy( p_dec->p_libvlc, "vbi-page" ); var_Destroy( p_dec, "vbi-page" );
var_DelCallback( p_dec->p_libvlc, "vbi-page", RequestPage, p_sys ); var_DelCallback( p_dec, "vbi-page", RequestPage, p_sys );
var_DelCallback( p_dec->p_libvlc, "vbi-opaque", Opaque, p_sys ); var_DelCallback( p_dec, "vbi-opaque", Opaque, p_sys );
#ifdef HAVE_FFMPEG_SWSCALE_H #ifdef HAVE_FFMPEG_SWSCALE_H
if( p_sys->p_image ) image_HandlerDelete( p_sys->p_image ); if( p_sys->p_image ) image_HandlerDelete( p_sys->p_image );
...@@ -473,7 +473,7 @@ static void event_handler( vbi_event *ev, void *user_data ) ...@@ -473,7 +473,7 @@ static void event_handler( vbi_event *ev, void *user_data )
if( ev->type == VBI_EVENT_TTX_PAGE ) if( ev->type == VBI_EVENT_TTX_PAGE )
{ {
/* msg_Dbg( p_dec, "Page %03x.%02x ", /* msg_Info( p_dec, "Page %03x.%02x ",
ev->ev.ttx_page.pgno, ev->ev.ttx_page.pgno,
ev->ev.ttx_page.subno & 0xFF); ev->ev.ttx_page.subno & 0xFF);
*/ */
......
...@@ -240,7 +240,16 @@ void InputManager::telexGotoPage( int page ) ...@@ -240,7 +240,16 @@ void InputManager::telexGotoPage( int page )
{ {
// TODO: this has only sense when telx codec is available // TODO: this has only sense when telx codec is available
if( hasInput() ) if( hasInput() )
var_SetInteger( p_input->p_libvlc, "vbi-page", page ); {
vlc_object_t *p_vbi;
p_vbi = (vlc_object_t *) vlc_object_find_name( p_input,
"zvbi", FIND_ANYWHERE );
if( p_vbi )
{
var_SetInteger( p_vbi, "vbi-page", page );
vlc_object_release( p_vbi );
}
}
} }
void InputManager::telexToggle( bool b_enabled ) void InputManager::telexToggle( bool b_enabled )
...@@ -252,7 +261,16 @@ void InputManager::telexSetTransparency( bool b_transp ) ...@@ -252,7 +261,16 @@ void InputManager::telexSetTransparency( bool b_transp )
{ {
// TODO: this has only sense when telx codec is available // TODO: this has only sense when telx codec is available
if( hasInput() ) if( hasInput() )
var_SetBool( p_input->p_libvlc, "vbi-opaque", b_transp ); {
vlc_object_t *p_vbi;
p_vbi = (vlc_object_t *) vlc_object_find_name( p_input,
"zvbi", FIND_ANYWHERE );
if( p_vbi )
{
var_SetBool( p_input->p_libvlc, "vbi-opaque", b_transp );
vlc_object_release( p_vbi );
}
}
} }
void InputManager::slower() void InputManager::slower()
......
...@@ -486,12 +486,20 @@ int libvlc_video_get_teletext( libvlc_media_instance_t *p_mi, ...@@ -486,12 +486,20 @@ int libvlc_video_get_teletext( libvlc_media_instance_t *p_mi,
libvlc_exception_t *p_e ) libvlc_exception_t *p_e )
{ {
vout_thread_t *p_vout = GetVout( p_mi, p_e ); vout_thread_t *p_vout = GetVout( p_mi, p_e );
vlc_object_t *p_vbi;
int i_ret = -1; int i_ret = -1;
if( !p_vout ) if( !p_vout )
return i_ret; return i_ret;
i_ret = var_GetInteger( p_vout, "vbi-page" ); p_vbi = (vlc_object_t *) vlc_object_find_name( p_vout, "zvbi",
FIND_ANYWHERE );
if( p_vbi )
{
i_ret = var_GetInteger( p_vout, "vbi-page" );
vlc_object_release( p_vbi );
}
vlc_object_release( p_vout ); vlc_object_release( p_vout );
return i_ret; return i_ret;
} }
...@@ -500,12 +508,19 @@ void libvlc_video_set_teletext( libvlc_media_instance_t *p_mi, int i_page, ...@@ -500,12 +508,19 @@ void libvlc_video_set_teletext( libvlc_media_instance_t *p_mi, int i_page,
libvlc_exception_t *p_e ) libvlc_exception_t *p_e )
{ {
vout_thread_t *p_vout = GetVout( p_mi, p_e ); vout_thread_t *p_vout = GetVout( p_mi, p_e );
vlc_object_t *p_vbi;
int i_ret = -1; int i_ret = -1;
if( !p_vout ) if( !p_vout )
return; return;
i_ret = var_SetInteger( p_vout, "vbi-page", i_page ); p_vbi = (vlc_object_t *) vlc_object_find_name( p_vout, "zvbi",
FIND_ANYWHERE );
if( p_vbi )
{
i_ret = var_SetInteger( p_vbi, "vbi-page", i_page );
vlc_object_release( p_vbi );
}
if( i_ret ) if( i_ret )
libvlc_exception_raise( p_e, libvlc_exception_raise( p_e,
"Unexpected error while setting teletext page" ); "Unexpected error while setting teletext 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