aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/decode.c9
-rw-r--r--src/outputBuffer.c6
-rw-r--r--src/outputBuffer.h2
3 files changed, 9 insertions, 8 deletions
diff --git a/src/decode.c b/src/decode.c
index 6e04a12e9..0dae5a1de 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -361,11 +361,6 @@ void decoderInit(void)
FATAL("Failed to spawn decoder task: %s\n", strerror(errno));
}
-static void advanceOutputBufferTo(OutputBuffer * cb, int to)
-{
- cb->begin = to;
-}
-
static void crossFade(OutputBufferChunk * a, OutputBufferChunk * b,
AudioFormat * format,
unsigned int fadePosition, unsigned int crossFadeChunks)
@@ -576,9 +571,7 @@ static void decodeParent(PlayerControl * pc, DecoderControl * dc, OutputBuffer *
/* the cross-fade is finished; skip
the section which was cross-faded
(and thus already played) */
- nextChunk = outputBufferAbsolute(cb, crossFadeChunks);
- if (nextChunk >= 0)
- advanceOutputBufferTo(cb, nextChunk);
+ output_buffer_skip(cb, crossFadeChunks);
}
doCrossFade = 0;
diff --git a/src/outputBuffer.c b/src/outputBuffer.c
index 0d114a1a6..4995fa9a5 100644
--- a/src/outputBuffer.c
+++ b/src/outputBuffer.c
@@ -218,3 +218,9 @@ int sendDataToOutputBuffer(OutputBuffer * cb, InputStream * inStream,
return 0;
}
+void output_buffer_skip(OutputBuffer * cb, unsigned num)
+{
+ int i = outputBufferAbsolute(cb, num);
+ if (i >= 0)
+ cb->begin = i;
+}
diff --git a/src/outputBuffer.h b/src/outputBuffer.h
index ac2ffac3f..28bb743b3 100644
--- a/src/outputBuffer.h
+++ b/src/outputBuffer.h
@@ -99,4 +99,6 @@ int sendDataToOutputBuffer(OutputBuffer * cb,
float data_time,
mpd_uint16 bitRate, ReplayGainInfo * replayGainInfo);
+void output_buffer_skip(OutputBuffer * cb, unsigned num);
+
#endif