Bug #334

[PATCH] file writer flac does not write tags

Added by James Buren 12 months ago. Updated 12 months ago.

Status:Closed Start date:August 24, 2013
Priority:Minor Due date:
Assignee:- % Done:

100%

Category:plugins/filewriter
Target version:3.4.1
Affects version:3.4

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.

filewriter-flac.patch Magnifier (3.2 kB) James Buren, August 24, 2013 01:05

History

#1 Updated by John Lindgren 12 months 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.

#3 Updated by John Lindgren 12 months 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 12 months 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.

Also available in: Atom PDF