diff options
author | Max Kellermann <max@duempel.org> | 2008-11-12 08:16:38 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-11-12 08:16:38 +0100 |
commit | b30ec73099bc42b0ccb9202cc7ab7269e5adb2d1 (patch) | |
tree | 4f08d74d0bf2f43386886c0b7c1e56ac4ee4d44d /src | |
parent | 9806355d4cf55eeecfd1d3123530ad8603902c5a (diff) | |
download | mpd-b30ec73099bc42b0ccb9202cc7ab7269e5adb2d1.tar.gz mpd-b30ec73099bc42b0ccb9202cc7ab7269e5adb2d1.tar.xz mpd-b30ec73099bc42b0ccb9202cc7ab7269e5adb2d1.zip |
aac: use unsigned integers and size_t where appropriate
Diffstat (limited to '')
-rw-r--r-- | src/decoder/aac_plugin.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/decoder/aac_plugin.c b/src/decoder/aac_plugin.c index 4e2208e6d..477efb773 100644 --- a/src/decoder/aac_plugin.c +++ b/src/decoder/aac_plugin.c @@ -79,7 +79,7 @@ static void advanceAacBuffer(AacBuffer * b, size_t bytes) b->bytesIntoBuffer -= bytes; } -static int adtsSampleRates[] = +static const unsigned adtsSampleRates[] = { 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350, 0, 0, 0 }; @@ -139,7 +139,7 @@ static size_t adts_find_frame(AacBuffer * b) static void adtsParse(AacBuffer * b, float *length) { unsigned int frames, frameLength; - int sample_rate = 0; + unsigned sample_rate = 0; float framesPerSec; /* Read all frames to ensure correct time and bitrate */ @@ -163,7 +163,7 @@ static void adtsParse(AacBuffer * b, float *length) } framesPerSec = (float)sample_rate / 1024.0; - if (framesPerSec != 0) + if (framesPerSec > 0) *length = (float)frames / framesPerSec; } @@ -217,8 +217,9 @@ static void aac_parse_header(AacBuffer * b, float *length) fillAacBuffer(b); } else if (memcmp(b->buffer, "ADIF", 4) == 0) { - int bitRate; - int skipSize = (b->buffer[4] & 0x80) ? 9 : 0; + unsigned bitRate; + size_t skipSize = (b->buffer[4] & 0x80) ? 9 : 0; + bitRate = ((unsigned int)(b-> buffer[4 + |