From fedde765de1ce98a77eb86133a3c17ebcd7195bb Mon Sep 17 00:00:00 2001 From: xufulong Date: Tue, 5 Oct 2021 17:40:53 +0800 Subject: [PATCH] remove nulfile.c --- app/src/main/cpp/sox/CmakeLists.txt | 1 - app/src/main/cpp/sox/formats.h | 2 +- app/src/main/cpp/sox/nulfile.c | 58 ----------------------------- 3 files changed, 1 insertion(+), 60 deletions(-) delete mode 100644 app/src/main/cpp/sox/nulfile.c diff --git a/app/src/main/cpp/sox/CmakeLists.txt b/app/src/main/cpp/sox/CmakeLists.txt index 15419c2..da4b6e9 100644 --- a/app/src/main/cpp/sox/CmakeLists.txt +++ b/app/src/main/cpp/sox/CmakeLists.txt @@ -102,7 +102,6 @@ set(formats_srcs ima_rw.c la-fmt.c lu-fmt.c - nulfile.c prc.c raw.c raw.h diff --git a/app/src/main/cpp/sox/formats.h b/app/src/main/cpp/sox/formats.h index eb4af47..ae83afd 100644 --- a/app/src/main/cpp/sox/formats.h +++ b/app/src/main/cpp/sox/formats.h @@ -36,7 +36,7 @@ FORMAT(la) FORMAT(lu) // FORMAT(maud) - FORMAT(nul) +// FORMAT(nul) FORMAT(prc) FORMAT(raw) FORMAT(s1) diff --git a/app/src/main/cpp/sox/nulfile.c b/app/src/main/cpp/sox/nulfile.c deleted file mode 100644 index 857de84..0000000 --- a/app/src/main/cpp/sox/nulfile.c +++ /dev/null @@ -1,58 +0,0 @@ -/* libSoX file format: null (c) 2006-8 SoX contributors - * Based on an original idea by Carsten Borchardt - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or (at - * your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser - * General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "sox_i.h" -#include - -static int startread(sox_format_t * ft) -{ - if (!ft->signal.rate) { - ft->signal.rate = SOX_DEFAULT_RATE; - lsx_report("sample rate not specified; using %g", ft->signal.rate); - } - ft->signal.precision = ft->encoding.bits_per_sample? - ft->encoding.bits_per_sample: SOX_SAMPLE_PRECISION; - /* Default number of channels is application-dependent */ - return SOX_SUCCESS; -} - -static size_t read_samples(sox_format_t * ft, sox_sample_t * buf, size_t len) -{ - /* Reading from null generates silence i.e. (sox_sample_t)0. */ - (void)ft; - memset(buf, 0, sizeof(sox_sample_t) * len); - return len; /* Return number of samples "read". */ -} - -static size_t write_samples( - sox_format_t * ft, sox_sample_t const * buf, size_t len) -{ - /* Writing to null just discards the samples */ - (void)ft, (void)buf; - return len; /* Return number of samples "written". */ -} - -LSX_FORMAT_HANDLER(nul) -{ - static const char * const names[] = {"null", NULL}; - static sox_format_handler_t const handler = {SOX_LIB_VERSION_CODE, - NULL, names, SOX_FILE_DEVICE | SOX_FILE_PHONY | SOX_FILE_NOSTDIO, - startread, read_samples,NULL,NULL, write_samples,NULL,NULL, NULL, NULL, 0 - }; - return &handler; -}