diff options
author | Eric Wong <normalperson@yhbt.net> | 2006-10-06 18:01:12 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2006-10-06 18:01:12 +0000 |
commit | e0a8c179575648afedd0d2088d1b542c5427fcf2 (patch) | |
tree | 1d58e58d422a0639106568749bfceba57e35928e /src/inputPlugins/mp3_plugin.c | |
parent | e19882660677baf8ba01c3006cf1a8ae5bee83ef (diff) | |
download | mpd-e0a8c179575648afedd0d2088d1b542c5427fcf2.tar.gz mpd-e0a8c179575648afedd0d2088d1b542c5427fcf2.tar.xz mpd-e0a8c179575648afedd0d2088d1b542c5427fcf2.zip |
mp3_plugin.c: fix compilation with -pedantic and/or gcc 2.95
git-svn-id: https://svn.musicpd.org/mpd/trunk@4876 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/inputPlugins/mp3_plugin.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/src/inputPlugins/mp3_plugin.c b/src/inputPlugins/mp3_plugin.c index 5275dcf9b..7838624ab 100644 --- a/src/inputPlugins/mp3_plugin.c +++ b/src/inputPlugins/mp3_plugin.c @@ -651,23 +651,27 @@ static int decodeFirstFrame(mp3DecodeData * data, DecoderControl * dc, /* * Attempt to calulcate the length of the song from filesize */ - size_t offset = data->inStream->offset; - mad_timer_t duration = data->frame.header.duration; - float frameTime = ((float)mad_timer_count(duration, MAD_UNITS_MILLISECONDS)) / 1000; - - if (data->stream.this_frame != NULL) - offset -= data->stream.bufend - data->stream.this_frame; - else - offset -= data->stream.bufend - data->stream.buffer; - - if (data->inStream->size >= offset) { - data->totalTime = ((data->inStream->size - offset) * 8.0) / (data->frame).header.bitrate; - data->maxFrames = data->totalTime / frameTime + FRAMES_CUSHION; - } else { - data->maxFrames = FRAMES_CUSHION; - data->totalTime = 0; + { + size_t offset = data->inStream->offset; + mad_timer_t duration = data->frame.header.duration; + float frameTime = ((float)mad_timer_count(duration, + MAD_UNITS_MILLISECONDS)) / 1000; + + if (data->stream.this_frame != NULL) + offset -= data->stream.bufend - data->stream.this_frame; + else + offset -= data->stream.bufend - data->stream.buffer; + + if (data->inStream->size >= offset) { + data->totalTime = ((data->inStream->size - offset) * + 8.0) / (data->frame).header.bitrate; + data->maxFrames = data->totalTime / frameTime + + FRAMES_CUSHION; + } else { + data->maxFrames = FRAMES_CUSHION; + data->totalTime = 0; + } } - /* * if an xing tag exists, use that! */ |