[flac-dev] "Compression failed" message

Brian Willoughby brianw at sounds.wa.com
Fri Jan 31 23:43:18 PST 2014


On Jan 31, 2014, at 23:06, Erik de Castro Lopo wrote:
> lvqcl 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?


I think a more appropriate term would be FAILURE, as in COMPRESSION  
FAILURE, because the compression failed to make the file smaller.  
Error implies that the program is not working the way that it is  
supposed to, especially when it suggests contacting the developers to  
correct the problem.

There is nothing to be done with a lossless algorithm that cannot  
guarantee it will always compress any data that might be given to it.  
It is not an error when that algorithm fails to losslessly compress a  
particular set of data. It's simply a mathematical fact.


>> Or to compare compress ratio with 1.01 (or 1.05 or 1.1) instead of  
>> 1.0?
>
> As soon as the output file is the same size of bigger than the input,
> the encoding process is no longer providing compression. I think  
> checking
> against 1.0 is in fact the correct behaviour.
>
> There is a --no-error-on-compression-fail command line option. Its  
> documented
> in the HTML docs I've just added it to the --help output.

Ah, there you see that "fail" is the terminology used in the option.

I suggest replacing ERROR with FAILURE, and removing the comments  
about contacting the developers.

Brian Willoughby



More information about the flac-dev mailing list