summaryrefslogtreecommitdiff
path: root/src/flac/main.c
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2013-07-22 20:32:01 +1000
committerErik de Castro Lopo <erikd@mega-nerd.com>2013-08-01 22:06:18 +1000
commitf742b93bb028f9b2ff4206afca153ec069adad7a (patch)
tree2cffa292523f59fce7513903a7f7906aeaa39cf0 /src/flac/main.c
parent3418acc1f62449f05962f03385e1230ae80f62d7 (diff)
downloadflac-f742b93bb028f9b2ff4206afca153ec069adad7a.tar.gz
flac: Implement --no-error-on-compression-fail command line option.
This is designed for the test suite where a number of artificially created files end up bigger than the original.
Diffstat (limited to 'src/flac/main.c')
-rw-r--r--src/flac/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/flac/main.c b/src/flac/main.c
index 39a2514d..102ff3f9 100644
--- a/src/flac/main.c
+++ b/src/flac/main.c
@@ -207,6 +207,7 @@ static struct share__option long_options_[] = {
{ "no-warnings-as-errors" , share__no_argument, 0, 0 },
{ "no-residual-gnuplot" , share__no_argument, 0, 0 },
{ "no-residual-text" , share__no_argument, 0, 0 },
+ { "no-error-on-compression-fail", share__no_argument, 0, 0 },
/*
* undocumented debugging options for the test suite
*/
@@ -271,6 +272,7 @@ static struct {
const char *cuesheet_filename;
FLAC__bool cued_seekpoints;
FLAC__bool channel_map_none; /* --channel-map=none specified, eventually will expand to take actual channel map */
+ FLAC__bool error_on_compression_fail;
unsigned num_files;
char **filenames;
@@ -594,6 +596,7 @@ FLAC__bool init_options(void)
option_values.cuesheet_filename = 0;
option_values.cued_seekpoints = true;
option_values.channel_map_none = false;
+ option_values.error_on_compression_fail = true;
option_values.num_files = 0;
option_values.filenames = 0;
@@ -908,6 +911,9 @@ int parse_option(int short_option, const char *long_option, const char *option_a
else if(0 == strcmp(long_option, "no-md5-sum")) {
option_values.debug.do_md5 = false;
}
+ else if(0 == strcmp(long_option, "no-error-on-compression-fail")) {
+ option_values.error_on_compression_fail = false;
+ }
}
else {
switch(short_option) {
@@ -1901,6 +1907,7 @@ int encode_file(const char *infilename, FLAC__bool is_first_file, FLAC__bool is_
encode_options.debug.disable_fixed_subframes = option_values.debug.disable_fixed_subframes;
encode_options.debug.disable_verbatim_subframes = option_values.debug.disable_verbatim_subframes;
encode_options.debug.do_md5 = option_values.debug.do_md5;
+ encode_options.error_on_compression_fail = option_values.error_on_compression_fail;
/* if infilename and outfilename point to the same file, we need to write to a temporary file */
if(encode_infile != stdin && grabbag__file_are_same(infilename, outfilename)) {