Bug #334
[PATCH] file writer flac does not write tags
100%
Description
Due to how this is written, the tags do not get written to the FLAC file that is
created by the plugin. The attached patch fixes 5 issues.
1) A switch case in insert_vorbis_comment() did not include a break statement, so
string tags would not be inserted because the default case has a return statement.
2) The metadata object is allocated on the stack and is not managed by libFLAC,
resulting in a memory leak. It is now a static global variable.
3) The encoder and metadata objects are both handled properly now when the file is
closed. Pointers are NULL checked, freed, and reset to NULL now.
4) FLAC__stream_encoder_init_stream() must be called after the metadata is set.
Otherwise the call will fail.
5) FLAC vorbis comments should be in uppercase, as that is what the official encoder
does.
Also, the compression level is now set to 8, the maximum. Please apply this patch.
History
#1 Updated by John Lindgren about 11 years ago
This is a good start, but making flac_metadata static introduces another leak. See if you can figure out why.
Edit: Never mind, the leak I'm thinking of shouldn't happen in normal operation.
#2 Updated by John Lindgren about 11 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
- Affects version 3.4 added
- Affects version deleted (
3.4.1, 3.5)
#3 Updated by John Lindgren about 11 years ago
James Buren wrote:
Also, the compression level is now set to 8, the maximum.
DO NOT EVER add arbitrary changes like this to an otherwise legitimate bug-fix patch.
#4 Updated by John Lindgren about 11 years ago
James Buren wrote:
5) FLAC vorbis comments should be in uppercase, as that is what the official encoder
does.
Actually, Vorbis comments are case-insensitive, so either way is fine.