use size_t in audio.c
Buffer sizes should be size_t. This is safe here, at least not unsafer than without the patch. I have no idea why audioBufferSize and audioBufferPos were explicitly declared as signed integer. git-svn-id: https://svn.musicpd.org/mpd/trunk@7296 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
c9d80d6090
commit
1ad2f07a39
@ -49,9 +49,9 @@ static mpd_uint8 *audioDeviceStates;
|
||||
|
||||
static mpd_uint8 audioOpened;
|
||||
|
||||
static mpd_sint32 audioBufferSize;
|
||||
static size_t audioBufferSize;
|
||||
static char *audioBuffer;
|
||||
static mpd_sint32 audioBufferPos;
|
||||
static size_t audioBufferPos;
|
||||
|
||||
unsigned int audio_device_count(void)
|
||||
{
|
||||
@ -358,9 +358,9 @@ int openAudioDevice(AudioFormat * audioFormat)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int playAudio(const char *playChunk, int size)
|
||||
int playAudio(const char *playChunk, size_t size)
|
||||
{
|
||||
int send_size;
|
||||
size_t send_size;
|
||||
|
||||
while (size > 0) {
|
||||
send_size = audioBufferSize - audioBufferPos;
|
||||
|
@ -59,7 +59,7 @@ void finishAudioDriver(void);
|
||||
|
||||
int openAudioDevice(AudioFormat * audioFormat);
|
||||
|
||||
int playAudio(const char *playChunk, int size);
|
||||
int playAudio(const char *playChunk, size_t size);
|
||||
|
||||
void dropBufferedAudio(void);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user