player: removed set_current_song()
set_current_song() is an internal function and consists of only one assignment. Eliminate it.
This commit is contained in:
parent
42409a35e2
commit
2fcbabf4d1
|
@ -44,15 +44,6 @@ void pc_deinit(void)
|
||||||
notify_deinit(&pc.notify);
|
notify_deinit(&pc.notify);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
set_current_song(struct song *song)
|
|
||||||
{
|
|
||||||
assert(song != NULL);
|
|
||||||
assert(song->url != NULL);
|
|
||||||
|
|
||||||
pc.next_song = song;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void player_command(enum player_command cmd)
|
static void player_command(enum player_command cmd)
|
||||||
{
|
{
|
||||||
pc.command = cmd;
|
pc.command = cmd;
|
||||||
|
@ -65,6 +56,7 @@ static void player_command(enum player_command cmd)
|
||||||
void
|
void
|
||||||
playerPlay(struct song *song)
|
playerPlay(struct song *song)
|
||||||
{
|
{
|
||||||
|
assert(song != NULL);
|
||||||
assert(pc.queueLockState == PLAYER_QUEUE_UNLOCKED);
|
assert(pc.queueLockState == PLAYER_QUEUE_UNLOCKED);
|
||||||
|
|
||||||
if (pc.state != PLAYER_STATE_STOP)
|
if (pc.state != PLAYER_STATE_STOP)
|
||||||
|
@ -72,7 +64,7 @@ playerPlay(struct song *song)
|
||||||
|
|
||||||
pc.queueState = PLAYER_QUEUE_BLANK;
|
pc.queueState = PLAYER_QUEUE_BLANK;
|
||||||
|
|
||||||
set_current_song(song);
|
pc.next_song = song;
|
||||||
player_command(PLAYER_COMMAND_PLAY);
|
player_command(PLAYER_COMMAND_PLAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,9 +171,10 @@ char *getPlayerErrorStr(void)
|
||||||
void
|
void
|
||||||
queueSong(struct song *song)
|
queueSong(struct song *song)
|
||||||
{
|
{
|
||||||
|
assert(song != NULL);
|
||||||
assert(pc.queueState == PLAYER_QUEUE_BLANK);
|
assert(pc.queueState == PLAYER_QUEUE_BLANK);
|
||||||
|
|
||||||
set_current_song(song);
|
pc.next_song = song;
|
||||||
pc.queueState = PLAYER_QUEUE_FULL;
|
pc.queueState = PLAYER_QUEUE_FULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,8 +212,7 @@ playerSeek(struct song *song, float seek_time)
|
||||||
if (pc.state == PLAYER_STATE_STOP)
|
if (pc.state == PLAYER_STATE_STOP)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (pc.next_song != song)
|
pc.next_song = song;
|
||||||
set_current_song(song);
|
|
||||||
|
|
||||||
if (pc.error == PLAYER_ERROR_NOERROR) {
|
if (pc.error == PLAYER_ERROR_NOERROR) {
|
||||||
pc.seekWhere = seek_time;
|
pc.seekWhere = seek_time;
|
||||||
|
|
Loading…
Reference in New Issue