comparison data/fileio/OggVorbisFileReader.cpp @ 1043:fe39581d249b cxx11

More type-size adjustments
author Chris Cannam
date Wed, 04 Mar 2015 19:08:21 +0000
parents a1cd5abcb38b
children 0a9193dc136b
comparison
equal deleted inserted replaced
1042:16dc7307d43a 1043:fe39581d249b
142 OggVorbisFileReader::readPacket(OGGZ *, ogg_packet *packet, long, void *data) 142 OggVorbisFileReader::readPacket(OGGZ *, ogg_packet *packet, long, void *data)
143 { 143 {
144 OggVorbisFileReader *reader = (OggVorbisFileReader *)data; 144 OggVorbisFileReader *reader = (OggVorbisFileReader *)data;
145 FishSound *fs = reader->m_fishSound; 145 FishSound *fs = reader->m_fishSound;
146 146
147 fish_sound_prepare_truncation(fs, packet->granulepos, packet->e_o_s); 147 fish_sound_prepare_truncation(fs, packet->granulepos, int(packet->e_o_s));
148 fish_sound_decode(fs, packet->packet, packet->bytes); 148 fish_sound_decode(fs, packet->packet, packet->bytes);
149 149
150 reader->m_bytesRead += packet->bytes; 150 reader->m_bytesRead += packet->bytes;
151 151
152 // The number of bytes read by this function is smaller than 152 // The number of bytes read by this function is smaller than
153 // the file size because of the packet headers 153 // the file size because of the packet headers
154 int p = lrint(double(reader->m_bytesRead) * 114 / 154 int p = int(lrint(double(reader->m_bytesRead) * 114 /
155 double(reader->m_fileSize)); 155 double(reader->m_fileSize)));
156 if (p > 99) p = 99; 156 if (p > 99) p = 99;
157 reader->m_completion = p; 157 reader->m_completion = p;
158 reader->progress(p); 158 reader->progress(p);
159 159
160 if (reader->m_fileSize > 0 && reader->m_reporter) { 160 if (reader->m_fileSize > 0 && reader->m_reporter) {