[PATCH] file writer flac does not write tags
|Status:||Closed||Start date:||August 24, 2013|
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
Also, the compression level is now set to 8, the maximum. Please apply this patch.
#1 Updated by John Lindgren over 1 year 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 over 1 year ago
- Status changed from New to Closed
- % Done changed from 0 to 100
- Affects version 3.4 added
#3 Updated by John Lindgren over 1 year 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.