#include <stdlib.h> /* malloc(), free() */
#include <vlc/vlc.h>
-#include <vlc/intf.h>
-#include <vlc/input.h>
-#include <vlc/vout.h>
-#include <vlc/aout.h>
+#include <vlc_interface.h>
+#include <vlc_input.h>
+#include <vlc_vout.h>
+#include <vlc_aout.h>
#include <vlc_osd.h>
-
+#include <vlc_playlist.h>
#include "vlc_keys.h"
#define BUFFER_SIZE 10
{
vlc_object_release( p_intf->p_sys->p_vout );
}
+ vlc_mutex_destroy( &p_intf->p_sys->change_lock );
/* Destroy structure */
free( p_intf->p_sys );
}
int i_times = 0;
/* Sleep a bit */
- msleep( INTF_IDLE_SLEEP );
+// msleep( INTF_IDLE_SLEEP );
/* Update the input */
if( p_intf->p_sys->p_input == NULL )
if( !i_action )
{
+ vlc_mutex_lock( &p_intf->object_lock );
+ vlc_cond_wait( &p_intf->object_wait, &p_intf->object_lock );
+ vlc_mutex_unlock( &p_intf->object_lock );
/* No key pressed, sleep a bit more */
- msleep( INTF_IDLE_SLEEP );
+// msleep( INTF_IDLE_SLEEP );
continue;
}
p_intf->p_sys->p_keys[ p_intf->p_sys->i_size ] = newval.i_int;
p_intf->p_sys->i_size++;
}
+ vlc_mutex_lock( &p_intf->object_lock );
+ vlc_cond_signal( &p_intf->object_wait );
+ vlc_mutex_unlock( &p_intf->object_lock );
vlc_mutex_unlock( &p_intf->p_sys->change_lock );
return VLC_SUCCESS;
var_Get( p_intf, psz_bookmark_name, &val );
char *psz_bookmark = strdup( val.psz_string );
- for( i = 0; i < p_playlist->i_size; i++)
- {
- if( !strcmp( psz_bookmark,
- p_playlist->pp_items[i]->p_input->psz_uri ) )
+ PL_LOCK;
+ FOREACH_ARRAY( playlist_item_t *p_item, p_playlist->items )
+ if( !strcmp( psz_bookmark, p_item->p_input->psz_uri ) )
{
- playlist_LockControl( p_playlist, PLAYLIST_VIEWPLAY, NULL,
- p_playlist->pp_items[i] );
+ playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, VLC_TRUE,
+ NULL, p_item );
break;
}
- }
+ FOREACH_END();
+ PL_UNLOCK;
vlc_object_release( p_playlist );
}