diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2007-02-11 20:36:26 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2007-02-11 20:36:26 +0000 |
commit | b54c7c64c00dca82a5a1699140ec828343be0cbf (patch) | |
tree | 9cd41b36d785998fcc019596b289498e6cf49f61 /src/outputBuffer.c | |
parent | c5933a164a2b25352becda8b0f103b42bc646348 (diff) | |
download | mpd-b54c7c64c00dca82a5a1699140ec828343be0cbf.tar.gz mpd-b54c7c64c00dca82a5a1699140ec828343be0cbf.tar.xz mpd-b54c7c64c00dca82a5a1699140ec828343be0cbf.zip |
#1) fix a few potential deadlock conditons in decode.c when crossfading is enabled
#2) fix a deadlock condition when attempting to seek if the decoder quit and returned to playerInit()
git-svn-id: https://svn.musicpd.org/mpd/trunk@5325 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/outputBuffer.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/outputBuffer.c b/src/outputBuffer.c index c27a8e671..3011505bf 100644 --- a/src/outputBuffer.c +++ b/src/outputBuffer.c @@ -58,11 +58,10 @@ void clearOutputBuffer(OutputBuffer * cb) void flushOutputBuffer(OutputBuffer * cb) { if (currentChunk == cb->end) { - int next = cb->end + 1; - if (next >= buffered_chunks) { - next = 0; + if ((cb->end + 1) >= buffered_chunks) { + cb->end = 0; } - cb->end = next; + else cb->end++; currentChunk = -1; } } |