Commit 1c8e75e8 authored by Rémi Duraffort's avatar Rémi Duraffort

Use var_TriggerCallback instead of var_SetVoid (the result is exactly the same

but a bit faster).
parent ec1ca416
......@@ -3055,12 +3055,12 @@ static int Control( vlc_object_t *p_obj, demux_sys_t *p_sys, int i_fd,
case VLC_VAR_BOOL:
val.b_bool = control.value;
var_Change( p_obj, psz_name, VLC_VAR_SETVALUE, &val, NULL );
var_SetVoid( p_obj, "controls-update" );
var_TriggerCallback( p_obj, "controls-update" );
break;
case VLC_VAR_INTEGER:
val.i_int = control.value;
var_Change( p_obj, psz_name, VLC_VAR_SETVALUE, &val, NULL );
var_SetVoid( p_obj, "controls-update" );
var_TriggerCallback( p_obj, "controls-update" );
break;
}
}
......
......@@ -236,7 +236,7 @@ static void RunIntf( intf_thread_t *p_intf )
p_input = playlist_CurrentInput( p_playlist );
if( p_input )
{
var_SetVoid( p_input, "rate-slower" );
var_TriggerCallback( p_input, "rate-slower" );
vlc_object_release( p_input );
}
break;
......@@ -246,7 +246,7 @@ static void RunIntf( intf_thread_t *p_intf )
p_input = playlist_CurrentInput( p_playlist );
if( p_input )
{
var_SetVoid( p_input, "rate-faster" );
var_TriggerCallback( p_input, "rate-faster" );
vlc_object_release( p_input );
}
break;
......
......@@ -689,19 +689,19 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
}
else if( i_action == ACTIONID_FRAME_NEXT )
{
var_SetVoid( p_input, "frame-next" );
var_TriggerCallback( p_input, "frame-next" );
vout_OSDMessage( VLC_OBJECT(p_input), DEFAULT_CHAN,
"%s", _("Next frame") );
}
else if( i_action == ACTIONID_FASTER )
{
var_SetVoid( p_input, "rate-faster" );
var_TriggerCallback( p_input, "rate-faster" );
vout_OSDMessage( VLC_OBJECT(p_input), DEFAULT_CHAN,
"%s", _("Faster") );
}
else if( i_action == ACTIONID_SLOWER )
{
var_SetVoid( p_input, "rate-slower" );
var_TriggerCallback( p_input, "rate-slower" );
vout_OSDMessage( VLC_OBJECT(p_input), DEFAULT_CHAN,
"%s", _("Slower") );
}
......@@ -754,13 +754,13 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
}
/* Only makes sense with DVD */
else if( i_action == ACTIONID_TITLE_PREV )
var_SetVoid( p_input, "prev-title" );
var_TriggerCallback( p_input, "prev-title" );
else if( i_action == ACTIONID_TITLE_NEXT )
var_SetVoid( p_input, "next-title" );
var_TriggerCallback( p_input, "next-title" );
else if( i_action == ACTIONID_CHAPTER_PREV )
var_SetVoid( p_input, "prev-chapter" );
var_TriggerCallback( p_input, "prev-chapter" );
else if( i_action == ACTIONID_CHAPTER_NEXT )
var_SetVoid( p_input, "next-chapter" );
var_TriggerCallback( p_input, "next-chapter" );
else if( i_action == ACTIONID_DISC_MENU )
var_SetInteger( p_input, "title 0", 2 );
......
......@@ -1086,12 +1086,12 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
}
else if ( !strcmp( psz_cmd, "faster" ) )
{
var_SetVoid( p_input, "rate-faster" );
var_TriggerCallback( p_input, "rate-faster" );
i_error = VLC_SUCCESS;
}
else if ( !strcmp( psz_cmd, "slower" ) )
{
var_SetVoid( p_input, "rate-slower" );
var_TriggerCallback( p_input, "rate-slower" );
i_error = VLC_SUCCESS;
}
else if ( !strcmp( psz_cmd, "normal" ) )
......@@ -1120,9 +1120,9 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
}
}
else if( !strcmp( psz_cmd, "chapter_n" ) )
var_SetVoid( p_input, "next-chapter" );
var_TriggerCallback( p_input, "next-chapter" );
else if( !strcmp( psz_cmd, "chapter_p" ) )
var_SetVoid( p_input, "prev-chapter" );
var_TriggerCallback( p_input, "prev-chapter" );
i_error = VLC_SUCCESS;
}
else if( !strcmp( psz_cmd, "title" ) ||
......@@ -1144,9 +1144,9 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
}
}
else if( !strcmp( psz_cmd, "title_n" ) )
var_SetVoid( p_input, "next-title" );
var_TriggerCallback( p_input, "next-title" );
else if( !strcmp( psz_cmd, "title_p" ) )
var_SetVoid( p_input, "prev-title" );
var_TriggerCallback( p_input, "prev-title" );
i_error = VLC_SUCCESS;
}
......
......@@ -565,14 +565,14 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
case PREV_TITLE:
if( p_input )
{
var_SetVoid( p_input, "prev-title" );
var_TriggerCallback( p_input, "prev-title" );
}
break;
case NEXT_TITLE:
if( p_input )
{
var_SetVoid( p_input, "next-title" );
var_TriggerCallback( p_input, "next-title" );
}
break;
......@@ -590,14 +590,14 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
case PREV_CHAPTER:
if( p_input )
{
var_SetVoid( p_input, "prev-chapter" );
var_TriggerCallback( p_input, "prev-chapter" );
}
break;
case NEXT_CHAPTER:
if( p_input )
{
var_SetVoid( p_input, "next-chapter" );
var_TriggerCallback( p_input, "next-chapter" );
}
break;
......@@ -636,7 +636,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
{
if( val.i_int > 1 )
{
var_SetVoid( p_input, "prev-chapter" );
var_TriggerCallback( p_input, "prev-chapter" );
break;
}
}
......@@ -646,7 +646,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
{
if( val.i_int > 1 )
{
var_SetVoid( p_input, "prev-title" );
var_TriggerCallback( p_input, "prev-title" );
break;
}
}
......@@ -668,7 +668,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
int i_chapter_count = var_CountChoices( p_input, "chapter" );
if( i_chapter_count > val.i_int )
{
var_SetVoid( p_input, "next-chapter" );
var_TriggerCallback( p_input, "next-chapter" );
break;
}
}
......@@ -679,7 +679,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
int i_title_count = var_CountChoices( p_input, "title" );
if( i_title_count > val.i_int )
{
var_SetVoid( p_input, "next-title" );
var_TriggerCallback( p_input, "next-title" );
break;
}
}
......
......@@ -1167,22 +1167,22 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
case '[':
if( p_sys->p_input )
var_SetVoid( p_sys->p_input, "prev-title" );
var_TriggerCallback( p_sys->p_input, "prev-title" );
break;
case ']':
if( p_sys->p_input )
var_SetVoid( p_sys->p_input, "next-title" );
var_TriggerCallback( p_sys->p_input, "next-title" );
break;
case '<':
if( p_sys->p_input )
var_SetVoid( p_sys->p_input, "prev-chapter" );
var_TriggerCallback( p_sys->p_input, "prev-chapter" );
break;
case '>':
if( p_sys->p_input )
var_SetVoid( p_sys->p_input, "next-chapter" );
var_TriggerCallback( p_sys->p_input, "next-chapter" );
break;
case 'p':
......
......@@ -358,7 +358,7 @@ void onRewind(GtkButton *button, gpointer user_data)
if (p_intf->p_sys->p_input != NULL)
{
var_SetVoid( p_intf->p_sys->p_input, "rate-slower" );
var_TriggerCallback( p_intf->p_sys->p_input, "rate-slower" );
}
}
......@@ -413,7 +413,7 @@ void onForward(GtkButton *button, gpointer user_data)
if (p_intf->p_sys->p_input != NULL)
{
var_SetVoid( p_intf->p_sys->p_input, "rate-faster" );
var_TriggerCallback( p_intf->p_sys->p_input, "rate-faster" );
}
}
......
......@@ -165,7 +165,7 @@ void ActionsManager::frame()
{
input_thread_t *p_input = THEMIM->getInput();
if( p_input )
var_SetVoid( p_input, "frame-next" );
var_TriggerCallback( p_input, "frame-next" );
}
void ActionsManager::toggleMuteAudio()
......
......@@ -803,7 +803,7 @@ void ExtV4l2::ValueChange( int value )
var_SetBool( p_obj, psz_var, value );
break;
case VLC_VAR_VOID:
var_SetVoid( p_obj, psz_var );
var_TriggerCallback( p_obj, psz_var );
break;
}
free( psz_var );
......
......@@ -672,8 +672,8 @@ void InputManager::sectionPrev()
if( hasInput() )
{
int i_type = var_Type( p_input, "next-chapter" );
var_SetVoid( p_input, (i_type & VLC_VAR_TYPE) != 0 ?
"prev-chapter":"prev-title" );
var_TriggerCallback( p_input, (i_type & VLC_VAR_TYPE) != 0 ?
"prev-chapter":"prev-title" );
}
}
......@@ -682,8 +682,8 @@ void InputManager::sectionNext()
if( hasInput() )
{
int i_type = var_Type( p_input, "next-chapter" );
var_SetVoid( p_input, (i_type & VLC_VAR_TYPE) != 0 ?
"next-chapter":"next-title" );
var_TriggerCallback( p_input, (i_type & VLC_VAR_TYPE) != 0 ?
"next-chapter":"next-title" );
}
}
......@@ -787,13 +787,13 @@ void InputManager::reverse()
void InputManager::slower()
{
if( hasInput() )
var_SetVoid( p_input, "rate-slower" );
var_TriggerCallback( p_input, "rate-slower" );
}
void InputManager::faster()
{
if( hasInput() )
var_SetVoid( p_input, "rate-faster" );
var_TriggerCallback( p_input, "rate-faster" );
}
void InputManager::littlefaster()
......
......@@ -31,7 +31,7 @@ void CmdDvdNextTitle::execute()
FIND_ANYWHERE );
if( p_input )
{
var_SetVoid( p_input, "next-title" );
var_TriggerCallback( p_input, "next-title" );
vlc_object_release( p_input );
}
}
......@@ -44,7 +44,7 @@ void CmdDvdPreviousTitle::execute()
FIND_ANYWHERE );
if( p_input )
{
var_SetVoid( p_input, "prev-title" );
var_TriggerCallback( p_input, "prev-title" );
vlc_object_release( p_input );
}
}
......@@ -57,7 +57,7 @@ void CmdDvdNextChapter::execute()
FIND_ANYWHERE );
if( p_input )
{
var_SetVoid( p_input, "next-chapter" );
var_TriggerCallback( p_input, "next-chapter" );
vlc_object_release( p_input );
}
}
......@@ -70,7 +70,7 @@ void CmdDvdPreviousChapter::execute()
FIND_ANYWHERE );
if( p_input )
{
var_SetVoid( p_input, "prev-chapter" );
var_TriggerCallback( p_input, "prev-chapter" );
vlc_object_release( p_input );
}
}
......
......@@ -1144,7 +1144,7 @@ static int CropCallback( vlc_object_t *p_this, char const *psz_cmd,
p_vout->fmt_in.i_visible_width,
p_vout->fmt_in.i_visible_height );
var_SetVoid( p_vout, "crop-update" );
var_TriggerCallback( p_vout, "crop-update" );
return VLC_SUCCESS;
}
......
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