Add "gsm" as a recognised file extension. Add tests.

This commit is contained in:
Erik de Castro Lopo 2005-11-16 11:42:10 +00:00
parent 0ec53fa7ad
commit 8712204014
4 changed files with 18 additions and 7 deletions

View File

@ -1,3 +1,11 @@
2005-11-16 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* src/sndfile.c
Add "gsm" as a recognised file extension when no magic number can be found.
* tests/lossy_comp_test.c tests/Makefile.am
Test headerless GSM610.
2005-11-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com> 2005-11-13 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* doc/api.html * doc/api.html

View File

@ -2105,6 +2105,9 @@ format_from_extension (const char *filename)
if (strcmp (cptr, "vox") == 0) if (strcmp (cptr, "vox") == 0)
return SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM ; return SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM ;
if (strcmp (cptr, "gsm") == 0)
return SF_FORMAT_RAW | SF_FORMAT_GSM610 ;
return 0 ; return 0 ;
} /* format_from_extension */ } /* format_from_extension */

View File

@ -236,6 +236,7 @@ raw-tests: write_read_test lossy_comp_test raw_test
./write_read_test raw ./write_read_test raw
./lossy_comp_test raw_ulaw ./lossy_comp_test raw_ulaw
./lossy_comp_test raw_alaw ./lossy_comp_test raw_alaw
./lossy_comp_test raw_gsm610
./lossy_comp_test vox_adpcm ./lossy_comp_test vox_adpcm
./raw_test ./raw_test
@echo "----------------------------------------------------------------------" @echo "----------------------------------------------------------------------"

View File

@ -312,15 +312,14 @@ main (int argc, char *argv [])
test_count++ ; test_count++ ;
} ; } ;
/*- if (do_all || strcmp (argv [1], "raw_gsm610") == 0) if (do_all || strcmp (argv [1], "raw_gsm610") == 0)
{ /+* Don't do lcomp_test_XXX as the errors are too big. *+/ { /* Don't do lcomp_test_XXX as the errors are too big. */
sdlcomp_test_short ("gsm610.raw", SF_FORMAT_RAW | SF_FORMAT_GSM610, 1, 0.24) ; sdlcomp_test_short ("raw.gsm", SF_FORMAT_RAW | SF_FORMAT_GSM610, 1, 0.24) ;
sdlcomp_test_int ("gsm610.raw", SF_FORMAT_RAW | SF_FORMAT_GSM610, 1, 0.24) ; sdlcomp_test_int ("raw.gsm", SF_FORMAT_RAW | SF_FORMAT_GSM610, 1, 0.24) ;
sdlcomp_test_float ("gsm610.raw", SF_FORMAT_RAW | SF_FORMAT_GSM610, 1, 0.24) ; sdlcomp_test_float ("raw.gsm", SF_FORMAT_RAW | SF_FORMAT_GSM610, 1, 0.24) ;
sdlcomp_test_double ("gsm610.raw", SF_FORMAT_RAW | SF_FORMAT_GSM610, 1, 0.24) ; sdlcomp_test_double ("raw.gsm", SF_FORMAT_RAW | SF_FORMAT_GSM610, 1, 0.24) ;
test_count++ ; test_count++ ;
} ; } ;
-*/
/* Lite remove start */ /* Lite remove start */
if (do_all || strcmp (argv [1], "ircam_ulaw") == 0) if (do_all || strcmp (argv [1], "ircam_ulaw") == 0)