[flac-dev] "Compression failed" message
Brian Willoughby
brianw at sounds.wa.com
Sat Feb 1 00:12:07 PST 2014
On Feb 1, 2014, at 00:06, lvqcl wrote:
> Erik de Castro Lopo wrote:
>
>>> Sure. But maybe it makes sense to write "WARNING" instead of an
>>> "ERROR"?
>>
>> Well its an ERROR because the flac executable will exit with a non-
>> zero
>> exit code, so this condition can be caught in for example a shell
>> script.
>>
>> If its only a warning, why would the executable return non-zero?
>
> But why should it return non-zero exit code?
>
> The input files are valid, all calculations are valid, but FLAC
> returns an error...
> IMHO it's counter-intuitive: I can't find another lossless encoder or
> general-purpose file archiver that works in the same way.
It makes sense to have the option to return non-zero when the
"compression" fails to "compress." As Erik pointed out, a script
could use the return code to decide to delete the larger FLAC output
file and keep the original input file since it is smaller (and
equally lossless).
However, I agree that it is rather strange to return non-zero by
default, requiring a command-line option to defeat. I would expect it
to be the reverse: off by default, and enabling non-zero on larger
files via command-line option.
Brian Willoughby
Sound Consulting
More information about the flac-dev
mailing list