[flac-dev] [PATCH] Add missing functions to VorbisComment class + a few other things
Bastiaan Timmer
basjetimmer at yahoo.com
Mon May 7 14:02:00 PDT 2012
Attached is a patch that adds 5 missing FLAC__metadata_object_vorbiscomment_* functions to the VorbisComment class. In my previous message I stated 8 functions were missing, but on closer inspection, 3 of those belong in the VorbisComment::Entry class, and 2 of them already have equivalent functions in there. The last one (FLAC__metadata_object_vorbiscomment_entry_matches()) does not, but I have not done that one (yet).
Looking at the FLAC__metadata_object_cuesheet_* FLAC__metadata_object_picture_* functions, it looks like the corresponding FLAC++ classes are already complete. Maybe some functions are missing from CueSheet::Track. If nobody objects, I will take a look later this week.
Also, I've noticed that on my system, flac will not compile with --enable-debug, because some functions that use 'PRId64' get compiled in, but no included header defines 'PRId64'. I have not written a patch because I'm not sure whether this is just my weird system (fairly standard Fedora installation) or all gcc users or all *NIX users. However, should a fix be necessary: PRId64 is defined in inttypes.h which can be included in line 43 of src/libFLAC/lpo.c (after the '#if defined DEBUG') to solve this on my system.
Lastly, the reason I tried to compile with debug was some invalid read sizes reported by valgrind when creating a VorbisComment::Entry. The invalid read is reported in set_field_name() at line 653 (src/libFLAC++/metadata.cpp), where strlen() is used on the newly created char *field_name_. I could not see anything wrong with the code though, and strangely enough just calling printf on the field_name_ 1 line before the strlen() removes all valgrind errors. So I'm not sure what's going on, but it's probably a bug in valgrind, maybe somebody on this list knows?
Bas Timmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_vorbiscomment_members.patch
Type: application/octet-stream
Size: 3345 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20120507/f6e0ea11/attachment.obj
More information about the flac-dev
mailing list