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.
This commit is contained in:
Max Kellermann 2010-11-05 19:24:42 +01:00
parent cc261872c2
commit 83ec0e5552
2 changed files with 9 additions and 0 deletions

1
NEWS
View File

@ -1,4 +1,5 @@
ver 0.15.14 (2010/??/??) 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 * output_thread: fix assertion failure due to race condition in OPEN
* input: * input:
- rewind: fix double free bug - rewind: fix double free bug

View File

@ -334,6 +334,14 @@ static bool player_seek_decoder(struct player *player)
return false; return false;
} }
} else { } 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; pc.next_song = NULL;
player->queued = false; player->queued = false;
} }