Version: 0.11 (using KDE KDE 3.2.0) Installed from: RedHat RPMs OS: Linux Currently, the flac-plugin works with flac files without tags or with vorbis style tags, but not with id3-tags! Unfortunately, a lot of programs like grip and easytag don't support vorbis style tags, and add id3-tags instead. For grip there's a workaround using command-line arguments. The easytag main developer says they will support vorbis style tags in the next release (0.31 or so). But nevertheless, there is still some justification to have id3-tags in flac files: - other programs might only support id3-tags - some portable players only support id3-tags (but play flac & ogg). - the flac specification allows it (see http://flac.sourceforge.net/format.html) - "A FLAC bitstream may be appended with ID3V1 data or prepended with ID3V2 data. FLAC has no knowledge of such data, but the reference decoder knows how to skip an ID3 tag." So i think it would be nice if the k3b-flac-plugin would accept id3-tags as well (and use them if the file doesn't contain vorbis style comments).
Created attachment 4798 [details] UNTESTED patch to read id3tags from FLAC files This patch shows what I how I would use id3lib to resolve this bug. I emerged easytag and created a couple of test cases, but it's no good, because the mp3 decoder is putting its hand up to decode these files before the flac decoder gets a chance to look at them. Sebastian, any ideas? Perhaps the mp3 decoder can check for an MP3 magic number in addition to reading the tag?
Created attachment 4832 [details] tested/good patch to read ID3 tags of FLAC files Okay, here is a patch which will do what we want. The mad decoder will now check for the MP3 sync bytes which follow the ID3 tag. Thus FLAC files with ID3 tags will no longer be misidentified as MP3 files. The FLAC decoder factory will now correctly identify FLAC files with ID3 headers. If a file has no Vorbis tags, the FLAC decoder will use id3lib to try and get the track info from ID3 tags. Just a couple of technical/stylistic notes: First, I don't know if you feel strongly about tabs, but I don't like them, so I removed them from the FLAC decoder. This results in a couple of extra/useless lines in the patch, sorry. I left them in the mad decoder, because maybe you're a big fan of tabs, I don't know. :) Second, I removed some calls to QFile.close() which are were in the canDecode() methods of both plugins. My understanding is that since the QFile is created on the stack in these methods, the QFile destructor will close the file when canDecode() returns. Explicitly closing the file for such a short piece of code only seems to mess up the code for no good reason (since we have so many exit points).
The patch works fine (and is already integrated in k3b-0.11.5). I don't know what tabs you removed from the FLAC decoder, but i don't miss them. Okay, thanks, John! This bug is RESOLVED!