aboutsummaryrefslogtreecommitdiffstats
path: root/src/outputBuffer.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-09-01 16:24:41 -0700
committerEric Wong <normalperson@yhbt.net>2008-09-01 16:24:41 -0700
commitc36029fc806cf083de3aaf1344d6bd2be8db316f (patch)
treeda88b1f073b8125d764b94b924492d2b05ea4c69 /src/outputBuffer.c
parentaa0755f53545fcf343f791f04760f6b934e022e4 (diff)
parent6982a829e22d2bc7cf7c829c4430a4ea6f5bc7fa (diff)
downloadmpd-c36029fc806cf083de3aaf1344d6bd2be8db316f.tar.gz
mpd-c36029fc806cf083de3aaf1344d6bd2be8db316f.tar.xz
mpd-c36029fc806cf083de3aaf1344d6bd2be8db316f.zip
Merge branch 'mk/cleanups'
* mk/cleanups: (60 commits) pass constant pointers const pointers unsigned integers and size_t oggflac: fix GCC warnings include cleanup protect locate.h from double inclusion playlist: eliminate unused fd parameters jack: made "sample_size" static const moved jack configuration to the JackData struct jack: removed unused macros jack: don't set audioOutput->data=NULL jack: initialize JackData in jack_initDriver() jack: added freeJackClient() jack: initialize jd->client after !jd check jack: eliminate superfluous freeJackData() calls mp3: converted the MUTEFRAME_ macros to an enum mp3: converted the DECODE_ constants to an enum wavpack: don't use "isp" before initialization wavpack: moved code to wavpack_open_wvc() simplified code in the ogg decoder plugin ...
Diffstat (limited to '')
-rw-r--r--src/outputBuffer.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/outputBuffer.c b/src/outputBuffer.c
index 0adf570f7..8a41924db 100644
--- a/src/outputBuffer.c
+++ b/src/outputBuffer.c
@@ -27,6 +27,7 @@
#include "player_error.h"
#include "log.h"
#include "action_status.h"
+#include "decode.h"
/* typically have 2048-4096 of these structs, so pack tightly */
struct ob_chunk {
@@ -152,7 +153,7 @@ static enum action_status ob_finalize_action(void)
/* marks all buffered chunks with sequence number matching `seq' as invalid */
static enum action_status ob_do_drop(void)
{
- struct iovec vec[2];
+ struct rbvec vec[2];
long i;
mpd_uint8 seq_drop;
@@ -190,7 +191,7 @@ static enum action_status ob_do_pause(void)
static void reader_reset_buffer(void)
{
- struct iovec vec[2];
+ struct rbvec vec[2];
size_t nr;
long i;
@@ -330,15 +331,15 @@ static enum action_status ob_take_action(void)
* like an infinite, rotating buffer. The first available chunk
* is always indexed as `0', the second one as `1', and so on...
*/
-static struct ob_chunk *get_chunk(struct iovec vec[2], size_t i)
+static struct ob_chunk *get_chunk(struct rbvec vec[2], size_t i)
{
- if (vec[0].iov_len > i)
- return &ob.chunks[vec[0].iov_base + i - ob.index->buf];
- if (i && vec[1].iov_base) {
- assert(vec[0].iov_len > 0);
- i -= vec[0].iov_len;
- if (vec[1].iov_len > i)
- return &ob.chunks[vec[1].iov_base + i - ob.index->buf];
+ if (vec[0].len > i)
+ return &ob.chunks[vec[0].base + i - ob.index->buf];
+ if (i && vec[1].base) {
+ assert(vec[0].len > 0);
+ i -= vec[0].len;
+ if (vec[1].len > i)
+ return &ob.chunks[vec[1].base + i - ob.index->buf];
}
return NULL;
}
@@ -426,7 +427,7 @@ static void send_next_tag(void)
static void play_next_chunk(void)
{
- struct iovec vec[2];
+ struct rbvec vec[2];
struct ob_chunk *a;
size_t nr;
static float last_time;
@@ -551,7 +552,7 @@ void ob_seek_finish(void)
*/
void ob_flush(void)
{
- struct iovec vec[2];
+ struct rbvec vec[2];
assert(pthread_equal(pthread_self(), dc.thread));
/* DEBUG(__FILE__":%s %d\n", __func__, __LINE__); */