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