diff options
Diffstat (limited to '')
-rw-r--r-- | src/inputPlugins/_flac_common.c | 12 | ||||
-rw-r--r-- | src/inputPlugins/audiofile_plugin.c | 12 | ||||
-rw-r--r-- | src/inputPlugins/mod_plugin.c | 8 | ||||
-rw-r--r-- | src/inputPlugins/mp3_plugin.c | 16 | ||||
-rw-r--r-- | src/inputPlugins/mpc_plugin.c | 22 |
5 files changed, 35 insertions, 35 deletions
diff --git a/src/inputPlugins/_flac_common.c b/src/inputPlugins/_flac_common.c index 9a415f4b6..0a2adf6b7 100644 --- a/src/inputPlugins/_flac_common.c +++ b/src/inputPlugins/_flac_common.c @@ -62,12 +62,12 @@ static int flacFindVorbisCommentFloat(const FLAC__StreamMetadata * block, - pos; if (len > 0) { unsigned char tmp; - unsigned char *dup = &(block->data.vorbis_comment. - comments[offset].entry[pos]); - tmp = dup[len]; - dup[len] = '\0'; - *fl = atof((char *)dup); - dup[len] = tmp; + unsigned char *p = &(block->data.vorbis_comment. + comments[offset].entry[pos]); + tmp = p[len]; + p[len] = '\0'; + *fl = atof((char *)p); + p[len] = tmp; return 1; } diff --git a/src/inputPlugins/audiofile_plugin.c b/src/inputPlugins/audiofile_plugin.c index 8527a47a9..b5555f87d 100644 --- a/src/inputPlugins/audiofile_plugin.c +++ b/src/inputPlugins/audiofile_plugin.c @@ -33,16 +33,16 @@ static int getAudiofileTotalTime(char *file) { - int time; + int total_time; AFfilehandle af_fp = afOpenFile(file, "r", NULL); if (af_fp == AF_NULL_FILEHANDLE) { return -1; } - time = (int) + total_time = (int) ((double)afGetFrameCount(af_fp, AF_DEFAULT_TRACK) / afGetRate(af_fp, AF_DEFAULT_TRACK)); afCloseFile(af_fp); - return time; + return total_time; } static int audiofile_decode(OutputBuffer * cb, DecoderControl * dc, char *path) @@ -134,12 +134,12 @@ static int audiofile_decode(OutputBuffer * cb, DecoderControl * dc, char *path) static MpdTag *audiofileTagDup(char *file) { MpdTag *ret = NULL; - int time = getAudiofileTotalTime(file); + int total_time = getAudiofileTotalTime(file); - if (time >= 0) { + if (total_time >= 0) { if (!ret) ret = newMpdTag(); - ret->time = time; + ret->time = total_time; } else { DEBUG ("audiofileTagDup: Failed to get total song time from: %s\n", diff --git a/src/inputPlugins/mod_plugin.c b/src/inputPlugins/mod_plugin.c index 0c01caadb..092d9bd55 100644 --- a/src/inputPlugins/mod_plugin.c +++ b/src/inputPlugins/mod_plugin.c @@ -166,7 +166,7 @@ static void mod_close(mod_Data * data) static int mod_decode(OutputBuffer * cb, DecoderControl * dc, char *path) { mod_Data *data; - float time = 0.0; + float total_time = 0.0; int ret; float secPerByte; @@ -203,10 +203,10 @@ static int mod_decode(OutputBuffer * cb, DecoderControl * dc, char *path) break; ret = VC_WriteBytes(data->audio_buffer, MIKMOD_FRAME_SIZE); - time += ret * secPerByte; + total_time += ret * secPerByte; sendDataToOutputBuffer(cb, NULL, dc, 0, - (char *)data->audio_buffer, ret, time, - 0, NULL); + (char *)data->audio_buffer, ret, + total_time, 0, NULL); } flushOutputBuffer(cb); diff --git a/src/inputPlugins/mp3_plugin.c b/src/inputPlugins/mp3_plugin.c index 9bb3f2f4b..2d101f616 100644 --- a/src/inputPlugins/mp3_plugin.c +++ b/src/inputPlugins/mp3_plugin.c @@ -69,7 +69,7 @@ static signed long audio_linear_dither(unsigned int bits, mad_fixed_t sample, struct audio_dither *dither) { unsigned int scalebits; - mad_fixed_t output, mask, random; + mad_fixed_t output, mask, rnd; enum { MIN = -MAD_F_ONE, @@ -86,10 +86,10 @@ static signed long audio_linear_dither(unsigned int bits, mad_fixed_t sample, scalebits = MAD_F_FRACBITS + 1 - bits; mask = (1L << scalebits) - 1; - random = prng(dither->random); - output += (random & mask) - (dither->random & mask); + rnd = prng(dither->random); + output += (rnd & mask) - (dither->random & mask); - dither->random = random; + dither->random = rnd; if (output > MAX) { output = MAX; @@ -1093,16 +1093,16 @@ static int mp3_decode(OutputBuffer * cb, DecoderControl * dc, static MpdTag *mp3_tagDup(char *file) { MpdTag *ret = NULL; - int time; + int total_time; ret = id3Dup(file); - time = getMp3TotalTime(file); + total_time = getMp3TotalTime(file); - if (time >= 0) { + if (total_time >= 0) { if (!ret) ret = newMpdTag(); - ret->time = time; + ret->time = total_time; } else { DEBUG("mp3_tagDup: Failed to get total song time from: %s\n", file); diff --git a/src/inputPlugins/mpc_plugin.c b/src/inputPlugins/mpc_plugin.c index 0d18c113a..db217f888 100644 --- a/src/inputPlugins/mpc_plugin.c +++ b/src/inputPlugins/mpc_plugin.c @@ -134,7 +134,7 @@ static int mpc_decode(OutputBuffer * cb, DecoderControl * dc, unsigned long samplePos = 0; mpc_uint32_t vbrUpdateAcc; mpc_uint32_t vbrUpdateBits; - float time; + float total_time; int i; ReplayGainInfo *replayGainInfo = NULL; @@ -218,7 +218,7 @@ static int mpc_decode(OutputBuffer * cb, DecoderControl * dc, s16++; if (chunkpos >= MPC_CHUNK_SIZE) { - time = ((float)samplePos) / + total_time = ((float)samplePos) / dc->audioFormat.sampleRate; bitRate = vbrUpdateBits * @@ -227,7 +227,7 @@ static int mpc_decode(OutputBuffer * cb, DecoderControl * dc, sendDataToOutputBuffer(cb, inStream, dc, inStream->seekable, chunk, chunkpos, - time, + total_time, bitRate, replayGainInfo); chunkpos = 0; @@ -241,13 +241,13 @@ static int mpc_decode(OutputBuffer * cb, DecoderControl * dc, } if (!dc->stop && chunkpos > 0) { - time = ((float)samplePos) / dc->audioFormat.sampleRate; + total_time = ((float)samplePos) / dc->audioFormat.sampleRate; bitRate = vbrUpdateBits * dc->audioFormat.sampleRate / 1152 / 1000; sendDataToOutputBuffer(cb, NULL, dc, inStream->seekable, - chunk, chunkpos, time, bitRate, + chunk, chunkpos, total_time, bitRate, replayGainInfo); } @@ -261,7 +261,7 @@ static int mpc_decode(OutputBuffer * cb, DecoderControl * dc, static float mpcGetTime(char *file) { InputStream inStream; - float time = -1; + float total_time = -1; mpc_reader reader; mpc_streaminfo info; @@ -289,19 +289,19 @@ static float mpcGetTime(char *file) return -1; } - time = mpc_streaminfo_get_length(&info); + total_time = mpc_streaminfo_get_length(&info); closeInputStream(&inStream); - return time; + return total_time; } static MpdTag *mpcTagDup(char *file) { MpdTag *ret = NULL; - float time = mpcGetTime(file); + float total_time = mpcGetTime(file); - if (time < 0) { + if (total_time < 0) { DEBUG("mpcTagDup: Failed to get Songlength of file: %s\n", file); return NULL; @@ -312,7 +312,7 @@ static MpdTag *mpcTagDup(char *file) ret = id3Dup(file); if (!ret) ret = newMpdTag(); - ret->time = time; + ret->time = total_time; return ret; } |