aboutsummaryrefslogtreecommitdiffstats
path: root/src/player_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-03 21:18:22 +0100
committerMax Kellermann <max@duempel.org>2009-11-03 21:18:22 +0100
commit98d30ac9cfdd12c5bb5932145adc7218ff4fca9e (patch)
tree93ac23d35ea4ae6c834f300b9e0000d3e2604b32 /src/player_thread.c
parent98150f503a808f4bb0d7be343f1a231a4c8ff0dc (diff)
downloadmpd-98d30ac9cfdd12c5bb5932145adc7218ff4fca9e.tar.gz
mpd-98d30ac9cfdd12c5bb5932145adc7218ff4fca9e.tar.xz
mpd-98d30ac9cfdd12c5bb5932145adc7218ff4fca9e.zip
decoder_control: pass pipe and buffer to dc_start()
Don't access decoder_control attributes directly.
Diffstat (limited to '')
-rw-r--r--src/player_thread.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index 91b373380..b6599ed0d 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -129,14 +129,14 @@ static void player_command_finished(void)
* Player lock is not held.
*/
static void
-player_dc_start(struct player *player)
+player_dc_start(struct player *player, struct music_pipe *pipe)
{
struct decoder_control *dc = player->dc;
assert(player->queued);
assert(pc.next_song != NULL);
- dc_start(dc, pc.next_song);
+ dc_start(dc, pc.next_song, player_buffer, pipe);
}
/**
@@ -346,10 +346,9 @@ static bool player_seek_decoder(struct player *player)
/* clear music chunks which might still reside in the
pipe */
music_pipe_clear(player->pipe, player_buffer);
- dc->pipe = player->pipe;
/* re-start the decoder */
- player_dc_start(player);
+ player_dc_start(player, player->pipe);
ret = player_wait_for_decoder(player);
if (!ret) {
/* decoder failure */
@@ -726,9 +725,7 @@ static void do_play(struct decoder_control *dc)
player.pipe = music_pipe_new();
- dc->buffer = player_buffer;
- dc->pipe = player.pipe;
- player_dc_start(&player);
+ player_dc_start(&player, player.pipe);
if (!player_wait_for_decoder(&player)) {
player_dc_stop(&player);
player_command_finished();
@@ -804,11 +801,9 @@ static void do_play(struct decoder_control *dc)
if (decoder_lock_is_idle(dc) && player.queued) {
/* the decoder has finished the current song;
make it decode the next song */
- assert(pc.next_song != NULL);
assert(dc->pipe == NULL || dc->pipe == player.pipe);
- dc->pipe = music_pipe_new();
- player_dc_start(&player);
+ player_dc_start(&player, music_pipe_new());
}
if (dc->pipe != NULL && dc->pipe != player.pipe &&