From 87122040141775fe0c5d2b37271791f4c6caf51a Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Wed, 16 Nov 2005 11:42:10 +0000 Subject: [PATCH] Add "gsm" as a recognised file extension. Add tests. --- ChangeLog | 8 ++++++++ src/sndfile.c | 3 +++ tests/Makefile.am | 1 + tests/lossy_comp_test.c | 13 ++++++------- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 02e24246..061ff0bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-11-16 Erik de Castro Lopo + + * 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 * doc/api.html diff --git a/src/sndfile.c b/src/sndfile.c index fa74d081..fb655886 100644 --- a/src/sndfile.c +++ b/src/sndfile.c @@ -2105,6 +2105,9 @@ format_from_extension (const char *filename) if (strcmp (cptr, "vox") == 0) return SF_FORMAT_RAW | SF_FORMAT_VOX_ADPCM ; + if (strcmp (cptr, "gsm") == 0) + return SF_FORMAT_RAW | SF_FORMAT_GSM610 ; + return 0 ; } /* format_from_extension */ diff --git a/tests/Makefile.am b/tests/Makefile.am index 1b8278e3..d55ace1a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -236,6 +236,7 @@ raw-tests: write_read_test lossy_comp_test raw_test ./write_read_test raw ./lossy_comp_test raw_ulaw ./lossy_comp_test raw_alaw + ./lossy_comp_test raw_gsm610 ./lossy_comp_test vox_adpcm ./raw_test @echo "----------------------------------------------------------------------" diff --git a/tests/lossy_comp_test.c b/tests/lossy_comp_test.c index c8cc9975..b869d390 100644 --- a/tests/lossy_comp_test.c +++ b/tests/lossy_comp_test.c @@ -312,15 +312,14 @@ main (int argc, char *argv []) test_count++ ; } ; -/*- if (do_all || strcmp (argv [1], "raw_gsm610") == 0) - { /+* 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_int ("gsm610.raw", 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_double ("gsm610.raw", SF_FORMAT_RAW | SF_FORMAT_GSM610, 1, 0.24) ; + if (do_all || strcmp (argv [1], "raw_gsm610") == 0) + { /* Don't do lcomp_test_XXX as the errors are too big. */ + sdlcomp_test_short ("raw.gsm", 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 ("raw.gsm", 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++ ; } ; --*/ /* Lite remove start */ if (do_all || strcmp (argv [1], "ircam_ulaw") == 0)