Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling of foreign metadata in flac ( / metaflac); suggestion to retain upon decoding and optionally allow deletion upon re-encoding #778

Open
H2Swine opened this issue Dec 21, 2024 · 0 comments

Comments

@H2Swine
Copy link
Contributor

H2Swine commented Dec 21, 2024

Feature cleanup "wish", with whatever priority should be assigned to foreign metadata handling at the 1.5 stage. Myself I think that it is not at the core of what FLAC is about.

  • Encoding. There is issue Add foreign metadata handling of some malformed chunks #680. Could there be a way to verify that the foreign metadata actually is in restorable form? The time it takes is hardly any object (compared to say -V), but the question on whether to repair odd-bytesize chunks does remain.
  • Decoding: if a .flac file was generated with foreign metadata stored in it, then presumably the purpose is to restore it. That suggests that decoding should default to keeping if present. A potential is that users might discover that a file of theirs does suddenly decode to .aiff, but how often will that be contrary to intention?
  • Re-encoding: as far as I can see, there is no way within flac to remove the foreign metadata from a .flac file except by decoding and encoding, losing tags too. --no-keep-foreign-metadata does nothing upon re-encoding, and you could consider to change that? Surely you can say it is a job for metaflac, but:
  • metaflac has no real provision for deleting only the APPLICATION blocks that are foreign metadata - except through inspecting them and selecting precisely the right ones?

So a way out of it for the flac tool, could be to have --keep-foreign-metadata(-if-present) verify the metadata upon encoding; to have decoding (only!) use --keep-foreign-metadata-if-present by default; and for re-encoding, to allow --no-keep-foreign-metadata to delete these particular blocks? The latter must be much simpler than using metaflac?

And despite the worry over running out of letters: "--keep-foreign-metadata-if-present" is a cumbersome way around not wanting to change how --keep-foreign-metadata behaves as errors go.
"-k"? (Question is then, should it take a parameter, determining how it should handle this or that? -k 0 for kill, k 1 for keep but err out if not, -k 2 for repair what can be repaired ... or, that depends on whether you will allow non-compliant metadata to be restored verbatim with warts and all, which maybe is even more worrisome if decoding defaults to keeping.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant