Commit e9efaeac authored by Warren Dukes's avatar Warren Dukes

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
parent 795a1e93
...@@ -51,6 +51,11 @@ void initPlayerData() { ...@@ -51,6 +51,11 @@ void initPlayerData() {
buffered_chunks = bufferSize/CHUNK_SIZE; 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); perc = strtod((getConf())[CONF_BUFFER_BEFORE_PLAY],&test);
if(*test!='%' || perc<0 || perc>100) { if(*test!='%' || perc<0 || perc>100) {
ERROR("buffered before play \"%s\" is not a positive " ERROR("buffered before play \"%s\" is not a positive "
......
...@@ -37,10 +37,10 @@ typedef struct _Buffer { ...@@ -37,10 +37,10 @@ typedef struct _Buffer {
mpd_uint16 * chunkSize; mpd_uint16 * chunkSize;
mpd_uint16 * bitRate; mpd_uint16 * bitRate;
float * times; float * times;
int begin; mpd_sint16 begin;
int end; mpd_sint16 end;
int next; mpd_sint16 next;
int wrap; mpd_sint8 wrap;
float totalTime; float totalTime;
} Buffer; } Buffer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment