Summary: | Accept id3-tags in flac-plugin | ||
---|---|---|---|
Product: | [Applications] k3b | Reporter: | Nicolas Dietrich <nidi> |
Component: | general | Assignee: | Sebastian Trueg <trueg> |
Status: | RESOLVED WORKSFORME | ||
Severity: | wishlist | CC: | toojays |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | RedHat Enterprise Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: |
UNTESTED patch to read id3tags from FLAC files
tested/good patch to read ID3 tags of FLAC files |
Description
Nicolas Dietrich
2004-02-19 00:34:27 UTC
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! |