* REST: remove code duplication in some places. there might be more locations.
FIND_ANYWHERE );
if( p_playlist )
{
- vlc_mutex_lock( &p_playlist->object_lock );
- if( p_playlist->i_size )
- {
- vlc_mutex_unlock( &p_playlist->object_lock );
- playlist_Play( p_playlist );
- vlc_object_release( p_playlist );
- }
+ playlist_Play( p_playlist );
+ vlc_object_release( p_playlist );
}
}
else if( i_action == ACTIONID_PLAY_PAUSE )
[self setSubmenusEnabled: FALSE];
[self manageVolumeSlider];
- /* Check if we need to start playing */
- if( p_intf->b_play )
- {
- p_playlist = (playlist_t *) vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ p_playlist = (playlist_t *) vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
- if( p_playlist )
+ if( p_playlist )
+ {
+ /* Check if we need to start playing */
+ if( p_intf->b_play )
{
playlist_Play( p_playlist );
- vlc_object_release( p_playlist );
}
+ [o_btn_fullscreen setState: ( var_Get( p_playlist, "fullscreen", &val )>=0 && val.b_bool )];
+ vlc_object_release( p_playlist );
}
-
- [o_btn_fullscreen setState: ( var_Get( p_playlist, "fullscreen", &val )>=0 && val.b_bool )];
}
- (void)initStrings
FIND_ANYWHERE );
if( p_playlist )
{
- vlc_mutex_lock( &p_playlist->object_lock );
- if( p_playlist->i_size )
- {
- vlc_mutex_unlock( &p_playlist->object_lock );
- playlist_Play( p_playlist );
- }
- else
- {
- vlc_mutex_unlock( &p_playlist->object_lock );
- }
+ playlist_Play( p_playlist );
vlc_object_release( p_playlist );
}
}
/**
- * Do a playlist action
+ * Do a playlist action.
*
+ * If there is something in the playlist then you can do playlist actions.
* \param p_playlist the playlist to do the command on
* \param i_command the command to do
* \param i_arg the argument to the command. See playlist_command_t for details
vlc_mutex_lock( &p_playlist->object_lock );
+ if( p_playlist->i_size <= 0 )
+ {
+ vlc_mutex_unlock( &p_playlist->object_lock );
+ return;
+ }
+
switch( i_command )
{
case PLAYLIST_STOP: