aboutsummaryrefslogtreecommitdiff
path: root/src/pipe.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-02 14:15:47 +0100
committerMax Kellermann <max@duempel.org>2008-11-02 14:15:47 +0100
commit8964c69a643108a4b4828c99111517c0f6f8e3d0 (patch)
treef74d3a7af2f79393fe7471bcdc2737e3cd801bd3 /src/pipe.c
parent767b4c95bdb468429232a96242bd73b8e92d8660 (diff)
music_pipe: renamed struct output_buffer to struct music_pipe
.. and rename ob_chunk to struct music_chunk.
Diffstat (limited to 'src/pipe.c')
-rw-r--r--src/pipe.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/pipe.c b/src/pipe.c
index 9b868383..28a24803 100644
--- a/src/pipe.c
+++ b/src/pipe.c
@@ -23,7 +23,7 @@
#include <assert.h>
#include <string.h>
-struct output_buffer ob;
+struct music_pipe ob;
void
ob_init(unsigned int size, struct notify *notify)
@@ -82,7 +82,7 @@ static void output_buffer_expand(unsigned i)
void ob_flush(void)
{
- ob_chunk *chunk = ob_get_chunk(ob.end);
+ struct music_chunk *chunk = ob_get_chunk(ob.end);
if (chunk->chunkSize > 0) {
unsigned int next = successor(ob.end);
@@ -139,7 +139,8 @@ int ob_absolute(const unsigned relative)
return (int)i;
}
-ob_chunk * ob_get_chunk(const unsigned i)
+struct music_chunk *
+ob_get_chunk(const unsigned i)
{
assert(i < ob.size);
@@ -152,11 +153,12 @@ ob_chunk * ob_get_chunk(const unsigned i)
* @return the chunk which has room for more data; NULL if there is no
* room.
*/
-static ob_chunk *tail_chunk(float data_time, uint16_t bitRate)
+static struct music_chunk *
+tail_chunk(float data_time, uint16_t bitRate)
{
const size_t frame_size = audio_format_frame_size(&ob.audioFormat);
unsigned int next;
- ob_chunk *chunk;
+ struct music_chunk *chunk;
chunk = ob_get_chunk(ob.end);
assert(chunk->chunkSize <= sizeof(chunk->data));
@@ -189,7 +191,7 @@ size_t ob_append(const void *data0, size_t datalen,
const unsigned char *data = data0;
const size_t frame_size = audio_format_frame_size(&ob.audioFormat);
size_t ret = 0, dataToSend;
- ob_chunk *chunk = NULL;
+ struct music_chunk *chunk = NULL;
/* no partial frames allowed */
assert((datalen % frame_size) == 0);