unsigned integers in playerData.[ch]
The number of buffered chunks can obviously not become negative. The "buffered_before_play<0" therefore cannot be useful, so let's remove it, too. git-svn-id: https://svn.musicpd.org/mpd/trunk@7232 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
c069b89d86
commit
1b6cf29937
@ -21,8 +21,8 @@
|
||||
#include "log.h"
|
||||
#include "os_compat.h"
|
||||
|
||||
int buffered_before_play;
|
||||
int buffered_chunks;
|
||||
unsigned int buffered_before_play;
|
||||
unsigned int buffered_chunks;
|
||||
|
||||
#define DEFAULT_BUFFER_SIZE 2048
|
||||
#define DEFAULT_BUFFER_BEFORE_PLAY 10
|
||||
@ -72,8 +72,7 @@ void initPlayerData(void)
|
||||
buffered_before_play = (perc / 100) * buffered_chunks;
|
||||
if (buffered_before_play > buffered_chunks) {
|
||||
buffered_before_play = buffered_chunks;
|
||||
} else if (buffered_before_play < 0)
|
||||
buffered_before_play = 0;
|
||||
}
|
||||
|
||||
allocationSize = buffered_chunks * CHUNK_SIZE; /*actual buffer */
|
||||
allocationSize += buffered_chunks * sizeof(float); /*for times */
|
||||
|
@ -30,8 +30,8 @@
|
||||
/* pick 1020 since its devisible for 8,16,24, and 32-bit audio */
|
||||
#define CHUNK_SIZE 1020
|
||||
|
||||
extern int buffered_before_play;
|
||||
extern int buffered_chunks;
|
||||
extern unsigned int buffered_before_play;
|
||||
extern unsigned int buffered_chunks;
|
||||
|
||||
typedef struct _PlayerData {
|
||||
OutputBuffer buffer;
|
||||
|
Loading…
Reference in New Issue
Block a user