Smart Playlist problem with FLAC
#1
I simply want to report a bug and suggest how to fix it.
The bug is that when using a true flac formatted file, the "comment" data never makes it to the database. (And, therefore, cannot be used as a rule when making a "smart" playlist.)

Cause: in VorbisTag.cpp in the function ParseTagEntry(), the tag is mis-referenced when using a true Vorbis commented file. The code as written is found on line 138:

if ( strTagType == "COMMENT" )
tag.SetComment(strTagValue);

According to FLAC.org, a properly formatted flac file will use the Vorbis standard
ref: http://flac.sourceforge.net/format.html

which further references
http://xiph.org/vorbis/doc/v-comment.html

which goes on to give a list of the valid field names (or tags) in a Vorbis Comment:

TITLE
Track/Work name
VERSION
The version field may be used to differentiate multiple versions of the same track title in a single collection. (e.g. remix info)
ALBUM
The collection name to which this track belongs
TRACKNUMBER
The track number of this piece if part of a specific larger collection or album
ARTIST
The artist generally considered responsible for the work. In popular music this is usually the performing band or singer. For classical music it would be the composer. For an audio book it would be the author of the original text.
PERFORMER
The artist(s) who performed the work. In classical music this would be the conductor, orchestra, soloists. In an audio book it would be the actor who did the reading. In popular music this is typically the same as the ARTIST and is omitted.
COPYRIGHT
Copyright attribution, e.g., '2001 Nobody's Band' or '1999 Jack Moffitt'
LICENSE
License information, eg, 'All Rights Reserved', 'Any Use Permitted', a URL to a license such as a Creative Commons license ("www.creativecommons.org/blahblah/license.html") or the EFF Open Audio License ('distributed under the terms of the Open Audio License. see http://www.eff.org/IP/Open_licenses/eff_oal.html for details'), etc.
ORGANIZATION
Name of the organization producing the track (i.e. the 'record label')
DESCRIPTION
A short text description of the contents
GENRE
A short text indication of music genre
DATE
Date the track was recorded
LOCATION
Location where track was recorded
CONTACT
Contact information for the creators or distributors of the track. This could be a URL, an email address, the physical address of the producing label.
ISRC
ISRC number for the track; see the ISRC intro page for more information on ISRC numbers.

Note that there is no field tagged "Comment", instead, it is tagged "Description", and thus the problem, i.e. VorbisTag.cpp won't pick up the "Description" data.

Now, for the confusing part.

If an audio file is ripped and encoded into a flac format using command line operated flac.exe from the flac.org site, you can enter as many fields as you like, you can even name one "Comment" if you want to; however, this process is slow and cumbersome, and most audiophiles will use a very good ripping program (like, say, dbPowerAmp) which both rips the audio track, get's the song's meta data via various online music db site(s) and wraps it all up in a neat flac formatted file. Unfortunately, these rippers were designed on an "album" basis and there is no practical way to add comments to a single song until after the song has been ripped to file. Which is where the problem happens.
Believe it or not (I had a hard time believing it myself) the easiest, most efficient way to add/alter/delete metadata on a file is to use Windows Explorer. By driving to the file you want to edit, selecting the file by right-clicking on it, and selecting "properties", Windows Explorer gives you the opportunity (via a tab) to look at the "ID3" data on the file, which will display the data, and allows you to edit the data for the entries. When you are finished, the flac file will now be altered, except that (and I am assuming here) Microsoft Windows Explorer saves the edited file in a format strictly consistent with the file extension, and thus, with a flac file, inserts the word "Description" instead of "Comment". This is confusing, because when Windows Explorer displays the metadata, it displays the tag "Comment" exclusively despite the files extension.

The fix:
Change the VorbisTag.cpp line from that noted above, to:

if ( strTagType == "COMMENT" || strTagType == "DESCRIPTION")
tag.SetComment(strTagValue);


By using the comments/description feature of the metadata (really, the only piece of data that can be altered at the users discretion and still be valid) with the smart playlist function of XBMC, you have an extremely powerful tool. Because flac is lossless, you can retain the best sound possible, but also, the Vorbis "Description" field is virtually limitless in size. Therefore, over time, you can nail down an accurate description of a song:

mood=sedate primaryinstrument=saxaphone bpm=40 endingkey=eflat
endingtype=moderatefade begintype=cold sexylevel=7 dontplaybefore=5pm ...and on and on and on. For those who "just want the machine to play me some music", this feature will be useless, which is fine; however, to those who took the time, effort and disk space to rip to flac in the first place, we don't want Sade's sweet, mellow voice following Joan Jett telling us how much she loves rock and roll. Although, Joan Jett following The Blues Brothers wailing that everybody needs somebody to love is a kick-A.. set. As soon as the vizualisation guys get around to making their stuff a little more dynamic (i.e. incorporating jpegs of your choice ) XBMC will become a standard item in most folk's living room. At least, those folks with decent sound and flat screen.
Reply
#2
Seems reasonable - please post a patch on trac so we don't miss this one - we're currently in Vienna at devcon Smile

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
J,
Uhm, no thanks. The "patch" is in the post, but as far as trying to get xbmc to compile and run on a windows computer, well... It's not that I don't have enough time (I'm retired) it's just trying to weed thru the documentation is not nearly as much fun as fishing.

Enjoy Vienna, it's a beautiful city, where coffee was first introduced to western civilization, or so they told me. Enjoy those little weenies too!
Reply
#4
You don't need to compile or run XBMC in order to post a patch on trac. The "patch" in your post is just fine.

Left on the forums here it will be lost. Put it on trac (login with your forum username) and it won't be lost.

And cheers - we enjoyed Vienna a lot Smile

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
Retired, whith a uername of Whizkidz... they sure retire early these days Smile
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply

Logout Mark Read Team Forum Stats Members Help
Smart Playlist problem with FLAC0