aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-04-01 00:33:35 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-04-01 00:33:35 +0000
commite9efaeaca9993e32c32e24de925f6a25378a694d (patch)
treec66df539dcc15e6844f1eac15d25fe3bf7ef8187 /src
parent795a1e930b6d3d606546689e991149b9ad583066 (diff)
downloadmpd-e9efaeaca9993e32c32e24de925f6a25378a694d.tar.gz
mpd-e9efaeaca9993e32c32e24de925f6a25378a694d.tar.xz
mpd-e9efaeaca9993e32c32e24de925f6a25378a694d.zip
use 16-bit signed ints for storing positions in the ring buffer
git-svn-id: https://svn.musicpd.org/mpd/trunk@576 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src')
-rw-r--r--src/playerData.c5
-rw-r--r--src/playerData.h8
2 files changed, 9 insertions, 4 deletions
diff --git a/src/playerData.c b/src/playerData.c
index 3f22483d1..07b0dfb3c 100644
--- a/src/playerData.c
+++ b/src/playerData.c
@@ -51,6 +51,11 @@ void initPlayerData() {
buffered_chunks = bufferSize/CHUNK_SIZE;
+ if(buffered_chunks >= 1<<15) {
+ ERROR("buffer size \"%i\" is too big\n",bufferSize);
+ exit(-1);
+ }
+
perc = strtod((getConf())[CONF_BUFFER_BEFORE_PLAY],&test);
if(*test!='%' || perc<0 || perc>100) {
ERROR("buffered before play \"%s\" is not a positive "
diff --git a/src/playerData.h b/src/playerData.h
index 7da51e7b3..52cbba1be 100644
--- a/src/playerData.h
+++ b/src/playerData.h
@@ -37,10 +37,10 @@ typedef struct _Buffer {
mpd_uint16 * chunkSize;
mpd_uint16 * bitRate;
float * times;
- int begin;
- int end;
- int next;
- int wrap;
+ mpd_sint16 begin;
+ mpd_sint16 end;
+ mpd_sint16 next;
+ mpd_sint8 wrap;
float totalTime;
} Buffer;