diff options
author | Max Kellermann <max@duempel.org> | 2008-10-11 12:52:57 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-11 12:52:57 +0200 |
commit | 2fcbabf4d1a25ccc27b9d40c10f6643541853d4d (patch) | |
tree | 592fc64eb3e65e3c3613baba16716d4d59fecf0c /src/player_control.c | |
parent | 42409a35e2468f13a03d23417f73730f1f8e41d5 (diff) | |
download | mpd-2fcbabf4d1a25ccc27b9d40c10f6643541853d4d.tar.gz mpd-2fcbabf4d1a25ccc27b9d40c10f6643541853d4d.tar.xz mpd-2fcbabf4d1a25ccc27b9d40c10f6643541853d4d.zip |
player: removed set_current_song()
set_current_song() is an internal function and consists of only one
assignment. Eliminate it.
Diffstat (limited to 'src/player_control.c')
-rw-r--r-- | src/player_control.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/player_control.c b/src/player_control.c index 0c4063693..8ba215ae1 100644 --- a/src/player_control.c +++ b/src/player_control.c @@ -44,15 +44,6 @@ void pc_deinit(void) 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) { pc.command = cmd; @@ -65,6 +56,7 @@ static void player_command(enum player_command cmd) void playerPlay(struct song *song) { + assert(song != NULL); assert(pc.queueLockState == PLAYER_QUEUE_UNLOCKED); if (pc.state != PLAYER_STATE_STOP) @@ -72,7 +64,7 @@ playerPlay(struct song *song) pc.queueState = PLAYER_QUEUE_BLANK; - set_current_song(song); + pc.next_song = song; player_command(PLAYER_COMMAND_PLAY); } @@ -179,9 +171,10 @@ char *getPlayerErrorStr(void) void queueSong(struct song *song) { + assert(song != NULL); assert(pc.queueState == PLAYER_QUEUE_BLANK); - set_current_song(song); + pc.next_song = song; pc.queueState = PLAYER_QUEUE_FULL; } @@ -219,8 +212,7 @@ playerSeek(struct song *song, float seek_time) if (pc.state == PLAYER_STATE_STOP) return -1; - if (pc.next_song != song) - set_current_song(song); + pc.next_song = song; if (pc.error == PLAYER_ERROR_NOERROR) { pc.seekWhere = seek_time; |