Commit 76c03d8c authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

playlist: b_reset_currently_playing is private.

parent 5bb0e510
......@@ -163,8 +163,6 @@ struct playlist_t
playlist_item_array_t current; /**< Items currently being played */
int i_current_index; /**< Index in current array */
/** Reset current item array */
bool b_reset_currently_playing;
int i_last_playlist_id; /**< Last id to an item */
......
......@@ -118,7 +118,7 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args
pl_priv(p_playlist)->request.p_node = p_node;
pl_priv(p_playlist)->request.p_item = p_item;
if( p_item && var_GetBool( p_playlist, "random" ) )
p_playlist->b_reset_currently_playing = true;
pl_priv(p_playlist)->b_reset_currently_playing = true;
break;
case PLAYLIST_PLAY:
......@@ -325,7 +325,7 @@ void ResetCurrentlyPlaying( playlist_t *p_playlist, bool b_random,
ARRAY_VAL(p_playlist->current,j) = p_tmp;
}
}
p_playlist->b_reset_currently_playing = false;
pl_priv(p_playlist)->b_reset_currently_playing = false;
stats_TimerStop( p_playlist, STATS_TIMER_PLAYLIST_BUILD );
}
......@@ -397,7 +397,7 @@ playlist_item_t * playlist_NextItem( playlist_t *p_playlist )
set_current_status_node( p_playlist, pl_priv(p_playlist)->request.p_node );
pl_priv(p_playlist)->request.p_node = NULL;
p_playlist->b_reset_currently_playing = true;
pl_priv(p_playlist)->b_reset_currently_playing = true;
}
/* If we are asked for a node, go to it's first child */
......@@ -418,7 +418,7 @@ playlist_item_t * playlist_NextItem( playlist_t *p_playlist )
}
}
if( p_playlist->b_reset_currently_playing )
if( pl_priv(p_playlist)->b_reset_currently_playing )
/* A bit too bad to reset twice ... */
ResetCurrentlyPlaying( p_playlist, b_random, p_new );
else if( p_new )
......@@ -469,7 +469,7 @@ playlist_item_t * playlist_NextItem( playlist_t *p_playlist )
get_current_status_item( p_playlist )->i_flags & PLAYLIST_SKIP_FLAG )
return NULL;
if( p_playlist->b_reset_currently_playing )
if( pl_priv(p_playlist)->b_reset_currently_playing )
ResetCurrentlyPlaying( p_playlist, b_random,
get_current_status_item( p_playlist ) );
......
......@@ -45,7 +45,7 @@ static int RandomCallback( vlc_object_t *p_this, char const *psz_cmd,
{
(void)psz_cmd; (void)oldval; (void)newval; (void)a;
((playlist_t*)p_this)->b_reset_currently_playing = true;
pl_priv((playlist_t*)p_this)->b_reset_currently_playing = true;
playlist_Signal( ((playlist_t*)p_this) );
return VLC_SUCCESS;
}
......@@ -91,7 +91,7 @@ playlist_t * playlist_Create( vlc_object_t *p_parent )
ARRAY_INIT( p_playlist->current );
p_playlist->i_current_index = 0;
p_playlist->b_reset_currently_playing = true;
pl_priv(p_playlist)->b_reset_currently_playing = true;
pl_priv(p_playlist)->last_rebuild_date = 0;
pl_priv(p_playlist)->b_tree = var_CreateGetBool( p_playlist, "playlist-tree" );
......@@ -362,7 +362,7 @@ void playlist_MainLoop( playlist_t *p_playlist )
PL_ASSERT_LOCKED;
if( p_playlist->b_reset_currently_playing &&
if( pl_priv(p_playlist)->b_reset_currently_playing &&
mdate() - pl_priv(p_playlist)->last_rebuild_date > 30000 ) // 30 ms
{
ResetCurrentlyPlaying( p_playlist, var_GetBool( p_playlist, "random" ),
......
......@@ -632,7 +632,7 @@ playlist_item_t *playlist_ItemToNode( playlist_t *p_playlist,
DeleteFromInput( p_playlist, p_item_in_one->p_input->i_id,
p_playlist->p_root_onelevel, false );
}
p_playlist->b_reset_currently_playing = true;
pl_priv(p_playlist)->b_reset_currently_playing = true;
vlc_object_signal_unlocked( p_playlist );
var_SetInteger( p_playlist, "item-change", p_item_in_category->
p_input->i_id );
......@@ -769,7 +769,7 @@ int playlist_TreeMove( playlist_t * p_playlist, playlist_item_t *p_item,
}
else
i_ret = TreeMove( p_playlist, p_item, p_node, i_newpos );
p_playlist->b_reset_currently_playing = true;
pl_priv(p_playlist)->b_reset_currently_playing = true;
vlc_object_signal_unlocked( p_playlist );
return i_ret;
}
......@@ -796,7 +796,7 @@ void playlist_SendAddNotify( playlist_t *p_playlist, int i_item_id,
p_add->i_item = i_item_id;
p_add->i_node = i_node_id;
val.p_address = p_add;
p_playlist->b_reset_currently_playing = true;
pl_priv(p_playlist)->b_reset_currently_playing = true;
if( b_signal )
vlc_object_signal_unlocked( p_playlist );
......@@ -919,7 +919,7 @@ static int DeleteInner( playlist_t * p_playlist, playlist_item_t *p_item,
{
return playlist_NodeDelete( p_playlist, p_item, true, false );
}
p_playlist->b_reset_currently_playing = true;
pl_priv(p_playlist)->b_reset_currently_playing = true;
var_SetInteger( p_playlist, "item-deleted", i_id );
/* Remove the item from the bank */
......
......@@ -107,6 +107,7 @@ typedef struct playlist_private_t
bool b_cant_sleep;
mtime_t gc_date;
mtime_t last_rebuild_date;
bool b_reset_currently_playing; /** Reset current item array */
} playlist_private_t;
......
......@@ -170,7 +170,7 @@ int playlist_LiveSearchUpdate( playlist_t *p_playlist, playlist_item_t *p_root,
const char *psz_string )
{
PL_ASSERT_LOCKED;
p_playlist->b_reset_currently_playing = true;
pl_priv(p_playlist)->b_reset_currently_playing = true;
playlist_LiveSearchUpdateInternal( p_playlist, p_root, psz_string );
vlc_object_signal_unlocked( p_playlist );
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