Mercurial > hg > svcore
comparison data/fileio/MP3FileReader.cpp @ 349:f39d33b0b265 1.2-stable
* Merge r884 from trunk
author | Chris Cannam |
---|---|
date | Fri, 30 Nov 2007 17:36:14 +0000 |
parents | aa8dbac62024 |
children | b92513201610 94fc0591ea43 |
comparison
equal
deleted
inserted
replaced
347:7a5a9b6d50c7 | 349:f39d33b0b265 |
---|---|
204 } | 204 } |
205 | 205 |
206 unsigned int nstrings = id3_field_getnstrings(&frame->fields[1]); | 206 unsigned int nstrings = id3_field_getnstrings(&frame->fields[1]); |
207 if (nstrings == 0) { | 207 if (nstrings == 0) { |
208 #ifdef DEBUG_ID3TAG | 208 #ifdef DEBUG_ID3TAG |
209 std::cerr << "MP3FileReader::loadTags: No data for \"" << name << "\" in ID3 tag" << std::endl; | 209 std::cerr << "MP3FileReader::loadTags: No strings for \"" << name << "\" in ID3 tag" << std::endl; |
210 #endif | 210 #endif |
211 return ""; | 211 return ""; |
212 } | 212 } |
213 | 213 |
214 id3_ucs4_t const *ustr = id3_field_getstrings(&frame->fields[1], 0); | 214 id3_ucs4_t const *ustr = id3_field_getstrings(&frame->fields[1], 0); |
289 MP3FileReader::input(void *dp, struct mad_stream *stream) | 289 MP3FileReader::input(void *dp, struct mad_stream *stream) |
290 { | 290 { |
291 DecoderData *data = (DecoderData *)dp; | 291 DecoderData *data = (DecoderData *)dp; |
292 | 292 |
293 if (!data->length) return MAD_FLOW_STOP; | 293 if (!data->length) return MAD_FLOW_STOP; |
294 mad_stream_buffer(stream, data->start, data->length); | 294 |
295 unsigned char const *start = data->start; | |
296 unsigned long length = data->length; | |
297 | |
298 #ifdef HAVE_ID3TAG | |
299 if (length > ID3_TAG_QUERYSIZE) { | |
300 int taglen = id3_tag_query(start, ID3_TAG_QUERYSIZE); | |
301 if (taglen > 0) { | |
302 // std::cerr << "ID3 tag length to skip: " << taglen << std::endl; | |
303 start += taglen; | |
304 length -= taglen; | |
305 } | |
306 } | |
307 #endif | |
308 | |
309 mad_stream_buffer(stream, start, length); | |
295 data->length = 0; | 310 data->length = 0; |
296 | 311 |
297 return MAD_FLOW_CONTINUE; | 312 return MAD_FLOW_CONTINUE; |
298 } | 313 } |
299 | 314 |