Problem saving multiple values for same FLAC field.

David Vazgenovich Shakaryan dvshakaryan at gmail.com
Mon Oct 18 05:34:40 CEST 2010


Hello,

I'm currently using the rtaglib Ruby bindings for TagLib. Working with FLAC
files, when I try to add more than one of the same field, everything appears
to be working fine until I try to save the changes. However, once I run the
save() method on the TagLib file object, only the first value for the field
is actually saved.

Interesting things I've noticed:
- After running save(), the fieldListMap has a null COMMENT field.
- If I actually add a COMMENT field, the fieldListMap has a null DESCRIPTION
field.
- Multiple values for the same field are working fine with custom fields,
but not DATE, ARTIST, TRACKNUMBER, etc.
- Everything seems to be working fine with Vorbis files; I'm using the exact
same method for FLAC and Vorbis files in my script.

I've added output to my script to show this strange behaviour, and ran
commands on both FLAC and Vorbis files to show it in action.
http://paste.pocoo.org/show/276817/
http://dpaste.com/259444/  (mirror)

The code I'm using to add a field:
    field = TagLib::String.new(field)
    metadata.addField(field, TagLib::String.new(value), false)
Each line in the pasted output is generated from:
    metadata.fieldListMap.hash

Note that "metadata" above is not a variable, it's a function which returns
@file.xiphComment for FLAC files and @file.tag for Vorbis files, with @file
being either a TagLib::FLAC::File object or a TagLib::Vorbis::File object.
(Ruby doesn't require explicit () on method calls with no arguments.)

I'm not sure what could be causing this; I'm assuming either TagLib or
rtaglib is doing something strange... I don't have the C++ knowledge to
easily test this out with TagLib directly, so I figured I'd post it here in
case anybody knows what the reason behind this could be. Otherwise, I guess
I'll spend the hour or so writing C++ to test it.

Thanks. :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/taglib-devel/attachments/20101017/361ef806/attachment.htm 


More information about the taglib-devel mailing list