Janne Hyvärinen
2014-Sep-14 08:28 UTC
[flac-dev] Patch to stop writing empty vorbiscomment fields
Here's a patch that stops the flac binary from writing empty tag fields. At least in Windows world these come to files by accident. CD extraction programs pass all possible metadata entries they allow setting in the UI to flac binary and most of the time most fields are empty when basic info like artist, album, title, track number and release date are the only fields that are set. -------------- next part -------------- diff --git a/src/flac/vorbiscomment.c b/src/flac/vorbiscomment.c index ed9f710..0e99267 100644 --- a/src/flac/vorbiscomment.c +++ b/src/flac/vorbiscomment.c @@ -243,7 +243,7 @@ FLAC__bool flac__vorbiscomment_add(FLAC__StreamMetadata *block, const char *comm return false; } - if(!set_vc_field(block, &parsed, &dummy, raw, violation)) { + if(parsed.field_value_length > 0 && !set_vc_field(block, &parsed, &dummy, raw, violation)) { free_field(&parsed); return false; }
Erik de Castro Lopo
2014-Sep-19 07:38 UTC
[flac-dev] Patch to stop writing empty vorbiscomment fields
Janne Hyv?rinen wrote:> Here's a patch that stops the flac binary from writing empty tag fields. > At least in Windows world these come to files by accident. CD extraction > programs pass all possible metadata entries they allow setting in the UI > to flac binary and most of the time most fields are empty when basic > info like artist, album, title, track number and release date are the > only fields that are set.Applied. Thanks. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/