Mercurial > otakunoraifu
comparison music2/koedec_ogg.cc @ 44:a85cdca1980a
* fixed itoa_ws
* now, configure fails if the requested vorbis lib is not found (so it doesn't build with the wrong lib)
* removed unused current_section in koe_ogg.cc
author | thib |
---|---|
date | Wed, 25 Mar 2009 16:00:52 +0000 |
parents | 4d7486cb20a9 |
children | 53a311ea8289 |
comparison
equal
deleted
inserted
replaced
43:01aa5ddf7dc8 | 44:a85cdca1980a |
---|---|
148 | 148 |
149 int cur = 0x2c; | 149 int cur = 0x2c; |
150 cur_size = INITSIZE; | 150 cur_size = INITSIZE; |
151 out = (char*)malloc(cur_size); | 151 out = (char*)malloc(cur_size); |
152 | 152 |
153 int current_section; | |
154 do { | 153 do { |
155 #if HAVE_LIBVORBISFILE | 154 #if HAVE_LIBVORBISFILE |
156 r = ov_read(&vf, out+cur, cur_size-cur, 0, 2, 1, 0); | 155 r = ov_read(&vf, out+cur, cur_size-cur, 0, 2, 1, NULL); |
157 #else /* HAVE_LIBVORBISIDEC */ | 156 #else /* HAVE_LIBVORBISIDEC */ |
158 r = ov_read(&vf, out+cur, cur_size-cur, ¤t_section); | 157 r = ov_read(&vf, out+cur, cur_size-cur, NULL); |
159 #endif | 158 #endif |
160 if (r <= 0) break; | 159 if (r <= 0) break; |
161 cur += r; | 160 cur += r; |
162 if (cur_size-INITSIZE/4 < cur) Resize(); | 161 if (cur_size-INITSIZE/4 < cur) Resize(); |
163 } while(1); | 162 } while(1); |
209 delete pimpl; | 208 delete pimpl; |
210 } | 209 } |
211 } | 210 } |
212 int OggFILE::Read(char* buf, int blksize, int blklen) { | 211 int OggFILE::Read(char* buf, int blksize, int blklen) { |
213 if (pimpl == 0) return -1; | 212 if (pimpl == 0) return -1; |
214 int current_section; | 213 #if HAVE_LIBVORBISFILE |
215 #if HAVE_LIBVORBISFILE | 214 int r = ov_read( &(pimpl->vf), buf, blksize*blklen, 0, 2, 1, NULL); |
216 int r = ov_read( &(pimpl->vf), buf, blksize*blklen, 0, 2, 1, 0); | 215 #else /* HAVE_LIBVORBISIDEC */ |
217 #else /* HAVE_LIBVORBISIDEC */ | 216 int r = ov_read( &(pimpl->vf), buf, blksize*blklen, NULL); |
218 int r = ov_read( &(pimpl->vf), buf, blksize*blklen, ¤t_section); | |
219 #endif | 217 #endif |
220 if (r <= 0) { // end of file | 218 if (r <= 0) { // end of file |
221 return -1; | 219 return -1; |
222 } | 220 } |
223 while(r < blksize*blklen) { | 221 while(r < blksize*blklen) { |
224 #if HAVE_LIBVORBISFILE | 222 #if HAVE_LIBVORBISFILE |
225 int dr = ov_read(&(pimpl->vf), buf+r, blksize*blklen-r, 0, 2, 1, 0); | 223 int dr = ov_read(&(pimpl->vf), buf+r, blksize*blklen-r, 0, 2, 1, NULL); |
226 #else /* HAVE_LIBVORBISIDEC */ | 224 #else /* HAVE_LIBVORBISIDEC */ |
227 int dr = ov_read(&(pimpl->vf), buf+r, blksize*blklen-r, ¤t_section); | 225 int dr = ov_read(&(pimpl->vf), buf+r, blksize*blklen-r, NULL); |
228 #endif | 226 #endif |
229 if (dr <= 0) break; | 227 if (dr <= 0) break; |
230 r += dr; | 228 r += dr; |
231 } | 229 } |
232 return r / blksize; | 230 return r / blksize; |