{
case EXTENSION_EVENT_CLICK:
assert( p_widget != NULL );
- PushCommand( p_ext, CMD_CLICK, p_widget );
+ PushCommandUnique( p_ext, CMD_CLICK, p_widget );
break;
case EXTENSION_EVENT_CLOSE:
PushCommandUnique( p_ext, CMD_CLOSE );
if( b_unique && last->i_command == i_command )
{
// Do not push this 'unique' command a second time
- b_skip = true;
+ b_skip = !memcmp( last->data, cmd->data, sizeof( cmd->data ) );
break;
}
else
}
}
if( !b_skip )
- last->next = cmd;
+ {
+ if( !b_unique || ( last->i_command != i_command )
+ || memcmp( last->data, cmd->data, sizeof( cmd->data ) ) != 0 )
+ last->next = cmd;
+ }
}
vlc_cond_signal( &p_ext->p_sys->wait );
{
/* Pop command in front */
struct command_t *cmd = p_ext->p_sys->command;
- if( cmd )
- {
- p_ext->p_sys->command = cmd->next;
- cmd->next = NULL; // This prevents FreeCommands from freeing next
- }
-
vlc_mutex_unlock( &p_ext->p_sys->command_lock );
/* Run command */
}
}
- FreeCommands( cmd );
+ if( cmd )
+ {
+ p_ext->p_sys->command = cmd->next;
+ cmd->next = NULL; // This prevents FreeCommands from freeing next
+ FreeCommands( cmd );
+ }
vlc_mutex_lock( &p_ext->p_sys->command_lock );
if( !p_ext->p_sys->b_exiting && !p_ext->p_sys->command )