diff options
author | Max Kellermann <max@duempel.org> | 2008-03-26 10:38:12 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-03-26 10:38:12 +0000 |
commit | 1910df96a321085410be575a0148dce586929c4b (patch) | |
tree | 4842b80f383ac550f22687cf6dc19355d086c83d /src/playerData.c | |
parent | 27f12c173d57d09d095d0e5ecfeb18acf5d2434a (diff) | |
download | mpd-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/playerData.c')
-rw-r--r-- | src/playerData.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/playerData.c b/src/playerData.c index a84601bb0..551582e45 100644 --- a/src/playerData.c +++ b/src/playerData.c @@ -37,7 +37,6 @@ void initPlayerData(void) int crossfade = 0; size_t bufferSize = DEFAULT_BUFFER_SIZE; size_t allocationSize; - OutputBuffer *buffer; ConfigParam *param; size_t device_array_size = audio_device_count() * sizeof(mpd_sint8); @@ -95,21 +94,9 @@ void initPlayerData(void) playerData_pd->audioDeviceStates = (mpd_uint8 *)playerData_pd + allocationSize - device_array_size; - buffer = &(playerData_pd->buffer); - - memset(&buffer->convState, 0, sizeof(ConvState)); - buffer->chunks = ((char *)playerData_pd) + sizeof(PlayerData); - buffer->chunkSize = (mpd_uint16 *) (((char *)buffer->chunks) + - buffered_chunks * CHUNK_SIZE); - buffer->bitRate = (mpd_uint16 *) (((char *)buffer->chunkSize) + - buffered_chunks * sizeof(mpd_sint16)); - buffer->metaChunk = (mpd_sint8 *) (((char *)buffer->bitRate) + - buffered_chunks * - sizeof(mpd_sint16)); - buffer->times = - (float *)(((char *)buffer->metaChunk) + - buffered_chunks * sizeof(mpd_sint8)); - buffer->acceptMetadata = 0; + + initOutputBuffer(&(playerData_pd->buffer), + ((char *)playerData_pd) + sizeof(PlayerData)); playerData_pd->playerControl.wait = 0; playerData_pd->playerControl.stop = 0; |