aboutsummaryrefslogtreecommitdiffstats
path: root/src/outputBuffer.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-04-12 04:13:24 +0000
committerEric Wong <normalperson@yhbt.net>2008-04-12 04:13:24 +0000
commit74910df0f367143e73e460524b31bacead953b16 (patch)
tree571196ade2bc01216679b5181b72d7e754a1f48a /src/outputBuffer.h
parent68a625b5b819416dacf2e4def6e124413d5226c5 (diff)
downloadmpd-74910df0f367143e73e460524b31bacead953b16.tar.gz
mpd-74910df0f367143e73e460524b31bacead953b16.tar.xz
mpd-74910df0f367143e73e460524b31bacead953b16.zip
added struct OutputBufferChunk
To make access to OutputBuffer easier, move everything which belongs to a chunk into its own structure, namely OutputBufferChunk. git-svn-id: https://svn.musicpd.org/mpd/trunk@7269 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/outputBuffer.h')
-rw-r--r--src/outputBuffer.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/outputBuffer.h b/src/outputBuffer.h
index b4d96acf2..a99489968 100644
--- a/src/outputBuffer.h
+++ b/src/outputBuffer.h
@@ -32,15 +32,19 @@
/* pick 1020 since its devisible for 8,16,24, and 32-bit audio */
#define CHUNK_SIZE 1020
+typedef struct _OutputBufferChunk {
+ volatile mpd_uint16 chunkSize;
+ volatile mpd_uint16 bitRate;
+ volatile float times;
+ char data[CHUNK_SIZE];
+} OutputBufferChunk;
+
/**
* A ring set of buffers where the decoder appends data after the end,
* and the player consumes data from the beginning.
*/
typedef struct _OutputBuffer {
- char *volatile chunks;
- mpd_uint16 *volatile chunkSize;
- mpd_uint16 *volatile bitRate;
- float *volatile times;
+ OutputBufferChunk *chunks;
/** the index of the first decoded chunk */
mpd_uint16 volatile begin;
@@ -52,7 +56,7 @@ typedef struct _OutputBuffer {
ConvState convState;
} OutputBuffer;
-void initOutputBuffer(OutputBuffer * cb, char *chunks);
+void initOutputBuffer(OutputBuffer * cb, OutputBufferChunk * chunks);
void clearOutputBuffer(OutputBuffer * cb);
@@ -76,7 +80,7 @@ unsigned availableOutputBuffer(const OutputBuffer * cb);
*/
int outputBufferAbsolute(const OutputBuffer * cb, unsigned relative);
-char * outputBufferChunkData(const OutputBuffer * cb, unsigned i);
+OutputBufferChunk * outputBufferGetChunk(const OutputBuffer * cb, unsigned i);
/* we send inStream for buffering the inputStream while waiting to
send the next chunk */