Commit 9c1d2239 authored by Laurent Aimar's avatar Laurent Aimar

Removed invalid var_DelCallback in teletext code (qt4).

parent a67d563f
...@@ -76,6 +76,7 @@ InputManager::InputManager( QObject *parent, intf_thread_t *_p_intf) : ...@@ -76,6 +76,7 @@ InputManager::InputManager( QObject *parent, intf_thread_t *_p_intf) :
oldName = ""; oldName = "";
artUrl = ""; artUrl = "";
p_input = NULL; p_input = NULL;
p_input_vbi = NULL;
i_rate = 0; i_rate = 0;
p_item = NULL; p_item = NULL;
b_video = false; b_video = false;
...@@ -113,6 +114,7 @@ void InputManager::setInput( input_thread_t *_p_input ) ...@@ -113,6 +114,7 @@ void InputManager::setInput( input_thread_t *_p_input )
{ {
p_input = NULL; p_input = NULL;
p_item = NULL; p_item = NULL;
assert( !p_input_vbi );
emit rateChanged( INPUT_RATE_DEFAULT ); emit rateChanged( INPUT_RATE_DEFAULT );
} }
} }
...@@ -134,6 +136,12 @@ void InputManager::delInput() ...@@ -134,6 +136,12 @@ void InputManager::delInput()
timeA = 0; timeA = 0;
timeB = 0; timeB = 0;
if( p_input_vbi )
{
vlc_object_release( p_input_vbi );
p_input_vbi = NULL;
}
vlc_object_release( p_input ); vlc_object_release( p_input );
p_input = NULL; p_input = NULL;
...@@ -501,21 +509,22 @@ void InputManager::UpdateTeletext() ...@@ -501,21 +509,22 @@ void InputManager::UpdateTeletext()
int i_page = 100; int i_page = 100;
bool b_transparent = false; bool b_transparent = false;
vlc_object_t *p_vbi = (vlc_object_t *) if( p_input_vbi )
{
var_DelCallback( p_input_vbi, "vbi-page", VbiEvent, this );
vlc_object_release( p_input_vbi );
}
p_input_vbi = (vlc_object_t *)
vlc_object_find_name( p_input, "zvbi", FIND_CHILD ); vlc_object_find_name( p_input, "zvbi", FIND_CHILD );
if( p_vbi ) if( p_input_vbi )
{ {
/* We deleted it (if not here, it does not harm), because
* var_AddCallback will silently add a duplicated one */
var_DelCallback( p_vbi, "vbi-page", VbiEvent, this );
/* This callback is not remove explicitly, but interfaces /* This callback is not remove explicitly, but interfaces
* are guaranted to outlive input */ * are guaranted to outlive input */
var_AddCallback( p_vbi, "vbi-page", VbiEvent, this ); var_AddCallback( p_input_vbi, "vbi-page", VbiEvent, this );
i_page = var_GetInteger( p_vbi, "vbi-page" ); i_page = var_GetInteger( p_input_vbi, "vbi-page" );
b_transparent = !var_GetBool( p_vbi, "vbi-opaque" ); b_transparent = !var_GetBool( p_input_vbi, "vbi-opaque" );
vlc_object_release( p_vbi );
} }
emit newTelexPageSet( i_page ); emit newTelexPageSet( i_page );
emit teletextTransparencyActivated( b_transparent ); emit teletextTransparencyActivated( b_transparent );
...@@ -736,38 +745,26 @@ void InputManager::sectionMenu() ...@@ -736,38 +745,26 @@ void InputManager::sectionMenu()
/* Set a new Teletext Page */ /* Set a new Teletext Page */
void InputManager::telexSetPage( int page ) void InputManager::telexSetPage( int page )
{ {
if( hasInput() ) if( hasInput() && p_input_vbi )
{ {
const int i_teletext_es = var_GetInteger( p_input, "teletext-es" ); const int i_teletext_es = var_GetInteger( p_input, "teletext-es" );
if( i_teletext_es >= 0 ) if( i_teletext_es >= 0 )
{ {
vlc_object_t *p_vbi = (vlc_object_t *) vlc_object_find_name( p_input, var_SetInteger( p_input_vbi, "vbi-page", page );
"zvbi", FIND_CHILD );
if( p_vbi )
{
var_SetInteger( p_vbi, "vbi-page", page );
vlc_object_release( p_vbi );
emit newTelexPageSet( page ); emit newTelexPageSet( page );
} }
} }
}
} }
/* Set the transparency on teletext */ /* Set the transparency on teletext */
void InputManager::telexSetTransparency( bool b_transparentTelextext ) void InputManager::telexSetTransparency( bool b_transparentTelextext )
{ {
if( hasInput() ) if( hasInput() && p_input_vbi )
{ {
vlc_object_t *p_vbi = (vlc_object_t *) vlc_object_find_name( p_input, var_SetBool( p_input_vbi, "vbi-opaque", !b_transparentTelextext );
"zvbi", FIND_CHILD );
if( p_vbi )
{
var_SetBool( p_vbi, "vbi-opaque", !b_transparentTelextext );
vlc_object_release( p_vbi );
emit teletextTransparencyActivated( b_transparentTelextext ); emit teletextTransparencyActivated( b_transparentTelextext );
} }
}
} }
void InputManager::activateTeletext( bool b_enable ) void InputManager::activateTeletext( bool b_enable )
......
...@@ -137,6 +137,7 @@ public: ...@@ -137,6 +137,7 @@ public:
private: private:
intf_thread_t *p_intf; intf_thread_t *p_intf;
input_thread_t *p_input; input_thread_t *p_input;
vlc_object_t *p_input_vbi;
input_item_t *p_item; input_item_t *p_item;
int i_old_playing_status; int i_old_playing_status;
QString oldName; QString oldName;
......
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