From f275a1a1abf353873ce85c5c66b2be7c51d317a5 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 12 Apr 2008 04:16:32 +0000 Subject: Fix a few more warnings from -Wshadow git-svn-id: https://svn.musicpd.org/mpd/trunk@7300 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/inputPlugins/aac_plugin.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/inputPlugins/aac_plugin.c') diff --git a/src/inputPlugins/aac_plugin.c b/src/inputPlugins/aac_plugin.c index 5d8eb74f3..2962b57c6 100644 --- a/src/inputPlugins/aac_plugin.c +++ b/src/inputPlugins/aac_plugin.c @@ -273,18 +273,18 @@ static float getAacFloatTotalTime(char *file) static int getAacTotalTime(char *file) { - int time = -1; + int file_time = -1; float length; if ((length = getAacFloatTotalTime(file)) >= 0) - time = length + 0.5; + file_time = length + 0.5; - return time; + return file_time; } static int aac_decode(OutputBuffer * cb, DecoderControl * dc, char *path) { - float time; + float file_time; float totalTime; faacDecHandle decoder; faacDecFrameInfo frameInfo; @@ -343,7 +343,7 @@ static int aac_decode(OutputBuffer * cb, DecoderControl * dc, char *path) dc->totalTime = totalTime; - time = 0.0; + file_time = 0.0; advanceAacBuffer(&b, bread); @@ -388,7 +388,7 @@ static int aac_decode(OutputBuffer * cb, DecoderControl * dc, char *path) bitRate = frameInfo.bytesconsumed * 8.0 * frameInfo.channels * sampleRate / frameInfo.samples / 1000 + 0.5; - time += + file_time += (float)(frameInfo.samples) / frameInfo.channels / sampleRate; } @@ -396,7 +396,8 @@ static int aac_decode(OutputBuffer * cb, DecoderControl * dc, char *path) sampleBufferLen = sampleCount * 2; sendDataToOutputBuffer(cb, NULL, dc, 0, sampleBuffer, - sampleBufferLen, time, bitRate, NULL); + sampleBufferLen, file_time, + bitRate, NULL); if (dc->seek) { dc->seekError = 1; dc->seek = 0; @@ -428,14 +429,12 @@ static int aac_decode(OutputBuffer * cb, DecoderControl * dc, char *path) static MpdTag *aacTagDup(char *file) { MpdTag *ret = NULL; - int time; + int file_time = getAacTotalTime(file); - time = getAacTotalTime(file); - - if (time >= 0) { + if (file_time >= 0) { if ((ret = id3Dup(file)) == NULL) ret = newMpdTag(); - ret->time = time; + ret->time = file_time; } else { DEBUG("aacTagDup: Failed to get total song time from: %s\n", file); -- cgit v1.2.3