aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-02 16:57:15 +0100
committerMax Kellermann <max@duempel.org>2008-11-02 16:57:15 +0100
commit8490c1b4cfbd35f049f36c3f85396a429a80d837 (patch)
tree747231774191f6cc8473634ae03df085a680e7cf /src
parentcd61f6570f50c5ef3ba51a2864b07d52a7ab788c (diff)
downloadmpd-8490c1b4cfbd35f049f36c3f85396a429a80d837.tar.gz
mpd-8490c1b4cfbd35f049f36c3f85396a429a80d837.tar.xz
mpd-8490c1b4cfbd35f049f36c3f85396a429a80d837.zip
music_pipe: set bit_rate and time in music_pipe_append()
Don't bother to pass these values as parameters to tail_chunk().
Diffstat (limited to '')
-rw-r--r--src/pipe.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/pipe.c b/src/pipe.c
index 911dcbdb5..e8383e31a 100644
--- a/src/pipe.c
+++ b/src/pipe.c
@@ -155,7 +155,7 @@ music_pipe_get_chunk(const unsigned i)
* room.
*/
static struct music_chunk *
-tail_chunk(float data_time, uint16_t bitRate, size_t frame_size)
+tail_chunk(size_t frame_size)
{
unsigned int next;
struct music_chunk *chunk;
@@ -174,14 +174,6 @@ tail_chunk(float data_time, uint16_t bitRate, size_t frame_size)
assert(chunk->chunkSize == 0);
}
- if (chunk->chunkSize == 0) {
- /* if the chunk is empty, nobody has set bitRate and
- times yet */
-
- chunk->bitRate = bitRate;
- chunk->times = data_time;
- }
-
return chunk;
}
@@ -219,10 +211,18 @@ size_t music_pipe_append(const void *data0, size_t datalen,
assert((datalen % frame_size) == 0);
while (datalen) {
- chunk = tail_chunk(data_time, bitRate, frame_size);
+ chunk = tail_chunk(frame_size);
if (chunk == NULL)
return ret;
+ if (chunk->chunkSize == 0) {
+ /* if the chunk is empty, nobody has set bitRate and
+ times yet */
+
+ chunk->bitRate = bitRate;
+ chunk->times = data_time;
+ }
+
nbytes = music_chunk_append(chunk, data, datalen,
frame_size);
assert(nbytes > 0);