diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-08-30 17:33:07 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-08-30 17:33:07 -0700 |
commit | a848893d85cd027d831ba0ecae9dacef0a5f0605 (patch) | |
tree | 0090036a5036ab3d7f8dce1cd35477536253e46d /src/outputBuffer_ob_send.h | |
parent | aa2fcfa7574ebdf3e348c051e496797841aa4f1d (diff) | |
download | mpd-a848893d85cd027d831ba0ecae9dacef0a5f0605.tar.gz mpd-a848893d85cd027d831ba0ecae9dacef0a5f0605.tar.xz mpd-a848893d85cd027d831ba0ecae9dacef0a5f0605.zip |
ringbuf: create a new struct rbvec instead of reusing struct iovec
Using struct iovec means having to cast iov_base everywhere
we want to do pointer arithmetic. Instead, just use rbvec
which can be safely casted to iovec whenever we use
the readv/writev functions.
Diffstat (limited to '')
-rw-r--r-- | src/outputBuffer_ob_send.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/outputBuffer_ob_send.h b/src/outputBuffer_ob_send.h index 2a4a84763..d2c99b3f2 100644 --- a/src/outputBuffer_ob_send.h +++ b/src/outputBuffer_ob_send.h @@ -63,7 +63,7 @@ enum dc_action ob_send(void *data, size_t len, float decode_time, mpd_uint16 bit_rate, ReplayGainInfo * rgi) { - struct iovec vec[2]; + struct rbvec vec[2]; struct ob_chunk *c; size_t idx; size_t i, j; @@ -86,9 +86,9 @@ ob_send(void *data, size_t len, } for (i = 0; i < ARRAY_SIZE(vec); i++) { - for (j = 0; j < vec[i].iov_len; j++) { + for (j = 0; j < vec[i].len; j++) { size_t c_len; - idx = vec[i].iov_base - ob.index->buf + j; + idx = vec[i].base - ob.index->buf + j; c = &(ob.chunks[idx]); if (!c->len) { /* populate empty chunk */ |