# HG changeset patch # User Chris Cannam # Date 1196443869 0 # Node ID edda24bb85fc5241367434ade80e8560d9ec197a # Parent a9ccd644f3bf528d24aac1a1bf55343b203882f9 * Skip ID3 block when reading MP3 files (so long as ID3 support is included) * Show progress when retrieving audio file from playlist * Avoid -- but do not actually fix -- segmentation fault on exit. I am totally stumped at the moment about why both the PA and JACK audio targets should crash when properly shut down. For the moment, we just don't shut them down... * Fix incorrect behaviour (introduced on Friday as part of a different fix) when replacing main model in situation where no current main model exists diff -r a9ccd644f3bf -r edda24bb85fc data/fileio/MP3FileReader.cpp --- a/data/fileio/MP3FileReader.cpp Thu Nov 29 17:10:53 2007 +0000 +++ b/data/fileio/MP3FileReader.cpp Fri Nov 30 17:31:09 2007 +0000 @@ -206,7 +206,7 @@ unsigned int nstrings = id3_field_getnstrings(&frame->fields[1]); if (nstrings == 0) { #ifdef DEBUG_ID3TAG - std::cerr << "MP3FileReader::loadTags: No data for \"" << name << "\" in ID3 tag" << std::endl; + std::cerr << "MP3FileReader::loadTags: No strings for \"" << name << "\" in ID3 tag" << std::endl; #endif return ""; } @@ -291,7 +291,22 @@ DecoderData *data = (DecoderData *)dp; if (!data->length) return MAD_FLOW_STOP; - mad_stream_buffer(stream, data->start, data->length); + + unsigned char const *start = data->start; + unsigned long length = data->length; + +#ifdef HAVE_ID3TAG + if (length > ID3_TAG_QUERYSIZE) { + int taglen = id3_tag_query(start, ID3_TAG_QUERYSIZE); + if (taglen > 0) { +// std::cerr << "ID3 tag length to skip: " << taglen << std::endl; + start += taglen; + length -= taglen; + } + } +#endif + + mad_stream_buffer(stream, start, length); data->length = 0; return MAD_FLOW_CONTINUE;