summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2014-07-03 21:26:11 +1000
committerErik de Castro Lopo <erikd@mega-nerd.com>2014-07-03 21:30:52 +1000
commitb25f7f3bb3b9fcf73316b042395def33add5d40a (patch)
treecda7f8a3e5e8e5305b9747abc55b9e32dd1283a3
parent77504d6abde21d73505d32359ea0e5693835fda3 (diff)
Revert "src/sndfile.c : Make WAV/GSM610 with sample rates other than 8kHz invalid."
-rw-r--r--programs/sndfile-convert.c16
-rw-r--r--src/sndfile.c4
-rw-r--r--tests/floating_point_test.tpl4
-rw-r--r--tests/lossy_comp_test.c10
4 files changed, 12 insertions, 22 deletions
diff --git a/programs/sndfile-convert.c b/programs/sndfile-convert.c
index 28a30f6..547d01c 100644
--- a/programs/sndfile-convert.c
+++ b/programs/sndfile-convert.c
@@ -113,21 +113,11 @@ report_format_error_exit (const char * argv0, SF_INFO * sfinfo)
exit (1) ;
} ;
- if ((sfinfo->format & SF_FORMAT_SUBMASK) == SF_FORMAT_GSM610)
- printf ("\n"
+ printf ("\n"
"Error : output file format is invalid.\n"
- "The '%s' container does not support '%s' data at %d Hz.\n"
+ "The '%s' container does not support '%s' codec data.\n"
"Run '%s --help' for clues.\n\n",
- sfe_container_name (sfinfo->format), sfe_codec_name (sfinfo->format),
- sfinfo->samplerate, program_name (argv0)) ;
- else
- printf ("\n"
- "Error : output file format is invalid.\n"
- "The '%s' container does not support '%s' data.\n"
- "Run '%s --help' for clues.\n\n",
- sfe_container_name (sfinfo->format), sfe_codec_name (sfinfo->format),
- program_name (argv0)) ;
-
+ sfe_container_name (sfinfo->format), sfe_codec_name (sfinfo->format), program_name (argv0)) ;
exit (1) ;
} /* report_format_error_exit */
diff --git a/src/sndfile.c b/src/sndfile.c
index bf69dd4..c048aea 100644
--- a/src/sndfile.c
+++ b/src/sndfile.c
@@ -1,5 +1,5 @@
/*
-** Copyright (C) 1999-2014 Erik de Castro Lopo <erikd@mega-nerd.com>
+** Copyright (C) 1999-2013 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU Lesser General Public License as published by
@@ -658,7 +658,7 @@ sf_format_check (const SF_INFO *info)
if ((subformat == SF_FORMAT_DWVW_12 || subformat == SF_FORMAT_DWVW_16 ||
subformat == SF_FORMAT_DWVW_24) && info-> channels == 1)
return 1 ;
- if (subformat == SF_FORMAT_GSM610 && info->channels == 1 && info->samplerate == 8000)
+ if (subformat == SF_FORMAT_GSM610 && info->channels == 1)
return 1 ;
if (subformat == SF_FORMAT_VOX_ADPCM && info->channels == 1)
return 1 ;
diff --git a/tests/floating_point_test.tpl b/tests/floating_point_test.tpl
index ba79691..ab6c95b 100644
--- a/tests/floating_point_test.tpl
+++ b/tests/floating_point_test.tpl
@@ -204,7 +204,7 @@ float_scaled_test (const char *filename, int allow_exit, int replace_float, int
gen_windowed_sine_float (float_data, DFT_DATA_LENGTH, 1.0) ;
- sfinfo.samplerate = (filetype & SF_FORMAT_SUBMASK) == SF_FORMAT_GSM610 ? 8000 : SAMPLE_RATE ;
+ sfinfo.samplerate = SAMPLE_RATE ;
sfinfo.frames = DFT_DATA_LENGTH ;
sfinfo.channels = 1 ;
sfinfo.format = filetype ;
@@ -256,7 +256,7 @@ double_scaled_test (const char *filename, int allow_exit, int replace_float, int
gen_windowed_sine_double (double_data, DFT_DATA_LENGTH, 0.95) ;
- sfinfo.samplerate = (filetype & SF_FORMAT_SUBMASK) == SF_FORMAT_GSM610 ? 8000 : SAMPLE_RATE ;
+ sfinfo.samplerate = SAMPLE_RATE ;
sfinfo.frames = DFT_DATA_LENGTH ;
sfinfo.channels = 1 ;
sfinfo.format = filetype ;
diff --git a/tests/lossy_comp_test.c b/tests/lossy_comp_test.c
index 5444e73..5f9f593 100644
--- a/tests/lossy_comp_test.c
+++ b/tests/lossy_comp_test.c
@@ -1,5 +1,5 @@
/*
-** Copyright (C) 1999-2014 Erik de Castro Lopo <erikd@mega-nerd.com>
+** Copyright (C) 1999-2012 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
@@ -1346,7 +1346,7 @@ channels = 1 ;
for (k = 0 ; k < datalen ; k++)
orig [k] = lrint (orig_buffer.d [k]) ;
- sfinfo.samplerate = (filetype & SF_FORMAT_SUBMASK) == SF_FORMAT_GSM610 ? 8000 : SAMPLE_RATE ;
+ sfinfo.samplerate = SAMPLE_RATE ;
sfinfo.frames = 123456789 ; /* Ridiculous value. */
sfinfo.channels = channels ;
sfinfo.format = filetype ;
@@ -1554,7 +1554,7 @@ channels = 1 ;
for (k = 0 ; k < datalen ; k++)
orig [k] = lrint (orig_buffer.d [k]) ;
- sfinfo.samplerate = (filetype & SF_FORMAT_SUBMASK) == SF_FORMAT_GSM610 ? 8000 : SAMPLE_RATE ;
+ sfinfo.samplerate = SAMPLE_RATE ;
sfinfo.frames = 123456789 ; /* Ridiculous value. */
sfinfo.channels = channels ;
sfinfo.format = filetype ;
@@ -1767,7 +1767,7 @@ printf ("** fix this ** ") ;
for (k = 0 ; k < datalen ; k++)
orig [k] = lrint (orig_buffer.d [k]) ;
- sfinfo.samplerate = (filetype & SF_FORMAT_SUBMASK) == SF_FORMAT_GSM610 ? 8000 : SAMPLE_RATE ;
+ sfinfo.samplerate = SAMPLE_RATE ;
sfinfo.frames = 123456789 ; /* Ridiculous value. */
sfinfo.channels = channels ;
sfinfo.format = filetype ;
@@ -1958,7 +1958,7 @@ channels = 1 ;
gen_signal_double (orig_buffer.d, 32000.0, channels, datalen) ;
- sfinfo.samplerate = (filetype & SF_FORMAT_SUBMASK) == SF_FORMAT_GSM610 ? 8000 : SAMPLE_RATE ;
+ sfinfo.samplerate = SAMPLE_RATE ;
sfinfo.frames = 123456789 ; /* Ridiculous value. */
sfinfo.channels = channels ;
sfinfo.format = filetype ;