aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-11-05 19:24:42 +0100
committerMax Kellermann <max@duempel.org>2010-11-05 19:24:42 +0100
commit83ec0e55523b05c724dcf8ef68839e04d4911396 (patch)
tree2864c8209280970071d39399d7457e7790ba58e5
parentcc261872c25be3a5792be8ae160e070d1bbedf0b (diff)
downloadmpd-83ec0e55523b05c724dcf8ef68839e04d4911396.tar.gz
mpd-83ec0e55523b05c724dcf8ef68839e04d4911396.tar.xz
mpd-83ec0e55523b05c724dcf8ef68839e04d4911396.zip
player_thread: fix assertion failure due to wrong music pipe on seek
When one song is played twice, and the decoder is working on the second "instance", but the first should be seeked, the check in player_seek_decoder() may assume that it can reuse the decoder without exchanging pipes. The last thing was the mistake: the pipe pointer was different, which led to an assertion failure. This patch adds another check which exchanges the player pipe.
-rw-r--r--NEWS1
-rw-r--r--src/player_thread.c8
2 files changed, 9 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 3a61e1149..29ce2dcc4 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,5 @@
ver 0.15.14 (2010/??/??)
+* player_thread: fix assertion failure due to wrong music pipe on seek
* output_thread: fix assertion failure due to race condition in OPEN
* input:
- rewind: fix double free bug
diff --git a/src/player_thread.c b/src/player_thread.c
index 3d2ebcb42..d428484c7 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -334,6 +334,14 @@ static bool player_seek_decoder(struct player *player)
return false;
}
} else {
+ if (!player_dc_at_current_song(player)) {
+ /* the decoder is already decoding the "next" song,
+ but it is the same song file; exchange the pipe */
+ music_pipe_clear(player->pipe, player_buffer);
+ music_pipe_free(player->pipe);
+ player->pipe = dc.pipe;
+ }
+
pc.next_song = NULL;
player->queued = false;
}