aboutsummaryrefslogtreecommitdiffstats
path: root/src/outputBuffer.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-03-26 10:38:12 +0000
committerEric Wong <normalperson@yhbt.net>2008-03-26 10:38:12 +0000
commit1910df96a321085410be575a0148dce586929c4b (patch)
tree4842b80f383ac550f22687cf6dc19355d086c83d /src/outputBuffer.c
parent27f12c173d57d09d095d0e5ecfeb18acf5d2434a (diff)
downloadmpd-1910df96a321085410be575a0148dce586929c4b.tar.gz
mpd-1910df96a321085410be575a0148dce586929c4b.tar.xz
mpd-1910df96a321085410be575a0148dce586929c4b.zip
moved code to initOutputBuffer()
This patch moves code which initializes the OutputBuffer struct to outputBuffer.c. Although this is generally a good idea, it prepares the following patch. git-svn-id: https://svn.musicpd.org/mpd/trunk@7206 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/outputBuffer.c')
-rw-r--r--src/outputBuffer.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/outputBuffer.c b/src/outputBuffer.c
index 25325ecb7..25c9b3c12 100644
--- a/src/outputBuffer.c
+++ b/src/outputBuffer.c
@@ -30,6 +30,23 @@ static mpd_sint16 currentChunk = -1;
static mpd_sint8 currentMetaChunk = -1;
static mpd_sint8 sendMetaChunk;
+void initOutputBuffer(OutputBuffer * cb, char *chunks)
+{
+ memset(&cb->convState, 0, sizeof(ConvState));
+ cb->chunks = chunks;
+ cb->chunkSize = (mpd_uint16 *) (((char *)cb->chunks) +
+ buffered_chunks * CHUNK_SIZE);
+ cb->bitRate = (mpd_uint16 *) (((char *)cb->chunkSize) +
+ buffered_chunks * sizeof(mpd_sint16));
+ cb->metaChunk = (mpd_sint8 *) (((char *)cb->bitRate) +
+ buffered_chunks *
+ sizeof(mpd_sint16));
+ cb->times =
+ (float *)(((char *)cb->metaChunk) +
+ buffered_chunks * sizeof(mpd_sint8));
+ cb->acceptMetadata = 0;
+}
+
void clearAllMetaChunkSets(OutputBuffer * cb)
{
memset(cb->metaChunkSet, 0, BUFFERED_METACHUNKS);