diff options
Diffstat (limited to '3rdparty/libflac/src')
317 files changed, 0 insertions, 100763 deletions
diff --git a/3rdparty/libflac/src/Makefile.am b/3rdparty/libflac/src/Makefile.am deleted file mode 100644 index 131383e6a17..00000000000 --- a/3rdparty/libflac/src/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -# FLAC - Free Lossless Audio Codec -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# This file is part the FLAC project. FLAC is comprised of several -# components distributed under difference licenses. The codec libraries -# are distributed under Xiph.Org's BSD-like license (see the file -# COPYING.Xiph in this distribution). All other programs, libraries, and -# plugins are distributed under the GPL (see COPYING.GPL). The documentation -# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the -# FLAC distribution contains at the top the terms under which it may be -# distributed. -# -# Since this particular file is relevant to all components of FLAC, -# it may be distributed under the Xiph.Org license, which is the least -# restrictive of those mentioned above. See the file COPYING.Xiph in this -# distribution. - -if FLaC__HAS_XMMS -XMMS_DIRS = plugin_common plugin_xmms -endif - -if FLaC__WITH_CPPLIBS -CPPLIBS_DIRS = libFLAC++ test_libFLAC++ -endif - -SUBDIRS = \ - libFLAC \ - share \ - flac \ - metaflac \ - monkeys_audio_utilities \ - $(XMMS_DIRS) \ - plugin_winamp2 \ - test_grabbag \ - test_libs_common \ - test_libFLAC \ - test_seeking \ - test_streams \ - $(CPPLIBS_DIRS) - -EXTRA_DIST = \ - Makefile.lite diff --git a/3rdparty/libflac/src/Makefile.in b/3rdparty/libflac/src/Makefile.in deleted file mode 100644 index 14ac8913644..00000000000 --- a/3rdparty/libflac/src/Makefile.in +++ /dev/null @@ -1,545 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# FLAC - Free Lossless Audio Codec -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# This file is part the FLAC project. FLAC is comprised of several -# components distributed under difference licenses. The codec libraries -# are distributed under Xiph.Org's BSD-like license (see the file -# COPYING.Xiph in this distribution). All other programs, libraries, and -# plugins are distributed under the GPL (see COPYING.GPL). The documentation -# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the -# FLAC distribution contains at the top the terms under which it may be -# distributed. -# -# Since this particular file is relevant to all components of FLAC, -# it may be distributed under the Xiph.Org license, which is the least -# restrictive of those mentioned above. See the file COPYING.Xiph in this -# distribution. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -@FLaC__HAS_XMMS_TRUE@XMMS_DIRS = plugin_common plugin_xmms - -@FLaC__WITH_CPPLIBS_TRUE@CPPLIBS_DIRS = libFLAC++ test_libFLAC++ - -SUBDIRS = \ - libFLAC \ - share \ - flac \ - metaflac \ - monkeys_audio_utilities \ - $(XMMS_DIRS) \ - plugin_winamp2 \ - test_grabbag \ - test_libs_common \ - test_libFLAC \ - test_seeking \ - test_streams \ - $(CPPLIBS_DIRS) - - -EXTRA_DIST = \ - Makefile.lite - -subdir = src -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = - -RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ - ps-recursive install-info-recursive uninstall-info-recursive \ - all-recursive install-data-recursive install-exec-recursive \ - installdirs-recursive install-recursive uninstall-recursive \ - check-recursive installcheck-recursive -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -DIST_SUBDIRS = libFLAC share flac metaflac monkeys_audio_utilities \ - plugin_common plugin_xmms plugin_winamp2 test_grabbag \ - test_libs_common test_libFLAC test_seeking test_streams \ - libFLAC++ test_libFLAC++ -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if (etags --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - else \ - include_option=--include; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: - -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags - -dvi: dvi-recursive - -dvi-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ - clean-generic clean-libtool clean-recursive ctags \ - ctags-recursive distclean distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am \ - dvi-recursive info info-am info-recursive install install-am \ - install-data install-data-am install-data-recursive \ - install-exec install-exec-am install-exec-recursive \ - install-info install-info-am install-info-recursive install-man \ - install-recursive install-strip installcheck installcheck-am \ - installdirs installdirs-am installdirs-recursive \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-libtool mostlyclean-recursive pdf pdf-am \ - pdf-recursive ps ps-am ps-recursive tags tags-recursive \ - uninstall uninstall-am uninstall-info-am \ - uninstall-info-recursive uninstall-recursive - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/Makefile.lite b/3rdparty/libflac/src/Makefile.lite deleted file mode 100644 index 1d496b02a56..00000000000 --- a/3rdparty/libflac/src/Makefile.lite +++ /dev/null @@ -1,61 +0,0 @@ -# FLAC - Free Lossless Audio Codec -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# This file is part the FLAC project. FLAC is comprised of several -# components distributed under difference licenses. The codec libraries -# are distributed under Xiph.Org's BSD-like license (see the file -# COPYING.Xiph in this distribution). All other programs, libraries, and -# plugins are distributed under the GPL (see COPYING.GPL). The documentation -# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the -# FLAC distribution contains at the top the terms under which it may be -# distributed. -# -# Since this particular file is relevant to all components of FLAC, -# it may be distributed under the Xiph.Org license, which is the least -# restrictive of those mentioned above. See the file COPYING.Xiph in this -# distribution. - -.PHONY: all flac libFLAC libFLAC++ metaflac plugin_common plugin_xmms share test_grabbag test_libs_common test_libFLAC test_libFLAC++ test_seeking test_streams -all: flac libFLAC libFLAC++ metaflac plugin_common plugin_xmms share test_grabbag test_libs_common test_libFLAC test_libFLAC++ test_seeking test_streams - -DEFAULT_CONFIG = release - -CONFIG = $(DEFAULT_CONFIG) - -debug : CONFIG = debug -valgrind: CONFIG = valgrind -release : CONFIG = release - -debug : all -valgrind: all -release : all - -flac libFLAC libFLAC++ metaflac plugin_common plugin_xmms share test_grabbag test_libs_common test_libFLAC test_libFLAC++ test_seeking test_streams: - (cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG)) - -clean: - -(cd flac ; $(MAKE) -f Makefile.lite clean) - -(cd libFLAC ; $(MAKE) -f Makefile.lite clean) - -(cd libFLAC++ ; $(MAKE) -f Makefile.lite clean) - -(cd metaflac ; $(MAKE) -f Makefile.lite clean) - -(cd plugin_common ; $(MAKE) -f Makefile.lite clean) - -(cd plugin_xmms ; $(MAKE) -f Makefile.lite clean) - -(cd share ; $(MAKE) -f Makefile.lite clean) - -(cd test_grabbag ; $(MAKE) -f Makefile.lite clean) - -(cd test_libs_common ; $(MAKE) -f Makefile.lite clean) - -(cd test_libFLAC ; $(MAKE) -f Makefile.lite clean) - -(cd test_libFLAC++ ; $(MAKE) -f Makefile.lite clean) - -(cd test_seeking ; $(MAKE) -f Makefile.lite clean) - -(cd test_streams ; $(MAKE) -f Makefile.lite clean) - -flac: libFLAC share -libFLAC++: libFLAC -metaflac: libFLAC share -plugin_common: libFLAC -plugin_xmms: libFLAC plugin_common -share: libFLAC -test_grabbag: share -test_libFLAC++: libFLAC libFLAC++ test_libs_common -test_libFLAC: libFLAC test_libs_common -test_seeking: libFLAC -test_streams: libFLAC diff --git a/3rdparty/libflac/src/flac/Makefile.am b/3rdparty/libflac/src/flac/Makefile.am deleted file mode 100644 index 638cd74d413..00000000000 --- a/3rdparty/libflac/src/flac/Makefile.am +++ /dev/null @@ -1,58 +0,0 @@ -# flac - Command-line FLAC encoder/decoder -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -bin_PROGRAMS = flac - -AM_CFLAGS = @OGG_CFLAGS@ - -EXTRA_DIST = \ - Makefile.lite \ - Makefile.lite.iffscan \ - flac.dsp \ - flac.vcproj \ - iffscan.c \ - iffscan.dsp \ - iffscan.vcproj - -flac_SOURCES = \ - analyze.c \ - decode.c \ - encode.c \ - foreign_metadata.c \ - main.c \ - local_string_utils.c \ - utils.c \ - vorbiscomment.c \ - analyze.h \ - decode.h \ - encode.h \ - foreign_metadata.h \ - local_string_utils.h \ - utils.h \ - vorbiscomment.h - -flac_LDADD = \ - $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/share/getopt/libgetopt.a \ - $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \ - $(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \ - $(top_builddir)/src/share/utf8/libutf8.la \ - $(top_builddir)/src/libFLAC/libFLAC.la \ - @OGG_LIBS@ \ - @LIBICONV@ \ - @MINGW_WINSOCK_LIBS@ \ - -lm diff --git a/3rdparty/libflac/src/flac/Makefile.in b/3rdparty/libflac/src/flac/Makefile.in deleted file mode 100644 index b828c301a86..00000000000 --- a/3rdparty/libflac/src/flac/Makefile.in +++ /dev/null @@ -1,584 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# flac - Command-line FLAC encoder/decoder -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -bin_PROGRAMS = flac - -AM_CFLAGS = @OGG_CFLAGS@ - -EXTRA_DIST = \ - Makefile.lite \ - Makefile.lite.iffscan \ - flac.dsp \ - flac.vcproj \ - iffscan.c \ - iffscan.dsp \ - iffscan.vcproj - - -flac_SOURCES = \ - analyze.c \ - decode.c \ - encode.c \ - foreign_metadata.c \ - main.c \ - local_string_utils.c \ - utils.c \ - vorbiscomment.c \ - analyze.h \ - decode.h \ - encode.h \ - foreign_metadata.h \ - local_string_utils.h \ - utils.h \ - vorbiscomment.h - - -flac_LDADD = \ - $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/share/getopt/libgetopt.a \ - $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \ - $(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \ - $(top_builddir)/src/share/utf8/libutf8.la \ - $(top_builddir)/src/libFLAC/libFLAC.la \ - @OGG_LIBS@ \ - @LIBICONV@ \ - @MINGW_WINSOCK_LIBS@ \ - -lm - -subdir = src/flac -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -bin_PROGRAMS = flac$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) - -am_flac_OBJECTS = analyze.$(OBJEXT) decode.$(OBJEXT) encode.$(OBJEXT) \ - foreign_metadata.$(OBJEXT) main.$(OBJEXT) \ - local_string_utils.$(OBJEXT) utils.$(OBJEXT) \ - vorbiscomment.$(OBJEXT) -flac_OBJECTS = $(am_flac_OBJECTS) -flac_DEPENDENCIES = $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/share/getopt/libgetopt.a \ - $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \ - $(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \ - $(top_builddir)/src/share/utf8/libutf8.la \ - $(top_builddir)/src/libFLAC/libFLAC.la -flac_LDFLAGS = - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/analyze.Po ./$(DEPDIR)/decode.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/encode.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/foreign_metadata.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/local_string_utils.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/main.Po ./$(DEPDIR)/utils.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/vorbiscomment.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(flac_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(flac_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/flac/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - || test -f $$p1 \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ - else :; fi; \ - done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ - rm -f $(DESTDIR)$(bindir)/$$f; \ - done - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -flac$(EXEEXT): $(flac_OBJECTS) $(flac_DEPENDENCIES) - @rm -f flac$(EXEEXT) - $(LINK) $(flac_LDFLAGS) $(flac_OBJECTS) $(flac_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/analyze.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decode.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encode.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/foreign_metadata.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/local_string_utils.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vorbiscomment.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) - -installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: install-binPROGRAMS - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libtool ctags distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am info info-am install install-am install-binPROGRAMS \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/flac/Makefile.lite b/3rdparty/libflac/src/flac/Makefile.lite deleted file mode 100644 index 9e8a0cc90a4..00000000000 --- a/3rdparty/libflac/src/flac/Makefile.lite +++ /dev/null @@ -1,47 +0,0 @@ -# flac - Command-line FLAC encoder/decoder -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# -# GNU makefile -# - -topdir = ../.. -libdir = $(topdir)/obj/$(BUILD)/lib - -PROGRAM_NAME = flac - -INCLUDES = -I./include -I$(topdir)/include -I$(OGG_INCLUDE_DIR) - -ifeq ($(DARWIN_BUILD),yes) -EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libFLAC.a $(libdir)/libreplaygain_analysis.a $(libdir)/libreplaygain_synthesis.a $(libdir)/libgetopt.a $(libdir)/libutf8.a $(OGG_LIB_DIR)/libogg.a -liconv -lm -else -LIBS = -lgrabbag -lFLAC -lreplaygain_analysis -lreplaygain_synthesis -lgetopt -lutf8 -L$(OGG_LIB_DIR) -logg -lm -endif - -SRCS_C = \ - analyze.c \ - decode.c \ - encode.c \ - foreign_metadata.c \ - local_string_utils.c \ - main.c \ - utils.c \ - vorbiscomment.c - -include $(topdir)/build/exe.mk - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/3rdparty/libflac/src/flac/Makefile.lite.iffscan b/3rdparty/libflac/src/flac/Makefile.lite.iffscan deleted file mode 100644 index b12bb10a60e..00000000000 --- a/3rdparty/libflac/src/flac/Makefile.lite.iffscan +++ /dev/null @@ -1,41 +0,0 @@ -# flac - Command-line FLAC encoder/decoder -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# -# GNU makefile -# - -topdir = ../.. -libdir = $(topdir)/obj/$(BUILD)/lib - -PROGRAM_NAME = iffscan - -INCLUDES = -I./include -I$(topdir)/include -I$(OGG_INCLUDE_DIR) - -ifeq ($(DARWIN_BUILD),yes) -EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -liconv -lm -else -LIBS = -lFLAC -L$(OGG_LIB_DIR) -logg -lm -endif - -SRCS_C = \ - foreign_metadata.c \ - iffscan.c - -include $(topdir)/build/exe.mk - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/3rdparty/libflac/src/flac/analyze.c b/3rdparty/libflac/src/flac/analyze.c deleted file mode 100644 index 47a5e76d7a9..00000000000 --- a/3rdparty/libflac/src/flac/analyze.c +++ /dev/null @@ -1,247 +0,0 @@ -/* flac - Command-line FLAC encoder/decoder - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <errno.h> -#include <math.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "FLAC/all.h" -#include "analyze.h" - -typedef struct { - FLAC__int32 residual; - unsigned count; -} pair_t; - -typedef struct { - pair_t buckets[FLAC__MAX_BLOCK_SIZE]; - int peak_index; - unsigned nbuckets; - unsigned nsamples; - double sum, sos; - double variance; - double mean; - double stddev; -} subframe_stats_t; - -static subframe_stats_t all_; - -static void init_stats(subframe_stats_t *stats); -static void update_stats(subframe_stats_t *stats, FLAC__int32 residual, unsigned incr); -static void compute_stats(subframe_stats_t *stats); -static FLAC__bool dump_stats(const subframe_stats_t *stats, const char *filename); - -void flac__analyze_init(analysis_options aopts) -{ - if(aopts.do_residual_gnuplot) { - init_stats(&all_); - } -} - -void flac__analyze_frame(const FLAC__Frame *frame, unsigned frame_number, FLAC__uint64 frame_offset, unsigned frame_bytes, analysis_options aopts, FILE *fout) -{ - const unsigned channels = frame->header.channels; - char outfilename[1024]; - subframe_stats_t stats; - unsigned i, channel, partitions; - - /* do the human-readable part first */ -#ifdef _MSC_VER - fprintf(fout, "frame=%u\toffset=%I64u\tbits=%u\tblocksize=%u\tsample_rate=%u\tchannels=%u\tchannel_assignment=%s\n", frame_number, frame_offset, frame_bytes*8, frame->header.blocksize, frame->header.sample_rate, channels, FLAC__ChannelAssignmentString[frame->header.channel_assignment]); -#else - fprintf(fout, "frame=%u\toffset=%llu\tbits=%u\tblocksize=%u\tsample_rate=%u\tchannels=%u\tchannel_assignment=%s\n", frame_number, (unsigned long long)frame_offset, frame_bytes*8, frame->header.blocksize, frame->header.sample_rate, channels, FLAC__ChannelAssignmentString[frame->header.channel_assignment]); -#endif - for(channel = 0; channel < channels; channel++) { - const FLAC__Subframe *subframe = frame->subframes+channel; - const FLAC__bool is_rice2 = subframe->data.fixed.entropy_coding_method.type == FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2; - const unsigned pesc = is_rice2? FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_ESCAPE_PARAMETER : FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER; - fprintf(fout, "\tsubframe=%u\twasted_bits=%u\ttype=%s", channel, subframe->wasted_bits, FLAC__SubframeTypeString[subframe->type]); - switch(subframe->type) { - case FLAC__SUBFRAME_TYPE_CONSTANT: - fprintf(fout, "\tvalue=%d\n", subframe->data.constant.value); - break; - case FLAC__SUBFRAME_TYPE_FIXED: - FLAC__ASSERT(subframe->data.fixed.entropy_coding_method.type <= FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2); - fprintf(fout, "\torder=%u\tresidual_type=%s\tpartition_order=%u\n", subframe->data.fixed.order, is_rice2? "RICE2":"RICE", subframe->data.fixed.entropy_coding_method.data.partitioned_rice.order); - for(i = 0; i < subframe->data.fixed.order; i++) - fprintf(fout, "\t\twarmup[%u]=%d\n", i, subframe->data.fixed.warmup[i]); - partitions = (1u << subframe->data.fixed.entropy_coding_method.data.partitioned_rice.order); - for(i = 0; i < partitions; i++) { - unsigned parameter = subframe->data.fixed.entropy_coding_method.data.partitioned_rice.contents->parameters[i]; - if(parameter == pesc) - fprintf(fout, "\t\tparameter[%u]=ESCAPE, raw_bits=%u\n", i, subframe->data.fixed.entropy_coding_method.data.partitioned_rice.contents->raw_bits[i]); - else - fprintf(fout, "\t\tparameter[%u]=%u\n", i, parameter); - } - if(aopts.do_residual_text) { - for(i = 0; i < frame->header.blocksize-subframe->data.fixed.order; i++) - fprintf(fout, "\t\tresidual[%u]=%d\n", i, subframe->data.fixed.residual[i]); - } - break; - case FLAC__SUBFRAME_TYPE_LPC: - FLAC__ASSERT(subframe->data.lpc.entropy_coding_method.type <= FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2); - fprintf(fout, "\torder=%u\tqlp_coeff_precision=%u\tquantization_level=%d\tresidual_type=%s\tpartition_order=%u\n", subframe->data.lpc.order, subframe->data.lpc.qlp_coeff_precision, subframe->data.lpc.quantization_level, is_rice2? "RICE2":"RICE", subframe->data.lpc.entropy_coding_method.data.partitioned_rice.order); - for(i = 0; i < subframe->data.lpc.order; i++) - fprintf(fout, "\t\tqlp_coeff[%u]=%d\n", i, subframe->data.lpc.qlp_coeff[i]); - for(i = 0; i < subframe->data.lpc.order; i++) - fprintf(fout, "\t\twarmup[%u]=%d\n", i, subframe->data.lpc.warmup[i]); - partitions = (1u << subframe->data.lpc.entropy_coding_method.data.partitioned_rice.order); - for(i = 0; i < partitions; i++) { - unsigned parameter = subframe->data.lpc.entropy_coding_method.data.partitioned_rice.contents->parameters[i]; - if(parameter == pesc) - fprintf(fout, "\t\tparameter[%u]=ESCAPE, raw_bits=%u\n", i, subframe->data.lpc.entropy_coding_method.data.partitioned_rice.contents->raw_bits[i]); - else - fprintf(fout, "\t\tparameter[%u]=%u\n", i, parameter); - } - if(aopts.do_residual_text) { - for(i = 0; i < frame->header.blocksize-subframe->data.lpc.order; i++) - fprintf(fout, "\t\tresidual[%u]=%d\n", i, subframe->data.lpc.residual[i]); - } - break; - case FLAC__SUBFRAME_TYPE_VERBATIM: - fprintf(fout, "\n"); - break; - } - } - - /* now do the residual distributions if requested */ - if(aopts.do_residual_gnuplot) { - for(channel = 0; channel < channels; channel++) { - const FLAC__Subframe *subframe = frame->subframes+channel; - unsigned residual_samples; - - init_stats(&stats); - - switch(subframe->type) { - case FLAC__SUBFRAME_TYPE_FIXED: - residual_samples = frame->header.blocksize - subframe->data.fixed.order; - for(i = 0; i < residual_samples; i++) - update_stats(&stats, subframe->data.fixed.residual[i], 1); - break; - case FLAC__SUBFRAME_TYPE_LPC: - residual_samples = frame->header.blocksize - subframe->data.lpc.order; - for(i = 0; i < residual_samples; i++) - update_stats(&stats, subframe->data.lpc.residual[i], 1); - break; - default: - break; - } - - /* update all_ */ - for(i = 0; i < stats.nbuckets; i++) { - update_stats(&all_, stats.buckets[i].residual, stats.buckets[i].count); - } - - /* write the subframe */ - sprintf(outfilename, "f%06u.s%u.gp", frame_number, channel); - compute_stats(&stats); - - (void)dump_stats(&stats, outfilename); - } - } -} - -void flac__analyze_finish(analysis_options aopts) -{ - if(aopts.do_residual_gnuplot) { - compute_stats(&all_); - (void)dump_stats(&all_, "all"); - } -} - -void init_stats(subframe_stats_t *stats) -{ - stats->peak_index = -1; - stats->nbuckets = 0; - stats->nsamples = 0; - stats->sum = 0.0; - stats->sos = 0.0; -} - -void update_stats(subframe_stats_t *stats, FLAC__int32 residual, unsigned incr) -{ - unsigned i; - const double r = (double)residual, a = r*incr; - - stats->nsamples += incr; - stats->sum += a; - stats->sos += (a*r); - - for(i = 0; i < stats->nbuckets; i++) { - if(stats->buckets[i].residual == residual) { - stats->buckets[i].count += incr; - goto find_peak; - } - } - /* not found, make a new bucket */ - i = stats->nbuckets; - stats->buckets[i].residual = residual; - stats->buckets[i].count = incr; - stats->nbuckets++; -find_peak: - if(stats->peak_index < 0 || stats->buckets[i].count > stats->buckets[stats->peak_index].count) - stats->peak_index = i; -} - -void compute_stats(subframe_stats_t *stats) -{ - stats->mean = stats->sum / (double)stats->nsamples; - stats->variance = (stats->sos - (stats->sum * stats->sum / stats->nsamples)) / stats->nsamples; - stats->stddev = sqrt(stats->variance); -} - -FLAC__bool dump_stats(const subframe_stats_t *stats, const char *filename) -{ - FILE *outfile; - unsigned i; - const double m = stats->mean; - const double s1 = stats->stddev, s2 = s1*2, s3 = s1*3, s4 = s1*4, s5 = s1*5, s6 = s1*6; - const double p = stats->buckets[stats->peak_index].count; - - outfile = fopen(filename, "w"); - - if(0 == outfile) { - fprintf(stderr, "ERROR opening %s: %s\n", filename, strerror(errno)); - return false; - } - - fprintf(outfile, "plot '-' title 'PDF', '-' title 'mean' with impulses, '-' title '1-stddev' with histeps, '-' title '2-stddev' with histeps, '-' title '3-stddev' with histeps, '-' title '4-stddev' with histeps, '-' title '5-stddev' with histeps, '-' title '6-stddev' with histeps\n"); - - for(i = 0; i < stats->nbuckets; i++) { - fprintf(outfile, "%d %u\n", stats->buckets[i].residual, stats->buckets[i].count); - } - fprintf(outfile, "e\n"); - - fprintf(outfile, "%f %f\ne\n", stats->mean, p); - fprintf(outfile, "%f %f\n%f %f\ne\n", m-s1, p*0.8, m+s1, p*0.8); - fprintf(outfile, "%f %f\n%f %f\ne\n", m-s2, p*0.7, m+s2, p*0.7); - fprintf(outfile, "%f %f\n%f %f\ne\n", m-s3, p*0.6, m+s3, p*0.6); - fprintf(outfile, "%f %f\n%f %f\ne\n", m-s4, p*0.5, m+s4, p*0.5); - fprintf(outfile, "%f %f\n%f %f\ne\n", m-s5, p*0.4, m+s5, p*0.4); - fprintf(outfile, "%f %f\n%f %f\ne\n", m-s6, p*0.3, m+s6, p*0.3); - - fprintf(outfile, "pause -1 'waiting...'\n"); - - fclose(outfile); - return true; -} diff --git a/3rdparty/libflac/src/flac/analyze.h b/3rdparty/libflac/src/flac/analyze.h deleted file mode 100644 index b58b6b875ff..00000000000 --- a/3rdparty/libflac/src/flac/analyze.h +++ /dev/null @@ -1,31 +0,0 @@ -/* flac - Command-line FLAC encoder/decoder - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef flac__analyze_h -#define flac__analyze_h - -typedef struct { - FLAC__bool do_residual_text; - FLAC__bool do_residual_gnuplot; -} analysis_options; - -void flac__analyze_init(analysis_options aopts); -void flac__analyze_frame(const FLAC__Frame *frame, unsigned frame_number, FLAC__uint64 frame_offset, unsigned frame_bytes, analysis_options aopts, FILE *fout); -void flac__analyze_finish(analysis_options aopts); - -#endif diff --git a/3rdparty/libflac/src/flac/decode.c b/3rdparty/libflac/src/flac/decode.c deleted file mode 100644 index 1e537c064e2..00000000000 --- a/3rdparty/libflac/src/flac/decode.c +++ /dev/null @@ -1,1380 +0,0 @@ -/* flac - Command-line FLAC encoder/decoder - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#if defined _WIN32 && !defined __CYGWIN__ -/* where MSVC puts unlink() */ -# include <io.h> -#else -# include <unistd.h> -#endif -#if defined _MSC_VER || defined __MINGW32__ -#include <sys/types.h> /* for off_t */ -#if _MSC_VER <= 1600 /* @@@ [2G limit] */ -#define fseeko fseek -#define ftello ftell -#endif -#endif -#include <errno.h> -#include <math.h> /* for floor() */ -#include <stdio.h> /* for FILE etc. */ -#include <string.h> /* for strcmp(), strerror() */ -#include "FLAC/all.h" -#include "share/grabbag.h" -#include "share/replaygain_synthesis.h" -#include "decode.h" - -typedef struct { -#if FLAC__HAS_OGG - FLAC__bool is_ogg; - FLAC__bool use_first_serial_number; - long serial_number; -#endif - - FLAC__bool is_aiff_out; - FLAC__bool is_wave_out; - FLAC__bool treat_warnings_as_errors; - FLAC__bool continue_through_decode_errors; - FLAC__bool channel_map_none; - - struct { - replaygain_synthesis_spec_t spec; - FLAC__bool apply; /* 'spec.apply' is just a request; this 'apply' means we actually parsed the RG tags and are ready to go */ - double scale; - DitherContext dither_context; - } replaygain; - - FLAC__bool test_only; - FLAC__bool analysis_mode; - analysis_options aopts; - utils__SkipUntilSpecification *skip_specification; - utils__SkipUntilSpecification *until_specification; /* a canonicalized value of 0 mean end-of-stream (i.e. --until=-0) */ - utils__CueSpecification *cue_specification; - - const char *inbasefilename; - const char *infilename; - const char *outfilename; - - FLAC__uint64 samples_processed; - unsigned frame_counter; - FLAC__bool abort_flag; - FLAC__bool aborting_due_to_until; /* true if we intentionally abort decoding prematurely because we hit the --until point */ - FLAC__bool aborting_due_to_unparseable; /* true if we abort decoding because we hit an unparseable frame */ - - FLAC__bool iff_headers_need_fixup; - - FLAC__bool is_big_endian; - FLAC__bool is_unsigned_samples; - FLAC__bool got_stream_info; - FLAC__bool has_md5sum; - FLAC__uint64 total_samples; - unsigned bps; - unsigned channels; - unsigned sample_rate; - FLAC__uint32 channel_mask; - - /* these are used only in analyze mode */ - FLAC__uint64 decode_position; - - FLAC__StreamDecoder *decoder; - - FILE *fout; - - foreign_metadata_t *foreign_metadata; /* NULL unless --keep-foreign-metadata requested */ - off_t fm_offset1, fm_offset2, fm_offset3; -} DecoderSession; - - -static FLAC__bool is_big_endian_host_; - - -/* - * local routines - */ -static FLAC__bool DecoderSession_construct(DecoderSession *d, FLAC__bool is_ogg, FLAC__bool use_first_serial_number, long serial_number, FLAC__bool is_aiff_out, FLAC__bool is_wave_out, FLAC__bool treat_warnings_as_errors, FLAC__bool continue_through_decode_errors, FLAC__bool channel_map_none, replaygain_synthesis_spec_t replaygain_synthesis_spec, FLAC__bool analysis_mode, analysis_options aopts, utils__SkipUntilSpecification *skip_specification, utils__SkipUntilSpecification *until_specification, utils__CueSpecification *cue_specification, foreign_metadata_t *foreign_metadata, const char *infilename, const char *outfilename); -static void DecoderSession_destroy(DecoderSession *d, FLAC__bool error_occurred); -static FLAC__bool DecoderSession_init_decoder(DecoderSession *d, const char *infilename); -static FLAC__bool DecoderSession_process(DecoderSession *d); -static int DecoderSession_finish_ok(DecoderSession *d); -static int DecoderSession_finish_error(DecoderSession *d); -static FLAC__bool canonicalize_until_specification(utils__SkipUntilSpecification *spec, const char *inbasefilename, unsigned sample_rate, FLAC__uint64 skip, FLAC__uint64 total_samples_in_input); -static FLAC__bool write_iff_headers(FILE *f, DecoderSession *decoder_session, FLAC__uint64 samples); -static FLAC__bool write_riff_wave_fmt_chunk(FILE *f, FLAC__bool is_waveformatextensible, unsigned bps, unsigned channels, unsigned sample_rate, FLAC__uint32 channel_mask); -static FLAC__bool write_aiff_form_comm_chunk(FILE *f, FLAC__uint64 samples, unsigned bps, unsigned channels, unsigned sample_rate); -static FLAC__bool write_little_endian_uint16(FILE *f, FLAC__uint16 val); -static FLAC__bool write_little_endian_uint32(FILE *f, FLAC__uint32 val); -static FLAC__bool write_big_endian_uint16(FILE *f, FLAC__uint16 val); -static FLAC__bool write_big_endian_uint32(FILE *f, FLAC__uint32 val); -static FLAC__bool write_sane_extended(FILE *f, unsigned val); -static FLAC__bool fixup_iff_headers(DecoderSession *d); -static FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data); -static void metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data); -static void error_callback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data); -static void print_error_with_init_status(const DecoderSession *d, const char *message, FLAC__StreamDecoderInitStatus init_status); -static void print_error_with_state(const DecoderSession *d, const char *message); -static void print_stats(const DecoderSession *decoder_session); - - -/* - * public routines - */ -int flac__decode_aiff(const char *infilename, const char *outfilename, FLAC__bool analysis_mode, analysis_options aopts, wav_decode_options_t options) -{ - DecoderSession decoder_session; - - if(! - DecoderSession_construct( - &decoder_session, -#if FLAC__HAS_OGG - options.common.is_ogg, - options.common.use_first_serial_number, - options.common.serial_number, -#else - /*is_ogg=*/false, - /*use_first_serial_number=*/false, - /*serial_number=*/0, -#endif - /*is_aiff_out=*/true, - /*is_wave_out=*/false, - options.common.treat_warnings_as_errors, - options.common.continue_through_decode_errors, - options.common.channel_map_none, - options.common.replaygain_synthesis_spec, - analysis_mode, - aopts, - &options.common.skip_specification, - &options.common.until_specification, - options.common.has_cue_specification? &options.common.cue_specification : 0, - options.foreign_metadata, - infilename, - outfilename - ) - ) - return 1; - - if(!DecoderSession_init_decoder(&decoder_session, infilename)) - return DecoderSession_finish_error(&decoder_session); - - if(!DecoderSession_process(&decoder_session)) - return DecoderSession_finish_error(&decoder_session); - - return DecoderSession_finish_ok(&decoder_session); -} - -int flac__decode_wav(const char *infilename, const char *outfilename, FLAC__bool analysis_mode, analysis_options aopts, wav_decode_options_t options) -{ - DecoderSession decoder_session; - - if(! - DecoderSession_construct( - &decoder_session, -#if FLAC__HAS_OGG - options.common.is_ogg, - options.common.use_first_serial_number, - options.common.serial_number, -#else - /*is_ogg=*/false, - /*use_first_serial_number=*/false, - /*serial_number=*/0, -#endif - /*is_aiff_out=*/false, - /*is_wave_out=*/true, - options.common.treat_warnings_as_errors, - options.common.continue_through_decode_errors, - options.common.channel_map_none, - options.common.replaygain_synthesis_spec, - analysis_mode, - aopts, - &options.common.skip_specification, - &options.common.until_specification, - options.common.has_cue_specification? &options.common.cue_specification : 0, - options.foreign_metadata, - infilename, - outfilename - ) - ) - return 1; - - if(!DecoderSession_init_decoder(&decoder_session, infilename)) - return DecoderSession_finish_error(&decoder_session); - - if(!DecoderSession_process(&decoder_session)) - return DecoderSession_finish_error(&decoder_session); - - return DecoderSession_finish_ok(&decoder_session); -} - -int flac__decode_raw(const char *infilename, const char *outfilename, FLAC__bool analysis_mode, analysis_options aopts, raw_decode_options_t options) -{ - DecoderSession decoder_session; - - decoder_session.is_big_endian = options.is_big_endian; - decoder_session.is_unsigned_samples = options.is_unsigned_samples; - - if(! - DecoderSession_construct( - &decoder_session, -#if FLAC__HAS_OGG - options.common.is_ogg, - options.common.use_first_serial_number, - options.common.serial_number, -#else - /*is_ogg=*/false, - /*use_first_serial_number=*/false, - /*serial_number=*/0, -#endif - /*is_aiff_out=*/false, - /*is_wave_out=*/false, - options.common.treat_warnings_as_errors, - options.common.continue_through_decode_errors, - options.common.channel_map_none, - options.common.replaygain_synthesis_spec, - analysis_mode, - aopts, - &options.common.skip_specification, - &options.common.until_specification, - options.common.has_cue_specification? &options.common.cue_specification : 0, - /*foreign_metadata=*/NULL, - infilename, - outfilename - ) - ) - return 1; - - if(!DecoderSession_init_decoder(&decoder_session, infilename)) - return DecoderSession_finish_error(&decoder_session); - - if(!DecoderSession_process(&decoder_session)) - return DecoderSession_finish_error(&decoder_session); - - return DecoderSession_finish_ok(&decoder_session); -} - -FLAC__bool DecoderSession_construct(DecoderSession *d, FLAC__bool is_ogg, FLAC__bool use_first_serial_number, long serial_number, FLAC__bool is_aiff_out, FLAC__bool is_wave_out, FLAC__bool treat_warnings_as_errors, FLAC__bool continue_through_decode_errors, FLAC__bool channel_map_none, replaygain_synthesis_spec_t replaygain_synthesis_spec, FLAC__bool analysis_mode, analysis_options aopts, utils__SkipUntilSpecification *skip_specification, utils__SkipUntilSpecification *until_specification, utils__CueSpecification *cue_specification, foreign_metadata_t *foreign_metadata, const char *infilename, const char *outfilename) -{ -#if FLAC__HAS_OGG - d->is_ogg = is_ogg; - d->use_first_serial_number = use_first_serial_number; - d->serial_number = serial_number; -#else - (void)is_ogg; - (void)use_first_serial_number; - (void)serial_number; -#endif - - d->is_aiff_out = is_aiff_out; - d->is_wave_out = is_wave_out; - d->treat_warnings_as_errors = treat_warnings_as_errors; - d->continue_through_decode_errors = continue_through_decode_errors; - d->channel_map_none = channel_map_none; - d->replaygain.spec = replaygain_synthesis_spec; - d->replaygain.apply = false; - d->replaygain.scale = 0.0; - /* d->replaygain.dither_context gets initialized later once we know the sample resolution */ - d->test_only = (0 == outfilename); - d->analysis_mode = analysis_mode; - d->aopts = aopts; - d->skip_specification = skip_specification; - d->until_specification = until_specification; - d->cue_specification = cue_specification; - - d->inbasefilename = grabbag__file_get_basename(infilename); - d->infilename = infilename; - d->outfilename = outfilename; - - d->samples_processed = 0; - d->frame_counter = 0; - d->abort_flag = false; - d->aborting_due_to_until = false; - d->aborting_due_to_unparseable = false; - - d->iff_headers_need_fixup = false; - - d->total_samples = 0; - d->got_stream_info = false; - d->has_md5sum = false; - d->bps = 0; - d->channels = 0; - d->sample_rate = 0; - d->channel_mask = 0; - - d->decode_position = 0; - - d->decoder = 0; - - d->fout = 0; /* initialized with an open file later if necessary */ - - d->foreign_metadata = foreign_metadata; - - FLAC__ASSERT(!(d->test_only && d->analysis_mode)); - - if(!d->test_only) { - if(0 == strcmp(outfilename, "-")) { - d->fout = grabbag__file_get_binary_stdout(); - } - else { - if(0 == (d->fout = fopen(outfilename, "wb"))) { - flac__utils_printf(stderr, 1, "%s: ERROR: can't open output file %s: %s\n", d->inbasefilename, outfilename, strerror(errno)); - DecoderSession_destroy(d, /*error_occurred=*/true); - return false; - } - } - } - - if(analysis_mode) - flac__analyze_init(aopts); - - return true; -} - -void DecoderSession_destroy(DecoderSession *d, FLAC__bool error_occurred) -{ - if(0 != d->fout && d->fout != stdout) { - fclose(d->fout); - if(error_occurred) - unlink(d->outfilename); - } -} - -FLAC__bool DecoderSession_init_decoder(DecoderSession *decoder_session, const char *infilename) -{ - FLAC__StreamDecoderInitStatus init_status; - FLAC__uint32 test = 1; - - is_big_endian_host_ = (*((FLAC__byte*)(&test)))? false : true; - - if(!decoder_session->analysis_mode && !decoder_session->test_only && (decoder_session->is_wave_out || decoder_session->is_aiff_out)) { - if(decoder_session->foreign_metadata) { - const char *error; - if(!flac__foreign_metadata_read_from_flac(decoder_session->foreign_metadata, infilename, &error)) { - flac__utils_printf(stderr, 1, "%s: ERROR reading foreign metadata: %s\n", decoder_session->inbasefilename, error); - return false; - } - } - } - - decoder_session->decoder = FLAC__stream_decoder_new(); - - if(0 == decoder_session->decoder) { - flac__utils_printf(stderr, 1, "%s: ERROR creating the decoder instance\n", decoder_session->inbasefilename); - return false; - } - - FLAC__stream_decoder_set_md5_checking(decoder_session->decoder, true); - if (0 != decoder_session->cue_specification) - FLAC__stream_decoder_set_metadata_respond(decoder_session->decoder, FLAC__METADATA_TYPE_CUESHEET); - if (decoder_session->replaygain.spec.apply) - FLAC__stream_decoder_set_metadata_respond(decoder_session->decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT); - -#if FLAC__HAS_OGG - if(decoder_session->is_ogg) { - if(!decoder_session->use_first_serial_number) - FLAC__stream_decoder_set_ogg_serial_number(decoder_session->decoder, decoder_session->serial_number); - init_status = FLAC__stream_decoder_init_ogg_file(decoder_session->decoder, strcmp(infilename, "-")? infilename : 0, write_callback, metadata_callback, error_callback, /*client_data=*/decoder_session); - } - else -#endif - { - init_status = FLAC__stream_decoder_init_file(decoder_session->decoder, strcmp(infilename, "-")? infilename : 0, write_callback, metadata_callback, error_callback, /*client_data=*/decoder_session); - } - - if(init_status != FLAC__STREAM_DECODER_INIT_STATUS_OK) { - print_error_with_init_status(decoder_session, "ERROR initializing decoder", init_status); - return false; - } - - return true; -} - -FLAC__bool DecoderSession_process(DecoderSession *d) -{ - if(!FLAC__stream_decoder_process_until_end_of_metadata(d->decoder)) { - flac__utils_printf(stderr, 2, "\n"); - print_error_with_state(d, "ERROR while decoding metadata"); - return false; - } - if(FLAC__stream_decoder_get_state(d->decoder) > FLAC__STREAM_DECODER_END_OF_STREAM) { - flac__utils_printf(stderr, 2, "\n"); - print_error_with_state(d, "ERROR during metadata decoding"); - if(!d->continue_through_decode_errors) - return false; - } - - if(d->abort_flag) - return false; - - /* set channel mapping */ - if(!d->channel_map_none) { - /* currently FLAC order matches SMPTE/WAVEFORMATEXTENSIBLE order, so no reordering is necessary; see encode.c */ - /* only the channel mask must be set if it was not already picked up from the WAVEFORMATEXTENSIBLE_CHANNEL_MASK tag */ - if(d->channels == 1) { - if(d->channel_mask == 0) - d->channel_mask = 0x0001; - } - else if(d->channels == 2) { - if(d->channel_mask == 0) - d->channel_mask = 0x0003; - } - else if(d->channels == 3) { - if(d->channel_mask == 0) - d->channel_mask = 0x0007; - } - else if(d->channels == 4) { - if(d->channel_mask == 0) - d->channel_mask = 0x0033; - } - else if(d->channels == 5) { - if(d->channel_mask == 0) - d->channel_mask = 0x0607; - } - else if(d->channels == 6) { - if(d->channel_mask == 0) - d->channel_mask = 0x060f; - } - } - - /* write the WAVE/AIFF headers if necessary */ - if(!d->analysis_mode && !d->test_only && (d->is_wave_out || d->is_aiff_out)) { - if(!write_iff_headers(d->fout, d, d->total_samples)) { - d->abort_flag = true; - return false; - } - } - - if(d->skip_specification->value.samples > 0) { - const FLAC__uint64 skip = (FLAC__uint64)d->skip_specification->value.samples; - - if(!FLAC__stream_decoder_seek_absolute(d->decoder, skip)) { - print_error_with_state(d, "ERROR seeking while skipping bytes"); - return false; - } - } - if(!FLAC__stream_decoder_process_until_end_of_stream(d->decoder) && !d->aborting_due_to_until) { - flac__utils_printf(stderr, 2, "\n"); - print_error_with_state(d, "ERROR while decoding data"); - if(!d->continue_through_decode_errors) - return false; - } - if( - (d->abort_flag && !(d->aborting_due_to_until || d->continue_through_decode_errors)) || - (FLAC__stream_decoder_get_state(d->decoder) > FLAC__STREAM_DECODER_END_OF_STREAM && !d->aborting_due_to_until) - ) { - flac__utils_printf(stderr, 2, "\n"); - print_error_with_state(d, "ERROR during decoding"); - return false; - } - - if(!d->analysis_mode && !d->test_only && (d->is_wave_out || d->is_aiff_out) && ((d->total_samples * d->channels * ((d->bps+7)/8)) & 1)) { - if(flac__utils_fwrite("\000", 1, 1, d->fout) != 1) { - print_error_with_state(d, d->is_wave_out? - "ERROR writing pad byte to WAVE data chunk" : - "ERROR writing pad byte to AIFF SSND chunk" - ); - return false; - } - } - - return true; -} - -int DecoderSession_finish_ok(DecoderSession *d) -{ - FLAC__bool ok = true, md5_failure = false; - - if(d->decoder) { - md5_failure = !FLAC__stream_decoder_finish(d->decoder) && !d->aborting_due_to_until; - print_stats(d); - FLAC__stream_decoder_delete(d->decoder); - } - if(d->analysis_mode) - flac__analyze_finish(d->aopts); - if(md5_failure) { - flac__utils_printf(stderr, 1, "\r%s: ERROR, MD5 signature mismatch\n", d->inbasefilename); - ok = d->continue_through_decode_errors; - } - else { - if(!d->got_stream_info) { - flac__utils_printf(stderr, 1, "\r%s: WARNING, cannot check MD5 signature since there was no STREAMINFO\n", d->inbasefilename); - ok = !d->treat_warnings_as_errors; - } - else if(!d->has_md5sum) { - flac__utils_printf(stderr, 1, "\r%s: WARNING, cannot check MD5 signature since it was unset in the STREAMINFO\n", d->inbasefilename); - ok = !d->treat_warnings_as_errors; - } - flac__utils_printf(stderr, 2, "\r%s: %s \n", d->inbasefilename, d->test_only? "ok ":d->analysis_mode?"done ":"done"); - } - DecoderSession_destroy(d, /*error_occurred=*/!ok); - if(!d->analysis_mode && !d->test_only && (d->is_wave_out || d->is_aiff_out)) { - if(d->iff_headers_need_fixup || (!d->got_stream_info && strcmp(d->outfilename, "-"))) { - if(!fixup_iff_headers(d)) - return 1; - } - if(d->foreign_metadata) { - const char *error; - if(!flac__foreign_metadata_write_to_iff(d->foreign_metadata, d->infilename, d->outfilename, d->fm_offset1, d->fm_offset2, d->fm_offset3, &error)) { - flac__utils_printf(stderr, 1, "ERROR updating foreign metadata from %s to %s: %s\n", d->infilename, d->outfilename, error); - return 1; - } - } - } - return ok? 0 : 1; -} - -int DecoderSession_finish_error(DecoderSession *d) -{ - if(d->decoder) { - (void)FLAC__stream_decoder_finish(d->decoder); - FLAC__stream_decoder_delete(d->decoder); - } - if(d->analysis_mode) - flac__analyze_finish(d->aopts); - DecoderSession_destroy(d, /*error_occurred=*/true); - return 1; -} - -FLAC__bool canonicalize_until_specification(utils__SkipUntilSpecification *spec, const char *inbasefilename, unsigned sample_rate, FLAC__uint64 skip, FLAC__uint64 total_samples_in_input) -{ - /* convert from mm:ss.sss to sample number if necessary */ - flac__utils_canonicalize_skip_until_specification(spec, sample_rate); - - /* special case: if "--until=-0", use the special value '0' to mean "end-of-stream" */ - if(spec->is_relative && spec->value.samples == 0) { - spec->is_relative = false; - return true; - } - - /* in any other case the total samples in the input must be known */ - if(total_samples_in_input == 0) { - flac__utils_printf(stderr, 1, "%s: ERROR, cannot use --until when FLAC metadata has total sample count of 0\n", inbasefilename); - return false; - } - - FLAC__ASSERT(spec->value_is_samples); - - /* convert relative specifications to absolute */ - if(spec->is_relative) { - if(spec->value.samples <= 0) - spec->value.samples += (FLAC__int64)total_samples_in_input; - else - spec->value.samples += skip; - spec->is_relative = false; - } - - /* error check */ - if(spec->value.samples < 0) { - flac__utils_printf(stderr, 1, "%s: ERROR, --until value is before beginning of input\n", inbasefilename); - return false; - } - if((FLAC__uint64)spec->value.samples <= skip) { - flac__utils_printf(stderr, 1, "%s: ERROR, --until value is before --skip point\n", inbasefilename); - return false; - } - if((FLAC__uint64)spec->value.samples > total_samples_in_input) { - flac__utils_printf(stderr, 1, "%s: ERROR, --until value is after end of input\n", inbasefilename); - return false; - } - - return true; -} - -FLAC__bool write_iff_headers(FILE *f, DecoderSession *decoder_session, FLAC__uint64 samples) -{ - const char *fmt_desc = decoder_session->is_wave_out? "WAVE" : "AIFF"; - const FLAC__bool is_waveformatextensible = decoder_session->is_wave_out && (decoder_session->channel_mask == 2 || decoder_session->channel_mask > 3 || decoder_session->bps%8 || decoder_session->channels > 2); - FLAC__uint64 data_size = samples * decoder_session->channels * ((decoder_session->bps+7)/8); - const FLAC__uint32 aligned_data_size = (FLAC__uint32)((data_size+1) & (~1U)); /* we'll check for overflow later */ - - unsigned foreign_metadata_size = 0; /* size of all non-audio non-fmt/COMM foreign metadata chunks */ - foreign_metadata_t *fm = decoder_session->foreign_metadata; - size_t i; - - if(samples == 0) { - if(f == stdout) { - flac__utils_printf(stderr, 1, "%s: WARNING, don't have accurate sample count available for %s header.\n", decoder_session->inbasefilename, fmt_desc); - flac__utils_printf(stderr, 1, " Generated %s file will have a data chunk size of 0. Try\n", fmt_desc); - flac__utils_printf(stderr, 1, " decoding directly to a file instead.\n"); - if(decoder_session->treat_warnings_as_errors) - return false; - } - else { - decoder_session->iff_headers_need_fixup = true; - } - } - - if(fm) { - FLAC__ASSERT(fm->format_block); - FLAC__ASSERT(fm->audio_block); - FLAC__ASSERT(fm->format_block < fm->audio_block); - /* calc foreign metadata size; for RIFF/AIFF we always skip the first chunk, format chunk, and sound chunk since we write our own */ - for(i = 1; i < fm->num_blocks; i++) { - if(i != fm->format_block && i != fm->audio_block) - foreign_metadata_size += fm->blocks[i].size; - } - } - - if(data_size + foreign_metadata_size + 60/*worst-case*/ >= 0xFFFFFFF4) { - flac__utils_printf(stderr, 1, "%s: ERROR: stream is too big to fit in a single %s file\n", decoder_session->inbasefilename, fmt_desc); - return false; - } - - if(decoder_session->is_wave_out) { - if(flac__utils_fwrite("RIFF", 1, 4, f) != 4) - return false; - - if(!write_little_endian_uint32(f, foreign_metadata_size + aligned_data_size + (is_waveformatextensible?60:36))) /* filesize-8 */ - return false; - - if(flac__utils_fwrite("WAVE", 1, 4, f) != 4) - return false; - - decoder_session->fm_offset1 = ftello(f); - - if(fm) { - /* seek forward to {allocate} or {skip over already-written chunks} before "fmt " */ - for(i = 1; i < fm->format_block; i++) { - if(fseeko(f, fm->blocks[i].size, SEEK_CUR) < 0) { - flac__utils_printf(stderr, 1, "%s: ERROR: allocating/skipping foreign metadata before \"fmt \"\n", decoder_session->inbasefilename); - return false; - } - } - } - - if(!write_riff_wave_fmt_chunk(f, is_waveformatextensible, decoder_session->bps, decoder_session->channels, decoder_session->sample_rate, decoder_session->channel_mask)) - return false; - - decoder_session->fm_offset2 = ftello(f); - - if(fm) { - /* seek forward to {allocate} or {skip over already-written chunks} after "fmt " but before "data" */ - for(i = fm->format_block+1; i < fm->audio_block; i++) { - if(fseeko(f, fm->blocks[i].size, SEEK_CUR) < 0) { - flac__utils_printf(stderr, 1, "%s: ERROR: allocating/skipping foreign metadata after \"fmt \"\n", decoder_session->inbasefilename); - return false; - } - } - } - - if(flac__utils_fwrite("data", 1, 4, f) != 4) - return false; - - if(!write_little_endian_uint32(f, (FLAC__uint32)data_size)) /* data size */ - return false; - - decoder_session->fm_offset3 = ftello(f) + aligned_data_size; - } - else { - FLAC__uint32 ssnd_offset_size = (fm? fm->ssnd_offset_size : 0); - - if(flac__utils_fwrite("FORM", 1, 4, f) != 4) - return false; - - if(!write_big_endian_uint32(f, foreign_metadata_size + aligned_data_size + 46 + ssnd_offset_size)) /* filesize-8 */ - return false; - - if(flac__utils_fwrite("AIFF", 1, 4, f) != 4) - return false; - - decoder_session->fm_offset1 = ftello(f); - - if(fm) { - /* seek forward to {allocate} or {skip over already-written chunks} before "COMM" */ - for(i = 1; i < fm->format_block; i++) { - if(fseeko(f, fm->blocks[i].size, SEEK_CUR) < 0) { - flac__utils_printf(stderr, 1, "%s: ERROR: allocating/skipping foreign metadata before \"COMM\"\n", decoder_session->inbasefilename); - return false; - } - } - } - - if(!write_aiff_form_comm_chunk(f, samples, decoder_session->bps, decoder_session->channels, decoder_session->sample_rate)) - return false; - - decoder_session->fm_offset2 = ftello(f); - - if(fm) { - /* seek forward to {allocate} or {skip over already-written chunks} after "COMM" but before "SSND" */ - for(i = fm->format_block+1; i < fm->audio_block; i++) { - if(fseeko(f, fm->blocks[i].size, SEEK_CUR) < 0) { - flac__utils_printf(stderr, 1, "%s: ERROR: allocating/skipping foreign metadata after \"COMM\"\n", decoder_session->inbasefilename); - return false; - } - } - } - - if(flac__utils_fwrite("SSND", 1, 4, f) != 4) - return false; - - if(!write_big_endian_uint32(f, (FLAC__uint32)data_size + 8 + ssnd_offset_size)) /* data size */ - return false; - - if(!write_big_endian_uint32(f, ssnd_offset_size)) - return false; - - if(!write_big_endian_uint32(f, 0/*block_size*/)) - return false; - - if(ssnd_offset_size) { - /* seek forward to {allocate} or {skip over already-written} SSND offset */ - if(fseeko(f, ssnd_offset_size, SEEK_CUR) < 0) { - flac__utils_printf(stderr, 1, "%s: ERROR: allocating/skipping \"SSND\" offset\n", decoder_session->inbasefilename); - return false; - } - } - - decoder_session->fm_offset3 = ftello(f) + aligned_data_size; - } - - return true; -} - -FLAC__bool write_riff_wave_fmt_chunk(FILE *f, FLAC__bool is_waveformatextensible, unsigned bps, unsigned channels, unsigned sample_rate, FLAC__uint32 channel_mask) -{ - if(flac__utils_fwrite("fmt ", 1, 4, f) != 4) - return false; - - if(!write_little_endian_uint32(f, is_waveformatextensible? 40 : 16)) /* chunk size */ - return false; - - if(!write_little_endian_uint16(f, (FLAC__uint16)(is_waveformatextensible? 65534 : 1))) /* compression code */ - return false; - - if(!write_little_endian_uint16(f, (FLAC__uint16)channels)) - return false; - - if(!write_little_endian_uint32(f, sample_rate)) - return false; - - if(!write_little_endian_uint32(f, sample_rate * channels * ((bps+7) / 8))) - return false; - - if(!write_little_endian_uint16(f, (FLAC__uint16)(channels * ((bps+7) / 8)))) /* block align */ - return false; - - if(!write_little_endian_uint16(f, (FLAC__uint16)(((bps+7)/8)*8))) /* bits per sample */ - return false; - - if(is_waveformatextensible) { - if(!write_little_endian_uint16(f, (FLAC__uint16)22)) /* cbSize */ - return false; - - if(!write_little_endian_uint16(f, (FLAC__uint16)bps)) /* validBitsPerSample */ - return false; - - if(!write_little_endian_uint32(f, channel_mask)) - return false; - - /* GUID = {0x00000001, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} */ - if(flac__utils_fwrite("\x01\x00\x00\x00\x00\x00\x10\x00\x80\x00\x00\xaa\x00\x38\x9b\x71", 1, 16, f) != 16) - return false; - } - - return true; -} - -FLAC__bool write_aiff_form_comm_chunk(FILE *f, FLAC__uint64 samples, unsigned bps, unsigned channels, unsigned sample_rate) -{ - FLAC__ASSERT(samples <= 0xffffffff); - - if(flac__utils_fwrite("COMM", 1, 4, f) != 4) - return false; - - if(!write_big_endian_uint32(f, 18)) /* chunk size = 18 */ - return false; - - if(!write_big_endian_uint16(f, (FLAC__uint16)channels)) - return false; - - if(!write_big_endian_uint32(f, (FLAC__uint32)samples)) - return false; - - if(!write_big_endian_uint16(f, (FLAC__uint16)bps)) - return false; - - if(!write_sane_extended(f, sample_rate)) - return false; - - return true; -} - -FLAC__bool write_little_endian_uint16(FILE *f, FLAC__uint16 val) -{ - FLAC__byte *b = (FLAC__byte*)(&val); - if(is_big_endian_host_) { - FLAC__byte tmp; - tmp = b[1]; b[1] = b[0]; b[0] = tmp; - } - return flac__utils_fwrite(b, 1, 2, f) == 2; -} - -FLAC__bool write_little_endian_uint32(FILE *f, FLAC__uint32 val) -{ - FLAC__byte *b = (FLAC__byte*)(&val); - if(is_big_endian_host_) { - FLAC__byte tmp; - tmp = b[3]; b[3] = b[0]; b[0] = tmp; - tmp = b[2]; b[2] = b[1]; b[1] = tmp; - } - return flac__utils_fwrite(b, 1, 4, f) == 4; -} - -FLAC__bool write_big_endian_uint16(FILE *f, FLAC__uint16 val) -{ - FLAC__byte *b = (FLAC__byte*)(&val); - if(!is_big_endian_host_) { - FLAC__byte tmp; - tmp = b[1]; b[1] = b[0]; b[0] = tmp; - } - return flac__utils_fwrite(b, 1, 2, f) == 2; -} - -FLAC__bool write_big_endian_uint32(FILE *f, FLAC__uint32 val) -{ - FLAC__byte *b = (FLAC__byte*)(&val); - if(!is_big_endian_host_) { - FLAC__byte tmp; - tmp = b[3]; b[3] = b[0]; b[0] = tmp; - tmp = b[2]; b[2] = b[1]; b[1] = tmp; - } - return flac__utils_fwrite(b, 1, 4, f) == 4; -} - -FLAC__bool write_sane_extended(FILE *f, unsigned val) - /* Write to 'f' a SANE extended representation of 'val'. Return false if - * the write succeeds; return true otherwise. - * - * SANE extended is an 80-bit IEEE-754 representation with sign bit, 15 bits - * of exponent, and 64 bits of significand (mantissa). Unlike most IEEE-754 - * representations, it does not imply a 1 above the MSB of the significand. - * - * Preconditions: - * val!=0U - */ -{ - unsigned int shift, exponent; - - FLAC__ASSERT(val!=0U); /* handling 0 would require a special case */ - - for(shift= 0U; (val>>(31-shift))==0U; ++shift) - ; - val<<= shift; - exponent= 63U-(shift+32U); /* add 32 for unused second word */ - - if(!write_big_endian_uint16(f, (FLAC__uint16)(exponent+0x3FFF))) - return false; - if(!write_big_endian_uint32(f, val)) - return false; - if(!write_big_endian_uint32(f, 0)) /* unused second word */ - return false; - - return true; -} - -FLAC__bool fixup_iff_headers(DecoderSession *d) -{ - const char *fmt_desc = (d->is_wave_out? "WAVE" : "AIFF"); - FILE *f = fopen(d->outfilename, "r+b"); /* stream is positioned at beginning of file */ - - if(0 == f) { - flac__utils_printf(stderr, 1, "ERROR, couldn't open file %s while fixing up %s chunk size: %s\n", d->outfilename, fmt_desc, strerror(errno)); - return false; - } - - if(!write_iff_headers(f, d, d->samples_processed)) { - fclose(f); - return false; - } - - fclose(f); - return true; -} - -FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data) -{ - DecoderSession *decoder_session = (DecoderSession*)client_data; - FILE *fout = decoder_session->fout; - const unsigned bps = frame->header.bits_per_sample, channels = frame->header.channels; - const unsigned shift = ((decoder_session->is_wave_out || decoder_session->is_aiff_out) && (bps%8)? 8-(bps%8): 0); - FLAC__bool is_big_endian = (decoder_session->is_aiff_out? true : (decoder_session->is_wave_out? false : decoder_session->is_big_endian)); - FLAC__bool is_unsigned_samples = (decoder_session->is_aiff_out? false : (decoder_session->is_wave_out? bps<=8 : decoder_session->is_unsigned_samples)); - unsigned wide_samples = frame->header.blocksize, wide_sample, sample, channel, byte; - unsigned frame_bytes = 0; - static FLAC__int8 s8buffer[FLAC__MAX_BLOCK_SIZE * FLAC__MAX_CHANNELS * sizeof(FLAC__int32)]; /* WATCHOUT: can be up to 2 megs */ - FLAC__uint8 *u8buffer = (FLAC__uint8 *)s8buffer; - FLAC__int16 *s16buffer = (FLAC__int16 *)s8buffer; - FLAC__uint16 *u16buffer = (FLAC__uint16 *)s8buffer; - FLAC__int32 *s32buffer = (FLAC__int32 *)s8buffer; - FLAC__uint32 *u32buffer = (FLAC__uint32 *)s8buffer; - size_t bytes_to_write = 0; - - (void)decoder; - - if(decoder_session->abort_flag) - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - - /* sanity-check the bits-per-sample */ - if(decoder_session->bps) { - if(bps != decoder_session->bps) { - if(decoder_session->got_stream_info) - flac__utils_printf(stderr, 1, "%s: ERROR, bits-per-sample is %u in frame but %u in STREAMINFO\n", decoder_session->inbasefilename, bps, decoder_session->bps); - else - flac__utils_printf(stderr, 1, "%s: ERROR, bits-per-sample is %u in this frame but %u in previous frames\n", decoder_session->inbasefilename, bps, decoder_session->bps); - if(!decoder_session->continue_through_decode_errors) - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - } - } - else { - /* must not have gotten STREAMINFO, save the bps from the frame header */ - FLAC__ASSERT(!decoder_session->got_stream_info); - decoder_session->bps = bps; - } - - /* sanity-check the #channels */ - if(decoder_session->channels) { - if(channels != decoder_session->channels) { - if(decoder_session->got_stream_info) - flac__utils_printf(stderr, 1, "%s: ERROR, channels is %u in frame but %u in STREAMINFO\n", decoder_session->inbasefilename, channels, decoder_session->channels); - else - flac__utils_printf(stderr, 1, "%s: ERROR, channels is %u in this frame but %u in previous frames\n", decoder_session->inbasefilename, channels, decoder_session->channels); - if(!decoder_session->continue_through_decode_errors) - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - } - } - else { - /* must not have gotten STREAMINFO, save the #channels from the frame header */ - FLAC__ASSERT(!decoder_session->got_stream_info); - decoder_session->channels = channels; - } - - /* sanity-check the sample rate */ - if(decoder_session->sample_rate) { - if(frame->header.sample_rate != decoder_session->sample_rate) { - if(decoder_session->got_stream_info) - flac__utils_printf(stderr, 1, "%s: ERROR, sample rate is %u in frame but %u in STREAMINFO\n", decoder_session->inbasefilename, frame->header.sample_rate, decoder_session->sample_rate); - else - flac__utils_printf(stderr, 1, "%s: ERROR, sample rate is %u in this frame but %u in previous frames\n", decoder_session->inbasefilename, frame->header.sample_rate, decoder_session->sample_rate); - if(!decoder_session->continue_through_decode_errors) - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - } - } - else { - /* must not have gotten STREAMINFO, save the sample rate from the frame header */ - FLAC__ASSERT(!decoder_session->got_stream_info); - decoder_session->sample_rate = frame->header.sample_rate; - } - - /* - * limit the number of samples to accept based on --until - */ - FLAC__ASSERT(!decoder_session->skip_specification->is_relative); - /* if we never got the total_samples from the metadata, the skip and until specs would never have been canonicalized, so protect against that: */ - if(decoder_session->skip_specification->is_relative) { - if(decoder_session->skip_specification->value.samples == 0) /* special case for when no --skip was given */ - decoder_session->skip_specification->is_relative = false; /* convert to our meaning of beginning-of-stream */ - else { - flac__utils_printf(stderr, 1, "%s: ERROR, cannot use --skip because the total sample count was not found in the metadata\n", decoder_session->inbasefilename); - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - } - } - if(decoder_session->until_specification->is_relative) { - if(decoder_session->until_specification->value.samples == 0) /* special case for when no --until was given */ - decoder_session->until_specification->is_relative = false; /* convert to our meaning of end-of-stream */ - else { - flac__utils_printf(stderr, 1, "%s: ERROR, cannot use --until because the total sample count was not found in the metadata\n", decoder_session->inbasefilename); - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - } - } - FLAC__ASSERT(decoder_session->skip_specification->value.samples >= 0); - FLAC__ASSERT(decoder_session->until_specification->value.samples >= 0); - if(decoder_session->until_specification->value.samples > 0) { - const FLAC__uint64 skip = (FLAC__uint64)decoder_session->skip_specification->value.samples; - const FLAC__uint64 until = (FLAC__uint64)decoder_session->until_specification->value.samples; - const FLAC__uint64 input_samples_passed = skip + decoder_session->samples_processed; - FLAC__ASSERT(until >= input_samples_passed); - if(input_samples_passed + wide_samples > until) - wide_samples = (unsigned)(until - input_samples_passed); - if (wide_samples == 0) { - decoder_session->abort_flag = true; - decoder_session->aborting_due_to_until = true; - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - } - } - - if(decoder_session->analysis_mode) { - FLAC__uint64 dpos; - FLAC__stream_decoder_get_decode_position(decoder_session->decoder, &dpos); - frame_bytes = (unsigned)(dpos-decoder_session->decode_position); - decoder_session->decode_position = dpos; - } - - if(wide_samples > 0) { - decoder_session->samples_processed += wide_samples; - decoder_session->frame_counter++; - - if(!(decoder_session->frame_counter & 0x3f)) - print_stats(decoder_session); - - if(decoder_session->analysis_mode) { - flac__analyze_frame(frame, decoder_session->frame_counter-1, decoder_session->decode_position-frame_bytes, frame_bytes, decoder_session->aopts, fout); - } - else if(!decoder_session->test_only) { - if(shift && !decoder_session->replaygain.apply) { - for(wide_sample = 0; wide_sample < wide_samples; wide_sample++) - for(channel = 0; channel < channels; channel++) - ((FLAC__int32**)buffer)[channel][wide_sample] <<= shift;/*@@@@@@un-const'ing the buffer is hacky but safe*/ - } - if(decoder_session->replaygain.apply) { - bytes_to_write = FLAC__replaygain_synthesis__apply_gain( - u8buffer, - !is_big_endian, - is_unsigned_samples, - buffer, - wide_samples, - channels, - bps, /* source_bps */ - bps+shift, /* target_bps */ - decoder_session->replaygain.scale, - decoder_session->replaygain.spec.limiter == RGSS_LIMIT__HARD, /* hard_limit */ - decoder_session->replaygain.spec.noise_shaping != NOISE_SHAPING_NONE, /* do_dithering */ - &decoder_session->replaygain.dither_context - ); - } - /* first some special code for common cases */ - else if(is_big_endian == is_big_endian_host_ && !is_unsigned_samples && channels == 2 && bps+shift == 16) { - FLAC__int16 *buf1_ = s16buffer + 1; - if(is_big_endian) - memcpy(s16buffer, ((FLAC__byte*)(buffer[0]))+2, sizeof(FLAC__int32) * wide_samples - 2); - else - memcpy(s16buffer, buffer[0], sizeof(FLAC__int32) * wide_samples); - for(sample = 0; sample < wide_samples; sample++, buf1_+=2) - *buf1_ = (FLAC__int16)buffer[1][sample]; - bytes_to_write = 4 * sample; - } - else if(is_big_endian == is_big_endian_host_ && !is_unsigned_samples && channels == 1 && bps+shift == 16) { - FLAC__int16 *buf1_ = s16buffer; - for(sample = 0; sample < wide_samples; sample++) - *buf1_++ = (FLAC__int16)buffer[0][sample]; - bytes_to_write = 2 * sample; - } - /* generic code for the rest */ - else if(bps+shift == 16) { - if(is_unsigned_samples) { - if(channels == 2) { - for(sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++) { - u16buffer[sample++] = (FLAC__uint16)(buffer[0][wide_sample] + 0x8000); - u16buffer[sample++] = (FLAC__uint16)(buffer[1][wide_sample] + 0x8000); - } - } - else if(channels == 1) { - for(sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++) - u16buffer[sample++] = (FLAC__uint16)(buffer[0][wide_sample] + 0x8000); - } - else { /* works for any 'channels' but above flavors are faster for 1 and 2 */ - for(sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++) - for(channel = 0; channel < channels; channel++, sample++) - u16buffer[sample] = (FLAC__uint16)(buffer[channel][wide_sample] + 0x8000); - } - } - else { - if(channels == 2) { - for(sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++) { - s16buffer[sample++] = (FLAC__int16)(buffer[0][wide_sample]); - s16buffer[sample++] = (FLAC__int16)(buffer[1][wide_sample]); - } - } - else if(channels == 1) { - for(sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++) - s16buffer[sample++] = (FLAC__int16)(buffer[0][wide_sample]); - } - else { /* works for any 'channels' but above flavors are faster for 1 and 2 */ - for(sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++) - for(channel = 0; channel < channels; channel++, sample++) - s16buffer[sample] = (FLAC__int16)(buffer[channel][wide_sample]); - } - } - if(is_big_endian != is_big_endian_host_) { - unsigned char tmp; - const unsigned bytes = sample * 2; - for(byte = 0; byte < bytes; byte += 2) { - tmp = u8buffer[byte]; - u8buffer[byte] = u8buffer[byte+1]; - u8buffer[byte+1] = tmp; - } - } - bytes_to_write = 2 * sample; - } - else if(bps+shift == 24) { - if(is_unsigned_samples) { - for(sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++) - for(channel = 0; channel < channels; channel++, sample++) - u32buffer[sample] = buffer[channel][wide_sample] + 0x800000; - } - else { - for(sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++) - for(channel = 0; channel < channels; channel++, sample++) - s32buffer[sample] = buffer[channel][wide_sample]; - } - if(is_big_endian != is_big_endian_host_) { - unsigned char tmp; - const unsigned bytes = sample * 4; - for(byte = 0; byte < bytes; byte += 4) { - tmp = u8buffer[byte]; - u8buffer[byte] = u8buffer[byte+3]; - u8buffer[byte+3] = tmp; - tmp = u8buffer[byte+1]; - u8buffer[byte+1] = u8buffer[byte+2]; - u8buffer[byte+2] = tmp; - } - } - if(is_big_endian) { - unsigned lbyte; - const unsigned bytes = sample * 4; - for(lbyte = byte = 0; byte < bytes; ) { - byte++; - u8buffer[lbyte++] = u8buffer[byte++]; - u8buffer[lbyte++] = u8buffer[byte++]; - u8buffer[lbyte++] = u8buffer[byte++]; - } - } - else { - unsigned lbyte; - const unsigned bytes = sample * 4; - for(lbyte = byte = 0; byte < bytes; ) { - u8buffer[lbyte++] = u8buffer[byte++]; - u8buffer[lbyte++] = u8buffer[byte++]; - u8buffer[lbyte++] = u8buffer[byte++]; - byte++; - } - } - bytes_to_write = 3 * sample; - } - else if(bps+shift == 8) { - if(is_unsigned_samples) { - for(sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++) - for(channel = 0; channel < channels; channel++, sample++) - u8buffer[sample] = (FLAC__uint8)(buffer[channel][wide_sample] + 0x80); - } - else { - for(sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++) - for(channel = 0; channel < channels; channel++, sample++) - s8buffer[sample] = (FLAC__int8)(buffer[channel][wide_sample]); - } - bytes_to_write = sample; - } - else { - FLAC__ASSERT(0); - /* double protection */ - decoder_session->abort_flag = true; - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - } - } - } - if(bytes_to_write > 0) { - if(flac__utils_fwrite(u8buffer, 1, bytes_to_write, fout) != bytes_to_write) { - /* if a pipe closed when writing to stdout, we let it go without an error message */ - if(errno == EPIPE && decoder_session->fout == stdout) - decoder_session->aborting_due_to_until = true; - decoder_session->abort_flag = true; - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - } - } - return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; -} - -void metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) -{ - DecoderSession *decoder_session = (DecoderSession*)client_data; - - if(decoder_session->analysis_mode) - FLAC__stream_decoder_get_decode_position(decoder, &decoder_session->decode_position); - - if(metadata->type == FLAC__METADATA_TYPE_STREAMINFO) { - FLAC__uint64 skip, until; - decoder_session->got_stream_info = true; - decoder_session->has_md5sum = memcmp(metadata->data.stream_info.md5sum, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16); - decoder_session->bps = metadata->data.stream_info.bits_per_sample; - decoder_session->channels = metadata->data.stream_info.channels; - decoder_session->sample_rate = metadata->data.stream_info.sample_rate; - - flac__utils_canonicalize_skip_until_specification(decoder_session->skip_specification, decoder_session->sample_rate); - FLAC__ASSERT(decoder_session->skip_specification->value.samples >= 0); - skip = (FLAC__uint64)decoder_session->skip_specification->value.samples; - - /* remember, metadata->data.stream_info.total_samples can be 0, meaning 'unknown' */ - if(metadata->data.stream_info.total_samples > 0 && skip >= metadata->data.stream_info.total_samples) { - flac__utils_printf(stderr, 1, "%s: ERROR trying to --skip more samples than in stream\n", decoder_session->inbasefilename); - decoder_session->abort_flag = true; - return; - } - else if(metadata->data.stream_info.total_samples == 0 && skip > 0) { - flac__utils_printf(stderr, 1, "%s: ERROR, can't --skip when FLAC metadata has total sample count of 0\n", decoder_session->inbasefilename); - decoder_session->abort_flag = true; - return; - } - FLAC__ASSERT(skip == 0 || 0 == decoder_session->cue_specification); - decoder_session->total_samples = metadata->data.stream_info.total_samples - skip; - - /* note that we use metadata->data.stream_info.total_samples instead of decoder_session->total_samples */ - if(!canonicalize_until_specification(decoder_session->until_specification, decoder_session->inbasefilename, decoder_session->sample_rate, skip, metadata->data.stream_info.total_samples)) { - decoder_session->abort_flag = true; - return; - } - FLAC__ASSERT(decoder_session->until_specification->value.samples >= 0); - until = (FLAC__uint64)decoder_session->until_specification->value.samples; - - if(until > 0) { - FLAC__ASSERT(decoder_session->total_samples != 0); - FLAC__ASSERT(0 == decoder_session->cue_specification); - decoder_session->total_samples -= (metadata->data.stream_info.total_samples - until); - } - - if(decoder_session->bps < 4 || decoder_session->bps > 24) { - flac__utils_printf(stderr, 1, "%s: ERROR: bits per sample is %u, must be 4-24\n", decoder_session->inbasefilename, decoder_session->bps); - decoder_session->abort_flag = true; - return; - } - } - else if(metadata->type == FLAC__METADATA_TYPE_CUESHEET) { - /* remember, at this point, decoder_session->total_samples can be 0, meaning 'unknown' */ - if(decoder_session->total_samples == 0) { - flac__utils_printf(stderr, 1, "%s: ERROR can't use --cue when FLAC metadata has total sample count of 0\n", decoder_session->inbasefilename); - decoder_session->abort_flag = true; - return; - } - - flac__utils_canonicalize_cue_specification(decoder_session->cue_specification, &metadata->data.cue_sheet, decoder_session->total_samples, decoder_session->skip_specification, decoder_session->until_specification); - - FLAC__ASSERT(!decoder_session->skip_specification->is_relative); - FLAC__ASSERT(decoder_session->skip_specification->value_is_samples); - - FLAC__ASSERT(!decoder_session->until_specification->is_relative); - FLAC__ASSERT(decoder_session->until_specification->value_is_samples); - - FLAC__ASSERT(decoder_session->skip_specification->value.samples >= 0); - FLAC__ASSERT(decoder_session->until_specification->value.samples >= 0); - FLAC__ASSERT((FLAC__uint64)decoder_session->until_specification->value.samples <= decoder_session->total_samples); - FLAC__ASSERT(decoder_session->skip_specification->value.samples <= decoder_session->until_specification->value.samples); - - decoder_session->total_samples = decoder_session->until_specification->value.samples - decoder_session->skip_specification->value.samples; - } - else if(metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) { - if (decoder_session->replaygain.spec.apply) { - double reference, gain, peak; - if (!(decoder_session->replaygain.apply = grabbag__replaygain_load_from_vorbiscomment(metadata, decoder_session->replaygain.spec.use_album_gain, /*strict=*/false, &reference, &gain, &peak))) { - flac__utils_printf(stderr, 1, "%s: WARNING: can't get %s (or even %s) ReplayGain tags\n", decoder_session->inbasefilename, decoder_session->replaygain.spec.use_album_gain? "album":"track", decoder_session->replaygain.spec.use_album_gain? "track":"album"); - if(decoder_session->treat_warnings_as_errors) { - decoder_session->abort_flag = true; - return; - } - } - else { - const char *ls[] = { "no", "peak", "hard" }; - const char *ns[] = { "no", "low", "medium", "high" }; - decoder_session->replaygain.scale = grabbag__replaygain_compute_scale_factor(peak, gain, decoder_session->replaygain.spec.preamp, decoder_session->replaygain.spec.limiter == RGSS_LIMIT__PEAK); - FLAC__ASSERT(decoder_session->bps > 0 && decoder_session->bps <= 32); - FLAC__replaygain_synthesis__init_dither_context(&decoder_session->replaygain.dither_context, decoder_session->bps, decoder_session->replaygain.spec.noise_shaping); - flac__utils_printf(stderr, 1, "%s: INFO: applying %s ReplayGain (gain=%0.2fdB+preamp=%0.1fdB, %s noise shaping, %s limiting) to output\n", decoder_session->inbasefilename, decoder_session->replaygain.spec.use_album_gain? "album":"track", gain, decoder_session->replaygain.spec.preamp, ns[decoder_session->replaygain.spec.noise_shaping], ls[decoder_session->replaygain.spec.limiter]); - flac__utils_printf(stderr, 1, "%s: WARNING: applying ReplayGain is not lossless\n", decoder_session->inbasefilename); - /* don't check if(decoder_session->treat_warnings_as_errors) because the user explicitly asked for it */ - } - } - (void)flac__utils_get_channel_mask_tag(metadata, &decoder_session->channel_mask); - } -} - -void error_callback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) -{ - DecoderSession *decoder_session = (DecoderSession*)client_data; - (void)decoder; - flac__utils_printf(stderr, 1, "%s: *** Got error code %d:%s\n", decoder_session->inbasefilename, status, FLAC__StreamDecoderErrorStatusString[status]); - if(!decoder_session->continue_through_decode_errors) { - decoder_session->abort_flag = true; - if(status == FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM) - decoder_session->aborting_due_to_unparseable = true; - } -} - -void print_error_with_init_status(const DecoderSession *d, const char *message, FLAC__StreamDecoderInitStatus init_status) -{ - const int ilen = strlen(d->inbasefilename) + 1; - - flac__utils_printf(stderr, 1, "\n%s: %s\n", d->inbasefilename, message); - - flac__utils_printf(stderr, 1, "%*s init status = %s\n", ilen, "", FLAC__StreamDecoderInitStatusString[init_status]); - - /* print out some more info for some errors: */ - if (init_status == FLAC__STREAM_DECODER_INIT_STATUS_ERROR_OPENING_FILE) { - flac__utils_printf(stderr, 1, - "\n" - "An error occurred opening the input file; it is likely that it does not exist\n" - "or is not readable.\n" - ); - } -} - -void print_error_with_state(const DecoderSession *d, const char *message) -{ - const int ilen = strlen(d->inbasefilename) + 1; - - flac__utils_printf(stderr, 1, "\n%s: %s\n", d->inbasefilename, message); - flac__utils_printf(stderr, 1, "%*s state = %s\n", ilen, "", FLAC__stream_decoder_get_resolved_state_string(d->decoder)); - - /* print out some more info for some errors: */ - if (d->aborting_due_to_unparseable) { - flac__utils_printf(stderr, 1, - "\n" - "The FLAC stream may have been created by a more advanced encoder. Try\n" - " metaflac --show-vendor-tag %s\n" - "If the version number is greater than %s, this decoder is probably\n" - "not able to decode the file. If the version number is not, the file\n" - "may be corrupted, or you may have found a bug. In this case please\n" - "submit a bug report to\n" - " http://sourceforge.net/bugs/?func=addbug&group_id=13478\n" - "Make sure to use the \"Monitor\" feature to monitor the bug status.\n", - d->inbasefilename, FLAC__VERSION_STRING - ); - } -} - -void print_stats(const DecoderSession *decoder_session) -{ - if(flac__utils_verbosity_ >= 2) { -#if defined _MSC_VER || defined __MINGW32__ - /* with MSVC you have to spoon feed it the casting */ - const double progress = (double)(FLAC__int64)decoder_session->samples_processed / (double)(FLAC__int64)decoder_session->total_samples * 100.0; -#else - const double progress = (double)decoder_session->samples_processed / (double)decoder_session->total_samples * 100.0; -#endif - if(decoder_session->total_samples > 0) { - fprintf(stderr, "\r%s: %s%u%% complete", - decoder_session->inbasefilename, - decoder_session->test_only? "testing, " : decoder_session->analysis_mode? "analyzing, " : "", - (unsigned)floor(progress + 0.5) - ); - } - else { - fprintf(stderr, "\r%s: %s %u samples", - decoder_session->inbasefilename, - decoder_session->test_only? "tested" : decoder_session->analysis_mode? "analyzed" : "wrote", - (unsigned)decoder_session->samples_processed - ); - } - } -} diff --git a/3rdparty/libflac/src/flac/decode.h b/3rdparty/libflac/src/flac/decode.h deleted file mode 100644 index 2ab9deb6605..00000000000 --- a/3rdparty/libflac/src/flac/decode.h +++ /dev/null @@ -1,74 +0,0 @@ -/* flac - Command-line FLAC encoder/decoder - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef flac__decode_h -#define flac__decode_h - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "analyze.h" -#include "foreign_metadata.h" -#include "utils.h" -#include "share/replaygain_synthesis.h" - - -typedef struct { - FLAC__bool apply; - FLAC__bool use_album_gain; /* false => use track gain */ - enum { RGSS_LIMIT__NONE, RGSS_LIMIT__PEAK, RGSS_LIMIT__HARD} limiter; - NoiseShaping noise_shaping; - double preamp; -} replaygain_synthesis_spec_t; - -typedef struct { - FLAC__bool treat_warnings_as_errors; - FLAC__bool continue_through_decode_errors; - replaygain_synthesis_spec_t replaygain_synthesis_spec; -#if FLAC__HAS_OGG - FLAC__bool is_ogg; - FLAC__bool use_first_serial_number; - long serial_number; -#endif - utils__SkipUntilSpecification skip_specification; - utils__SkipUntilSpecification until_specification; - FLAC__bool has_cue_specification; - utils__CueSpecification cue_specification; - FLAC__bool channel_map_none; /* --channel-map=none specified, eventually will expand to take actual channel map */ -} decode_options_t; - -/* used for AIFF also */ -typedef struct { - decode_options_t common; - foreign_metadata_t *foreign_metadata; /* NULL unless --keep-foreign-metadata requested */ -} wav_decode_options_t; - -typedef struct { - decode_options_t common; - - FLAC__bool is_big_endian; - FLAC__bool is_unsigned_samples; -} raw_decode_options_t; - -/* outfile == 0 => test only */ -int flac__decode_aiff(const char *infilename, const char *outfilename, FLAC__bool analysis_mode, analysis_options aopts, wav_decode_options_t options); -int flac__decode_wav(const char *infilename, const char *outfilename, FLAC__bool analysis_mode, analysis_options aopts, wav_decode_options_t options); -int flac__decode_raw(const char *infilename, const char *outfilename, FLAC__bool analysis_mode, analysis_options aopts, raw_decode_options_t options); - -#endif diff --git a/3rdparty/libflac/src/flac/encode.c b/3rdparty/libflac/src/flac/encode.c deleted file mode 100644 index 8d2434993e5..00000000000 --- a/3rdparty/libflac/src/flac/encode.c +++ /dev/null @@ -1,2936 +0,0 @@ -/* flac - Command-line FLAC encoder/decoder - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#if defined _WIN32 && !defined __CYGWIN__ -/* where MSVC puts unlink() */ -# include <io.h> -#else -# include <unistd.h> -#endif -#if defined _MSC_VER || defined __MINGW32__ -#include <sys/types.h> /* for off_t */ -#if _MSC_VER <= 1600 /* @@@ [2G limit] */ -#define fseeko fseek -#define ftello ftell -#endif -#endif -#include <errno.h> -#include <limits.h> /* for LONG_MAX */ -#include <math.h> /* for floor() */ -#include <stdio.h> /* for FILE etc. */ -#include <stdlib.h> /* for malloc */ -#include <string.h> /* for strcmp(), strerror() */ -#include "FLAC/all.h" -#include "share/alloc.h" -#include "share/grabbag.h" -#include "encode.h" - -#ifdef min -#undef min -#endif -#define min(x,y) ((x)<(y)?(x):(y)) -#ifdef max -#undef max -#endif -#define max(x,y) ((x)>(y)?(x):(y)) - -/* this MUST be >= 588 so that sector aligning can take place with one read */ -#define CHUNK_OF_SAMPLES 2048 - -typedef struct { -#if FLAC__HAS_OGG - FLAC__bool use_ogg; -#endif - FLAC__bool verify; - FLAC__bool is_stdout; - FLAC__bool outputfile_opened; /* true if we successfully opened the output file and we want it to be deleted if there is an error */ - const char *inbasefilename; - const char *infilename; - const char *outfilename; - - FLAC__uint64 skip; - FLAC__uint64 until; /* a value of 0 mean end-of-stream (i.e. --until=-0) */ - FLAC__bool treat_warnings_as_errors; - FLAC__bool continue_through_decode_errors; - FLAC__bool replay_gain; - unsigned channels; - unsigned bits_per_sample; - unsigned sample_rate; - FLAC__uint64 unencoded_size; - FLAC__uint64 total_samples_to_encode; - FLAC__uint64 bytes_written; - FLAC__uint64 samples_written; - unsigned stats_mask; - - FLAC__StreamEncoder *encoder; - - FILE *fin; - FLAC__StreamMetadata *seek_table_template; -} EncoderSession; - -/* this is data attached to the FLAC decoder when encoding from a FLAC file */ -typedef struct { - EncoderSession *encoder_session; - off_t filesize; - const FLAC__byte *lookahead; - unsigned lookahead_length; - size_t num_metadata_blocks; - FLAC__StreamMetadata *metadata_blocks[1024]; /*@@@ BAD MAGIC number */ - FLAC__uint64 samples_left_to_process; - FLAC__bool fatal_error; -} FLACDecoderData; - -const int FLAC_ENCODE__DEFAULT_PADDING = 8192; - -static FLAC__bool is_big_endian_host_; - -static unsigned char ucbuffer_[CHUNK_OF_SAMPLES*FLAC__MAX_CHANNELS*((FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE+7)/8)]; -static signed char *scbuffer_ = (signed char *)ucbuffer_; -static FLAC__uint16 *usbuffer_ = (FLAC__uint16 *)ucbuffer_; -static FLAC__int16 *ssbuffer_ = (FLAC__int16 *)ucbuffer_; - -static FLAC__int32 in_[FLAC__MAX_CHANNELS][CHUNK_OF_SAMPLES]; -static FLAC__int32 *input_[FLAC__MAX_CHANNELS]; - - -/* - * unpublished debug routines from the FLAC libs - */ -extern FLAC__bool FLAC__stream_encoder_disable_constant_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value); -extern FLAC__bool FLAC__stream_encoder_disable_fixed_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value); -extern FLAC__bool FLAC__stream_encoder_disable_verbatim_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value); -extern FLAC__bool FLAC__stream_encoder_set_do_md5(FLAC__StreamEncoder *encoder, FLAC__bool value); - -/* - * local routines - */ -static FLAC__bool EncoderSession_construct(EncoderSession *e, FLAC__bool use_ogg, FLAC__bool verify, FLAC__bool treat_warnings_as_errors, FLAC__bool continue_through_decode_errors, FILE *infile, const char *infilename, const char *outfilename); -static void EncoderSession_destroy(EncoderSession *e); -static int EncoderSession_finish_ok(EncoderSession *e, int info_align_carry, int info_align_zero, foreign_metadata_t *foreign_metadata); -static int EncoderSession_finish_error(EncoderSession *e); -static FLAC__bool EncoderSession_init_encoder(EncoderSession *e, encode_options_t options, FLAC__uint32 channel_mask, unsigned channels, unsigned bps, unsigned sample_rate, const foreign_metadata_t *foreign_metadata, FLACDecoderData *flac_decoder_data); -static FLAC__bool EncoderSession_process(EncoderSession *e, const FLAC__int32 * const buffer[], unsigned samples); -static FLAC__bool convert_to_seek_table_template(const char *requested_seek_points, int num_requested_seek_points, FLAC__StreamMetadata *cuesheet, EncoderSession *e); -static FLAC__bool canonicalize_until_specification(utils__SkipUntilSpecification *spec, const char *inbasefilename, unsigned sample_rate, FLAC__uint64 skip, FLAC__uint64 total_samples_in_input); -static FLAC__bool verify_metadata(const EncoderSession *e, FLAC__StreamMetadata **metadata, unsigned num_metadata); -static FLAC__bool format_input(FLAC__int32 *dest[], unsigned wide_samples, FLAC__bool is_big_endian, FLAC__bool is_unsigned_samples, unsigned channels, unsigned bps, unsigned shift, size_t *channel_map); -static void encoder_progress_callback(const FLAC__StreamEncoder *encoder, FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate, void *client_data); -static FLAC__StreamDecoderReadStatus flac_decoder_read_callback(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data); -static FLAC__StreamDecoderSeekStatus flac_decoder_seek_callback(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data); -static FLAC__StreamDecoderTellStatus flac_decoder_tell_callback(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data); -static FLAC__StreamDecoderLengthStatus flac_decoder_length_callback(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data); -static FLAC__bool flac_decoder_eof_callback(const FLAC__StreamDecoder *decoder, void *client_data); -static FLAC__StreamDecoderWriteStatus flac_decoder_write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data); -static void flac_decoder_metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data); -static void flac_decoder_error_callback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data); -static FLAC__bool parse_cuesheet(FLAC__StreamMetadata **cuesheet, const char *cuesheet_filename, const char *inbasefilename, FLAC__bool is_cdda, FLAC__uint64 lead_out_offset, FLAC__bool treat_warnings_as_errors); -static void print_stats(const EncoderSession *encoder_session); -static void print_error_with_init_status(const EncoderSession *e, const char *message, FLAC__StreamEncoderInitStatus init_status); -static void print_error_with_state(const EncoderSession *e, const char *message); -static void print_verify_error(EncoderSession *e); -static FLAC__bool read_little_endian_uint16(FILE *f, FLAC__uint16 *val, FLAC__bool eof_ok, const char *fn); -static FLAC__bool read_little_endian_uint32(FILE *f, FLAC__uint32 *val, FLAC__bool eof_ok, const char *fn); -static FLAC__bool read_big_endian_uint16(FILE *f, FLAC__uint16 *val, FLAC__bool eof_ok, const char *fn); -static FLAC__bool read_big_endian_uint32(FILE *f, FLAC__uint32 *val, FLAC__bool eof_ok, const char *fn); -static FLAC__bool read_sane_extended(FILE *f, FLAC__uint32 *val, FLAC__bool eof_ok, const char *fn); -static FLAC__bool fskip_ahead(FILE *f, FLAC__uint64 offset); -static unsigned count_channel_mask_bits(FLAC__uint32 mask); -#if 0 -static FLAC__uint32 limit_channel_mask(FLAC__uint32 mask, unsigned channels); -#endif - -/* - * public routines - */ -int flac__encode_aif(FILE *infile, off_t infilesize, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, unsigned lookahead_length, wav_encode_options_t options, FLAC__bool is_aifc) -{ - EncoderSession encoder_session; - FLAC__uint16 x; - FLAC__uint32 xx; - unsigned int channels= 0U, bps= 0U, shift= 0U, sample_rate= 0U, sample_frames= 0U; - size_t channel_map[FLAC__MAX_CHANNELS]; - FLAC__bool got_comm_chunk= false, got_ssnd_chunk= false; - int info_align_carry= -1, info_align_zero= -1; - FLAC__bool is_big_endian_pcm = true; - - (void)infilesize; /* silence compiler warning about unused parameter */ - (void)lookahead; /* silence compiler warning about unused parameter */ - (void)lookahead_length; /* silence compiler warning about unused parameter */ - - if(! - EncoderSession_construct( - &encoder_session, -#if FLAC__HAS_OGG - options.common.use_ogg, -#else - /*use_ogg=*/false, -#endif - options.common.verify, - options.common.treat_warnings_as_errors, - options.common.continue_through_decode_errors, - infile, - infilename, - outfilename - ) - ) - return 1; - - /* initialize default channel map that preserves channel order */ - { - size_t i; - for(i = 0; i < sizeof(channel_map)/sizeof(channel_map[0]); i++) - channel_map[i] = i; - } - - if(options.foreign_metadata) { - const char *error; - if(!flac__foreign_metadata_read_from_aiff(options.foreign_metadata, infilename, &error)) { - flac__utils_printf(stderr, 1, "%s: ERROR reading foreign metadata: %s\n", encoder_session.inbasefilename, error); - return EncoderSession_finish_error(&encoder_session); - } - } - - /* lookahead[] already has "FORMxxxxAIFF", do sub-chunks */ - - while(1) { - size_t c= 0U; - char chunk_id[5] = { '\0', '\0', '\0', '\0', '\0' }; /* one extra byte for terminating NUL so we can also treat it like a C string */ - - /* chunk identifier; really conservative about behavior of fread() and feof() */ - if(feof(infile) || ((c= fread(chunk_id, 1U, 4U, infile)), c==0U && feof(infile))) - break; - else if(c<4U || feof(infile)) { - flac__utils_printf(stderr, 1, "%s: ERROR: incomplete chunk identifier\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - - if(got_comm_chunk==false && !memcmp(chunk_id, "COMM", 4)) { /* common chunk */ - unsigned long skip; - const FLAC__uint32 minimum_comm_size = (is_aifc? 22 : 18); - - /* COMM chunk size */ - if(!read_big_endian_uint32(infile, &xx, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - else if(xx<minimum_comm_size) { - flac__utils_printf(stderr, 1, "%s: ERROR: non-standard %s 'COMM' chunk has length = %u\n", encoder_session.inbasefilename, is_aifc? "AIFF-C" : "AIFF", (unsigned int)xx); - return EncoderSession_finish_error(&encoder_session); - } - else if(!is_aifc && xx!=minimum_comm_size) { - flac__utils_printf(stderr, 1, "%s: WARNING: non-standard %s 'COMM' chunk has length = %u, expected %u\n", encoder_session.inbasefilename, is_aifc? "AIFF-C" : "AIFF", (unsigned int)xx, minimum_comm_size); - if(encoder_session.treat_warnings_as_errors) - return EncoderSession_finish_error(&encoder_session); - } - skip= (xx-minimum_comm_size)+(xx & 1U); - - /* number of channels */ - if(!read_big_endian_uint16(infile, &x, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - else if(x==0U || x>FLAC__MAX_CHANNELS) { - flac__utils_printf(stderr, 1, "%s: ERROR: unsupported number channels %u\n", encoder_session.inbasefilename, (unsigned int)x); - return EncoderSession_finish_error(&encoder_session); - } - else if(x>2U && !options.common.channel_map_none) { - flac__utils_printf(stderr, 1, "%s: ERROR: unsupported number channels %u for AIFF\n", encoder_session.inbasefilename, (unsigned int)x); - return EncoderSession_finish_error(&encoder_session); - } - else if(options.common.sector_align && x!=2U) { - flac__utils_printf(stderr, 1, "%s: ERROR: file has %u channels, must be 2 for --sector-align\n", encoder_session.inbasefilename, (unsigned int)x); - return EncoderSession_finish_error(&encoder_session); - } - channels= x; - - /* number of sample frames */ - if(!read_big_endian_uint32(infile, &xx, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - sample_frames= xx; - - /* bits per sample */ - if(!read_big_endian_uint16(infile, &x, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - else if(x<4U || x>24U) { - flac__utils_printf(stderr, 1, "%s: ERROR: unsupported bits-per-sample %u\n", encoder_session.inbasefilename, (unsigned int)x); - return EncoderSession_finish_error(&encoder_session); - } - else if(options.common.sector_align && x!=16U) { - flac__utils_printf(stderr, 1, "%s: ERROR: file has %u bits-per-sample, must be 16 for --sector-align\n", encoder_session.inbasefilename, (unsigned int)x); - return EncoderSession_finish_error(&encoder_session); - } - bps= x; - shift= (bps%8)? 8-(bps%8) : 0; /* SSND data is always byte-aligned, left-justified but format_input() will double-check */ - bps+= shift; - - /* sample rate */ - if(!read_sane_extended(infile, &xx, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - else if(!FLAC__format_sample_rate_is_valid(xx)) { - flac__utils_printf(stderr, 1, "%s: ERROR: unsupported sample rate %u\n", encoder_session.inbasefilename, (unsigned int)xx); - return EncoderSession_finish_error(&encoder_session); - } - else if(options.common.sector_align && xx!=44100U) { - flac__utils_printf(stderr, 1, "%s: ERROR: file's sample rate is %u, must be 44100 for --sector-align\n", encoder_session.inbasefilename, (unsigned int)xx); - return EncoderSession_finish_error(&encoder_session); - } - sample_rate= xx; - - /* check compression type for AIFF-C */ - if(is_aifc) { - if(!read_big_endian_uint32(infile, &xx, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - if(xx == 0x736F7774) /* "sowt" */ - is_big_endian_pcm = false; - else if(xx == 0x4E4F4E45) /* "NONE" */ - ; /* nothing to do, we already default to big-endian */ - else { - flac__utils_printf(stderr, 1, "%s: ERROR: can't handle AIFF-C compression type \"%c%c%c%c\"\n", encoder_session.inbasefilename, (char)(xx>>24), (char)((xx>>16)&8), (char)((xx>>8)&8), (char)(xx&8)); - return EncoderSession_finish_error(&encoder_session); - } - } - - /* set channel mapping */ - /* FLAC order follows SMPTE and WAVEFORMATEXTENSIBLE but with fewer channels, which are: */ - /* front left, front right, center, LFE, back left, back right, surround left, surround right */ - /* specs say the channel ordering is: - * 1 2 3 4 5 6 - * ___________________________________________________ - * 2 stereo l r - * 3 l r c - * 4 l c r S - * quad (ambiguous with 4ch) Fl Fr Bl Br - * 5 Fl Fr Fc Sl Sr - * 6 l lc c r rc S - * l:left r:right c:center Fl:front-left Fr:front-right Bl:back-left Br:back-right Lc:left-center Rc:right-center S:surround - * so we only have unambiguous mappings for 2, 3, and 5 channels - */ - if( - options.common.channel_map_none || - channels == 1 || /* 1 channel: (mono) */ - channels == 2 || /* 2 channels: left, right */ - channels == 3 || /* 3 channels: left, right, center */ - channels == 5 /* 5 channels: front left, front right, center, surround left, surround right */ - ) { - /* keep default channel order */ - } - else { - flac__utils_printf(stderr, 1, "%s: ERROR: unsupported number channels %u for AIFF\n", encoder_session.inbasefilename, channels); - return EncoderSession_finish_error(&encoder_session); - } - - /* skip any extra data in the COMM chunk */ - if(!fskip_ahead(infile, skip)) { - flac__utils_printf(stderr, 1, "%s: ERROR during read while skipping over extra COMM data\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - - /* - * now that we know the sample rate, canonicalize the - * --skip string to a number of samples: - */ - flac__utils_canonicalize_skip_until_specification(&options.common.skip_specification, sample_rate); - FLAC__ASSERT(options.common.skip_specification.value.samples >= 0); - encoder_session.skip = (FLAC__uint64)options.common.skip_specification.value.samples; - FLAC__ASSERT(!options.common.sector_align || encoder_session.skip == 0); - - got_comm_chunk= true; - } - else if(got_ssnd_chunk==false && !memcmp(chunk_id, "SSND", 4)) { /* sound data chunk */ - unsigned int offset= 0U, block_size= 0U, align_remainder= 0U, data_bytes; - const size_t bytes_per_frame= channels*(bps>>3); - FLAC__uint64 total_samples_in_input, trim = 0; - FLAC__bool pad= false; - - if(got_comm_chunk==false) { - flac__utils_printf(stderr, 1, "%s: ERROR: got 'SSND' chunk before 'COMM' chunk\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - - /* SSND chunk size */ - if(!read_big_endian_uint32(infile, &xx, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - if(options.common.ignore_chunk_sizes) { - FLAC__ASSERT(!options.common.sector_align); - data_bytes = (unsigned)(-(int)bytes_per_frame); /* max out data_bytes; we'll use EOF as signal to stop reading */ - } - else { - data_bytes= xx; - data_bytes-= 8U; /* discount the offset and block size fields */ - } - pad= (data_bytes & 1U) ? true : false; - - /* offset */ - if(!read_big_endian_uint32(infile, &xx, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - offset= xx; - data_bytes-= offset; - - /* block size */ - if(!read_big_endian_uint32(infile, &xx, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - else if(xx!=0U) { - flac__utils_printf(stderr, 1, "%s: ERROR: block size is %u; must be 0\n", encoder_session.inbasefilename, (unsigned int)xx); - return EncoderSession_finish_error(&encoder_session); - } - block_size= xx; - - /* skip any SSND offset bytes */ - FLAC__ASSERT(offset<=LONG_MAX); - if(!fskip_ahead(infile, offset)) { - flac__utils_printf(stderr, 1, "%s: ERROR: skipping offset in SSND chunk\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - if(data_bytes!=(sample_frames*bytes_per_frame)) { - flac__utils_printf(stderr, 1, "%s: ERROR: SSND chunk size inconsistent with sample frame count\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - - /* *options.common.align_reservoir_samples will be 0 unless --sector-align is used */ - FLAC__ASSERT(options.common.sector_align || *options.common.align_reservoir_samples == 0); - total_samples_in_input = data_bytes / bytes_per_frame + *options.common.align_reservoir_samples; - - /* - * now that we know the input size, canonicalize the - * --until string to an absolute sample number: - */ - if(!canonicalize_until_specification(&options.common.until_specification, encoder_session.inbasefilename, sample_rate, encoder_session.skip, total_samples_in_input)) - return EncoderSession_finish_error(&encoder_session); - encoder_session.until = (FLAC__uint64)options.common.until_specification.value.samples; - FLAC__ASSERT(!options.common.sector_align || encoder_session.until == 0); - - if(encoder_session.skip>0U) { - if(!fskip_ahead(infile, encoder_session.skip*bytes_per_frame)) { - flac__utils_printf(stderr, 1, "%s: ERROR during read while skipping samples\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - } - - data_bytes-= (unsigned int)encoder_session.skip*bytes_per_frame; /*@@@ WATCHOUT: 4GB limit */ - if(options.common.ignore_chunk_sizes) { - encoder_session.total_samples_to_encode= 0; - flac__utils_printf(stderr, 2, "(No runtime statistics possible; please wait for encoding to finish...)\n"); - FLAC__ASSERT(0 == encoder_session.until); - } - else { - encoder_session.total_samples_to_encode= total_samples_in_input - encoder_session.skip; - } - if(encoder_session.until > 0) { - trim = total_samples_in_input - encoder_session.until; - FLAC__ASSERT(total_samples_in_input > 0); - FLAC__ASSERT(!options.common.sector_align); - data_bytes-= (unsigned int)trim*bytes_per_frame; - encoder_session.total_samples_to_encode-= trim; - } - if(options.common.sector_align) { - align_remainder= (unsigned int)(encoder_session.total_samples_to_encode % 588U); - if(options.common.is_last_file) - encoder_session.total_samples_to_encode+= (588U-align_remainder); /* will pad with zeroes */ - else - encoder_session.total_samples_to_encode-= align_remainder; /* will stop short and carry over to next file */ - } - - /* +54 for the size of the AIFF headers; this is just an estimate for the progress indicator and doesn't need to be exact */ - encoder_session.unencoded_size= encoder_session.total_samples_to_encode*bytes_per_frame+54; - - if(!EncoderSession_init_encoder(&encoder_session, options.common, /*channel_mask=*/0, channels, bps-shift, sample_rate, options.foreign_metadata, /*flac_decoder_data=*/0)) - return EncoderSession_finish_error(&encoder_session); - - /* first do any samples in the reservoir */ - if(options.common.sector_align && *options.common.align_reservoir_samples>0U) { - - if(!EncoderSession_process(&encoder_session, (const FLAC__int32 *const *)options.common.align_reservoir, *options.common.align_reservoir_samples)) { - print_error_with_state(&encoder_session, "ERROR during encoding"); - return EncoderSession_finish_error(&encoder_session); - } - } - - /* decrement the data_bytes counter if we need to align the file */ - if(options.common.sector_align) { - if(options.common.is_last_file) - *options.common.align_reservoir_samples= 0U; - else { - *options.common.align_reservoir_samples= align_remainder; - data_bytes-= (*options.common.align_reservoir_samples)*bytes_per_frame; - } - } - - /* now do from the file */ - while(data_bytes>0) { - size_t bytes_read= fread(ucbuffer_, 1U, min(data_bytes, CHUNK_OF_SAMPLES*bytes_per_frame), infile); - - if(bytes_read==0U) { - if(ferror(infile)) { - flac__utils_printf(stderr, 1, "%s: ERROR during read\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - else if(feof(infile)) { - if(options.common.ignore_chunk_sizes) { - flac__utils_printf(stderr, 1, "%s: INFO: hit EOF with --ignore-chunk-sizes, got %u samples\n", encoder_session.inbasefilename, (unsigned)encoder_session.samples_written); - } - else { - flac__utils_printf(stderr, 1, "%s: WARNING: unexpected EOF; expected %u samples, got %u samples\n", encoder_session.inbasefilename, (unsigned)encoder_session.total_samples_to_encode, (unsigned)encoder_session.samples_written); - if(encoder_session.treat_warnings_as_errors) - return EncoderSession_finish_error(&encoder_session); - } - data_bytes= 0; - } - } - else { - if(bytes_read % bytes_per_frame != 0U) { - flac__utils_printf(stderr, 1, "%s: ERROR: got partial sample\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - else { - unsigned int frames= bytes_read/bytes_per_frame; - if(!format_input(input_, frames, is_big_endian_pcm, /*is_unsigned_samples=*/false, channels, bps, shift, channel_map)) - return EncoderSession_finish_error(&encoder_session); - - if(!EncoderSession_process(&encoder_session, (const FLAC__int32 *const *)input_, frames)) { - print_error_with_state(&encoder_session, "ERROR during encoding"); - return EncoderSession_finish_error(&encoder_session); - } - else - data_bytes-= bytes_read; - } - } - } - - if(trim>0) { - FLAC__ASSERT(!options.common.sector_align); - if(!fskip_ahead(infile, trim*bytes_per_frame)) { - flac__utils_printf(stderr, 1, "%s: ERROR during read while skipping samples\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - } - - /* now read unaligned samples into reservoir or pad with zeroes if necessary */ - if(options.common.sector_align) { - if(options.common.is_last_file) { - unsigned int pad_frames= 588U-align_remainder; - - if(pad_frames<588U) { - unsigned int i; - - info_align_zero= pad_frames; - for(i= 0U; i<channels; ++i) - memset(input_[i], 0, sizeof(input_[0][0])*pad_frames); - - if(!EncoderSession_process(&encoder_session, (const FLAC__int32 *const *)input_, pad_frames)) { - print_error_with_state(&encoder_session, "ERROR during encoding"); - return EncoderSession_finish_error(&encoder_session); - } - } - } - else { - if(*options.common.align_reservoir_samples > 0) { - size_t bytes_read= fread(ucbuffer_, 1U, (*options.common.align_reservoir_samples)*bytes_per_frame, infile); - - FLAC__ASSERT(CHUNK_OF_SAMPLES>=588U); - if(bytes_read==0U && ferror(infile)) { - flac__utils_printf(stderr, 1, "%s: ERROR during read\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - else if(bytes_read != (*options.common.align_reservoir_samples) * bytes_per_frame) { - flac__utils_printf(stderr, 1, "%s: WARNING: unexpected EOF; read %u bytes; expected %u samples, got %u samples\n", encoder_session.inbasefilename, (unsigned int)bytes_read, (unsigned int)encoder_session.total_samples_to_encode, (unsigned int)encoder_session.samples_written); - if(encoder_session.treat_warnings_as_errors) - return EncoderSession_finish_error(&encoder_session); - } - else { - info_align_carry= *options.common.align_reservoir_samples; - if(!format_input(options.common.align_reservoir, *options.common.align_reservoir_samples, is_big_endian_pcm, /*is_unsigned_samples=*/false, channels, bps, shift, channel_map)) - return EncoderSession_finish_error(&encoder_session); - } - } - } - } - - if(pad==true) { - unsigned char tmp; - - if(fread(&tmp, 1U, 1U, infile)<1U) { - flac__utils_printf(stderr, 1, "%s: ERROR during read of SSND pad byte\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - } - - got_ssnd_chunk= true; - } - else { /* other chunk */ - if(!options.foreign_metadata) { - if(!memcmp(chunk_id, "COMM", 4)) - flac__utils_printf(stderr, 1, "%s: WARNING: skipping extra 'COMM' chunk (use --keep-foreign-metadata to keep)\n", encoder_session.inbasefilename); - else if(!memcmp(chunk_id, "SSND", 4)) - flac__utils_printf(stderr, 1, "%s: WARNING: skipping extra 'SSND' chunk (use --keep-foreign-metadata to keep)\n", encoder_session.inbasefilename); - else if(!options.foreign_metadata) - flac__utils_printf(stderr, 1, "%s: WARNING: skipping unknown chunk '%s' (use --keep-foreign-metadata to keep)\n", encoder_session.inbasefilename, chunk_id); - if(encoder_session.treat_warnings_as_errors) - return EncoderSession_finish_error(&encoder_session); - } - - /* chunk size */ - if(!read_big_endian_uint32(infile, &xx, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - else { - unsigned long skip= xx+(xx & 1U); - - FLAC__ASSERT(skip<=LONG_MAX); - if(!fskip_ahead(infile, skip)) { - fprintf(stderr, "%s: ERROR during read while skipping over unknown chunk\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - } - } - } - - if(got_ssnd_chunk==false && sample_frames!=0U) { - flac__utils_printf(stderr, 1, "%s: ERROR: missing SSND chunk\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - - return EncoderSession_finish_ok(&encoder_session, info_align_carry, info_align_zero, options.foreign_metadata); -} - -int flac__encode_wav(FILE *infile, off_t infilesize, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, unsigned lookahead_length, wav_encode_options_t options) -{ - EncoderSession encoder_session; - FLAC__bool is_unsigned_samples = false; - unsigned channels = 0, bps = 0, sample_rate = 0, shift = 0; - size_t bytes_read; - size_t channel_map[FLAC__MAX_CHANNELS]; - FLAC__uint16 x, format; /* format is the wFormatTag word from the 'fmt ' chunk */ - FLAC__uint32 xx, channel_mask = 0; - FLAC__bool got_fmt_chunk = false, got_data_chunk = false; - unsigned align_remainder = 0; - int info_align_carry = -1, info_align_zero = -1; - - (void)infilesize; - (void)lookahead; - (void)lookahead_length; - - if(! - EncoderSession_construct( - &encoder_session, -#if FLAC__HAS_OGG - options.common.use_ogg, -#else - /*use_ogg=*/false, -#endif - options.common.verify, - options.common.treat_warnings_as_errors, - options.common.continue_through_decode_errors, - infile, - infilename, - outfilename - ) - ) - return 1; - - /* initialize default channel map that preserves channel order */ - { - size_t i; - for(i = 0; i < sizeof(channel_map)/sizeof(channel_map[0]); i++) - channel_map[i] = i; - } - - if(options.foreign_metadata) { - const char *error; - if(!flac__foreign_metadata_read_from_wave(options.foreign_metadata, infilename, &error)) { - flac__utils_printf(stderr, 1, "%s: ERROR reading foreign metadata: %s\n", encoder_session.inbasefilename, error); - return EncoderSession_finish_error(&encoder_session); - } - } - - /* - * lookahead[] already has "RIFFxxxxWAVE", do sub-chunks - */ - while(!feof(infile)) { - if(!read_little_endian_uint32(infile, &xx, true, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - if(feof(infile)) - break; - if(xx == 0x20746d66 && !got_fmt_chunk) { /* "fmt " */ - unsigned block_align, data_bytes; - - /* see - * http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html - * http://windowssdk.msdn.microsoft.com/en-us/library/ms713497.aspx - * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/audio_r/hh/Audio_r/aud-prop_d40f094e-44f9-4baa-8a15-03e4fb369501.xml.asp - * - * WAVEFORMAT is - * 4 byte: subchunk size - * 2 byte: format type: 1 for WAVE_FORMAT_PCM, 65534 for WAVE_FORMAT_EXTENSIBLE - * 2 byte: # channels - * 4 byte: sample rate (Hz) - * 4 byte: avg bytes per sec - * 2 byte: block align - * 2 byte: bits per sample (not necessarily all significant) - * WAVEFORMATEX adds - * 2 byte: extension size in bytes (usually 0 for WAVEFORMATEX and 22 for WAVEFORMATEXTENSIBLE with PCM) - * WAVEFORMATEXTENSIBLE adds - * 2 byte: valid bits per sample - * 4 byte: channel mask - * 16 byte: subformat GUID, first 2 bytes have format type, 1 being PCM - * - * Current spec says WAVEFORMATEX with PCM must have bps == 8 or 16, or any multiple of 8 for WAVEFORMATEXTENSIBLE. - * Lots of old broken WAVEs/apps have don't follow it, e.g. 20 bps but a block align of 3/6 for mono/stereo. - * - * Block align for WAVE_FORMAT_PCM or WAVE_FORMAT_EXTENSIBLE is also supposed to be channels*bps/8 - * - * If the channel mask has more set bits than # of channels, the extra MSBs are ignored. - * If the channel mask has less set bits than # of channels, the extra channels are unassigned to any speaker. - * - * Data is supposed to be unsigned for bps <= 8 else signed. - */ - - /* fmt sub-chunk size */ - if(!read_little_endian_uint32(infile, &xx, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - data_bytes = xx; - if(data_bytes < 16) { - flac__utils_printf(stderr, 1, "%s: ERROR: found non-standard 'fmt ' sub-chunk which has length = %u\n", encoder_session.inbasefilename, data_bytes); - return EncoderSession_finish_error(&encoder_session); - } - /* format code */ - if(!read_little_endian_uint16(infile, &format, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - if(format != 1 /*WAVE_FORMAT_PCM*/ && format != 65534 /*WAVE_FORMAT_EXTENSIBLE*/) { - flac__utils_printf(stderr, 1, "%s: ERROR: unsupported format type %u\n", encoder_session.inbasefilename, (unsigned)format); - return EncoderSession_finish_error(&encoder_session); - } - /* number of channels */ - if(!read_little_endian_uint16(infile, &x, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - channels = (unsigned)x; - if(channels == 0 || channels > FLAC__MAX_CHANNELS) { - flac__utils_printf(stderr, 1, "%s: ERROR: unsupported number of channels %u\n", encoder_session.inbasefilename, channels); - return EncoderSession_finish_error(&encoder_session); - } - else if(options.common.sector_align && channels != 2) { - flac__utils_printf(stderr, 1, "%s: ERROR: file has %u channels, must be 2 for --sector-align\n", encoder_session.inbasefilename, channels); - return EncoderSession_finish_error(&encoder_session); - } - /* sample rate */ - if(!read_little_endian_uint32(infile, &xx, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - sample_rate = xx; - if(!FLAC__format_sample_rate_is_valid(sample_rate)) { - flac__utils_printf(stderr, 1, "%s: ERROR: unsupported sample rate %u\n", encoder_session.inbasefilename, sample_rate); - return EncoderSession_finish_error(&encoder_session); - } - else if(options.common.sector_align && sample_rate != 44100) { - flac__utils_printf(stderr, 1, "%s: ERROR: file's sample rate is %u, must be 44100 for --sector-align\n", encoder_session.inbasefilename, sample_rate); - return EncoderSession_finish_error(&encoder_session); - } - /* avg bytes per second (ignored) */ - if(!read_little_endian_uint32(infile, &xx, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - /* block align */ - if(!read_little_endian_uint16(infile, &x, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - block_align = (unsigned)x; - /* bits per sample */ - if(!read_little_endian_uint16(infile, &x, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - bps = (unsigned)x; - is_unsigned_samples = (bps <= 8); - if(format == 1) { - if(bps != 8 && bps != 16) { - if(bps == 24 || bps == 32) { - /* let these slide with a warning since they're unambiguous */ - flac__utils_printf(stderr, 1, "%s: WARNING: legacy WAVE file has format type %u but bits-per-sample=%u\n", encoder_session.inbasefilename, (unsigned)format, bps); - if(encoder_session.treat_warnings_as_errors) - return EncoderSession_finish_error(&encoder_session); - } - else { - /* @@@ we could add an option to specify left- or right-justified blocks so we knew how to set 'shift' */ - flac__utils_printf(stderr, 1, "%s: ERROR: legacy WAVE file has format type %u but bits-per-sample=%u\n", encoder_session.inbasefilename, (unsigned)format, bps); - return EncoderSession_finish_error(&encoder_session); - } - } -#if 0 /* @@@ reinstate once we can get an answer about whether the samples are left- or right-justified */ - if((bps+7)/8 * channels == block_align) { - if(bps % 8) { - /* assume legacy file is byte aligned with some LSBs zero; this is double-checked in format_input() */ - flac__utils_printf(stderr, 1, "%s: WARNING: legacy WAVE file (format type %d) has block alignment=%u, bits-per-sample=%u, channels=%u\n", encoder_session.inbasefilename, (unsigned)format, block_align, bps, channels); - if(encoder_session.treat_warnings_as_errors) - return EncoderSession_finish_error(&encoder_session); - shift = 8 - (bps % 8); - bps += shift; - } - else - shift = 0; - } - else { - flac__utils_printf(stderr, 1, "%s: ERROR: illegal WAVE file (format type %d) has block alignment=%u, bits-per-sample=%u, channels=%u\n", encoder_session.inbasefilename, (unsigned)format, block_align, bps, channels); - return EncoderSession_finish_error(&encoder_session); - } -#else - shift = 0; -#endif - if(channels > 2 && !options.common.channel_map_none) { - flac__utils_printf(stderr, 1, "%s: ERROR: WAVE has >2 channels but is not WAVE_FORMAT_EXTENSIBLE; cannot assign channels\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - FLAC__ASSERT(data_bytes >= 16); - data_bytes -= 16; - } - else { - if(data_bytes < 40) { - flac__utils_printf(stderr, 1, "%s: ERROR: invalid WAVEFORMATEXTENSIBLE chunk with size %u\n", encoder_session.inbasefilename, data_bytes); - return EncoderSession_finish_error(&encoder_session); - } - /* cbSize */ - if(!read_little_endian_uint16(infile, &x, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - if(x < 22) { - flac__utils_printf(stderr, 1, "%s: ERROR: invalid WAVEFORMATEXTENSIBLE chunk with cbSize %u\n", encoder_session.inbasefilename, (unsigned)x); - return EncoderSession_finish_error(&encoder_session); - } - /* valid bps */ - if(!read_little_endian_uint16(infile, &x, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - if((unsigned)x > bps) { - flac__utils_printf(stderr, 1, "%s: ERROR: invalid WAVEFORMATEXTENSIBLE chunk with wValidBitsPerSample (%u) > wBitsPerSample (%u)\n", encoder_session.inbasefilename, (unsigned)x, bps); - return EncoderSession_finish_error(&encoder_session); - } - shift = bps - (unsigned)x; - /* channel mask */ - if(!read_little_endian_uint32(infile, &channel_mask, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - /* for mono/stereo and unassigned channels, we fake the mask */ - if(channel_mask == 0) { - if(channels == 1) - channel_mask = 0x0001; - else if(channels == 2) - channel_mask = 0x0003; - } - /* set channel mapping */ - /* FLAC order follows SMPTE and WAVEFORMATEXTENSIBLE but with fewer channels, which are: */ - /* front left, front right, center, LFE, back left, back right, surround left, surround right */ - /* the default mapping is sufficient for 1-6 channels and 7-8 are currently unspecified anyway */ -#if 0 - /* @@@ example for dolby/vorbis order, for reference later in case it becomes important */ - if( - options.common.channel_map_none || - channel_mask == 0x0001 || /* 1 channel: (mono) */ - channel_mask == 0x0003 || /* 2 channels: front left, front right */ - channel_mask == 0x0033 || /* 4 channels: front left, front right, back left, back right */ - channel_mask == 0x0603 /* 4 channels: front left, front right, side left, side right */ - ) { - /* keep default channel order */ - } - else if( - channel_mask == 0x0007 || /* 3 channels: front left, front right, front center */ - channel_mask == 0x0037 || /* 5 channels: front left, front right, front center, back left, back right */ - channel_mask == 0x0607 /* 5 channels: front left, front right, front center, side left, side right */ - ) { - /* to dolby order: front left, center, front right [, surround left, surround right ] */ - channel_map[1] = 2; - channel_map[2] = 1; - } - else if( - channel_mask == 0x003f || /* 6 channels: front left, front right, front center, LFE, back left, back right */ - channel_mask == 0x060f /* 6 channels: front left, front right, front center, LFE, side left, side right */ - ) { - /* to dolby order: front left, center, front right, surround left, surround right, LFE */ - channel_map[1] = 2; - channel_map[2] = 1; - channel_map[3] = 5; - channel_map[4] = 3; - channel_map[5] = 4; - } -#else - if( - options.common.channel_map_none || - channel_mask == 0x0001 || /* 1 channel: (mono) */ - channel_mask == 0x0003 || /* 2 channels: front left, front right */ - channel_mask == 0x0007 || /* 3 channels: front left, front right, front center */ - channel_mask == 0x0033 || /* 4 channels: front left, front right, back left, back right */ - channel_mask == 0x0603 || /* 4 channels: front left, front right, side left, side right */ - channel_mask == 0x0037 || /* 5 channels: front left, front right, front center, back left, back right */ - channel_mask == 0x0607 || /* 5 channels: front left, front right, front center, side left, side right */ - channel_mask == 0x003f || /* 6 channels: front left, front right, front center, LFE, back left, back right */ - channel_mask == 0x060f /* 6 channels: front left, front right, front center, LFE, side left, side right */ - ) { - /* keep default channel order */ - } -#endif - else { - flac__utils_printf(stderr, 1, "%s: ERROR: WAVEFORMATEXTENSIBLE chunk with unsupported channel mask=0x%04X\n", encoder_session.inbasefilename, (unsigned)channel_mask); - return EncoderSession_finish_error(&encoder_session); - } - if(!options.common.channel_map_none) { - if(count_channel_mask_bits(channel_mask) < channels) { - flac__utils_printf(stderr, 1, "%s: ERROR: WAVEFORMATEXTENSIBLE chunk: channel mask 0x%04X has unassigned channels (#channels=%u)\n", encoder_session.inbasefilename, (unsigned)channel_mask, channels); - return EncoderSession_finish_error(&encoder_session); - } -#if 0 - /* supporting this is too difficult with channel mapping; e.g. what if mask is 0x003f but #channels=4? - * there would be holes in the order that would have to be filled in, or the mask would have to be - * limited and the logic above rerun to see if it still fits into the FLAC mapping. - */ - else if(count_channel_mask_bits(channel_mask) > channels) - channel_mask = limit_channel_mask(channel_mask, channels); -#else - else if(count_channel_mask_bits(channel_mask) > channels) { - flac__utils_printf(stderr, 1, "%s: ERROR: WAVEFORMATEXTENSIBLE chunk: channel mask 0x%04X has extra bits for non-existant channels (#channels=%u)\n", encoder_session.inbasefilename, (unsigned)channel_mask, channels); - return EncoderSession_finish_error(&encoder_session); - } -#endif - } - /* first part of GUID */ - if(!read_little_endian_uint16(infile, &x, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - if(x != 1) { - flac__utils_printf(stderr, 1, "%s: ERROR: unsupported WAVEFORMATEXTENSIBLE chunk with non-PCM format %u\n", encoder_session.inbasefilename, (unsigned)x); - return EncoderSession_finish_error(&encoder_session); - } - data_bytes -= 26; - } - - if(bps-shift < 4 || bps-shift > 24) { - flac__utils_printf(stderr, 1, "%s: ERROR: unsupported bits-per-sample %u\n", encoder_session.inbasefilename, bps-shift); - return EncoderSession_finish_error(&encoder_session); - } - else if(options.common.sector_align && bps-shift != 16) { - flac__utils_printf(stderr, 1, "%s: ERROR: file has %u bits-per-sample, must be 16 for --sector-align\n", encoder_session.inbasefilename, bps-shift); - return EncoderSession_finish_error(&encoder_session); - } - - /* skip any extra data in the fmt sub-chunk */ - if(!fskip_ahead(infile, data_bytes)) { - flac__utils_printf(stderr, 1, "%s: ERROR during read while skipping over extra 'fmt' data\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - - /* - * now that we know the sample rate, canonicalize the - * --skip string to a number of samples: - */ - flac__utils_canonicalize_skip_until_specification(&options.common.skip_specification, sample_rate); - FLAC__ASSERT(options.common.skip_specification.value.samples >= 0); - encoder_session.skip = (FLAC__uint64)options.common.skip_specification.value.samples; - FLAC__ASSERT(!options.common.sector_align || encoder_session.skip == 0); - - got_fmt_chunk = true; - } - else if(xx == 0x61746164 && !got_data_chunk && got_fmt_chunk) { /* "data" */ - FLAC__uint64 total_samples_in_input, trim = 0; - FLAC__bool pad = false; - const size_t bytes_per_wide_sample = channels * (bps >> 3); - unsigned data_bytes; - - /* data size */ - if(!read_little_endian_uint32(infile, &xx, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - if(options.common.ignore_chunk_sizes) { - FLAC__ASSERT(!options.common.sector_align); - data_bytes = (unsigned)(-(int)bytes_per_wide_sample); /* max out data_bytes; we'll use EOF as signal to stop reading */ - } - else { - data_bytes = xx; - if(0 == data_bytes) { - flac__utils_printf(stderr, 1, "%s: ERROR: 'data' subchunk has size of 0\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - } - pad = (data_bytes & 1U) ? true : false; - - /* *options.common.align_reservoir_samples will be 0 unless --sector-align is used */ - FLAC__ASSERT(options.common.sector_align || *options.common.align_reservoir_samples == 0); - total_samples_in_input = data_bytes / bytes_per_wide_sample + *options.common.align_reservoir_samples; - - /* - * now that we know the input size, canonicalize the - * --until string to an absolute sample number: - */ - if(!canonicalize_until_specification(&options.common.until_specification, encoder_session.inbasefilename, sample_rate, encoder_session.skip, total_samples_in_input)) - return EncoderSession_finish_error(&encoder_session); - encoder_session.until = (FLAC__uint64)options.common.until_specification.value.samples; - FLAC__ASSERT(!options.common.sector_align || encoder_session.until == 0); - - if(encoder_session.skip > 0) { - if(!fskip_ahead(infile, encoder_session.skip * bytes_per_wide_sample)) { - flac__utils_printf(stderr, 1, "%s: ERROR during read while skipping samples\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - } - - data_bytes -= (unsigned)encoder_session.skip * bytes_per_wide_sample; /*@@@ WATCHOUT: 4GB limit */ - if(options.common.ignore_chunk_sizes) { - encoder_session.total_samples_to_encode = 0; - flac__utils_printf(stderr, 2, "(No runtime statistics possible; please wait for encoding to finish...)\n"); - FLAC__ASSERT(0 == encoder_session.until); - } - else { - encoder_session.total_samples_to_encode = total_samples_in_input - encoder_session.skip; - } - if(encoder_session.until > 0) { - trim = total_samples_in_input - encoder_session.until; - FLAC__ASSERT(total_samples_in_input > 0); - FLAC__ASSERT(!options.common.sector_align); - data_bytes -= (unsigned int)trim * bytes_per_wide_sample; - encoder_session.total_samples_to_encode -= trim; - } - if(options.common.sector_align) { - align_remainder = (unsigned)(encoder_session.total_samples_to_encode % 588); - if(options.common.is_last_file) - encoder_session.total_samples_to_encode += (588-align_remainder); /* will pad with zeroes */ - else - encoder_session.total_samples_to_encode -= align_remainder; /* will stop short and carry over to next file */ - } - - /* +44 for the size of the WAV headers; this is just an estimate for the progress indicator and doesn't need to be exact */ - encoder_session.unencoded_size = encoder_session.total_samples_to_encode * bytes_per_wide_sample + 44; - - if(!EncoderSession_init_encoder(&encoder_session, options.common, channel_mask, channels, bps-shift, sample_rate, options.foreign_metadata, /*flac_decoder_data=*/0)) - return EncoderSession_finish_error(&encoder_session); - - /* - * first do any samples in the reservoir - */ - if(options.common.sector_align && *options.common.align_reservoir_samples > 0) { - if(!EncoderSession_process(&encoder_session, (const FLAC__int32 * const *)options.common.align_reservoir, *options.common.align_reservoir_samples)) { - print_error_with_state(&encoder_session, "ERROR during encoding"); - return EncoderSession_finish_error(&encoder_session); - } - } - - /* - * decrement the data_bytes counter if we need to align the file - */ - if(options.common.sector_align) { - if(options.common.is_last_file) { - *options.common.align_reservoir_samples = 0; - } - else { - *options.common.align_reservoir_samples = align_remainder; - data_bytes -= (*options.common.align_reservoir_samples) * bytes_per_wide_sample; - } - } - - /* - * now do from the file - */ - while(data_bytes > 0) { - bytes_read = fread(ucbuffer_, sizeof(unsigned char), min(data_bytes, CHUNK_OF_SAMPLES * bytes_per_wide_sample), infile); - if(bytes_read == 0) { - if(ferror(infile)) { - flac__utils_printf(stderr, 1, "%s: ERROR during read\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - else if(feof(infile)) { - if(options.common.ignore_chunk_sizes) { - flac__utils_printf(stderr, 1, "%s: INFO: hit EOF with --ignore-chunk-sizes, got %u samples\n", encoder_session.inbasefilename, (unsigned)encoder_session.samples_written); - } - else { - flac__utils_printf(stderr, 1, "%s: WARNING: unexpected EOF; expected %u samples, got %u samples\n", encoder_session.inbasefilename, (unsigned)encoder_session.total_samples_to_encode, (unsigned)encoder_session.samples_written); - if(encoder_session.treat_warnings_as_errors) - return EncoderSession_finish_error(&encoder_session); - } - data_bytes = 0; - } - } - else { - if(bytes_read % bytes_per_wide_sample != 0) { - flac__utils_printf(stderr, 1, "%s: ERROR: got partial sample\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - else { - unsigned wide_samples = bytes_read / bytes_per_wide_sample; - if(!format_input(input_, wide_samples, /*is_big_endian=*/false, is_unsigned_samples, channels, bps, shift, channel_map)) - return EncoderSession_finish_error(&encoder_session); - - if(!EncoderSession_process(&encoder_session, (const FLAC__int32 * const *)input_, wide_samples)) { - print_error_with_state(&encoder_session, "ERROR during encoding"); - return EncoderSession_finish_error(&encoder_session); - } - data_bytes -= bytes_read; - } - } - } - - if(trim > 0) { - FLAC__ASSERT(!options.common.sector_align); - if(!fskip_ahead(infile, trim * bytes_per_wide_sample)) { - flac__utils_printf(stderr, 1, "%s: ERROR during read while skipping samples\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - } - - /* - * now read unaligned samples into reservoir or pad with zeroes if necessary - */ - if(options.common.sector_align) { - if(options.common.is_last_file) { - unsigned wide_samples = 588 - align_remainder; - if(wide_samples < 588) { - unsigned channel; - - info_align_zero = wide_samples; - for(channel = 0; channel < channels; channel++) - memset(input_[channel], 0, sizeof(input_[0][0]) * wide_samples); - - if(!EncoderSession_process(&encoder_session, (const FLAC__int32 * const *)input_, wide_samples)) { - print_error_with_state(&encoder_session, "ERROR during encoding"); - return EncoderSession_finish_error(&encoder_session); - } - } - } - else { - if(*options.common.align_reservoir_samples > 0) { - FLAC__ASSERT(CHUNK_OF_SAMPLES >= 588); - bytes_read = fread(ucbuffer_, sizeof(unsigned char), (*options.common.align_reservoir_samples) * bytes_per_wide_sample, infile); - if(bytes_read == 0 && ferror(infile)) { - flac__utils_printf(stderr, 1, "%s: ERROR during read\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - else if(bytes_read != (*options.common.align_reservoir_samples) * bytes_per_wide_sample) { - flac__utils_printf(stderr, 1, "%s: WARNING: unexpected EOF; read %u bytes; expected %u samples, got %u samples\n", encoder_session.inbasefilename, (unsigned)bytes_read, (unsigned)encoder_session.total_samples_to_encode, (unsigned)encoder_session.samples_written); - if(encoder_session.treat_warnings_as_errors) - return EncoderSession_finish_error(&encoder_session); - } - else { - info_align_carry = *options.common.align_reservoir_samples; - if(!format_input(options.common.align_reservoir, *options.common.align_reservoir_samples, /*is_big_endian=*/false, is_unsigned_samples, channels, bps, shift, channel_map)) - return EncoderSession_finish_error(&encoder_session); - } - } - } - } - - if(pad == true) { - unsigned char tmp; - - if(fread(&tmp, 1U, 1U, infile) < 1U) { - flac__utils_printf(stderr, 1, "%s: ERROR during read of data pad byte\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - } - - got_data_chunk = true; - } - else { - if(xx == 0x61746164 && !got_fmt_chunk) { /* "data" */ - flac__utils_printf(stderr, 1, "%s: ERROR: got 'data' sub-chunk before 'fmt' sub-chunk\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - - if(!options.foreign_metadata) { - if(xx == 0x20746d66 && got_fmt_chunk) /* "fmt " */ - flac__utils_printf(stderr, 1, "%s: WARNING: skipping extra 'fmt ' sub-chunk (use --keep-foreign-metadata to keep)\n", encoder_session.inbasefilename); - else if(xx == 0x61746164) /* "data" */ - flac__utils_printf(stderr, 1, "%s: WARNING: skipping extra 'data' sub-chunk (use --keep-foreign-metadata to keep)\n", encoder_session.inbasefilename); - else - flac__utils_printf(stderr, 1, "%s: WARNING: skipping unknown sub-chunk '%c%c%c%c' (use --keep-foreign-metadata to keep)\n", encoder_session.inbasefilename, (char)(xx&255), (char)((xx>>8)&255), (char)((xx>>16)&255), (char)(xx>>24)); - if(encoder_session.treat_warnings_as_errors) - return EncoderSession_finish_error(&encoder_session); - } - - /* sub-chunk size */ - if(!read_little_endian_uint32(infile, &xx, false, encoder_session.inbasefilename)) - return EncoderSession_finish_error(&encoder_session); - else { - unsigned long skip = xx+(xx & 1U); - - FLAC__ASSERT(skip<=LONG_MAX); - if(!fskip_ahead(infile, skip)) { - flac__utils_printf(stderr, 1, "%s: ERROR during read while skipping over unsupported sub-chunk\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - } - } - } - - return EncoderSession_finish_ok(&encoder_session, info_align_carry, info_align_zero, options.foreign_metadata); -} - -int flac__encode_raw(FILE *infile, off_t infilesize, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, unsigned lookahead_length, raw_encode_options_t options) -{ - EncoderSession encoder_session; - size_t bytes_read; - const size_t bytes_per_wide_sample = options.channels * (options.bps >> 3); - unsigned align_remainder = 0; - int info_align_carry = -1, info_align_zero = -1; - FLAC__uint64 total_samples_in_input = 0; - - FLAC__ASSERT(!options.common.sector_align || options.channels == 2); - FLAC__ASSERT(!options.common.sector_align || options.bps == 16); - FLAC__ASSERT(!options.common.sector_align || options.sample_rate == 44100); - FLAC__ASSERT(!options.common.sector_align || infilesize >= 0); - FLAC__ASSERT(!options.common.replay_gain || options.channels <= 2); - FLAC__ASSERT(!options.common.replay_gain || grabbag__replaygain_is_valid_sample_frequency(options.sample_rate)); - - if(! - EncoderSession_construct( - &encoder_session, -#if FLAC__HAS_OGG - options.common.use_ogg, -#else - /*use_ogg=*/false, -#endif - options.common.verify, - options.common.treat_warnings_as_errors, - options.common.continue_through_decode_errors, - infile, - infilename, - outfilename - ) - ) - return 1; - - /* - * now that we know the sample rate, canonicalize the - * --skip string to a number of samples: - */ - flac__utils_canonicalize_skip_until_specification(&options.common.skip_specification, options.sample_rate); - FLAC__ASSERT(options.common.skip_specification.value.samples >= 0); - encoder_session.skip = (FLAC__uint64)options.common.skip_specification.value.samples; - FLAC__ASSERT(!options.common.sector_align || encoder_session.skip == 0); - - if(infilesize < 0) - total_samples_in_input = 0; - else { - /* *options.common.align_reservoir_samples will be 0 unless --sector-align is used */ - FLAC__ASSERT(options.common.sector_align || *options.common.align_reservoir_samples == 0); - total_samples_in_input = (FLAC__uint64)infilesize / bytes_per_wide_sample + *options.common.align_reservoir_samples; - } - - /* - * now that we know the input size, canonicalize the - * --until strings to a number of samples: - */ - if(!canonicalize_until_specification(&options.common.until_specification, encoder_session.inbasefilename, options.sample_rate, encoder_session.skip, total_samples_in_input)) - return EncoderSession_finish_error(&encoder_session); - encoder_session.until = (FLAC__uint64)options.common.until_specification.value.samples; - FLAC__ASSERT(!options.common.sector_align || encoder_session.until == 0); - - infilesize -= (off_t)encoder_session.skip * bytes_per_wide_sample; - encoder_session.total_samples_to_encode = total_samples_in_input - encoder_session.skip; - if(encoder_session.until > 0) { - const FLAC__uint64 trim = total_samples_in_input - encoder_session.until; - FLAC__ASSERT(total_samples_in_input > 0); - FLAC__ASSERT(!options.common.sector_align); - infilesize -= (off_t)trim * bytes_per_wide_sample; - encoder_session.total_samples_to_encode -= trim; - } - if(infilesize >= 0 && options.common.sector_align) { - FLAC__ASSERT(encoder_session.skip == 0); - align_remainder = (unsigned)(encoder_session.total_samples_to_encode % 588); - if(options.common.is_last_file) - encoder_session.total_samples_to_encode += (588-align_remainder); /* will pad with zeroes */ - else - encoder_session.total_samples_to_encode -= align_remainder; /* will stop short and carry over to next file */ - } - encoder_session.unencoded_size = encoder_session.total_samples_to_encode * bytes_per_wide_sample; - - if(encoder_session.total_samples_to_encode <= 0) - flac__utils_printf(stderr, 2, "(No runtime statistics possible; please wait for encoding to finish...)\n"); - - if(encoder_session.skip > 0) { - unsigned skip_bytes = bytes_per_wide_sample * (unsigned)encoder_session.skip; - if(skip_bytes > lookahead_length) { - skip_bytes -= lookahead_length; - lookahead_length = 0; - if(!fskip_ahead(infile, skip_bytes)) { - flac__utils_printf(stderr, 1, "%s: ERROR during read while skipping samples\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - } - else { - lookahead += skip_bytes; - lookahead_length -= skip_bytes; - } - } - - if(!EncoderSession_init_encoder(&encoder_session, options.common, /*channel_mask=*/0, options.channels, options.bps, options.sample_rate, /*foreign_metadata=*/0, /*flac_decoder_data=*/0)) - return EncoderSession_finish_error(&encoder_session); - - /* - * first do any samples in the reservoir - */ - if(options.common.sector_align && *options.common.align_reservoir_samples > 0) { - if(!EncoderSession_process(&encoder_session, (const FLAC__int32 * const *)options.common.align_reservoir, *options.common.align_reservoir_samples)) { - print_error_with_state(&encoder_session, "ERROR during encoding"); - return EncoderSession_finish_error(&encoder_session); - } - } - - /* - * decrement infilesize if we need to align the file - */ - if(options.common.sector_align) { - FLAC__ASSERT(infilesize >= 0); - if(options.common.is_last_file) { - *options.common.align_reservoir_samples = 0; - } - else { - *options.common.align_reservoir_samples = align_remainder; - infilesize -= (off_t)((*options.common.align_reservoir_samples) * bytes_per_wide_sample); - FLAC__ASSERT(infilesize >= 0); - } - } - - /* - * now do from the file - */ - if(infilesize < 0) { - while(!feof(infile)) { - if(lookahead_length > 0) { - FLAC__ASSERT(lookahead_length < CHUNK_OF_SAMPLES * bytes_per_wide_sample); - memcpy(ucbuffer_, lookahead, lookahead_length); - bytes_read = fread(ucbuffer_+lookahead_length, sizeof(unsigned char), CHUNK_OF_SAMPLES * bytes_per_wide_sample - lookahead_length, infile) + lookahead_length; - if(ferror(infile)) { - flac__utils_printf(stderr, 1, "%s: ERROR during read\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - lookahead_length = 0; - } - else - bytes_read = fread(ucbuffer_, sizeof(unsigned char), CHUNK_OF_SAMPLES * bytes_per_wide_sample, infile); - - if(bytes_read == 0) { - if(ferror(infile)) { - flac__utils_printf(stderr, 1, "%s: ERROR during read\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - } - else if(bytes_read % bytes_per_wide_sample != 0) { - flac__utils_printf(stderr, 1, "%s: ERROR: got partial sample\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - else { - unsigned wide_samples = bytes_read / bytes_per_wide_sample; - if(!format_input(input_, wide_samples, options.is_big_endian, options.is_unsigned_samples, options.channels, options.bps, /*shift=*/0, /*channel_map=*/0)) - return EncoderSession_finish_error(&encoder_session); - - if(!EncoderSession_process(&encoder_session, (const FLAC__int32 * const *)input_, wide_samples)) { - print_error_with_state(&encoder_session, "ERROR during encoding"); - return EncoderSession_finish_error(&encoder_session); - } - } - } - } - else { - const FLAC__uint64 max_input_bytes = infilesize; - FLAC__uint64 total_input_bytes_read = 0; - while(total_input_bytes_read < max_input_bytes) { - { - size_t wanted = (CHUNK_OF_SAMPLES * bytes_per_wide_sample); - wanted = (size_t) min((FLAC__uint64)wanted, max_input_bytes - total_input_bytes_read); - - if(lookahead_length > 0) { - FLAC__ASSERT(lookahead_length <= wanted); - memcpy(ucbuffer_, lookahead, lookahead_length); - wanted -= lookahead_length; - bytes_read = lookahead_length; - if(wanted > 0) { - bytes_read += fread(ucbuffer_+lookahead_length, sizeof(unsigned char), wanted, infile); - if(ferror(infile)) { - flac__utils_printf(stderr, 1, "%s: ERROR during read\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - } - lookahead_length = 0; - } - else - bytes_read = fread(ucbuffer_, sizeof(unsigned char), wanted, infile); - } - - if(bytes_read == 0) { - if(ferror(infile)) { - flac__utils_printf(stderr, 1, "%s: ERROR during read\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - else if(feof(infile)) { - flac__utils_printf(stderr, 1, "%s: WARNING: unexpected EOF; expected %u samples, got %u samples\n", encoder_session.inbasefilename, (unsigned)encoder_session.total_samples_to_encode, (unsigned)encoder_session.samples_written); - if(encoder_session.treat_warnings_as_errors) - return EncoderSession_finish_error(&encoder_session); - total_input_bytes_read = max_input_bytes; - } - } - else { - if(bytes_read % bytes_per_wide_sample != 0) { - flac__utils_printf(stderr, 1, "%s: ERROR: got partial sample\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - else { - unsigned wide_samples = bytes_read / bytes_per_wide_sample; - if(!format_input(input_, wide_samples, options.is_big_endian, options.is_unsigned_samples, options.channels, options.bps, /*shift=*/0, /*channel_map=*/0)) - return EncoderSession_finish_error(&encoder_session); - - if(!EncoderSession_process(&encoder_session, (const FLAC__int32 * const *)input_, wide_samples)) { - print_error_with_state(&encoder_session, "ERROR during encoding"); - return EncoderSession_finish_error(&encoder_session); - } - total_input_bytes_read += bytes_read; - } - } - } - } - - /* - * now read unaligned samples into reservoir or pad with zeroes if necessary - */ - if(options.common.sector_align) { - if(options.common.is_last_file) { - unsigned wide_samples = 588 - align_remainder; - if(wide_samples < 588) { - unsigned channel; - - info_align_zero = wide_samples; - for(channel = 0; channel < options.channels; channel++) - memset(input_[channel], 0, sizeof(input_[0][0]) * wide_samples); - - if(!EncoderSession_process(&encoder_session, (const FLAC__int32 * const *)input_, wide_samples)) { - print_error_with_state(&encoder_session, "ERROR during encoding"); - return EncoderSession_finish_error(&encoder_session); - } - } - } - else { - if(*options.common.align_reservoir_samples > 0) { - FLAC__ASSERT(CHUNK_OF_SAMPLES >= 588); - bytes_read = fread(ucbuffer_, sizeof(unsigned char), (*options.common.align_reservoir_samples) * bytes_per_wide_sample, infile); - if(bytes_read == 0 && ferror(infile)) { - flac__utils_printf(stderr, 1, "%s: ERROR during read\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - else if(bytes_read != (*options.common.align_reservoir_samples) * bytes_per_wide_sample) { - flac__utils_printf(stderr, 1, "%s: WARNING: unexpected EOF; read %u bytes; expected %u samples, got %u samples\n", encoder_session.inbasefilename, (unsigned)bytes_read, (unsigned)encoder_session.total_samples_to_encode, (unsigned)encoder_session.samples_written); - if(encoder_session.treat_warnings_as_errors) - return EncoderSession_finish_error(&encoder_session); - } - else { - info_align_carry = *options.common.align_reservoir_samples; - if(!format_input(options.common.align_reservoir, *options.common.align_reservoir_samples, options.is_big_endian, options.is_unsigned_samples, options.channels, options.bps, /*shift=*/0, /*channel_map=*/0)) - return EncoderSession_finish_error(&encoder_session); - } - } - } - } - - return EncoderSession_finish_ok(&encoder_session, info_align_carry, info_align_zero, /*foreign_metadata=*/0); -} - -int flac__encode_flac(FILE *infile, off_t infilesize, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, unsigned lookahead_length, flac_encode_options_t options, FLAC__bool input_is_ogg) -{ - EncoderSession encoder_session; - FLAC__StreamDecoder *decoder = 0; - FLACDecoderData decoder_data; - size_t i; - int retval; - - if(! - EncoderSession_construct( - &encoder_session, -#if FLAC__HAS_OGG - options.common.use_ogg, -#else - /*use_ogg=*/false, -#endif - options.common.verify, - options.common.treat_warnings_as_errors, - options.common.continue_through_decode_errors, - infile, - infilename, - outfilename - ) - ) - return 1; - - decoder_data.encoder_session = &encoder_session; - decoder_data.filesize = (infilesize == (off_t)(-1)? 0 : infilesize); - decoder_data.lookahead = lookahead; - decoder_data.lookahead_length = lookahead_length; - decoder_data.num_metadata_blocks = 0; - decoder_data.samples_left_to_process = 0; - decoder_data.fatal_error = false; - - /* - * set up FLAC decoder for the input - */ - if (0 == (decoder = FLAC__stream_decoder_new())) { - flac__utils_printf(stderr, 1, "%s: ERROR: creating decoder for FLAC input\n", encoder_session.inbasefilename); - return EncoderSession_finish_error(&encoder_session); - } - if (!( - FLAC__stream_decoder_set_md5_checking(decoder, false) && - FLAC__stream_decoder_set_metadata_respond_all(decoder) - )) { - flac__utils_printf(stderr, 1, "%s: ERROR: setting up decoder for FLAC input\n", encoder_session.inbasefilename); - goto fubar1; /*@@@ yuck */ - } - - if (input_is_ogg) { - if (FLAC__stream_decoder_init_ogg_stream(decoder, flac_decoder_read_callback, flac_decoder_seek_callback, flac_decoder_tell_callback, flac_decoder_length_callback, flac_decoder_eof_callback, flac_decoder_write_callback, flac_decoder_metadata_callback, flac_decoder_error_callback, /*client_data=*/&decoder_data) != FLAC__STREAM_DECODER_INIT_STATUS_OK) { - flac__utils_printf(stderr, 1, "%s: ERROR: initializing decoder for Ogg FLAC input, state = %s\n", encoder_session.inbasefilename, FLAC__stream_decoder_get_resolved_state_string(decoder)); - goto fubar1; /*@@@ yuck */ - } - } - else if (FLAC__stream_decoder_init_stream(decoder, flac_decoder_read_callback, flac_decoder_seek_callback, flac_decoder_tell_callback, flac_decoder_length_callback, flac_decoder_eof_callback, flac_decoder_write_callback, flac_decoder_metadata_callback, flac_decoder_error_callback, /*client_data=*/&decoder_data) != FLAC__STREAM_DECODER_INIT_STATUS_OK) { - flac__utils_printf(stderr, 1, "%s: ERROR: initializing decoder for FLAC input, state = %s\n", encoder_session.inbasefilename, FLAC__stream_decoder_get_resolved_state_string(decoder)); - goto fubar1; /*@@@ yuck */ - } - - if (!FLAC__stream_decoder_process_until_end_of_metadata(decoder) || decoder_data.fatal_error) { - if (decoder_data.fatal_error) - flac__utils_printf(stderr, 1, "%s: ERROR: out of memory or too many metadata blocks while reading metadata in FLAC input\n", encoder_session.inbasefilename); - else - flac__utils_printf(stderr, 1, "%s: ERROR: reading metadata in FLAC input, state = %s\n", encoder_session.inbasefilename, FLAC__stream_decoder_get_resolved_state_string(decoder)); - goto fubar1; /*@@@ yuck */ - } - - if (decoder_data.num_metadata_blocks == 0) { - flac__utils_printf(stderr, 1, "%s: ERROR: reading metadata in FLAC input, got no metadata blocks\n", encoder_session.inbasefilename); - goto fubar2; /*@@@ yuck */ - } - else if (decoder_data.metadata_blocks[0]->type != FLAC__METADATA_TYPE_STREAMINFO) { - flac__utils_printf(stderr, 1, "%s: ERROR: reading metadata in FLAC input, first metadata block is not STREAMINFO\n", encoder_session.inbasefilename); - goto fubar2; /*@@@ yuck */ - } - else if (decoder_data.metadata_blocks[0]->data.stream_info.total_samples == 0) { - flac__utils_printf(stderr, 1, "%s: ERROR: FLAC input has STREAMINFO with unknown total samples which is not supported\n", encoder_session.inbasefilename); - goto fubar2; /*@@@ yuck */ - } - - /* - * now that we have the STREAMINFO and know the sample rate, - * canonicalize the --skip string to a number of samples: - */ - flac__utils_canonicalize_skip_until_specification(&options.common.skip_specification, decoder_data.metadata_blocks[0]->data.stream_info.sample_rate); - FLAC__ASSERT(options.common.skip_specification.value.samples >= 0); - encoder_session.skip = (FLAC__uint64)options.common.skip_specification.value.samples; - FLAC__ASSERT(!options.common.sector_align); /* --sector-align with FLAC input is not supported */ - - { - FLAC__uint64 total_samples_in_input, trim = 0; - - total_samples_in_input = decoder_data.metadata_blocks[0]->data.stream_info.total_samples; - - /* - * now that we know the input size, canonicalize the - * --until string to an absolute sample number: - */ - if(!canonicalize_until_specification(&options.common.until_specification, encoder_session.inbasefilename, decoder_data.metadata_blocks[0]->data.stream_info.sample_rate, encoder_session.skip, total_samples_in_input)) - goto fubar2; /*@@@ yuck */ - encoder_session.until = (FLAC__uint64)options.common.until_specification.value.samples; - - encoder_session.total_samples_to_encode = total_samples_in_input - encoder_session.skip; - if(encoder_session.until > 0) { - trim = total_samples_in_input - encoder_session.until; - FLAC__ASSERT(total_samples_in_input > 0); - encoder_session.total_samples_to_encode -= trim; - } - - encoder_session.unencoded_size = decoder_data.filesize; - - /* (channel mask will get copied over from the source VORBIS_COMMENT if it exists) */ - if(!EncoderSession_init_encoder(&encoder_session, options.common, /*channel_mask=*/0, decoder_data.metadata_blocks[0]->data.stream_info.channels, decoder_data.metadata_blocks[0]->data.stream_info.bits_per_sample, decoder_data.metadata_blocks[0]->data.stream_info.sample_rate, /*foreign_metadata=*/0, &decoder_data)) - goto fubar2; /*@@@ yuck */ - - /* - * have to wait until the FLAC encoder is set up for writing - * before any seeking in the input FLAC file, because the seek - * itself will usually call the decoder's write callback, and - * our decoder's write callback passes samples to our FLAC - * encoder - */ - decoder_data.samples_left_to_process = encoder_session.total_samples_to_encode; - if(encoder_session.skip > 0) { - if(!FLAC__stream_decoder_seek_absolute(decoder, encoder_session.skip)) { - flac__utils_printf(stderr, 1, "%s: ERROR while skipping samples, FLAC decoder state = %s\n", encoder_session.inbasefilename, FLAC__stream_decoder_get_resolved_state_string(decoder)); - goto fubar2; /*@@@ yuck */ - } - } - - /* - * now do samples from the file - */ - while(!decoder_data.fatal_error && decoder_data.samples_left_to_process > 0) { - /* We can also hit the end of stream without samples_left_to_process - * going to 0 if there are errors and continue_through_decode_errors - * is on, so we want to break in that case too: - */ - if(encoder_session.continue_through_decode_errors && FLAC__stream_decoder_get_state(decoder) == FLAC__STREAM_DECODER_END_OF_STREAM) - break; - if(!FLAC__stream_decoder_process_single(decoder)) { - flac__utils_printf(stderr, 1, "%s: ERROR: while decoding FLAC input, state = %s\n", encoder_session.inbasefilename, FLAC__stream_decoder_get_resolved_state_string(decoder)); - goto fubar2; /*@@@ yuck */ - } - } - if(decoder_data.fatal_error) { - flac__utils_printf(stderr, 1, "%s: ERROR: while decoding FLAC input, state = %s\n", encoder_session.inbasefilename, FLAC__stream_decoder_get_resolved_state_string(decoder)); - goto fubar2; /*@@@ yuck */ - } - } - - FLAC__stream_decoder_delete(decoder); - retval = EncoderSession_finish_ok(&encoder_session, -1, -1, /*foreign_metadata=*/0); - /* have to wail until encoder is completely finished before deleting because of the final step of writing the seekpoint offsets */ - for(i = 0; i < decoder_data.num_metadata_blocks; i++) - FLAC__metadata_object_delete(decoder_data.metadata_blocks[i]); - return retval; - -fubar2: - for(i = 0; i < decoder_data.num_metadata_blocks; i++) - FLAC__metadata_object_delete(decoder_data.metadata_blocks[i]); -fubar1: - FLAC__stream_decoder_delete(decoder); - return EncoderSession_finish_error(&encoder_session); -} - -FLAC__bool EncoderSession_construct(EncoderSession *e, FLAC__bool use_ogg, FLAC__bool verify, FLAC__bool treat_warnings_as_errors, FLAC__bool continue_through_decode_errors, FILE *infile, const char *infilename, const char *outfilename) -{ - unsigned i; - FLAC__uint32 test = 1; - - /* - * initialize globals - */ - - is_big_endian_host_ = (*((FLAC__byte*)(&test)))? false : true; - - for(i = 0; i < FLAC__MAX_CHANNELS; i++) - input_[i] = &(in_[i][0]); - - - /* - * initialize instance - */ - -#if FLAC__HAS_OGG - e->use_ogg = use_ogg; -#else - (void)use_ogg; -#endif - e->verify = verify; - e->treat_warnings_as_errors = treat_warnings_as_errors; - e->continue_through_decode_errors = continue_through_decode_errors; - - e->is_stdout = (0 == strcmp(outfilename, "-")); - e->outputfile_opened = false; - - e->inbasefilename = grabbag__file_get_basename(infilename); - e->infilename = infilename; - e->outfilename = outfilename; - - e->skip = 0; /* filled in later after the sample_rate is known */ - e->unencoded_size = 0; - e->total_samples_to_encode = 0; - e->bytes_written = 0; - e->samples_written = 0; - e->stats_mask = 0; - - e->encoder = 0; - - e->fin = infile; - e->seek_table_template = 0; - - if(0 == (e->seek_table_template = FLAC__metadata_object_new(FLAC__METADATA_TYPE_SEEKTABLE))) { - flac__utils_printf(stderr, 1, "%s: ERROR allocating memory for seek table\n", e->inbasefilename); - return false; - } - - e->encoder = FLAC__stream_encoder_new(); - if(0 == e->encoder) { - flac__utils_printf(stderr, 1, "%s: ERROR creating the encoder instance\n", e->inbasefilename); - EncoderSession_destroy(e); - return false; - } - - return true; -} - -void EncoderSession_destroy(EncoderSession *e) -{ - if(e->fin != stdin) - fclose(e->fin); - - if(0 != e->encoder) { - FLAC__stream_encoder_delete(e->encoder); - e->encoder = 0; - } - - if(0 != e->seek_table_template) { - FLAC__metadata_object_delete(e->seek_table_template); - e->seek_table_template = 0; - } -} - -int EncoderSession_finish_ok(EncoderSession *e, int info_align_carry, int info_align_zero, foreign_metadata_t *foreign_metadata) -{ - FLAC__StreamEncoderState fse_state = FLAC__STREAM_ENCODER_OK; - int ret = 0; - FLAC__bool verify_error = false; - - if(e->encoder) { - fse_state = FLAC__stream_encoder_get_state(e->encoder); - ret = FLAC__stream_encoder_finish(e->encoder)? 0 : 1; - verify_error = - fse_state == FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA || - FLAC__stream_encoder_get_state(e->encoder) == FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA - ; - } - /* all errors except verify errors should interrupt the stats */ - if(ret && !verify_error) - print_error_with_state(e, "ERROR during encoding"); - else if(e->total_samples_to_encode > 0) { - print_stats(e); - flac__utils_printf(stderr, 2, "\n"); - } - - if(verify_error) { - print_verify_error(e); - ret = 1; - } - else { - if(info_align_carry >= 0) { - flac__utils_printf(stderr, 1, "%s: INFO: sector alignment causing %d samples to be carried over\n", e->inbasefilename, info_align_carry); - } - if(info_align_zero >= 0) { - flac__utils_printf(stderr, 1, "%s: INFO: sector alignment causing %d zero samples to be appended\n", e->inbasefilename, info_align_zero); - } - } - - /*@@@@@@ should this go here or somewhere else? */ - if(ret == 0 && foreign_metadata) { - const char *error; - if(!flac__foreign_metadata_write_to_flac(foreign_metadata, e->infilename, e->outfilename, &error)) { - flac__utils_printf(stderr, 1, "%s: ERROR: updating foreign metadata in FLAC file: %s\n", e->inbasefilename, error); - ret = 1; - } - } - - EncoderSession_destroy(e); - - return ret; -} - -int EncoderSession_finish_error(EncoderSession *e) -{ - FLAC__ASSERT(e->encoder); - - if(e->total_samples_to_encode > 0) - flac__utils_printf(stderr, 2, "\n"); - - if(FLAC__stream_encoder_get_state(e->encoder) == FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA) - print_verify_error(e); - else if(e->outputfile_opened) - /* only want to delete the file if we opened it; otherwise it could be an existing file and our overwrite failed */ - unlink(e->outfilename); - - EncoderSession_destroy(e); - - return 1; -} - -typedef struct { - unsigned num_metadata; - FLAC__bool *needs_delete; - FLAC__StreamMetadata **metadata; - FLAC__StreamMetadata *cuesheet; /* always needs to be deleted */ -} static_metadata_t; - -static void static_metadata_init(static_metadata_t *m) -{ - m->num_metadata = 0; - m->needs_delete = 0; - m->metadata = 0; - m->cuesheet = 0; -} - -static void static_metadata_clear(static_metadata_t *m) -{ - unsigned i; - for(i = 0; i < m->num_metadata; i++) - if(m->needs_delete[i]) - FLAC__metadata_object_delete(m->metadata[i]); - if(m->metadata) - free(m->metadata); - if(m->needs_delete) - free(m->needs_delete); - if(m->cuesheet) - FLAC__metadata_object_delete(m->cuesheet); - static_metadata_init(m); -} - -static FLAC__bool static_metadata_append(static_metadata_t *m, FLAC__StreamMetadata *d, FLAC__bool needs_delete) -{ - void *x; - if(0 == (x = safe_realloc_muladd2_(m->metadata, sizeof(*m->metadata), /*times (*/m->num_metadata, /*+*/1/*)*/))) - return false; - m->metadata = (FLAC__StreamMetadata**)x; - if(0 == (x = safe_realloc_muladd2_(m->needs_delete, sizeof(*m->needs_delete), /*times (*/m->num_metadata, /*+*/1/*)*/))) - return false; - m->needs_delete = (FLAC__bool*)x; - m->metadata[m->num_metadata] = d; - m->needs_delete[m->num_metadata] = needs_delete; - m->num_metadata++; - return true; -} - -FLAC__bool EncoderSession_init_encoder(EncoderSession *e, encode_options_t options, FLAC__uint32 channel_mask, unsigned channels, unsigned bps, unsigned sample_rate, const foreign_metadata_t *foreign_metadata, FLACDecoderData *flac_decoder_data) -{ - FLAC__StreamMetadata padding; - FLAC__StreamMetadata **metadata = 0; - static_metadata_t static_metadata; - unsigned num_metadata = 0, i; - FLAC__StreamEncoderInitStatus init_status; - const FLAC__bool is_cdda = (channels == 1 || channels == 2) && (bps == 16) && (sample_rate == 44100); - char apodizations[2000]; - - FLAC__ASSERT(sizeof(options.pictures)/sizeof(options.pictures[0]) <= 64); - - static_metadata_init(&static_metadata); - - e->replay_gain = options.replay_gain; - e->channels = channels; - e->bits_per_sample = bps; - e->sample_rate = sample_rate; - - apodizations[0] = '\0'; - - if(e->replay_gain) { - if(channels != 1 && channels != 2) { - flac__utils_printf(stderr, 1, "%s: ERROR, number of channels (%u) must be 1 or 2 for --replay-gain\n", e->inbasefilename, channels); - return false; - } - if(!grabbag__replaygain_is_valid_sample_frequency(sample_rate)) { - flac__utils_printf(stderr, 1, "%s: ERROR, invalid sample rate (%u) for --replay-gain\n", e->inbasefilename, sample_rate); - return false; - } - if(options.is_first_file) { - if(!grabbag__replaygain_init(sample_rate)) { - flac__utils_printf(stderr, 1, "%s: ERROR initializing ReplayGain stage\n", e->inbasefilename); - return false; - } - } - } - - if(!parse_cuesheet(&static_metadata.cuesheet, options.cuesheet_filename, e->inbasefilename, is_cdda, e->total_samples_to_encode, e->treat_warnings_as_errors)) - return false; - - if(!convert_to_seek_table_template(options.requested_seek_points, options.num_requested_seek_points, options.cued_seekpoints? static_metadata.cuesheet : 0, e)) { - flac__utils_printf(stderr, 1, "%s: ERROR allocating memory for seek table\n", e->inbasefilename); - static_metadata_clear(&static_metadata); - return false; - } - - /* build metadata */ - if(flac_decoder_data) { - /* - * we're encoding from FLAC so we will use the FLAC file's - * metadata as the basis for the encoded file - */ - { - /* - * first handle pictures: simple append any --pictures - * specified. - */ - for(i = 0; i < options.num_pictures; i++) { - FLAC__StreamMetadata *pic = FLAC__metadata_object_clone(options.pictures[i]); - if(0 == pic) { - flac__utils_printf(stderr, 1, "%s: ERROR allocating memory for PICTURE block\n", e->inbasefilename); - static_metadata_clear(&static_metadata); - return false; - } - flac_decoder_data->metadata_blocks[flac_decoder_data->num_metadata_blocks++] = pic; - } - } - { - /* - * next handle vorbis comment: if any tags were specified - * or there is no existing vorbis comment, we create a - * new vorbis comment (discarding any existing one); else - * we keep the existing one. also need to make sure to - * propagate any channel mask tag. - */ - /* @@@ change to append -T values from options.vorbis_comment if input has VC already? */ - size_t i, j; - FLAC__bool vc_found = false; - for(i = 0, j = 0; i < flac_decoder_data->num_metadata_blocks; i++) { - if(flac_decoder_data->metadata_blocks[i]->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) - vc_found = true; - if(flac_decoder_data->metadata_blocks[i]->type == FLAC__METADATA_TYPE_VORBIS_COMMENT && options.vorbis_comment->data.vorbis_comment.num_comments > 0) { - (void) flac__utils_get_channel_mask_tag(flac_decoder_data->metadata_blocks[i], &channel_mask); - flac__utils_printf(stderr, 1, "%s: WARNING, replacing tags from input FLAC file with those given on the command-line\n", e->inbasefilename); - if(e->treat_warnings_as_errors) { - static_metadata_clear(&static_metadata); - return false; - } - FLAC__metadata_object_delete(flac_decoder_data->metadata_blocks[i]); - flac_decoder_data->metadata_blocks[i] = 0; - } - else - flac_decoder_data->metadata_blocks[j++] = flac_decoder_data->metadata_blocks[i]; - } - flac_decoder_data->num_metadata_blocks = j; - if((!vc_found || options.vorbis_comment->data.vorbis_comment.num_comments > 0) && flac_decoder_data->num_metadata_blocks < sizeof(flac_decoder_data->metadata_blocks)/sizeof(flac_decoder_data->metadata_blocks[0])) { - /* prepend ours */ - FLAC__StreamMetadata *vc = FLAC__metadata_object_clone(options.vorbis_comment); - if(0 == vc || (channel_mask && !flac__utils_set_channel_mask_tag(vc, channel_mask))) { - flac__utils_printf(stderr, 1, "%s: ERROR allocating memory for VORBIS_COMMENT block\n", e->inbasefilename); - static_metadata_clear(&static_metadata); - return false; - } - for(i = flac_decoder_data->num_metadata_blocks; i > 1; i--) - flac_decoder_data->metadata_blocks[i] = flac_decoder_data->metadata_blocks[i-1]; - flac_decoder_data->metadata_blocks[1] = vc; - flac_decoder_data->num_metadata_blocks++; - } - } - { - /* - * next handle cuesheet: if --cuesheet was specified, use - * it; else if file has existing CUESHEET and cuesheet's - * lead-out offset is correct, keep it; else no CUESHEET - */ - size_t i, j; - for(i = 0, j = 0; i < flac_decoder_data->num_metadata_blocks; i++) { - FLAC__bool existing_cuesheet_is_bad = false; - /* check if existing cuesheet matches the input audio */ - if(flac_decoder_data->metadata_blocks[i]->type == FLAC__METADATA_TYPE_CUESHEET && 0 == static_metadata.cuesheet) { - const FLAC__StreamMetadata_CueSheet *cs = &flac_decoder_data->metadata_blocks[i]->data.cue_sheet; - if(e->total_samples_to_encode == 0) { - flac__utils_printf(stderr, 1, "%s: WARNING, cuesheet in input FLAC file cannot be kept if input size is not known, dropping it...\n", e->inbasefilename); - if(e->treat_warnings_as_errors) { - static_metadata_clear(&static_metadata); - return false; - } - existing_cuesheet_is_bad = true; - } - else if(e->total_samples_to_encode != cs->tracks[cs->num_tracks-1].offset) { - flac__utils_printf(stderr, 1, "%s: WARNING, lead-out offset of cuesheet in input FLAC file does not match input length, dropping existing cuesheet...\n", e->inbasefilename); - if(e->treat_warnings_as_errors) { - static_metadata_clear(&static_metadata); - return false; - } - existing_cuesheet_is_bad = true; - } - } - if(flac_decoder_data->metadata_blocks[i]->type == FLAC__METADATA_TYPE_CUESHEET && (existing_cuesheet_is_bad || 0 != static_metadata.cuesheet)) { - if(0 != static_metadata.cuesheet) { - flac__utils_printf(stderr, 1, "%s: WARNING, replacing cuesheet in input FLAC file with the one given on the command-line\n", e->inbasefilename); - if(e->treat_warnings_as_errors) { - static_metadata_clear(&static_metadata); - return false; - } - } - FLAC__metadata_object_delete(flac_decoder_data->metadata_blocks[i]); - flac_decoder_data->metadata_blocks[i] = 0; - } - else - flac_decoder_data->metadata_blocks[j++] = flac_decoder_data->metadata_blocks[i]; - } - flac_decoder_data->num_metadata_blocks = j; - if(0 != static_metadata.cuesheet && flac_decoder_data->num_metadata_blocks < sizeof(flac_decoder_data->metadata_blocks)/sizeof(flac_decoder_data->metadata_blocks[0])) { - /* prepend ours */ - FLAC__StreamMetadata *cs = FLAC__metadata_object_clone(static_metadata.cuesheet); - if(0 == cs) { - flac__utils_printf(stderr, 1, "%s: ERROR allocating memory for CUESHEET block\n", e->inbasefilename); - static_metadata_clear(&static_metadata); - return false; - } - for(i = flac_decoder_data->num_metadata_blocks; i > 1; i--) - flac_decoder_data->metadata_blocks[i] = flac_decoder_data->metadata_blocks[i-1]; - flac_decoder_data->metadata_blocks[1] = cs; - flac_decoder_data->num_metadata_blocks++; - } - } - { - /* - * next handle seektable: if -S- was specified, no - * SEEKTABLE; else if -S was specified, use it/them; - * else if file has existing SEEKTABLE and input size is - * preserved (no --skip/--until/etc specified), keep it; - * else use default seektable options - * - * note: meanings of num_requested_seek_points: - * -1 : no -S option given, default to some value - * 0 : -S- given (no seektable) - * >0 : one or more -S options given - */ - size_t i, j; - FLAC__bool existing_seektable = false; - for(i = 0, j = 0; i < flac_decoder_data->num_metadata_blocks; i++) { - if(flac_decoder_data->metadata_blocks[i]->type == FLAC__METADATA_TYPE_SEEKTABLE) - existing_seektable = true; - if(flac_decoder_data->metadata_blocks[i]->type == FLAC__METADATA_TYPE_SEEKTABLE && (e->total_samples_to_encode != flac_decoder_data->metadata_blocks[0]->data.stream_info.total_samples || options.num_requested_seek_points >= 0)) { - if(options.num_requested_seek_points > 0) { - flac__utils_printf(stderr, 1, "%s: WARNING, replacing seektable in input FLAC file with the one given on the command-line\n", e->inbasefilename); - if(e->treat_warnings_as_errors) { - static_metadata_clear(&static_metadata); - return false; - } - } - else if(options.num_requested_seek_points == 0) - ; /* no warning, silently delete existing SEEKTABLE since user specified --no-seektable (-S-) */ - else { - flac__utils_printf(stderr, 1, "%s: WARNING, can't use existing seektable in input FLAC since the input size is changing or unknown, dropping existing SEEKTABLE block...\n", e->inbasefilename); - if(e->treat_warnings_as_errors) { - static_metadata_clear(&static_metadata); - return false; - } - } - FLAC__metadata_object_delete(flac_decoder_data->metadata_blocks[i]); - flac_decoder_data->metadata_blocks[i] = 0; - existing_seektable = false; - } - else - flac_decoder_data->metadata_blocks[j++] = flac_decoder_data->metadata_blocks[i]; - } - flac_decoder_data->num_metadata_blocks = j; - if((options.num_requested_seek_points > 0 || (options.num_requested_seek_points < 0 && !existing_seektable)) && flac_decoder_data->num_metadata_blocks < sizeof(flac_decoder_data->metadata_blocks)/sizeof(flac_decoder_data->metadata_blocks[0])) { - /* prepend ours */ - FLAC__StreamMetadata *st = FLAC__metadata_object_clone(e->seek_table_template); - if(0 == st) { - flac__utils_printf(stderr, 1, "%s: ERROR allocating memory for SEEKTABLE block\n", e->inbasefilename); - static_metadata_clear(&static_metadata); - return false; - } - for(i = flac_decoder_data->num_metadata_blocks; i > 1; i--) - flac_decoder_data->metadata_blocks[i] = flac_decoder_data->metadata_blocks[i-1]; - flac_decoder_data->metadata_blocks[1] = st; - flac_decoder_data->num_metadata_blocks++; - } - } - { - /* - * finally handle padding: if --no-padding was specified, - * then delete all padding; else if -P was specified, - * use that instead of existing padding (if any); else - * if existing file has padding, move all existing - * padding blocks to one padding block at the end; else - * use default padding. - */ - int p = -1; - size_t i, j; - for(i = 0, j = 0; i < flac_decoder_data->num_metadata_blocks; i++) { - if(flac_decoder_data->metadata_blocks[i]->type == FLAC__METADATA_TYPE_PADDING) { - if(p < 0) - p = 0; - p += flac_decoder_data->metadata_blocks[i]->length; - FLAC__metadata_object_delete(flac_decoder_data->metadata_blocks[i]); - flac_decoder_data->metadata_blocks[i] = 0; - } - else - flac_decoder_data->metadata_blocks[j++] = flac_decoder_data->metadata_blocks[i]; - } - flac_decoder_data->num_metadata_blocks = j; - if(options.padding > 0) - p = options.padding; - if(p < 0) - p = e->total_samples_to_encode / e->sample_rate < 20*60? FLAC_ENCODE__DEFAULT_PADDING : FLAC_ENCODE__DEFAULT_PADDING*8; - if(options.padding != 0) { - if(p > 0 && flac_decoder_data->num_metadata_blocks < sizeof(flac_decoder_data->metadata_blocks)/sizeof(flac_decoder_data->metadata_blocks[0])) { - flac_decoder_data->metadata_blocks[flac_decoder_data->num_metadata_blocks] = FLAC__metadata_object_new(FLAC__METADATA_TYPE_PADDING); - if(0 == flac_decoder_data->metadata_blocks[flac_decoder_data->num_metadata_blocks]) { - flac__utils_printf(stderr, 1, "%s: ERROR allocating memory for PADDING block\n", e->inbasefilename); - static_metadata_clear(&static_metadata); - return false; - } - flac_decoder_data->metadata_blocks[flac_decoder_data->num_metadata_blocks]->is_last = false; /* the encoder will set this for us */ - flac_decoder_data->metadata_blocks[flac_decoder_data->num_metadata_blocks]->length = p; - flac_decoder_data->num_metadata_blocks++; - } - } - } - metadata = &flac_decoder_data->metadata_blocks[1]; /* don't include STREAMINFO */ - num_metadata = flac_decoder_data->num_metadata_blocks - 1; - } - else { - /* - * we're not encoding from FLAC so we will build the metadata - * from scratch - */ - if(e->seek_table_template->data.seek_table.num_points > 0) { - e->seek_table_template->is_last = false; /* the encoder will set this for us */ - static_metadata_append(&static_metadata, e->seek_table_template, /*needs_delete=*/false); - } - if(0 != static_metadata.cuesheet) - static_metadata_append(&static_metadata, static_metadata.cuesheet, /*needs_delete=*/false); - if(channel_mask) { - if(!flac__utils_set_channel_mask_tag(options.vorbis_comment, channel_mask)) { - flac__utils_printf(stderr, 1, "%s: ERROR adding channel mask tag\n", e->inbasefilename); - static_metadata_clear(&static_metadata); - return false; - } - } - static_metadata_append(&static_metadata, options.vorbis_comment, /*needs_delete=*/false); - for(i = 0; i < options.num_pictures; i++) - static_metadata_append(&static_metadata, options.pictures[i], /*needs_delete=*/false); - if(foreign_metadata) { - for(i = 0; i < foreign_metadata->num_blocks; i++) { - FLAC__StreamMetadata *p = FLAC__metadata_object_new(FLAC__METADATA_TYPE_PADDING); - if(!p) { - flac__utils_printf(stderr, 1, "%s: ERROR: out of memory\n", e->inbasefilename); - static_metadata_clear(&static_metadata); - return false; - } - static_metadata_append(&static_metadata, p, /*needs_delete=*/true); - static_metadata.metadata[static_metadata.num_metadata-1]->length = FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8 + foreign_metadata->blocks[i].size; -/*fprintf(stderr,"@@@@@@ add PADDING=%u\n",static_metadata.metadata[static_metadata.num_metadata-1]->length);*/ - } - } - if(options.padding != 0) { - padding.is_last = false; /* the encoder will set this for us */ - padding.type = FLAC__METADATA_TYPE_PADDING; - padding.length = (unsigned)(options.padding>0? options.padding : (e->total_samples_to_encode / e->sample_rate < 20*60? FLAC_ENCODE__DEFAULT_PADDING : FLAC_ENCODE__DEFAULT_PADDING*8)); - static_metadata_append(&static_metadata, &padding, /*needs_delete=*/false); - } - metadata = static_metadata.metadata; - num_metadata = static_metadata.num_metadata; - } - - /* check for a few things that have not already been checked. the - * FLAC__stream_encoder_init*() will check it but only return - * FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA so we check some - * up front to give a better error message. - */ - if(!verify_metadata(e, metadata, num_metadata)) { - static_metadata_clear(&static_metadata); - return false; - } - - FLAC__stream_encoder_set_verify(e->encoder, options.verify); - FLAC__stream_encoder_set_streamable_subset(e->encoder, !options.lax); - FLAC__stream_encoder_set_channels(e->encoder, channels); - FLAC__stream_encoder_set_bits_per_sample(e->encoder, bps); - FLAC__stream_encoder_set_sample_rate(e->encoder, sample_rate); - for(i = 0; i < options.num_compression_settings; i++) { - switch(options.compression_settings[i].type) { - case CST_BLOCKSIZE: - FLAC__stream_encoder_set_blocksize(e->encoder, options.compression_settings[i].value.t_unsigned); - break; - case CST_COMPRESSION_LEVEL: - FLAC__stream_encoder_set_compression_level(e->encoder, options.compression_settings[i].value.t_unsigned); - apodizations[0] = '\0'; - break; - case CST_DO_MID_SIDE: - FLAC__stream_encoder_set_do_mid_side_stereo(e->encoder, options.compression_settings[i].value.t_bool); - break; - case CST_LOOSE_MID_SIDE: - FLAC__stream_encoder_set_loose_mid_side_stereo(e->encoder, options.compression_settings[i].value.t_bool); - break; - case CST_APODIZATION: - if(strlen(apodizations)+strlen(options.compression_settings[i].value.t_string)+2 >= sizeof(apodizations)) { - flac__utils_printf(stderr, 1, "%s: ERROR: too many apodization functions requested\n", e->inbasefilename); - static_metadata_clear(&static_metadata); - return false; - } - else { - strcat(apodizations, options.compression_settings[i].value.t_string); - strcat(apodizations, ";"); - } - break; - case CST_MAX_LPC_ORDER: - FLAC__stream_encoder_set_max_lpc_order(e->encoder, options.compression_settings[i].value.t_unsigned); - break; - case CST_QLP_COEFF_PRECISION: - FLAC__stream_encoder_set_qlp_coeff_precision(e->encoder, options.compression_settings[i].value.t_unsigned); - break; - case CST_DO_QLP_COEFF_PREC_SEARCH: - FLAC__stream_encoder_set_do_qlp_coeff_prec_search(e->encoder, options.compression_settings[i].value.t_bool); - break; - case CST_DO_ESCAPE_CODING: - FLAC__stream_encoder_set_do_escape_coding(e->encoder, options.compression_settings[i].value.t_bool); - break; - case CST_DO_EXHAUSTIVE_MODEL_SEARCH: - FLAC__stream_encoder_set_do_exhaustive_model_search(e->encoder, options.compression_settings[i].value.t_bool); - break; - case CST_MIN_RESIDUAL_PARTITION_ORDER: - FLAC__stream_encoder_set_min_residual_partition_order(e->encoder, options.compression_settings[i].value.t_unsigned); - break; - case CST_MAX_RESIDUAL_PARTITION_ORDER: - FLAC__stream_encoder_set_max_residual_partition_order(e->encoder, options.compression_settings[i].value.t_unsigned); - break; - case CST_RICE_PARAMETER_SEARCH_DIST: - FLAC__stream_encoder_set_rice_parameter_search_dist(e->encoder, options.compression_settings[i].value.t_unsigned); - break; - } - } - if(*apodizations) - FLAC__stream_encoder_set_apodization(e->encoder, apodizations); - FLAC__stream_encoder_set_total_samples_estimate(e->encoder, e->total_samples_to_encode); - FLAC__stream_encoder_set_metadata(e->encoder, (num_metadata > 0)? metadata : 0, num_metadata); - - FLAC__stream_encoder_disable_constant_subframes(e->encoder, options.debug.disable_constant_subframes); - FLAC__stream_encoder_disable_fixed_subframes(e->encoder, options.debug.disable_fixed_subframes); - FLAC__stream_encoder_disable_verbatim_subframes(e->encoder, options.debug.disable_verbatim_subframes); - if(!options.debug.do_md5) { - flac__utils_printf(stderr, 1, "%s: WARNING, MD5 computation disabled, resulting file will not have MD5 sum\n", e->inbasefilename); - if(e->treat_warnings_as_errors) { - static_metadata_clear(&static_metadata); - return false; - } - FLAC__stream_encoder_set_do_md5(e->encoder, false); - } - -#if FLAC__HAS_OGG - if(e->use_ogg) { - FLAC__stream_encoder_set_ogg_serial_number(e->encoder, options.serial_number); - - init_status = FLAC__stream_encoder_init_ogg_file(e->encoder, e->is_stdout? 0 : e->outfilename, encoder_progress_callback, /*client_data=*/e); - } - else -#endif - { - init_status = FLAC__stream_encoder_init_file(e->encoder, e->is_stdout? 0 : e->outfilename, encoder_progress_callback, /*client_data=*/e); - } - - if(init_status != FLAC__STREAM_ENCODER_INIT_STATUS_OK) { - print_error_with_init_status(e, "ERROR initializing encoder", init_status); - if(FLAC__stream_encoder_get_state(e->encoder) != FLAC__STREAM_ENCODER_IO_ERROR) - e->outputfile_opened = true; - static_metadata_clear(&static_metadata); - return false; - } - else - e->outputfile_opened = true; - - e->stats_mask = - (FLAC__stream_encoder_get_do_exhaustive_model_search(e->encoder) && FLAC__stream_encoder_get_do_qlp_coeff_prec_search(e->encoder))? 0x07 : - (FLAC__stream_encoder_get_do_exhaustive_model_search(e->encoder) || FLAC__stream_encoder_get_do_qlp_coeff_prec_search(e->encoder))? 0x0f : - 0x3f; - - static_metadata_clear(&static_metadata); - - return true; -} - -FLAC__bool EncoderSession_process(EncoderSession *e, const FLAC__int32 * const buffer[], unsigned samples) -{ - if(e->replay_gain) { - if(!grabbag__replaygain_analyze(buffer, e->channels==2, e->bits_per_sample, samples)) { - flac__utils_printf(stderr, 1, "%s: WARNING, error while calculating ReplayGain\n", e->inbasefilename); - if(e->treat_warnings_as_errors) - return false; - } - } - - return FLAC__stream_encoder_process(e->encoder, buffer, samples); -} - -FLAC__bool convert_to_seek_table_template(const char *requested_seek_points, int num_requested_seek_points, FLAC__StreamMetadata *cuesheet, EncoderSession *e) -{ - const FLAC__bool only_placeholders = e->is_stdout; - FLAC__bool has_real_points; - - if(num_requested_seek_points == 0 && 0 == cuesheet) - return true; - - if(num_requested_seek_points < 0) { -#if FLAC__HAS_OGG - /*@@@@@@ workaround ogg bug: too many seekpoints makes table not fit in one page */ - if(e->use_ogg && e->total_samples_to_encode > 0 && e->total_samples_to_encode / e->sample_rate / 10 > 230) - requested_seek_points = "230x;"; - else -#endif - requested_seek_points = "10s;"; - num_requested_seek_points = 1; - } - - if(num_requested_seek_points > 0) { - if(!grabbag__seektable_convert_specification_to_template(requested_seek_points, only_placeholders, e->total_samples_to_encode, e->sample_rate, e->seek_table_template, &has_real_points)) - return false; - } - - if(0 != cuesheet) { - unsigned i, j; - const FLAC__StreamMetadata_CueSheet *cs = &cuesheet->data.cue_sheet; - for(i = 0; i < cs->num_tracks; i++) { - const FLAC__StreamMetadata_CueSheet_Track *tr = cs->tracks+i; - for(j = 0; j < tr->num_indices; j++) { - if(!FLAC__metadata_object_seektable_template_append_point(e->seek_table_template, tr->offset + tr->indices[j].offset)) - return false; - has_real_points = true; - } - } - if(has_real_points) - if(!FLAC__metadata_object_seektable_template_sort(e->seek_table_template, /*compact=*/true)) - return false; - } - - if(has_real_points) { - if(e->is_stdout) { - flac__utils_printf(stderr, 1, "%s: WARNING, cannot write back seekpoints when encoding to stdout\n", e->inbasefilename); - if(e->treat_warnings_as_errors) - return false; - } - } - - return true; -} - -FLAC__bool canonicalize_until_specification(utils__SkipUntilSpecification *spec, const char *inbasefilename, unsigned sample_rate, FLAC__uint64 skip, FLAC__uint64 total_samples_in_input) -{ - /* convert from mm:ss.sss to sample number if necessary */ - flac__utils_canonicalize_skip_until_specification(spec, sample_rate); - - /* special case: if "--until=-0", use the special value '0' to mean "end-of-stream" */ - if(spec->is_relative && spec->value.samples == 0) { - spec->is_relative = false; - return true; - } - - /* in any other case the total samples in the input must be known */ - if(total_samples_in_input == 0) { - flac__utils_printf(stderr, 1, "%s: ERROR, cannot use --until when input length is unknown\n", inbasefilename); - return false; - } - - FLAC__ASSERT(spec->value_is_samples); - - /* convert relative specifications to absolute */ - if(spec->is_relative) { - if(spec->value.samples <= 0) - spec->value.samples += (FLAC__int64)total_samples_in_input; - else - spec->value.samples += skip; - spec->is_relative = false; - } - - /* error check */ - if(spec->value.samples < 0) { - flac__utils_printf(stderr, 1, "%s: ERROR, --until value is before beginning of input\n", inbasefilename); - return false; - } - if((FLAC__uint64)spec->value.samples <= skip) { - flac__utils_printf(stderr, 1, "%s: ERROR, --until value is before --skip point\n", inbasefilename); - return false; - } - if((FLAC__uint64)spec->value.samples > total_samples_in_input) { - flac__utils_printf(stderr, 1, "%s: ERROR, --until value is after end of input\n", inbasefilename); - return false; - } - - return true; -} - -FLAC__bool verify_metadata(const EncoderSession *e, FLAC__StreamMetadata **metadata, unsigned num_metadata) -{ - FLAC__bool metadata_picture_has_type1 = false; - FLAC__bool metadata_picture_has_type2 = false; - unsigned i; - - FLAC__ASSERT(0 != metadata); - for(i = 0; i < num_metadata; i++) { - const FLAC__StreamMetadata *m = metadata[i]; - if(m->type == FLAC__METADATA_TYPE_SEEKTABLE) { - if(!FLAC__format_seektable_is_legal(&m->data.seek_table)) { - flac__utils_printf(stderr, 1, "%s: ERROR: SEEKTABLE metadata block is invalid\n", e->inbasefilename); - return false; - } - } - else if(m->type == FLAC__METADATA_TYPE_CUESHEET) { - if(!FLAC__format_cuesheet_is_legal(&m->data.cue_sheet, m->data.cue_sheet.is_cd, /*violation=*/0)) { - flac__utils_printf(stderr, 1, "%s: ERROR: CUESHEET metadata block is invalid\n", e->inbasefilename); - return false; - } - } - else if(m->type == FLAC__METADATA_TYPE_PICTURE) { - const char *error = 0; - if(!FLAC__format_picture_is_legal(&m->data.picture, &error)) { - flac__utils_printf(stderr, 1, "%s: ERROR: PICTURE metadata block is invalid: %s\n", e->inbasefilename, error); - return false; - } - if(m->data.picture.type == FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD) { - if(metadata_picture_has_type1) { - flac__utils_printf(stderr, 1, "%s: ERROR: there may only be one picture of type 1 (32x32 icon) in the file\n", e->inbasefilename); - return false; - } - metadata_picture_has_type1 = true; - } - else if(m->data.picture.type == FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON) { - if(metadata_picture_has_type2) { - flac__utils_printf(stderr, 1, "%s: ERROR: there may only be one picture of type 2 (icon) in the file\n", e->inbasefilename); - return false; - } - metadata_picture_has_type2 = true; - } - } - } - - return true; -} - -FLAC__bool format_input(FLAC__int32 *dest[], unsigned wide_samples, FLAC__bool is_big_endian, FLAC__bool is_unsigned_samples, unsigned channels, unsigned bps, unsigned shift, size_t *channel_map) -{ - unsigned wide_sample, sample, channel, byte; - FLAC__int32 *out[FLAC__MAX_CHANNELS]; - - if(0 == channel_map) { - for(channel = 0; channel < channels; channel++) - out[channel] = dest[channel]; - } - else { - for(channel = 0; channel < channels; channel++) - out[channel] = dest[channel_map[channel]]; - } - - if(bps == 8) { - if(is_unsigned_samples) { - for(sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++) - for(channel = 0; channel < channels; channel++, sample++) - out[channel][wide_sample] = (FLAC__int32)ucbuffer_[sample] - 0x80; - } - else { - for(sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++) - for(channel = 0; channel < channels; channel++, sample++) - out[channel][wide_sample] = (FLAC__int32)scbuffer_[sample]; - } - } - else if(bps == 16) { - if(is_big_endian != is_big_endian_host_) { - unsigned char tmp; - const unsigned bytes = wide_samples * channels * (bps >> 3); - for(byte = 0; byte < bytes; byte += 2) { - tmp = ucbuffer_[byte]; - ucbuffer_[byte] = ucbuffer_[byte+1]; - ucbuffer_[byte+1] = tmp; - } - } - if(is_unsigned_samples) { - for(sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++) - for(channel = 0; channel < channels; channel++, sample++) - out[channel][wide_sample] = (FLAC__int32)usbuffer_[sample] - 0x8000; - } - else { - for(sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++) - for(channel = 0; channel < channels; channel++, sample++) - out[channel][wide_sample] = (FLAC__int32)ssbuffer_[sample]; - } - } - else if(bps == 24) { - if(!is_big_endian) { - unsigned char tmp; - const unsigned bytes = wide_samples * channels * (bps >> 3); - for(byte = 0; byte < bytes; byte += 3) { - tmp = ucbuffer_[byte]; - ucbuffer_[byte] = ucbuffer_[byte+2]; - ucbuffer_[byte+2] = tmp; - } - } - if(is_unsigned_samples) { - for(byte = sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++) - for(channel = 0; channel < channels; channel++, sample++) { - out[channel][wide_sample] = ucbuffer_[byte++]; out[channel][wide_sample] <<= 8; - out[channel][wide_sample] |= ucbuffer_[byte++]; out[channel][wide_sample] <<= 8; - out[channel][wide_sample] |= ucbuffer_[byte++]; - out[channel][wide_sample] -= 0x800000; - } - } - else { - for(byte = sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++) - for(channel = 0; channel < channels; channel++, sample++) { - out[channel][wide_sample] = scbuffer_[byte++]; out[channel][wide_sample] <<= 8; - out[channel][wide_sample] |= ucbuffer_[byte++]; out[channel][wide_sample] <<= 8; - out[channel][wide_sample] |= ucbuffer_[byte++]; - } - } - } - else { - FLAC__ASSERT(0); - } - if(shift > 0) { - FLAC__int32 mask = (1<<shift)-1; - for(wide_sample = 0; wide_sample < wide_samples; wide_sample++) - for(channel = 0; channel < channels; channel++) { - if(out[channel][wide_sample] & mask) { - flac__utils_printf(stderr, 1, "ERROR during read, sample data (channel#%u sample#%u = %d) has non-zero least-significant bits\n WAVE/AIFF header said the last %u bits are not significant and should be zero.\n", channel, wide_sample, out[channel][wide_sample], shift); - return false; - } - out[channel][wide_sample] >>= shift; - } - } - return true; -} - -void encoder_progress_callback(const FLAC__StreamEncoder *encoder, FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate, void *client_data) -{ - EncoderSession *encoder_session = (EncoderSession*)client_data; - - (void)encoder, (void)total_frames_estimate; - - encoder_session->bytes_written = bytes_written; - encoder_session->samples_written = samples_written; - - if(encoder_session->total_samples_to_encode > 0 && !((frames_written-1) & encoder_session->stats_mask)) - print_stats(encoder_session); -} - -FLAC__StreamDecoderReadStatus flac_decoder_read_callback(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data) -{ - size_t n = 0; - FLACDecoderData *data = (FLACDecoderData*)client_data; - (void)decoder; - - if (data->fatal_error) - return FLAC__STREAM_DECODER_READ_STATUS_ABORT; - - /* use up lookahead first */ - if (data->lookahead_length) { - n = min(data->lookahead_length, *bytes); - memcpy(buffer, data->lookahead, n); - buffer += n; - data->lookahead += n; - data->lookahead_length -= n; - } - - /* get the rest from file */ - if (*bytes > n) { - *bytes = n + fread(buffer, 1, *bytes-n, data->encoder_session->fin); - if(ferror(data->encoder_session->fin)) - return FLAC__STREAM_DECODER_READ_STATUS_ABORT; - else if(0 == *bytes) - return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; - else - return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; - } - else - return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; -} - -FLAC__StreamDecoderSeekStatus flac_decoder_seek_callback(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) -{ - FLACDecoderData *data = (FLACDecoderData*)client_data; - (void)decoder; - - if(fseeko(data->encoder_session->fin, (off_t)absolute_byte_offset, SEEK_SET) < 0) - return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; - else - return FLAC__STREAM_DECODER_SEEK_STATUS_OK; -} - -FLAC__StreamDecoderTellStatus flac_decoder_tell_callback(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data) -{ - FLACDecoderData *data = (FLACDecoderData*)client_data; - off_t pos; - (void)decoder; - - if((pos = ftello(data->encoder_session->fin)) < 0) - return FLAC__STREAM_DECODER_TELL_STATUS_ERROR; - else { - *absolute_byte_offset = (FLAC__uint64)pos; - return FLAC__STREAM_DECODER_TELL_STATUS_OK; - } -} - -FLAC__StreamDecoderLengthStatus flac_decoder_length_callback(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data) -{ - FLACDecoderData *data = (FLACDecoderData*)client_data; - (void)decoder; - - if(0 == data->filesize) - return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR; - else { - *stream_length = (FLAC__uint64)data->filesize; - return FLAC__STREAM_DECODER_LENGTH_STATUS_OK; - } -} - -FLAC__bool flac_decoder_eof_callback(const FLAC__StreamDecoder *decoder, void *client_data) -{ - FLACDecoderData *data = (FLACDecoderData*)client_data; - (void)decoder; - - return feof(data->encoder_session->fin)? true : false; -} - -FLAC__StreamDecoderWriteStatus flac_decoder_write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data) -{ - FLACDecoderData *data = (FLACDecoderData*)client_data; - FLAC__uint64 n = min(data->samples_left_to_process, frame->header.blocksize); - (void)decoder; - - if(!EncoderSession_process(data->encoder_session, buffer, (unsigned)n)) { - print_error_with_state(data->encoder_session, "ERROR during encoding"); - data->fatal_error = true; - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - } - - data->samples_left_to_process -= n; - return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; -} - -void flac_decoder_metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) -{ - FLACDecoderData *data = (FLACDecoderData*)client_data; - (void)decoder; - - if (data->fatal_error) - return; - - if ( - data->num_metadata_blocks == sizeof(data->metadata_blocks)/sizeof(data->metadata_blocks[0]) || - 0 == (data->metadata_blocks[data->num_metadata_blocks] = FLAC__metadata_object_clone(metadata)) - ) - data->fatal_error = true; - else - data->num_metadata_blocks++; -} - -void flac_decoder_error_callback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) -{ - FLACDecoderData *data = (FLACDecoderData*)client_data; - (void)decoder; - - flac__utils_printf(stderr, 1, "%s: ERROR got %s while decoding FLAC input\n", data->encoder_session->inbasefilename, FLAC__StreamDecoderErrorStatusString[status]); - if(!data->encoder_session->continue_through_decode_errors) - data->fatal_error = true; -} - -FLAC__bool parse_cuesheet(FLAC__StreamMetadata **cuesheet, const char *cuesheet_filename, const char *inbasefilename, FLAC__bool is_cdda, FLAC__uint64 lead_out_offset, FLAC__bool treat_warnings_as_errors) -{ - FILE *f; - unsigned last_line_read; - const char *error_message; - - if(0 == cuesheet_filename) - return true; - - if(lead_out_offset == 0) { - flac__utils_printf(stderr, 1, "%s: ERROR cannot import cuesheet when the number of input samples to encode is unknown\n", inbasefilename); - return false; - } - - if(0 == (f = fopen(cuesheet_filename, "r"))) { - flac__utils_printf(stderr, 1, "%s: ERROR opening cuesheet \"%s\" for reading: %s\n", inbasefilename, cuesheet_filename, strerror(errno)); - return false; - } - - *cuesheet = grabbag__cuesheet_parse(f, &error_message, &last_line_read, is_cdda, lead_out_offset); - - fclose(f); - - if(0 == *cuesheet) { - flac__utils_printf(stderr, 1, "%s: ERROR parsing cuesheet \"%s\" on line %u: %s\n", inbasefilename, cuesheet_filename, last_line_read, error_message); - return false; - } - - if(!FLAC__format_cuesheet_is_legal(&(*cuesheet)->data.cue_sheet, /*check_cd_da_subset=*/false, &error_message)) { - flac__utils_printf(stderr, 1, "%s: ERROR parsing cuesheet \"%s\": %s\n", inbasefilename, cuesheet_filename, error_message); - return false; - } - - /* if we're expecting CDDA, warn about non-compliance */ - if(is_cdda && !FLAC__format_cuesheet_is_legal(&(*cuesheet)->data.cue_sheet, /*check_cd_da_subset=*/true, &error_message)) { - flac__utils_printf(stderr, 1, "%s: WARNING cuesheet \"%s\" is not audio CD compliant: %s\n", inbasefilename, cuesheet_filename, error_message); - if(treat_warnings_as_errors) - return false; - (*cuesheet)->data.cue_sheet.is_cd = false; - } - - return true; -} - -void print_stats(const EncoderSession *encoder_session) -{ - const FLAC__uint64 samples_written = min(encoder_session->total_samples_to_encode, encoder_session->samples_written); -#if defined _MSC_VER || defined __MINGW32__ - /* with MSVC you have to spoon feed it the casting */ - const double progress = (double)(FLAC__int64)samples_written / (double)(FLAC__int64)encoder_session->total_samples_to_encode; - const double ratio = (double)(FLAC__int64)encoder_session->bytes_written / ((double)(FLAC__int64)encoder_session->unencoded_size * min(1.0, progress)); -#else - const double progress = (double)samples_written / (double)encoder_session->total_samples_to_encode; - const double ratio = (double)encoder_session->bytes_written / ((double)encoder_session->unencoded_size * min(1.0, progress)); -#endif - - FLAC__ASSERT(encoder_session->total_samples_to_encode > 0); - - if(samples_written == encoder_session->total_samples_to_encode) { - flac__utils_printf(stderr, 2, "\r%s:%s wrote %u bytes, ratio=%0.3f", - encoder_session->inbasefilename, - encoder_session->verify? " Verify OK," : "", - (unsigned)encoder_session->bytes_written, - ratio - ); - } - else { - flac__utils_printf(stderr, 2, "\r%s: %u%% complete, ratio=%0.3f", encoder_session->inbasefilename, (unsigned)floor(progress * 100.0 + 0.5), ratio); - } -} - -void print_error_with_init_status(const EncoderSession *e, const char *message, FLAC__StreamEncoderInitStatus init_status) -{ - const int ilen = strlen(e->inbasefilename) + 1; - const char *state_string = ""; - - flac__utils_printf(stderr, 1, "\n%s: %s\n", e->inbasefilename, message); - - flac__utils_printf(stderr, 1, "%*s init_status = %s\n", ilen, "", FLAC__StreamEncoderInitStatusString[init_status]); - - if(init_status == FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR) { - state_string = FLAC__stream_encoder_get_resolved_state_string(e->encoder); - - flac__utils_printf(stderr, 1, "%*s state = %s\n", ilen, "", state_string); - - /* print out some more info for some errors: */ - if(0 == strcmp(state_string, FLAC__StreamEncoderStateString[FLAC__STREAM_ENCODER_CLIENT_ERROR])) { - flac__utils_printf(stderr, 1, - "\n" - "An error occurred while writing; the most common cause is that the disk is full.\n" - ); - } - else if(0 == strcmp(state_string, FLAC__StreamEncoderStateString[FLAC__STREAM_ENCODER_IO_ERROR])) { - flac__utils_printf(stderr, 1, - "\n" - "An error occurred opening the output file; it is likely that the output\n" - "directory does not exist or is not writable, the output file already exists and\n" - "is not writable, or the disk is full.\n" - ); - } - } - else if(init_status == FLAC__STREAM_ENCODER_INIT_STATUS_NOT_STREAMABLE) { - flac__utils_printf(stderr, 1, - "\n" - "The encoding parameters specified do not conform to the FLAC Subset and may not\n" - "be streamable or playable in hardware devices. If you really understand the\n" - "consequences, you can add --lax to the command-line options to encode with\n" - "these parameters anyway. See http://flac.sourceforge.net/format.html#subset\n" - ); - } -} - -void print_error_with_state(const EncoderSession *e, const char *message) -{ - const int ilen = strlen(e->inbasefilename) + 1; - const char *state_string; - - flac__utils_printf(stderr, 1, "\n%s: %s\n", e->inbasefilename, message); - - state_string = FLAC__stream_encoder_get_resolved_state_string(e->encoder); - - flac__utils_printf(stderr, 1, "%*s state = %s\n", ilen, "", state_string); - - /* print out some more info for some errors: */ - if(0 == strcmp(state_string, FLAC__StreamEncoderStateString[FLAC__STREAM_ENCODER_CLIENT_ERROR])) { - flac__utils_printf(stderr, 1, - "\n" - "An error occurred while writing; the most common cause is that the disk is full.\n" - ); - } -} - -void print_verify_error(EncoderSession *e) -{ - FLAC__uint64 absolute_sample; - unsigned frame_number; - unsigned channel; - unsigned sample; - FLAC__int32 expected; - FLAC__int32 got; - - FLAC__stream_encoder_get_verify_decoder_error_stats(e->encoder, &absolute_sample, &frame_number, &channel, &sample, &expected, &got); - - flac__utils_printf(stderr, 1, "%s: ERROR: mismatch in decoded data, verify FAILED!\n", e->inbasefilename); - flac__utils_printf(stderr, 1, " Absolute sample=%u, frame=%u, channel=%u, sample=%u, expected %d, got %d\n", (unsigned)absolute_sample, frame_number, channel, sample, expected, got); - flac__utils_printf(stderr, 1, " In all known cases, verify errors are caused by hardware problems,\n"); - flac__utils_printf(stderr, 1, " usually overclocking or bad RAM. Delete %s\n", e->outfilename); - flac__utils_printf(stderr, 1, " and repeat the flac command exactly as before. If it does not give a\n"); - flac__utils_printf(stderr, 1, " verify error in the exact same place each time you try it, then there is\n"); - flac__utils_printf(stderr, 1, " a problem with your hardware; please see the FAQ:\n"); - flac__utils_printf(stderr, 1, " http://flac.sourceforge.net/faq.html#tools__hardware_prob\n"); - flac__utils_printf(stderr, 1, " If it does fail in the exact same place every time, keep\n"); - flac__utils_printf(stderr, 1, " %s and submit a bug report to:\n", e->outfilename); - flac__utils_printf(stderr, 1, " https://sourceforge.net/bugs/?func=addbug&group_id=13478\n"); - flac__utils_printf(stderr, 1, " Make sure to upload the FLAC file and use the \"Monitor\" feature to\n"); - flac__utils_printf(stderr, 1, " monitor the bug status.\n"); - flac__utils_printf(stderr, 1, "Verify FAILED! Do not trust %s\n", e->outfilename); -} - -FLAC__bool read_little_endian_uint16(FILE *f, FLAC__uint16 *val, FLAC__bool eof_ok, const char *fn) -{ - size_t bytes_read = fread(val, 1, 2, f); - - if(bytes_read == 0) { - if(!eof_ok) { - flac__utils_printf(stderr, 1, "%s: ERROR: unexpected EOF\n", fn); - return false; - } - else - return true; - } - else if(bytes_read < 2) { - flac__utils_printf(stderr, 1, "%s: ERROR: unexpected EOF\n", fn); - return false; - } - else { - if(is_big_endian_host_) { - FLAC__byte tmp, *b = (FLAC__byte*)val; - tmp = b[1]; b[1] = b[0]; b[0] = tmp; - } - return true; - } -} - -FLAC__bool read_little_endian_uint32(FILE *f, FLAC__uint32 *val, FLAC__bool eof_ok, const char *fn) -{ - size_t bytes_read = fread(val, 1, 4, f); - - if(bytes_read == 0) { - if(!eof_ok) { - flac__utils_printf(stderr, 1, "%s: ERROR: unexpected EOF\n", fn); - return false; - } - else - return true; - } - else if(bytes_read < 4) { - flac__utils_printf(stderr, 1, "%s: ERROR: unexpected EOF\n", fn); - return false; - } - else { - if(is_big_endian_host_) { - FLAC__byte tmp, *b = (FLAC__byte*)val; - tmp = b[3]; b[3] = b[0]; b[0] = tmp; - tmp = b[2]; b[2] = b[1]; b[1] = tmp; - } - return true; - } -} - -FLAC__bool read_big_endian_uint16(FILE *f, FLAC__uint16 *val, FLAC__bool eof_ok, const char *fn) -{ - unsigned char buf[4]; - size_t bytes_read= fread(buf, 1, 2, f); - - if(bytes_read==0U && eof_ok) - return true; - else if(bytes_read<2U) { - flac__utils_printf(stderr, 1, "%s: ERROR: unexpected EOF\n", fn); - return false; - } - - /* this is independent of host endianness */ - *val= (FLAC__uint16)(buf[0])<<8 | buf[1]; - - return true; -} - -FLAC__bool read_big_endian_uint32(FILE *f, FLAC__uint32 *val, FLAC__bool eof_ok, const char *fn) -{ - unsigned char buf[4]; - size_t bytes_read= fread(buf, 1, 4, f); - - if(bytes_read==0U && eof_ok) - return true; - else if(bytes_read<4U) { - flac__utils_printf(stderr, 1, "%s: ERROR: unexpected EOF\n", fn); - return false; - } - - /* this is independent of host endianness */ - *val= (FLAC__uint32)(buf[0])<<24 | (FLAC__uint32)(buf[1])<<16 | - (FLAC__uint32)(buf[2])<<8 | buf[3]; - - return true; -} - -FLAC__bool read_sane_extended(FILE *f, FLAC__uint32 *val, FLAC__bool eof_ok, const char *fn) - /* Read an IEEE 754 80-bit (aka SANE) extended floating point value from 'f', - * convert it into an integral value and store in 'val'. Return false if only - * between 1 and 9 bytes remain in 'f', if 0 bytes remain in 'f' and 'eof_ok' is - * false, or if the value is negative, between zero and one, or too large to be - * represented by 'val'; return true otherwise. - */ -{ - unsigned int i; - unsigned char buf[10]; - size_t bytes_read= fread(buf, 1U, 10U, f); - FLAC__int16 e= ((FLAC__uint16)(buf[0])<<8 | (FLAC__uint16)(buf[1]))-0x3FFF; - FLAC__int16 shift= 63-e; - FLAC__uint64 p= 0U; - - if(bytes_read==0U && eof_ok) - return true; - else if(bytes_read<10U) { - flac__utils_printf(stderr, 1, "%s: ERROR: unexpected EOF\n", fn); - return false; - } - else if((buf[0]>>7)==1U || e<0 || e>63) { - flac__utils_printf(stderr, 1, "%s: ERROR: invalid floating-point value\n", fn); - return false; - } - - for(i= 0U; i<8U; ++i) - p|= (FLAC__uint64)(buf[i+2])<<(56U-i*8); - *val= (FLAC__uint32)((p>>shift)+(p>>(shift-1) & 0x1)); - - return true; -} - -FLAC__bool fskip_ahead(FILE *f, FLAC__uint64 offset) -{ - static unsigned char dump[8192]; - -#ifdef _MSC_VER - if(f == stdin) { - /* MS' stdio impl can't even seek forward on stdin, have to use pure non-fseek() version: */ - while(offset > 0) { - const long need = (long)min(offset, sizeof(dump)); - if((long)fread(dump, 1, need, f) < need) - return false; - offset -= need; - } - } - else -#endif - { - while(offset > 0) { - long need = (long)min(offset, LONG_MAX); - if(fseeko(f, need, SEEK_CUR) < 0) { - need = (long)min(offset, sizeof(dump)); - if((long)fread(dump, 1, need, f) < need) - return false; - } - offset -= need; - } - } - return true; -} - -unsigned count_channel_mask_bits(FLAC__uint32 mask) -{ - unsigned count = 0; - while(mask) { - if(mask & 1) - count++; - mask >>= 1; - } - return count; -} - -#if 0 -FLAC__uint32 limit_channel_mask(FLAC__uint32 mask, unsigned channels) -{ - FLAC__uint32 x = 0x80000000; - unsigned count = count_channel_mask_bits(mask); - while(x && count > channels) { - if(mask & x) { - mask &= ~x; - count--; - } - x >>= 1; - } - FLAC__ASSERT(count_channel_mask_bits(mask) == channels); - return mask; -} -#endif diff --git a/3rdparty/libflac/src/flac/encode.h b/3rdparty/libflac/src/flac/encode.h deleted file mode 100644 index 13ee7d39a02..00000000000 --- a/3rdparty/libflac/src/flac/encode.h +++ /dev/null @@ -1,122 +0,0 @@ -/* flac - Command-line FLAC encoder/decoder - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef flac__encode_h -#define flac__encode_h - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "FLAC/metadata.h" -#include "foreign_metadata.h" -#include "utils.h" - -extern const int FLAC_ENCODE__DEFAULT_PADDING; - -typedef enum { - CST_BLOCKSIZE, - CST_COMPRESSION_LEVEL, - CST_DO_MID_SIDE, - CST_LOOSE_MID_SIDE, - CST_APODIZATION, - CST_MAX_LPC_ORDER, - CST_QLP_COEFF_PRECISION, - CST_DO_QLP_COEFF_PREC_SEARCH, - CST_DO_ESCAPE_CODING, - CST_DO_EXHAUSTIVE_MODEL_SEARCH, - CST_MIN_RESIDUAL_PARTITION_ORDER, - CST_MAX_RESIDUAL_PARTITION_ORDER, - CST_RICE_PARAMETER_SEARCH_DIST -} compression_setting_type_t; - -typedef struct { - compression_setting_type_t type; - union { - FLAC__bool t_bool; - unsigned t_unsigned; - const char *t_string; - } value; -} compression_setting_t; - -typedef struct { - utils__SkipUntilSpecification skip_specification; - utils__SkipUntilSpecification until_specification; - FLAC__bool verify; -#if FLAC__HAS_OGG - FLAC__bool use_ogg; - long serial_number; -#endif - FLAC__bool lax; - int padding; - size_t num_compression_settings; - compression_setting_t compression_settings[64]; - char *requested_seek_points; - int num_requested_seek_points; - const char *cuesheet_filename; - FLAC__bool treat_warnings_as_errors; - FLAC__bool continue_through_decode_errors; /* currently only obeyed when encoding from FLAC or Ogg FLAC */ - FLAC__bool cued_seekpoints; - FLAC__bool channel_map_none; /* --channel-map=none specified, eventually will expand to take actual channel map */ - - /* options related to --replay-gain and --sector-align */ - FLAC__bool is_first_file; - FLAC__bool is_last_file; - FLAC__int32 **align_reservoir; - unsigned *align_reservoir_samples; - FLAC__bool replay_gain; - FLAC__bool ignore_chunk_sizes; - FLAC__bool sector_align; - - FLAC__StreamMetadata *vorbis_comment; - FLAC__StreamMetadata *pictures[64]; - unsigned num_pictures; - - struct { - FLAC__bool disable_constant_subframes; - FLAC__bool disable_fixed_subframes; - FLAC__bool disable_verbatim_subframes; - FLAC__bool do_md5; - } debug; -} encode_options_t; - -typedef struct { - encode_options_t common; - foreign_metadata_t *foreign_metadata; /* NULL unless --keep-foreign-metadata requested */ -} wav_encode_options_t; - -typedef struct { - encode_options_t common; - - FLAC__bool is_big_endian; - FLAC__bool is_unsigned_samples; - unsigned channels; - unsigned bps; - unsigned sample_rate; -} raw_encode_options_t; - -typedef struct { - encode_options_t common; -} flac_encode_options_t; - -int flac__encode_aif(FILE *infile, off_t infilesize, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, unsigned lookahead_length, wav_encode_options_t options, FLAC__bool is_aifc); -int flac__encode_wav(FILE *infile, off_t infilesize, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, unsigned lookahead_length, wav_encode_options_t options); -int flac__encode_raw(FILE *infile, off_t infilesize, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, unsigned lookahead_length, raw_encode_options_t options); -int flac__encode_flac(FILE *infile, off_t infilesize, const char *infilename, const char *outfilename, const FLAC__byte *lookahead, unsigned lookahead_length, flac_encode_options_t options, FLAC__bool input_is_ogg); - -#endif diff --git a/3rdparty/libflac/src/flac/flac.dsp b/3rdparty/libflac/src/flac/flac.dsp deleted file mode 100644 index ae2ad597d00..00000000000 --- a/3rdparty/libflac/src/flac/flac.dsp +++ /dev/null @@ -1,156 +0,0 @@ -# Microsoft Developer Studio Project File - Name="flac" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=flac - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "flac.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "flac.mak" CFG="flac - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "flac - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "flac - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "flac - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\obj\release\bin" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\..\include" /D "NDEBUG" /D "FLAC__NO_DLL" /D "FLAC__HAS_OGG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\..\obj\release\lib\grabbag_static.lib ..\..\obj\release\lib\libFLAC_static.lib ..\..\obj\release\lib\replaygain_analysis_static.lib ..\..\obj\release\lib\replaygain_synthesis_static.lib ..\..\obj\release\lib\getopt_static.lib ..\..\obj\release\lib\utf8_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "flac - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\obj\debug\bin" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "..\..\include" /D "_DEBUG" /D "DEBUG" /D "FLAC__NO_DLL" /D "FLAC__HAS_OGG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\..\obj\debug\lib\grabbag_static.lib ..\..\obj\debug\lib\libFLAC_static.lib ..\..\obj\debug\lib\replaygain_analysis_static.lib ..\..\obj\debug\lib\replaygain_synthesis_static.lib ..\..\obj\debug\lib\getopt_static.lib ..\..\obj\debug\lib\utf8_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "flac - Win32 Release" -# Name "flac - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\analyze.c -# End Source File -# Begin Source File - -SOURCE=.\decode.c -# End Source File -# Begin Source File - -SOURCE=.\encode.c -# End Source File -# Begin Source File - -SOURCE=.\foreign_metadata.c -# End Source File -# Begin Source File - -SOURCE=.\main.c -# End Source File -# Begin Source File - -SOURCE=.\local_string_utils.c -# End Source File -# Begin Source File - -SOURCE=.\utils.c -# End Source File -# Begin Source File - -SOURCE=.\vorbiscomment.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\analyze.h -# End Source File -# Begin Source File - -SOURCE=.\decode.h -# End Source File -# Begin Source File - -SOURCE=.\encode.h -# End Source File -# Begin Source File - -SOURCE=.\foreign_metadata.h -# End Source File -# Begin Source File - -SOURCE=.\local_string_utils.h -# End Source File -# Begin Source File - -SOURCE=.\utils.h -# End Source File -# Begin Source File - -SOURCE=.\vorbiscomment.h -# End Source File -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/flac/flac.vcproj b/3rdparty/libflac/src/flac/flac.vcproj deleted file mode 100644 index 0680364335e..00000000000 --- a/3rdparty/libflac/src/flac/flac.vcproj +++ /dev/null @@ -1,260 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="flac" - ProjectGUID="{4cefbc7d-c215-11db-8314-0800200c9a66}" - RootNamespace="flac" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\obj\debug\bin" - IntermediateDirectory="Debug" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".;..\..\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;FLAC__HAS_OGG;FLAC__NO_DLL;DEBUG" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="..\..\obj\release\lib\ogg_static.lib" - LinkIncremental="2" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\obj\release\bin" - IntermediateDirectory="Release" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".;..\..\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__HAS_OGG;FLAC__NO_DLL" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="..\..\obj\release\lib\ogg_static.lib" - LinkIncremental="1" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" - LinkTimeCodeGeneration="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath=".\analyze.h" - > - </File> - <File - RelativePath=".\decode.h" - > - </File> - <File - RelativePath=".\encode.h" - > - </File> - <File - RelativePath=".\foreign_metadata.h" - > - </File> - <File - RelativePath=".\local_string_utils.h" - > - </File> - <File - RelativePath=".\utils.h" - > - </File> - <File - RelativePath=".\vorbiscomment.h" - > - </File> - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\analyze.c" - > - </File> - <File - RelativePath=".\decode.c" - > - </File> - <File - RelativePath=".\encode.c" - > - </File> - <File - RelativePath=".\foreign_metadata.c" - > - </File> - <File - RelativePath=".\local_string_utils.c" - > - </File> - <File - RelativePath=".\main.c" - > - </File> - <File - RelativePath=".\utils.c" - > - </File> - <File - RelativePath=".\vorbiscomment.c" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/flac/foreign_metadata.c b/3rdparty/libflac/src/flac/foreign_metadata.c deleted file mode 100644 index 3fc5310bbf4..00000000000 --- a/3rdparty/libflac/src/flac/foreign_metadata.c +++ /dev/null @@ -1,588 +0,0 @@ -/* flac - Command-line FLAC encoder/decoder - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#if defined _MSC_VER || defined __MINGW32__ -#include <sys/types.h> /* for off_t */ -#if _MSC_VER <= 1600 /* @@@ [2G limit] */ -#define fseeko fseek -#define ftello ftell -#endif -#endif -#include <stdio.h> /* for FILE etc. */ -#include <stdlib.h> /* for calloc() etc. */ -#include <string.h> /* for memcmp() etc. */ -#include "FLAC/assert.h" -#include "FLAC/metadata.h" -#include "share/alloc.h" -#include "foreign_metadata.h" - -#ifdef min -#undef min -#endif -#define min(x,y) ((x)<(y)?(x):(y)) - - -static const char *FLAC__FOREIGN_METADATA_APPLICATION_ID[2] = { "aiff" , "riff" }; - -static FLAC__uint32 unpack32be_(const FLAC__byte *b) -{ - return ((FLAC__uint32)b[0]<<24) + ((FLAC__uint32)b[1]<<16) + ((FLAC__uint32)b[2]<<8) + (FLAC__uint32)b[3]; -} - -static FLAC__uint32 unpack32le_(const FLAC__byte *b) -{ - return (FLAC__uint32)b[0] + ((FLAC__uint32)b[1]<<8) + ((FLAC__uint32)b[2]<<16) + ((FLAC__uint32)b[3]<<24); -} - -static FLAC__bool copy_data_(FILE *fin, FILE *fout, size_t size, const char **error, const char * const read_error, const char * const write_error) -{ - static FLAC__byte buffer[4096]; - size_t left; - for(left = size; left > 0; ) { - size_t need = min(sizeof(buffer), left); - if(fread(buffer, 1, need, fin) < need) { - if(error) *error = read_error; - return false; - } - if(fwrite(buffer, 1, need, fout) < need) { - if(error) *error = write_error; - return false; - } - left -= need; - } - return true; -} - -static FLAC__bool append_block_(foreign_metadata_t *fm, off_t offset, FLAC__uint32 size, const char **error) -{ - foreign_block_t *fb = safe_realloc_muladd2_(fm->blocks, sizeof(foreign_block_t), /*times (*/fm->num_blocks, /*+*/1/*)*/); - if(fb) { - fb[fm->num_blocks].offset = offset; - fb[fm->num_blocks].size = size; - fm->num_blocks++; - fm->blocks = fb; - return true; - } - if(error) *error = "out of memory"; - return false; -} - -static FLAC__bool read_from_aiff_(foreign_metadata_t *fm, FILE *f, const char **error) -{ - FLAC__byte buffer[12]; - off_t offset, eof_offset; - if((offset = ftello(f)) < 0) { - if(error) *error = "ftello() error (001)"; - return false; - } - if(fread(buffer, 1, 12, f) < 12 || memcmp(buffer, "FORM", 4) || (memcmp(buffer+8, "AIFF", 4) && memcmp(buffer+8, "AIFC", 4))) { - if(error) *error = "unsupported FORM layout (002)"; - return false; - } - if(!append_block_(fm, offset, 12, error)) - return false; - eof_offset = 8 + unpack32be_(buffer+4); - while(!feof(f)) { - FLAC__uint32 size; - if((offset = ftello(f)) < 0) { - if(error) *error = "ftello() error (003)"; - return false; - } - if((size = fread(buffer, 1, 8, f)) < 8) { - if(size == 0 && feof(f)) - break; - if(error) *error = "invalid AIFF file (004)"; - return false; - } - size = unpack32be_(buffer+4); - /* check if pad byte needed */ - if(size & 1) - size++; - if(!memcmp(buffer, "COMM", 4)) { - if(fm->format_block) { - if(error) *error = "invalid AIFF file: multiple \"COMM\" chunks (005)"; - return false; - } - if(fm->audio_block) { - if(error) *error = "invalid AIFF file: \"SSND\" chunk before \"COMM\" chunk (006)"; - return false; - } - fm->format_block = fm->num_blocks; - } - else if(!memcmp(buffer, "SSND", 4)) { - if(fm->audio_block) { - if(error) *error = "invalid AIFF file: multiple \"SSND\" chunks (007)"; - return false; - } - if(!fm->format_block) { - if(error) *error = "invalid AIFF file: \"SSND\" chunk before \"COMM\" chunk (008)"; - return false; - } - fm->audio_block = fm->num_blocks; - /* read #offset bytes */ - if(fread(buffer+8, 1, 4, f) < 4) { - if(error) *error = "invalid AIFF file (009)"; - return false; - } - fm->ssnd_offset_size = unpack32be_(buffer+8); - if(fseeko(f, -4, SEEK_CUR) < 0) { - if(error) *error = "invalid AIFF file: seek error (010)"; - return false; - } - } - if(!append_block_(fm, offset, 8 + (memcmp(buffer, "SSND", 4)? size : 8 + fm->ssnd_offset_size), error)) - return false; - if(fseeko(f, size, SEEK_CUR) < 0) { - if(error) *error = "invalid AIFF file: seek error (011)"; - return false; - } - } - if(eof_offset != ftello(f)) { - if(error) *error = "invalid AIFF file: unexpected EOF (012)"; - return false; - } - if(!fm->format_block) { - if(error) *error = "invalid AIFF file: missing \"COMM\" chunk (013)"; - return false; - } - if(!fm->audio_block) { - if(error) *error = "invalid AIFF file: missing \"SSND\" chunk (014)"; - return false; - } - return true; -} - -static FLAC__bool read_from_wave_(foreign_metadata_t *fm, FILE *f, const char **error) -{ - FLAC__byte buffer[12]; - off_t offset, eof_offset; - if((offset = ftello(f)) < 0) { - if(error) *error = "ftello() error (001)"; - return false; - } - if(fread(buffer, 1, 12, f) < 12 || memcmp(buffer, "RIFF", 4) || memcmp(buffer+8, "WAVE", 4)) { - if(error) *error = "unsupported RIFF layout (002)"; - return false; - } - if(!append_block_(fm, offset, 12, error)) - return false; - eof_offset = 8 + unpack32le_(buffer+4); - while(!feof(f)) { - FLAC__uint32 size; - if((offset = ftello(f)) < 0) { - if(error) *error = "ftello() error (003)"; - return false; - } - if((size = fread(buffer, 1, 8, f)) < 8) { - if(size == 0 && feof(f)) - break; - if(error) *error = "invalid WAVE file (004)"; - return false; - } - size = unpack32le_(buffer+4); - /* check if pad byte needed */ - if(size & 1) - size++; - if(!memcmp(buffer, "fmt ", 4)) { - if(fm->format_block) { - if(error) *error = "invalid WAVE file: multiple \"fmt \" chunks (005)"; - return false; - } - if(fm->audio_block) { - if(error) *error = "invalid WAVE file: \"data\" chunk before \"fmt \" chunk (006)"; - return false; - } - fm->format_block = fm->num_blocks; - } - else if(!memcmp(buffer, "data", 4)) { - if(fm->audio_block) { - if(error) *error = "invalid WAVE file: multiple \"data\" chunks (007)"; - return false; - } - if(!fm->format_block) { - if(error) *error = "invalid WAVE file: \"data\" chunk before \"fmt \" chunk (008)"; - return false; - } - fm->audio_block = fm->num_blocks; - } - if(!append_block_(fm, offset, 8 + (memcmp(buffer, "data", 4)? size : 0), error)) - return false; - if(fseeko(f, size, SEEK_CUR) < 0) { - if(error) *error = "invalid WAVE file: seek error (009)"; - return false; - } - } - if(eof_offset != ftello(f)) { - if(error) *error = "invalid WAVE file: unexpected EOF (010)"; - return false; - } - if(!fm->format_block) { - if(error) *error = "invalid WAVE file: missing \"fmt \" chunk (011)"; - return false; - } - if(!fm->audio_block) { - if(error) *error = "invalid WAVE file: missing \"data\" chunk (012)"; - return false; - } - return true; -} - -static FLAC__bool write_to_flac_(foreign_metadata_t *fm, FILE *fin, FILE *fout, FLAC__Metadata_SimpleIterator *it, const char **error) -{ - FLAC__byte buffer[4]; - const unsigned ID_LEN = FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8; - size_t block_num = 0; - FLAC__ASSERT(sizeof(buffer) >= ID_LEN); - while(block_num < fm->num_blocks) { - /* find next matching padding block */ - do { - /* even on the first chunk's loop there will be a skippable STREAMINFO block, on subsequent loops we are first moving past the PADDING we just used */ - if(!FLAC__metadata_simple_iterator_next(it)) { - if(error) *error = "no matching PADDING block found (004)"; - return false; - } - } while(FLAC__metadata_simple_iterator_get_block_type(it) != FLAC__METADATA_TYPE_PADDING); - if(FLAC__metadata_simple_iterator_get_block_length(it) != ID_LEN+fm->blocks[block_num].size) { - if(error) *error = "PADDING block with wrong size found (005)"; - return false; - } - /* transfer chunk into APPLICATION block */ - /* first set up the file pointers */ - if(fseeko(fin, fm->blocks[block_num].offset, SEEK_SET) < 0) { - if(error) *error = "seek failed in WAVE/AIFF file (006)"; - return false; - } - if(fseeko(fout, FLAC__metadata_simple_iterator_get_block_offset(it), SEEK_SET) < 0) { - if(error) *error = "seek failed in FLAC file (007)"; - return false; - } - /* update the type */ - buffer[0] = FLAC__METADATA_TYPE_APPLICATION; - if(FLAC__metadata_simple_iterator_is_last(it)) - buffer[0] |= 0x80; /*MAGIC number*/ - if(fwrite(buffer, 1, 1, fout) < 1) { - if(error) *error = "write failed in FLAC file (008)"; - return false; - } - /* length stays the same so skip over it */ - if(fseeko(fout, FLAC__STREAM_METADATA_LENGTH_LEN/8, SEEK_CUR) < 0) { - if(error) *error = "seek failed in FLAC file (009)"; - return false; - } - /* write the APPLICATION ID */ - memcpy(buffer, FLAC__FOREIGN_METADATA_APPLICATION_ID[fm->type], ID_LEN); - if(fwrite(buffer, 1, ID_LEN, fout) < ID_LEN) { - if(error) *error = "write failed in FLAC file (010)"; - return false; - } - /* transfer the foreign metadata */ - if(!copy_data_(fin, fout, fm->blocks[block_num].size, error, "read failed in WAVE/AIFF file (011)", "write failed in FLAC file (012)")) - return false; - block_num++; - } - return true; -} - -static FLAC__bool read_from_flac_(foreign_metadata_t *fm, FILE *f, FLAC__Metadata_SimpleIterator *it, const char **error) -{ - FLAC__byte id[4], buffer[12]; - off_t offset; - FLAC__bool type_found = false; - - FLAC__ASSERT(FLAC__STREAM_METADATA_APPLICATION_ID_LEN == sizeof(id)*8); - - while(FLAC__metadata_simple_iterator_next(it)) { - if(FLAC__metadata_simple_iterator_get_block_type(it) != FLAC__METADATA_TYPE_APPLICATION) - continue; - if(!FLAC__metadata_simple_iterator_get_application_id(it, id)) { - if(error) *error = "FLAC__metadata_simple_iterator_get_application_id() error (003)"; - return false; - } - if(memcmp(id, FLAC__FOREIGN_METADATA_APPLICATION_ID[fm->type], sizeof(id))) - continue; - offset = FLAC__metadata_simple_iterator_get_block_offset(it); - /* skip over header and app ID */ - offset += (FLAC__STREAM_METADATA_IS_LAST_LEN + FLAC__STREAM_METADATA_TYPE_LEN + FLAC__STREAM_METADATA_LENGTH_LEN) / 8; - offset += sizeof(id); - /* look for format or audio blocks */ - if(fseek(f, offset, SEEK_SET) < 0) { - if(error) *error = "seek error (004)"; - return false; - } - if(fread(buffer, 1, 4, f) != 4) { - if(error) *error = "read error (005)"; - return false; - } - if(fm->num_blocks == 0) { - if(fm->type == FOREIGN_BLOCK_TYPE__RIFF && 0 == memcmp(buffer, "RIFF", 4)) - type_found = true; - else if(fm->type == FOREIGN_BLOCK_TYPE__AIFF && 0 == memcmp(buffer, "FORM", 4)) - type_found = true; - else { - if(error) *error = "unsupported foreign metadata found, may need newer FLAC decoder (005)"; - return false; - } - } - else if(!type_found) { - FLAC__ASSERT(0); - /* double protection: */ - if(error) *error = "unsupported foreign metadata found, may need newer FLAC decoder (006)"; - return false; - } - else if(fm->type == FOREIGN_BLOCK_TYPE__RIFF) { - if(!memcmp(buffer, "fmt ", 4)) { - if(fm->format_block) { - if(error) *error = "invalid WAVE metadata: multiple \"fmt \" chunks (007)"; - return false; - } - if(fm->audio_block) { - if(error) *error = "invalid WAVE metadata: \"data\" chunk before \"fmt \" chunk (008)"; - return false; - } - fm->format_block = fm->num_blocks; - } - else if(!memcmp(buffer, "data", 4)) { - if(fm->audio_block) { - if(error) *error = "invalid WAVE metadata: multiple \"data\" chunks (009)"; - return false; - } - if(!fm->format_block) { - if(error) *error = "invalid WAVE metadata: \"data\" chunk before \"fmt \" chunk (010)"; - return false; - } - fm->audio_block = fm->num_blocks; - } - } - else if(fm->type == FOREIGN_BLOCK_TYPE__AIFF) { - if(!memcmp(buffer, "COMM", 4)) { - if(fm->format_block) { - if(error) *error = "invalid AIFF metadata: multiple \"COMM\" chunks (011)"; - return false; - } - if(fm->audio_block) { - if(error) *error = "invalid AIFF metadata: \"SSND\" chunk before \"COMM\" chunk (012)"; - return false; - } - fm->format_block = fm->num_blocks; - } - else if(!memcmp(buffer, "SSND", 4)) { - if(fm->audio_block) { - if(error) *error = "invalid AIFF metadata: multiple \"SSND\" chunks (013)"; - return false; - } - if(!fm->format_block) { - if(error) *error = "invalid AIFF metadata: \"SSND\" chunk before \"COMM\" chunk (014)"; - return false; - } - fm->audio_block = fm->num_blocks; - /* read SSND offset size */ - if(fread(buffer+4, 1, 8, f) != 8) { - if(error) *error = "read error (015)"; - return false; - } - fm->ssnd_offset_size = unpack32be_(buffer+8); - } - } - else { - FLAC__ASSERT(0); - /* double protection: */ - if(error) *error = "unsupported foreign metadata found, may need newer FLAC decoder (016)"; - return false; - } - if(!append_block_(fm, offset, FLAC__metadata_simple_iterator_get_block_length(it)-sizeof(id), error)) - return false; - } - if(!type_found) { - if(error) *error = "no foreign metadata found (017)"; - return false; - } - if(!fm->format_block) { - if(error) *error = fm->type==FOREIGN_BLOCK_TYPE__RIFF? "invalid WAVE file: missing \"fmt \" chunk (018)" : "invalid AIFF file: missing \"COMM\" chunk (018)"; - return false; - } - if(!fm->audio_block) { - if(error) *error = fm->type==FOREIGN_BLOCK_TYPE__RIFF? "invalid WAVE file: missing \"data\" chunk (019)" : "invalid AIFF file: missing \"SSND\" chunk (019)"; - return false; - } - return true; -} - -static FLAC__bool write_to_iff_(foreign_metadata_t *fm, FILE *fin, FILE *fout, off_t offset1, off_t offset2, off_t offset3, const char **error) -{ - size_t i; - if(fseeko(fout, offset1, SEEK_SET) < 0) { - if(error) *error = "seek failed in WAVE/AIFF file (002)"; - return false; - } - for(i = 1; i < fm->format_block; i++) { - if(fseeko(fin, fm->blocks[i].offset, SEEK_SET) < 0) { - if(error) *error = "seek failed in FLAC file (003)"; - return false; - } - if(!copy_data_(fin, fout, fm->blocks[i].size, error, "read failed in WAVE/AIFF file (004)", "write failed in FLAC file (005)")) - return false; - } - if(fseeko(fout, offset2, SEEK_SET) < 0) { - if(error) *error = "seek failed in WAVE/AIFF file (006)"; - return false; - } - for(i = fm->format_block+1; i < fm->audio_block; i++) { - if(fseeko(fin, fm->blocks[i].offset, SEEK_SET) < 0) { - if(error) *error = "seek failed in FLAC file (007)"; - return false; - } - if(!copy_data_(fin, fout, fm->blocks[i].size, error, "read failed in WAVE/AIFF file (008)", "write failed in FLAC file (009)")) - return false; - } - if(fseeko(fout, offset3, SEEK_SET) < 0) { - if(error) *error = "seek failed in WAVE/AIFF file (010)"; - return false; - } - for(i = fm->audio_block+1; i < fm->num_blocks; i++) { - if(fseeko(fin, fm->blocks[i].offset, SEEK_SET) < 0) { - if(error) *error = "seek failed in FLAC file (011)"; - return false; - } - if(!copy_data_(fin, fout, fm->blocks[i].size, error, "read failed in WAVE/AIFF file (012)", "write failed in FLAC file (013)")) - return false; - } - return true; -} - -foreign_metadata_t *flac__foreign_metadata_new(foreign_block_type_t type) -{ - foreign_metadata_t *x = (foreign_metadata_t*)calloc(sizeof(foreign_metadata_t), 1); - if(x) - x->type = type; - return x; -} - -void flac__foreign_metadata_delete(foreign_metadata_t *fm) -{ - if(fm) { - if(fm->blocks) - free(fm->blocks); - free(fm); - } -} - -FLAC__bool flac__foreign_metadata_read_from_aiff(foreign_metadata_t *fm, const char *filename, const char **error) -{ - FLAC__bool ok; - FILE *f = fopen(filename, "rb"); - if(!f) { - if(error) *error = "can't open AIFF file for reading (000)"; - return false; - } - ok = read_from_aiff_(fm, f, error); - fclose(f); - return ok; -} - -FLAC__bool flac__foreign_metadata_read_from_wave(foreign_metadata_t *fm, const char *filename, const char **error) -{ - FLAC__bool ok; - FILE *f = fopen(filename, "rb"); - if(!f) { - if(error) *error = "can't open WAVE file for reading (000)"; - return false; - } - ok = read_from_wave_(fm, f, error); - fclose(f); - return ok; -} - -FLAC__bool flac__foreign_metadata_write_to_flac(foreign_metadata_t *fm, const char *infilename, const char *outfilename, const char **error) -{ - FLAC__bool ok; - FILE *fin, *fout; - FLAC__Metadata_SimpleIterator *it = FLAC__metadata_simple_iterator_new(); - if(!it) { - if(error) *error = "out of memory (000)"; - return false; - } - if(!FLAC__metadata_simple_iterator_init(it, outfilename, /*read_only=*/true, /*preserve_file_stats=*/false)) { - if(error) *error = "can't initialize iterator (001)"; - FLAC__metadata_simple_iterator_delete(it); - return false; - } - if(0 == (fin = fopen(infilename, "rb"))) { - if(error) *error = "can't open WAVE/AIFF file for reading (002)"; - FLAC__metadata_simple_iterator_delete(it); - return false; - } - if(0 == (fout = fopen(outfilename, "r+b"))) { - if(error) *error = "can't open FLAC file for updating (003)"; - FLAC__metadata_simple_iterator_delete(it); - fclose(fin); - return false; - } - ok = write_to_flac_(fm, fin, fout, it, error); - FLAC__metadata_simple_iterator_delete(it); - fclose(fin); - fclose(fout); - return ok; -} - -FLAC__bool flac__foreign_metadata_read_from_flac(foreign_metadata_t *fm, const char *filename, const char **error) -{ - FLAC__bool ok; - FILE *f; - FLAC__Metadata_SimpleIterator *it = FLAC__metadata_simple_iterator_new(); - if(!it) { - if(error) *error = "out of memory (000)"; - return false; - } - if(!FLAC__metadata_simple_iterator_init(it, filename, /*read_only=*/true, /*preserve_file_stats=*/false)) { - if(error) *error = "can't initialize iterator (001)"; - FLAC__metadata_simple_iterator_delete(it); - return false; - } - if(0 == (f = fopen(filename, "rb"))) { - if(error) *error = "can't open FLAC file for reading (002)"; - FLAC__metadata_simple_iterator_delete(it); - return false; - } - ok = read_from_flac_(fm, f, it, error); - FLAC__metadata_simple_iterator_delete(it); - fclose(f); - return ok; -} - -FLAC__bool flac__foreign_metadata_write_to_iff(foreign_metadata_t *fm, const char *infilename, const char *outfilename, off_t offset1, off_t offset2, off_t offset3, const char **error) -{ - FLAC__bool ok; - FILE *fin, *fout; - if(0 == (fin = fopen(infilename, "rb"))) { - if(error) *error = "can't open FLAC file for reading (000)"; - return false; - } - if(0 == (fout = fopen(outfilename, "r+b"))) { - if(error) *error = "can't open WAVE/AIFF file for updating (001)"; - fclose(fin); - return false; - } - ok = write_to_iff_(fm, fin, fout, offset1, offset2, offset3, error); - fclose(fin); - fclose(fout); - return ok; -} diff --git a/3rdparty/libflac/src/flac/foreign_metadata.h b/3rdparty/libflac/src/flac/foreign_metadata.h deleted file mode 100644 index baeda20e9cd..00000000000 --- a/3rdparty/libflac/src/flac/foreign_metadata.h +++ /dev/null @@ -1,59 +0,0 @@ -/* flac - Command-line FLAC encoder/decoder - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef flac__foreign_metadata_h -#define flac__foreign_metadata_h - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "FLAC/metadata.h" -#include "utils.h" - -/* WATCHOUT: these enums are used to index internal arrays */ -typedef enum { FOREIGN_BLOCK_TYPE__AIFF = 0, FOREIGN_BLOCK_TYPE__RIFF = 1 } foreign_block_type_t; - -typedef struct { - /* for encoding, this will be the offset in the WAVE/AIFF file of the chunk */ - /* for decoding, this will be the offset in the FLAC file of the chunk data inside the APPLICATION block */ - off_t offset; - FLAC__uint32 size; -} foreign_block_t; - -typedef struct { - foreign_block_type_t type; /* currently we don't support multiple foreign types in a stream (an maybe never will) */ - foreign_block_t *blocks; - size_t num_blocks; - size_t format_block; /* block number of 'fmt ' or 'COMM' chunk */ - size_t audio_block; /* block number of 'data' or 'SSND' chunk */ - FLAC__uint32 ssnd_offset_size; /* 0 if type!=AIFF */ -} foreign_metadata_t; - -foreign_metadata_t *flac__foreign_metadata_new(foreign_block_type_t type); - -void flac__foreign_metadata_delete(foreign_metadata_t *fm); - -FLAC__bool flac__foreign_metadata_read_from_aiff(foreign_metadata_t *fm, const char *filename, const char **error); -FLAC__bool flac__foreign_metadata_read_from_wave(foreign_metadata_t *fm, const char *filename, const char **error); -FLAC__bool flac__foreign_metadata_write_to_flac(foreign_metadata_t *fm, const char *infilename, const char *outfilename, const char **error); - -FLAC__bool flac__foreign_metadata_read_from_flac(foreign_metadata_t *fm, const char *filename, const char **error); -FLAC__bool flac__foreign_metadata_write_to_iff(foreign_metadata_t *fm, const char *infilename, const char *outfilename, off_t offset1, off_t offset2, off_t offset3, const char **error); - -#endif diff --git a/3rdparty/libflac/src/flac/iffscan.c b/3rdparty/libflac/src/flac/iffscan.c deleted file mode 100644 index d03b65bc8b9..00000000000 --- a/3rdparty/libflac/src/flac/iffscan.c +++ /dev/null @@ -1,112 +0,0 @@ -/* iffscan - Simple AIFF/RIFF chunk scanner - * Copyright (C) 2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#if defined _MSC_VER || defined __MINGW32__ -#include <sys/types.h> /* for off_t */ -#if _MSC_VER <= 1600 /* @@@ [2G limit] */ -#define fseeko fseek -#define ftello ftell -#endif -#endif -#include "foreign_metadata.h" - -static FLAC__uint32 unpack32be_(const FLAC__byte *b) -{ - return ((FLAC__uint32)b[0]<<24) + ((FLAC__uint32)b[1]<<16) + ((FLAC__uint32)b[2]<<8) + (FLAC__uint32)b[3]; -} - -static FLAC__uint32 unpack32le_(const FLAC__byte *b) -{ - return (FLAC__uint32)b[0] + ((FLAC__uint32)b[1]<<8) + ((FLAC__uint32)b[2]<<16) + ((FLAC__uint32)b[3]<<24); -} - -static FLAC__uint32 unpack32_(const FLAC__byte *b, foreign_block_type_t type) -{ - if(type == FOREIGN_BLOCK_TYPE__AIFF) - return unpack32be_(b); - else - return unpack32le_(b); -} - -int main(int argc, char *argv[]) -{ - FILE *f; - char buf[12]; - foreign_metadata_t *fm; - const char *fn, *error; - size_t i; - FLAC__uint32 size; - - if(argc != 2) { - fprintf(stderr, "usage: %s { file.wav | file.aif }\n", argv[0]); - return 1; - } - fn = argv[1]; - if(0 == (f = fopen(fn, "rb")) || fread(buf, 1, 4, f) != 4) { - fprintf(stderr, "ERROR opening %s for reading\n", fn); - return 1; - } - fclose(f); - if(0 == (fm = flac__foreign_metadata_new(memcmp(buf, "RIFF", 4)? FOREIGN_BLOCK_TYPE__AIFF : FOREIGN_BLOCK_TYPE__RIFF))) { - fprintf(stderr, "ERROR: out of memory\n"); - return 1; - } - if(fm->type == FOREIGN_BLOCK_TYPE__AIFF) { - if(!flac__foreign_metadata_read_from_aiff(fm, fn, &error)) { - fprintf(stderr, "ERROR reading chunks from %s: %s\n", fn, error); - return 1; - } - } - else { - if(!flac__foreign_metadata_read_from_wave(fm, fn, &error)) { - fprintf(stderr, "ERROR reading chunks from %s: %s\n", fn, error); - return 1; - } - } - if(0 == (f = fopen(fn, "rb"))) { - fprintf(stderr, "ERROR opening %s for reading\n", fn); - return 1; - } - for(i = 0; i < fm->num_blocks; i++) { - if(fseeko(f, fm->blocks[i].offset, SEEK_SET) < 0) { - fprintf(stderr, "ERROR seeking in %s\n", fn); - return 1; - } - if(fread(buf, 1, 12, f) != 12) { - fprintf(stderr, "ERROR reading %s\n", fn); - return 1; - } - size = unpack32_((const FLAC__byte*)buf+4, fm->type); - printf("block:[%c%c%c%c] size=%08x=(%10u)", buf[0], buf[1], buf[2], buf[3], size, size); - if(i == 0) - printf(" type:[%c%c%c%c]", buf[8], buf[9], buf[10], buf[11]); - else if(fm->type == FOREIGN_BLOCK_TYPE__AIFF && i == fm->audio_block) - printf(" offset size=%08x=(%10u)", fm->ssnd_offset_size, fm->ssnd_offset_size); - printf("\n"); - } - fclose(f); - flac__foreign_metadata_delete(fm); - return 0; -} diff --git a/3rdparty/libflac/src/flac/iffscan.dsp b/3rdparty/libflac/src/flac/iffscan.dsp deleted file mode 100644 index f3d0e4120f0..00000000000 --- a/3rdparty/libflac/src/flac/iffscan.dsp +++ /dev/null @@ -1,108 +0,0 @@ -# Microsoft Developer Studio Project File - Name="iffscan" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=iffscan - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "iffscan.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "iffscan.mak" CFG="iffscan - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "iffscan - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "iffscan - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "iffscan - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\obj\release\bin" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\..\include" /D "NDEBUG" /D "FLAC__NO_DLL" /D "FLAC__HAS_OGG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\..\obj\release\lib\libFLAC_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "iffscan - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\obj\debug\bin" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "..\..\include" /D "_DEBUG" /D "DEBUG" /D "FLAC__NO_DLL" /D "FLAC__HAS_OGG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\..\obj\debug\lib\libFLAC_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "iffscan - Win32 Release" -# Name "iffscan - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\iffscan.c -# End Source File -# Begin Source File - -SOURCE=.\foreign_metadata.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\foreign_metadata.h -# End Source File -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/flac/iffscan.vcproj b/3rdparty/libflac/src/flac/iffscan.vcproj deleted file mode 100644 index 0651666b1db..00000000000 --- a/3rdparty/libflac/src/flac/iffscan.vcproj +++ /dev/null @@ -1,212 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="iffscan" - ProjectGUID="{4cefbc94-c215-11db-8314-0800200c9a66}" - RootNamespace="iffscan" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\obj\debug\bin" - IntermediateDirectory="Debug" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".;..\..\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;FLAC__HAS_OGG;FLAC__NO_DLL;DEBUG" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="..\..\obj\release\lib\ogg_static.lib" - LinkIncremental="2" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\obj\release\bin" - IntermediateDirectory="Release" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".;..\..\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__HAS_OGG;FLAC__NO_DLL" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="..\..\obj\release\lib\ogg_static.lib" - LinkIncremental="1" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" - LinkTimeCodeGeneration="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-6E5FBE522BFB}" - > - <File - RelativePath=".\foreign_metadata.h" - > - </File> - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2D32A752A2FF}" - > - <File - RelativePath=".\foreign_metadata.c" - > - </File> - <File - RelativePath=".\iffscan.c" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/flac/local_string_utils.c b/3rdparty/libflac/src/flac/local_string_utils.c deleted file mode 100644 index d0f8ed3499d..00000000000 --- a/3rdparty/libflac/src/flac/local_string_utils.c +++ /dev/null @@ -1,109 +0,0 @@ -/* flac - Command-line FLAC encoder/decoder - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <string.h> - -#include "utils.h" -#include "local_string_utils.h" - -/* $OpenBSD: strlcpy.c,v 1.8 2003/06/17 21:56:24 millert Exp $ - * - * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * - * Copy src to string dst of size siz. At most siz-1 characters - * will be copied. Always NUL terminates (unless siz == 0). - * Returns strlen(src); if retval >= siz, truncation occurred. - */ -size_t -flac__strlcpy(char *dst, const char *src, size_t siz) -{ - register char *d = dst; - register const char *s = src; - register size_t n = siz; - - /* Copy as many bytes as will fit */ - if (n != 0 && --n != 0) { - do { - if ((*d++ = *s++) == 0) - break; - } while (--n != 0); - } - - /* Not enough room in dst, add NUL and traverse rest of src */ - if (n == 0) { - if (siz != 0) - *d = '\0'; /* NUL-terminate dst */ - while (*s++) - ; - } - - return(s - src - 1); /* count does not include NUL */ -} - -/* $OpenBSD: strlcat.c,v 1.11 2003/06/17 21:56:24 millert Exp $ - * - * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * - * Appends src to string dst of size siz (unlike strncat, siz is the - * full size of dst, not space left). At most siz-1 characters - * will be copied. Always NUL terminates (unless siz <= strlen(dst)). - * Returns strlen(src) + MIN(siz, strlen(initial dst)). - * If retval >= siz, truncation occurred. - */ -size_t -flac__strlcat(char *dst, const char *src, size_t siz) -{ - register char *d = dst; - register const char *s = src; - register size_t n = siz; - size_t dlen; - - /* Find the end of dst and adjust bytes left but don't go past end */ - while (n-- != 0 && *d != '\0') - d++; - dlen = d - dst; - n = siz - dlen; - - if (n == 0) - return(dlen + strlen(s)); - while (*s != '\0') { - if (n != 1) { - *d++ = *s; - n--; - } - s++; - } - *d = '\0'; - - return(dlen + (s - src)); /* count does not include NUL */ -} diff --git a/3rdparty/libflac/src/flac/local_string_utils.h b/3rdparty/libflac/src/flac/local_string_utils.h deleted file mode 100644 index e43041bad28..00000000000 --- a/3rdparty/libflac/src/flac/local_string_utils.h +++ /dev/null @@ -1,27 +0,0 @@ -/* flac - Command-line FLAC encoder/decoder - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef flac__local_string_utils_h -#define flac__local_string_utils_h - -#include <stdlib.h> /* for size_t */ - -size_t flac__strlcpy(char *dst, const char *src, size_t siz); -size_t flac__strlcat(char *dst, const char *src, size_t siz); - -#endif diff --git a/3rdparty/libflac/src/flac/main.c b/3rdparty/libflac/src/flac/main.c deleted file mode 100644 index f3716a8097f..00000000000 --- a/3rdparty/libflac/src/flac/main.c +++ /dev/null @@ -1,2181 +0,0 @@ -/* flac - Command-line FLAC encoder/decoder - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <ctype.h> -#include <errno.h> -#include <locale.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> - -#if !defined _MSC_VER && !defined __MINGW32__ -/* unlink is in stdio.h in VC++ */ -#include <unistd.h> /* for unlink() */ -#endif -#include "FLAC/all.h" -#include "share/alloc.h" -#include "share/grabbag.h" -#include "analyze.h" -#include "decode.h" -#include "encode.h" -#include "local_string_utils.h" /* for flac__strlcat() and flac__strlcpy() */ -#include "utils.h" -#include "vorbiscomment.h" - -#if defined _MSC_VER || defined __MINGW32__ || defined __EMX__ -#define FLAC__STRCASECMP stricmp -#else -#define FLAC__STRCASECMP strcasecmp -#endif - -#if 0 -/*[JEC] was:#if HAVE_GETOPT_LONG*/ -/*[JEC] see flac/include/share/getopt.h as to why the change */ -# include <getopt.h> -#else -# include "share/getopt.h" -#endif - -typedef enum { RAW, WAV, AIF, FLAC, OGGFLAC } FileFormat; - -static int do_it(void); - -static FLAC__bool init_options(void); -static int parse_options(int argc, char *argv[]); -static int parse_option(int short_option, const char *long_option, const char *option_argument); -static void free_options(void); -static void add_compression_setting_bool(compression_setting_type_t type, FLAC__bool value); -static void add_compression_setting_string(compression_setting_type_t type, const char *value); -static void add_compression_setting_unsigned(compression_setting_type_t type, unsigned value); - -static int usage_error(const char *message, ...); -static void short_usage(void); -static void show_version(void); -static void show_help(void); -static void show_explain(void); -static void format_mistake(const char *infilename, FileFormat wrong, FileFormat right); - -static int encode_file(const char *infilename, FLAC__bool is_first_file, FLAC__bool is_last_file); -static int decode_file(const char *infilename); - -static const char *get_encoded_outfilename(const char *infilename); -static const char *get_decoded_outfilename(const char *infilename); -static const char *get_outfilename(const char *infilename, const char *suffix); - -static void die(const char *message); -static int conditional_fclose(FILE *f); -static char *local_strdup(const char *source); -#ifdef _MSC_VER -/* There's no strtoll() in MSVC6 so we just write a specialized one */ -static FLAC__int64 local__strtoll(const char *src, char **endptr); -#endif - - -/* - * share__getopt format struct; note that for long options with no - * short option equivalent we just set the 'val' field to 0. - */ -static struct share__option long_options_[] = { - /* - * general options - */ - { "help" , share__no_argument, 0, 'h' }, - { "explain" , share__no_argument, 0, 'H' }, - { "version" , share__no_argument, 0, 'v' }, - { "decode" , share__no_argument, 0, 'd' }, - { "analyze" , share__no_argument, 0, 'a' }, - { "test" , share__no_argument, 0, 't' }, - { "stdout" , share__no_argument, 0, 'c' }, - { "silent" , share__no_argument, 0, 's' }, - { "totally-silent" , share__no_argument, 0, 0 }, - { "warnings-as-errors" , share__no_argument, 0, 'w' }, - { "force" , share__no_argument, 0, 'f' }, - { "delete-input-file" , share__no_argument, 0, 0 }, - { "keep-foreign-metadata" , share__no_argument, 0, 0 }, - { "output-prefix" , share__required_argument, 0, 0 }, - { "output-name" , share__required_argument, 0, 'o' }, - { "skip" , share__required_argument, 0, 0 }, - { "until" , share__required_argument, 0, 0 }, - { "channel-map" , share__required_argument, 0, 0 }, /* undocumented */ - - /* - * decoding options - */ - { "decode-through-errors", share__no_argument, 0, 'F' }, - { "cue" , share__required_argument, 0, 0 }, - { "apply-replaygain-which-is-not-lossless", share__optional_argument, 0, 0 }, /* undocumented */ - - /* - * encoding options - */ - { "cuesheet" , share__required_argument, 0, 0 }, - { "no-cued-seekpoints" , share__no_argument, 0, 0 }, - { "picture" , share__required_argument, 0, 0 }, - { "tag" , share__required_argument, 0, 'T' }, - { "tag-from-file" , share__required_argument, 0, 0 }, - { "compression-level-0" , share__no_argument, 0, '0' }, - { "compression-level-1" , share__no_argument, 0, '1' }, - { "compression-level-2" , share__no_argument, 0, '2' }, - { "compression-level-3" , share__no_argument, 0, '3' }, - { "compression-level-4" , share__no_argument, 0, '4' }, - { "compression-level-5" , share__no_argument, 0, '5' }, - { "compression-level-6" , share__no_argument, 0, '6' }, - { "compression-level-7" , share__no_argument, 0, '7' }, - { "compression-level-8" , share__no_argument, 0, '8' }, - { "compression-level-9" , share__no_argument, 0, '9' }, - { "best" , share__no_argument, 0, '8' }, - { "fast" , share__no_argument, 0, '0' }, - { "verify" , share__no_argument, 0, 'V' }, - { "force-aiff-format" , share__no_argument, 0, 0 }, - { "force-raw-format" , share__no_argument, 0, 0 }, - { "lax" , share__no_argument, 0, 0 }, - { "replay-gain" , share__no_argument, 0, 0 }, - { "ignore-chunk-sizes" , share__no_argument, 0, 0 }, - { "sector-align" , share__no_argument, 0, 0 }, - { "seekpoint" , share__required_argument, 0, 'S' }, - { "padding" , share__required_argument, 0, 'P' }, -#if FLAC__HAS_OGG - { "ogg" , share__no_argument, 0, 0 }, - { "serial-number" , share__required_argument, 0, 0 }, -#endif - { "blocksize" , share__required_argument, 0, 'b' }, - { "exhaustive-model-search" , share__no_argument, 0, 'e' }, - { "max-lpc-order" , share__required_argument, 0, 'l' }, - { "apodization" , share__required_argument, 0, 'A' }, - { "mid-side" , share__no_argument, 0, 'm' }, - { "adaptive-mid-side" , share__no_argument, 0, 'M' }, - { "qlp-coeff-precision-search", share__no_argument, 0, 'p' }, - { "qlp-coeff-precision" , share__required_argument, 0, 'q' }, - { "rice-partition-order" , share__required_argument, 0, 'r' }, - { "endian" , share__required_argument, 0, 0 }, - { "channels" , share__required_argument, 0, 0 }, - { "bps" , share__required_argument, 0, 0 }, - { "sample-rate" , share__required_argument, 0, 0 }, - { "sign" , share__required_argument, 0, 0 }, - { "input-size" , share__required_argument, 0, 0 }, - - /* - * analysis options - */ - { "residual-gnuplot", share__no_argument, 0, 0 }, - { "residual-text", share__no_argument, 0, 0 }, - - /* - * negatives - */ - { "no-decode-through-errors" , share__no_argument, 0, 0 }, - { "no-silent" , share__no_argument, 0, 0 }, - { "no-force" , share__no_argument, 0, 0 }, - { "no-seektable" , share__no_argument, 0, 0 }, - { "no-delete-input-file" , share__no_argument, 0, 0 }, - { "no-keep-foreign-metadata" , share__no_argument, 0, 0 }, - { "no-replay-gain" , share__no_argument, 0, 0 }, - { "no-ignore-chunk-sizes" , share__no_argument, 0, 0 }, - { "no-sector-align" , share__no_argument, 0, 0 }, - { "no-utf8-convert" , share__no_argument, 0, 0 }, - { "no-lax" , share__no_argument, 0, 0 }, -#if FLAC__HAS_OGG - { "no-ogg" , share__no_argument, 0, 0 }, -#endif - { "no-exhaustive-model-search", share__no_argument, 0, 0 }, - { "no-mid-side" , share__no_argument, 0, 0 }, - { "no-adaptive-mid-side" , share__no_argument, 0, 0 }, - { "no-qlp-coeff-prec-search" , share__no_argument, 0, 0 }, - { "no-padding" , share__no_argument, 0, 0 }, - { "no-verify" , share__no_argument, 0, 0 }, - { "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 }, - /* - * undocumented debugging options for the test suite - */ - { "disable-constant-subframes", share__no_argument, 0, 0 }, - { "disable-fixed-subframes" , share__no_argument, 0, 0 }, - { "disable-verbatim-subframes", share__no_argument, 0, 0 }, - { "no-md5-sum" , share__no_argument, 0, 0 }, - - {0, 0, 0, 0} -}; - - -/* - * global to hold command-line option values - */ - -static struct { - FLAC__bool show_help; - FLAC__bool show_explain; - FLAC__bool show_version; - FLAC__bool mode_decode; - FLAC__bool verify; - FLAC__bool treat_warnings_as_errors; - FLAC__bool force_file_overwrite; - FLAC__bool continue_through_decode_errors; - replaygain_synthesis_spec_t replaygain_synthesis_spec; - FLAC__bool lax; - FLAC__bool test_only; - FLAC__bool analyze; - FLAC__bool use_ogg; - FLAC__bool has_serial_number; /* true iff --serial-number was used */ - long serial_number; /* this is the Ogg serial number and is unused for native FLAC */ - FLAC__bool force_to_stdout; - FLAC__bool force_aiff_format; - FLAC__bool force_raw_format; - FLAC__bool delete_input; - FLAC__bool keep_foreign_metadata; - FLAC__bool replay_gain; - FLAC__bool ignore_chunk_sizes; - FLAC__bool sector_align; - FLAC__bool utf8_convert; /* true by default, to convert tag strings from locale to utf-8, false if --no-utf8-convert used */ - const char *cmdline_forced_outfilename; - const char *output_prefix; - analysis_options aopts; - int padding; /* -1 => no -P options were given, 0 => -P- was given, else -P value */ - size_t num_compression_settings; - compression_setting_t compression_settings[64]; /* bad MAGIC NUMBER but buffer overflow is checked */ - const char *skip_specification; - const char *until_specification; - const char *cue_specification; - int format_is_big_endian; - int format_is_unsigned_samples; - int format_channels; - int format_bps; - int format_sample_rate; - off_t format_input_size; - char requested_seek_points[5000]; /* bad MAGIC NUMBER but buffer overflow is checked */ - int num_requested_seek_points; /* -1 => no -S options were given, 0 => -S- was given */ - 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 */ - - unsigned num_files; - char **filenames; - - FLAC__StreamMetadata *vorbis_comment; - FLAC__StreamMetadata *pictures[64]; - unsigned num_pictures; - - struct { - FLAC__bool disable_constant_subframes; - FLAC__bool disable_fixed_subframes; - FLAC__bool disable_verbatim_subframes; - FLAC__bool do_md5; - } debug; -} option_values; - - -/* - * miscellaneous globals - */ - -static FLAC__int32 align_reservoir_0[588], align_reservoir_1[588]; /* for carrying over samples from --sector-align */ -static FLAC__int32 *align_reservoir[2] = { align_reservoir_0, align_reservoir_1 }; -static unsigned align_reservoir_samples = 0; /* 0 .. 587 */ - - -int main(int argc, char *argv[]) -{ - int retval = 0; - -#ifdef __EMX__ - _response(&argc, &argv); - _wildcard(&argc, &argv); -#endif - - srand((unsigned)time(0)); - setlocale(LC_ALL, ""); - if(!init_options()) { - flac__utils_printf(stderr, 1, "ERROR: allocating memory\n"); - retval = 1; - } - else { - if((retval = parse_options(argc, argv)) == 0) - retval = do_it(); - } - - free_options(); - - return retval; -} - -int do_it(void) -{ - int retval = 0; - - if(option_values.show_version) { - show_version(); - return 0; - } - else if(option_values.show_explain) { - show_explain(); - return 0; - } - else if(option_values.show_help) { - show_help(); - return 0; - } - else { - if(option_values.num_files == 0) { - if(flac__utils_verbosity_ >= 1) - short_usage(); - return 0; - } - - /* - * tweak options; validate the values - */ - if(!option_values.mode_decode) { - if(0 != option_values.cue_specification) - return usage_error("ERROR: --cue is not allowed in test mode\n"); - } - else { - if(option_values.test_only) { - if(0 != option_values.skip_specification) - return usage_error("ERROR: --skip is not allowed in test mode\n"); - if(0 != option_values.until_specification) - return usage_error("ERROR: --until is not allowed in test mode\n"); - if(0 != option_values.cue_specification) - return usage_error("ERROR: --cue is not allowed in test mode\n"); - if(0 != option_values.analyze) - return usage_error("ERROR: analysis mode (-a/--analyze) and test mode (-t/--test) cannot be used together\n"); - } - } - - if(0 != option_values.cue_specification && (0 != option_values.skip_specification || 0 != option_values.until_specification)) - return usage_error("ERROR: --cue may not be combined with --skip or --until\n"); - - if(option_values.format_channels >= 0) { - if(option_values.format_channels == 0 || (unsigned)option_values.format_channels > FLAC__MAX_CHANNELS) - return usage_error("ERROR: invalid number of channels '%u', must be > 0 and <= %u\n", option_values.format_channels, FLAC__MAX_CHANNELS); - } - if(option_values.format_bps >= 0) { - if(option_values.format_bps != 8 && option_values.format_bps != 16 && option_values.format_bps != 24) - return usage_error("ERROR: invalid bits per sample '%u' (must be 8/16/24)\n", option_values.format_bps); - } - if(option_values.format_sample_rate >= 0) { - if(!FLAC__format_sample_rate_is_valid(option_values.format_sample_rate)) - return usage_error("ERROR: invalid sample rate '%u', must be > 0 and <= %u\n", option_values.format_sample_rate, FLAC__MAX_SAMPLE_RATE); - } - if(option_values.force_raw_format && option_values.force_aiff_format) - return usage_error("ERROR: only one of --force-raw-format and --force-aiff-format allowed\n"); - if(option_values.mode_decode) { - if(!option_values.force_raw_format) { - if(option_values.format_is_big_endian >= 0) - return usage_error("ERROR: --endian only allowed with --force-raw-format\n"); - if(option_values.format_is_unsigned_samples >= 0) - return usage_error("ERROR: --sign only allowed with --force-raw-format\n"); - } - if(option_values.format_channels >= 0) - return usage_error("ERROR: --channels not allowed with --decode\n"); - if(option_values.format_bps >= 0) - return usage_error("ERROR: --bps not allowed with --decode\n"); - if(option_values.format_sample_rate >= 0) - return usage_error("ERROR: --sample-rate not allowed with --decode\n"); - } - - if(option_values.ignore_chunk_sizes) { - if(option_values.mode_decode) - return usage_error("ERROR: --ignore-chunk-sizes only allowed for encoding\n"); - if(0 != option_values.sector_align) - return usage_error("ERROR: --ignore-chunk-sizes not allowed with --sector-align\n"); - if(0 != option_values.until_specification) - return usage_error("ERROR: --ignore-chunk-sizes not allowed with --until\n"); - if(0 != option_values.cue_specification) - return usage_error("ERROR: --ignore-chunk-sizes not allowed with --cue\n"); - if(0 != option_values.cuesheet_filename) - return usage_error("ERROR: --ignore-chunk-sizes not allowed with --cuesheet\n"); - } - if(option_values.sector_align) { - if(option_values.mode_decode) - return usage_error("ERROR: --sector-align only allowed for encoding\n"); - if(0 != option_values.skip_specification) - return usage_error("ERROR: --sector-align not allowed with --skip\n"); - if(0 != option_values.until_specification) - return usage_error("ERROR: --sector-align not allowed with --until\n"); - if(0 != option_values.cue_specification) - return usage_error("ERROR: --sector-align not allowed with --cue\n"); - if(option_values.format_channels >= 0 && option_values.format_channels != 2) - return usage_error("ERROR: --sector-align can only be done with stereo input\n"); - if(option_values.format_bps >= 0 && option_values.format_bps != 16) - return usage_error("ERROR: --sector-align can only be done with 16-bit samples\n"); - if(option_values.format_sample_rate >= 0 && option_values.format_sample_rate != 44100) - return usage_error("ERROR: --sector-align can only be done with a sample rate of 44100\n"); - } - if(option_values.replay_gain) { - if(option_values.force_to_stdout) - return usage_error("ERROR: --replay-gain not allowed with -c/--stdout\n"); - if(option_values.mode_decode) - return usage_error("ERROR: --replay-gain only allowed for encoding\n"); - if(option_values.format_channels > 2) - return usage_error("ERROR: --replay-gain can only be done with mono/stereo input\n"); - if(option_values.format_sample_rate >= 0 && !grabbag__replaygain_is_valid_sample_frequency(option_values.format_sample_rate)) - return usage_error("ERROR: invalid sample rate used with --replay-gain\n"); - /* - * We want to reserve padding space for the ReplayGain - * tags that we will set later, to avoid rewriting the - * whole file. - */ - if( - (option_values.padding >= 0 && option_values.padding < (int)GRABBAG__REPLAYGAIN_MAX_TAG_SPACE_REQUIRED) || - (option_values.padding < 0 && FLAC_ENCODE__DEFAULT_PADDING < (int)GRABBAG__REPLAYGAIN_MAX_TAG_SPACE_REQUIRED) - ) { - flac__utils_printf(stderr, 1, "NOTE: --replay-gain may leave a small PADDING block even with --no-padding\n"); - option_values.padding = GRABBAG__REPLAYGAIN_MAX_TAG_SPACE_REQUIRED; - } - else { - option_values.padding += GRABBAG__REPLAYGAIN_MAX_TAG_SPACE_REQUIRED; - } - } - if(option_values.num_files > 1 && option_values.cmdline_forced_outfilename) { - return usage_error("ERROR: -o/--output-name cannot be used with multiple files\n"); - } - if(option_values.cmdline_forced_outfilename && option_values.output_prefix) { - return usage_error("ERROR: --output-prefix conflicts with -o/--output-name\n"); - } - if(!option_values.mode_decode && 0 != option_values.cuesheet_filename && option_values.num_files > 1) { - return usage_error("ERROR: --cuesheet cannot be used when encoding multiple files\n"); - } - if(option_values.keep_foreign_metadata) { - /* we're not going to try and support the re-creation of broken WAVE files */ - if(option_values.ignore_chunk_sizes) - return usage_error("ERROR: using --keep-foreign-metadata cannot be used with --ignore-chunk-sizes\n"); - if(option_values.test_only) - return usage_error("ERROR: --keep-foreign-metadata is not allowed in test mode\n"); - if(option_values.analyze) - return usage_error("ERROR: --keep-foreign-metadata is not allowed in analyis mode\n"); - /*@@@@@@*/ - if(option_values.delete_input) - return usage_error("ERROR: using --delete-input-file with --keep-foreign-metadata has been disabled until more testing has been done.\n"); - flac__utils_printf(stderr, 1, "NOTE: --keep-foreign-metadata is a new feature; make sure to test the output file before deleting the original.\n"); - } - } - - flac__utils_printf(stderr, 2, "\n"); - flac__utils_printf(stderr, 2, "flac %s, Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson\n", FLAC__VERSION_STRING); - flac__utils_printf(stderr, 2, "flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are\n"); - flac__utils_printf(stderr, 2, "welcome to redistribute it under certain conditions. Type `flac' for details.\n\n"); - - if(option_values.mode_decode) { - FLAC__bool first = true; - - if(option_values.num_files == 0) { - retval = decode_file("-"); - } - else { - unsigned i; - if(option_values.num_files > 1) - option_values.cmdline_forced_outfilename = 0; - for(i = 0, retval = 0; i < option_values.num_files; i++) { - if(0 == strcmp(option_values.filenames[i], "-") && !first) - continue; - retval |= decode_file(option_values.filenames[i]); - first = false; - } - } - } - else { /* encode */ - FLAC__bool first = true; - - if(option_values.ignore_chunk_sizes) - flac__utils_printf(stderr, 1, "INFO: Make sure you know what you're doing when using --ignore-chunk-sizes.\n Improper use can cause flac to encode non-audio data as audio.\n"); - - if(option_values.num_files == 0) { - retval = encode_file("-", first, true); - } - else { - unsigned i; - if(option_values.num_files > 1) - option_values.cmdline_forced_outfilename = 0; - for(i = 0, retval = 0; i < option_values.num_files; i++) { - if(0 == strcmp(option_values.filenames[i], "-") && !first) - continue; - retval |= encode_file(option_values.filenames[i], first, i == (option_values.num_files-1)); - first = false; - } - if(option_values.replay_gain && retval == 0) { - float album_gain, album_peak; - grabbag__replaygain_get_album(&album_gain, &album_peak); - for(i = 0; i < option_values.num_files; i++) { - const char *error, *outfilename = get_encoded_outfilename(option_values.filenames[i]); - if(0 == outfilename) { - flac__utils_printf(stderr, 1, "ERROR: filename too long: %s", option_values.filenames[i]); - return 1; - } - if(0 == strcmp(option_values.filenames[i], "-")) { - FLAC__ASSERT(0); - /* double protection */ - flac__utils_printf(stderr, 1, "internal error\n"); - return 2; - } - if(0 != (error = grabbag__replaygain_store_to_file_album(outfilename, album_gain, album_peak, /*preserve_modtime=*/true))) { - flac__utils_printf(stderr, 1, "%s: ERROR writing ReplayGain album tags (%s)\n", outfilename, error); - retval = 1; - } - } - } - } - } - - return retval; -} - -FLAC__bool init_options(void) -{ - option_values.show_help = false; - option_values.show_explain = false; - option_values.mode_decode = false; - option_values.verify = false; - option_values.treat_warnings_as_errors = false; - option_values.force_file_overwrite = false; - option_values.continue_through_decode_errors = false; - option_values.replaygain_synthesis_spec.apply = false; - option_values.replaygain_synthesis_spec.use_album_gain = true; - option_values.replaygain_synthesis_spec.limiter = RGSS_LIMIT__HARD; - option_values.replaygain_synthesis_spec.noise_shaping = NOISE_SHAPING_LOW; - option_values.replaygain_synthesis_spec.preamp = 0.0; - option_values.lax = false; - option_values.test_only = false; - option_values.analyze = false; - option_values.use_ogg = false; - option_values.has_serial_number = false; - option_values.serial_number = 0; - option_values.force_to_stdout = false; - option_values.force_aiff_format = false; - option_values.force_raw_format = false; - option_values.delete_input = false; - option_values.keep_foreign_metadata = false; - option_values.replay_gain = false; - option_values.ignore_chunk_sizes = false; - option_values.sector_align = false; - option_values.utf8_convert = true; - option_values.cmdline_forced_outfilename = 0; - option_values.output_prefix = 0; - option_values.aopts.do_residual_text = false; - option_values.aopts.do_residual_gnuplot = false; - option_values.padding = -1; - option_values.num_compression_settings = 1; - option_values.compression_settings[0].type = CST_COMPRESSION_LEVEL; - option_values.compression_settings[0].value.t_unsigned = 5; - option_values.skip_specification = 0; - option_values.until_specification = 0; - option_values.cue_specification = 0; - option_values.format_is_big_endian = -1; - option_values.format_is_unsigned_samples = -1; - option_values.format_channels = -1; - option_values.format_bps = -1; - option_values.format_sample_rate = -1; - option_values.format_input_size = (off_t)(-1); - option_values.requested_seek_points[0] = '\0'; - option_values.num_requested_seek_points = -1; - option_values.cuesheet_filename = 0; - option_values.cued_seekpoints = true; - option_values.channel_map_none = false; - - option_values.num_files = 0; - option_values.filenames = 0; - - if(0 == (option_values.vorbis_comment = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT))) - return false; - option_values.num_pictures = 0; - - option_values.debug.disable_constant_subframes = false; - option_values.debug.disable_fixed_subframes = false; - option_values.debug.disable_verbatim_subframes = false; - option_values.debug.do_md5 = true; - - return true; -} - -int parse_options(int argc, char *argv[]) -{ - int short_option; - int option_index = 1; - FLAC__bool had_error = false; - const char *short_opts = "0123456789aA:b:cdefFhHl:mMo:pP:q:r:sS:tT:vVw"; - - while ((short_option = share__getopt_long(argc, argv, short_opts, long_options_, &option_index)) != -1) { - switch (short_option) { - case 0: /* long option with no equivalent short option */ - had_error |= (parse_option(short_option, long_options_[option_index].name, share__optarg) != 0); - break; - case '?': - case ':': - had_error = true; - break; - default: /* short option */ - had_error |= (parse_option(short_option, 0, share__optarg) != 0); - break; - } - } - - if(had_error) { - return 1; - } - - FLAC__ASSERT(share__optind <= argc); - - option_values.num_files = argc - share__optind; - - if(option_values.num_files > 0) { - unsigned i = 0; - if(0 == (option_values.filenames = (char**)malloc(sizeof(char*) * option_values.num_files))) - die("out of memory allocating space for file names list"); - while(share__optind < argc) - option_values.filenames[i++] = local_strdup(argv[share__optind++]); - } - - return 0; -} - -int parse_option(int short_option, const char *long_option, const char *option_argument) -{ - const char *violation; - char *p; - int i; - - if(short_option == 0) { - FLAC__ASSERT(0 != long_option); - if(0 == strcmp(long_option, "totally-silent")) { - flac__utils_verbosity_ = 0; - } - else if(0 == strcmp(long_option, "delete-input-file")) { - option_values.delete_input = true; - } - else if(0 == strcmp(long_option, "keep-foreign-metadata")) { - option_values.keep_foreign_metadata = true; - } - else if(0 == strcmp(long_option, "output-prefix")) { - FLAC__ASSERT(0 != option_argument); - option_values.output_prefix = option_argument; - } - else if(0 == strcmp(long_option, "skip")) { - FLAC__ASSERT(0 != option_argument); - option_values.skip_specification = option_argument; - } - else if(0 == strcmp(long_option, "until")) { - FLAC__ASSERT(0 != option_argument); - option_values.until_specification = option_argument; - } - else if(0 == strcmp(long_option, "input-size")) { - FLAC__ASSERT(0 != option_argument); - { - char *end; -#ifdef _MSC_VER - FLAC__int64 i; - i = local__strtoll(option_argument, &end); -#else - long long i; - i = strtoll(option_argument, &end, 10); -#endif - if(0 == strlen(option_argument) || *end) - return usage_error("ERROR: --%s must be a number\n", long_option); - option_values.format_input_size = (off_t)i; - if(option_values.format_input_size != i) /* check if off_t is smaller than long long */ - return usage_error("ERROR: --%s too large; this build of flac does not support filesizes over 2GB\n", long_option); - if(option_values.format_input_size <= 0) - return usage_error("ERROR: --%s must be > 0\n", long_option); - } - } - else if(0 == strcmp(long_option, "cue")) { - FLAC__ASSERT(0 != option_argument); - option_values.cue_specification = option_argument; - } - else if(0 == strcmp(long_option, "apply-replaygain-which-is-not-lossless")) { - option_values.replaygain_synthesis_spec.apply = true; - if (0 != option_argument) { - char *p; - option_values.replaygain_synthesis_spec.limiter = RGSS_LIMIT__NONE; - option_values.replaygain_synthesis_spec.noise_shaping = NOISE_SHAPING_NONE; - option_values.replaygain_synthesis_spec.preamp = strtod(option_argument, &p); - for ( ; *p; p++) { - if (*p == 'a') - option_values.replaygain_synthesis_spec.use_album_gain = true; - else if (*p == 't') - option_values.replaygain_synthesis_spec.use_album_gain = false; - else if (*p == 'l') - option_values.replaygain_synthesis_spec.limiter = RGSS_LIMIT__PEAK; - else if (*p == 'L') - option_values.replaygain_synthesis_spec.limiter = RGSS_LIMIT__HARD; - else if (*p == 'n' && p[1] >= '0' && p[1] <= '3') { - option_values.replaygain_synthesis_spec.noise_shaping = p[1] - '0'; - p++; - } - else - return usage_error("ERROR: bad specification string \"%s\" for --%s\n", option_argument, long_option); - } - } - } - else if(0 == strcmp(long_option, "channel-map")) { - if (0 == option_argument || strcmp(option_argument, "none")) - return usage_error("ERROR: only --channel-map=none currently supported\n"); - option_values.channel_map_none = true; - } - else if(0 == strcmp(long_option, "cuesheet")) { - FLAC__ASSERT(0 != option_argument); - option_values.cuesheet_filename = option_argument; - } - else if(0 == strcmp(long_option, "picture")) { - const unsigned max_pictures = sizeof(option_values.pictures)/sizeof(option_values.pictures[0]); - FLAC__ASSERT(0 != option_argument); - if(option_values.num_pictures >= max_pictures) - return usage_error("ERROR: too many --picture arguments, only %u allowed\n", max_pictures); - if(0 == (option_values.pictures[option_values.num_pictures] = grabbag__picture_parse_specification(option_argument, &violation))) - return usage_error("ERROR: (--picture) %s\n", violation); - option_values.num_pictures++; - } - else if(0 == strcmp(long_option, "tag-from-file")) { - FLAC__ASSERT(0 != option_argument); - if(!flac__vorbiscomment_add(option_values.vorbis_comment, option_argument, /*value_from_file=*/true, /*raw=*/!option_values.utf8_convert, &violation)) - return usage_error("ERROR: (--tag-from-file) %s\n", violation); - } - else if(0 == strcmp(long_option, "no-cued-seekpoints")) { - option_values.cued_seekpoints = false; - } - else if(0 == strcmp(long_option, "force-aiff-format")) { - option_values.force_aiff_format = true; - } - else if(0 == strcmp(long_option, "force-raw-format")) { - option_values.force_raw_format = true; - } - else if(0 == strcmp(long_option, "lax")) { - option_values.lax = true; - } - else if(0 == strcmp(long_option, "replay-gain")) { - option_values.replay_gain = true; - } - else if(0 == strcmp(long_option, "ignore-chunk-sizes")) { - option_values.ignore_chunk_sizes = true; - } - else if(0 == strcmp(long_option, "sector-align")) { - option_values.sector_align = true; - } -#if FLAC__HAS_OGG - else if(0 == strcmp(long_option, "ogg")) { - option_values.use_ogg = true; - } - else if(0 == strcmp(long_option, "serial-number")) { - option_values.has_serial_number = true; - option_values.serial_number = atol(option_argument); - } -#endif - else if(0 == strcmp(long_option, "endian")) { - FLAC__ASSERT(0 != option_argument); - if(0 == strncmp(option_argument, "big", strlen(option_argument))) - option_values.format_is_big_endian = true; - else if(0 == strncmp(option_argument, "little", strlen(option_argument))) - option_values.format_is_big_endian = false; - else - return usage_error("ERROR: argument to --endian must be \"big\" or \"little\"\n"); - } - else if(0 == strcmp(long_option, "channels")) { - FLAC__ASSERT(0 != option_argument); - option_values.format_channels = atoi(option_argument); - } - else if(0 == strcmp(long_option, "bps")) { - FLAC__ASSERT(0 != option_argument); - option_values.format_bps = atoi(option_argument); - } - else if(0 == strcmp(long_option, "sample-rate")) { - FLAC__ASSERT(0 != option_argument); - option_values.format_sample_rate = atoi(option_argument); - } - else if(0 == strcmp(long_option, "sign")) { - FLAC__ASSERT(0 != option_argument); - if(0 == strncmp(option_argument, "signed", strlen(option_argument))) - option_values.format_is_unsigned_samples = false; - else if(0 == strncmp(option_argument, "unsigned", strlen(option_argument))) - option_values.format_is_unsigned_samples = true; - else - return usage_error("ERROR: argument to --sign must be \"signed\" or \"unsigned\"\n"); - } - else if(0 == strcmp(long_option, "residual-gnuplot")) { - option_values.aopts.do_residual_gnuplot = true; - } - else if(0 == strcmp(long_option, "residual-text")) { - option_values.aopts.do_residual_text = true; - } - /* - * negatives - */ - else if(0 == strcmp(long_option, "no-decode-through-errors")) { - option_values.continue_through_decode_errors = false; - } - else if(0 == strcmp(long_option, "no-silent")) { - flac__utils_verbosity_ = 2; - } - else if(0 == strcmp(long_option, "no-force")) { - option_values.force_file_overwrite = false; - } - else if(0 == strcmp(long_option, "no-seektable")) { - option_values.num_requested_seek_points = 0; - option_values.requested_seek_points[0] = '\0'; - } - else if(0 == strcmp(long_option, "no-delete-input-file")) { - option_values.delete_input = false; - } - else if(0 == strcmp(long_option, "no-keep-foreign-metadata")) { - option_values.keep_foreign_metadata = false; - } - else if(0 == strcmp(long_option, "no-replay-gain")) { - option_values.replay_gain = false; - } - else if(0 == strcmp(long_option, "no-ignore-chunk-sizes")) { - option_values.ignore_chunk_sizes = false; - } - else if(0 == strcmp(long_option, "no-sector-align")) { - option_values.sector_align = false; - } - else if(0 == strcmp(long_option, "no-utf8-convert")) { - option_values.utf8_convert = false; - } - else if(0 == strcmp(long_option, "no-lax")) { - option_values.lax = false; - } -#if FLAC__HAS_OGG - else if(0 == strcmp(long_option, "no-ogg")) { - option_values.use_ogg = false; - } -#endif - else if(0 == strcmp(long_option, "no-exhaustive-model-search")) { - add_compression_setting_bool(CST_DO_EXHAUSTIVE_MODEL_SEARCH, false); - } - else if(0 == strcmp(long_option, "no-mid-side")) { - add_compression_setting_bool(CST_DO_MID_SIDE, false); - add_compression_setting_bool(CST_LOOSE_MID_SIDE, false); - } - else if(0 == strcmp(long_option, "no-adaptive-mid-side")) { - add_compression_setting_bool(CST_DO_MID_SIDE, false); - add_compression_setting_bool(CST_LOOSE_MID_SIDE, false); - } - else if(0 == strcmp(long_option, "no-qlp-coeff-prec-search")) { - add_compression_setting_bool(CST_DO_QLP_COEFF_PREC_SEARCH, false); - } - else if(0 == strcmp(long_option, "no-padding")) { - option_values.padding = 0; - } - else if(0 == strcmp(long_option, "no-verify")) { - option_values.verify = false; - } - else if(0 == strcmp(long_option, "no-warnings-as-errors")) { - option_values.treat_warnings_as_errors = false; - } - else if(0 == strcmp(long_option, "no-residual-gnuplot")) { - option_values.aopts.do_residual_gnuplot = false; - } - else if(0 == strcmp(long_option, "no-residual-text")) { - option_values.aopts.do_residual_text = false; - } - else if(0 == strcmp(long_option, "disable-constant-subframes")) { - option_values.debug.disable_constant_subframes = true; - } - else if(0 == strcmp(long_option, "disable-fixed-subframes")) { - option_values.debug.disable_fixed_subframes = true; - } - else if(0 == strcmp(long_option, "disable-verbatim-subframes")) { - option_values.debug.disable_verbatim_subframes = true; - } - else if(0 == strcmp(long_option, "no-md5-sum")) { - option_values.debug.do_md5 = false; - } - } - else { - switch(short_option) { - case 'h': - option_values.show_help = true; - break; - case 'H': - option_values.show_explain = true; - break; - case 'v': - option_values.show_version = true; - break; - case 'd': - option_values.mode_decode = true; - break; - case 'a': - option_values.mode_decode = true; - option_values.analyze = true; - break; - case 't': - option_values.mode_decode = true; - option_values.test_only = true; - break; - case 'c': - option_values.force_to_stdout = true; - break; - case 's': - flac__utils_verbosity_ = 1; - break; - case 'f': - option_values.force_file_overwrite = true; - break; - case 'o': - FLAC__ASSERT(0 != option_argument); - option_values.cmdline_forced_outfilename = option_argument; - break; - case 'F': - option_values.continue_through_decode_errors = true; - break; - case 'T': - FLAC__ASSERT(0 != option_argument); - if(!flac__vorbiscomment_add(option_values.vorbis_comment, option_argument, /*value_from_file=*/false, /*raw=*/!option_values.utf8_convert, &violation)) - return usage_error("ERROR: (-T/--tag) %s\n", violation); - break; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - add_compression_setting_unsigned(CST_COMPRESSION_LEVEL, short_option-'0'); - break; - case '9': - return usage_error("ERROR: compression level '9' is reserved\n"); - case 'V': - option_values.verify = true; - break; - case 'w': - option_values.treat_warnings_as_errors = true; - break; - case 'S': - FLAC__ASSERT(0 != option_argument); - if(0 == strcmp(option_argument, "-")) { - option_values.num_requested_seek_points = 0; - option_values.requested_seek_points[0] = '\0'; - } - else { - if(option_values.num_requested_seek_points < 0) - option_values.num_requested_seek_points = 0; - option_values.num_requested_seek_points++; - if(strlen(option_values.requested_seek_points)+strlen(option_argument)+2 >= sizeof(option_values.requested_seek_points)) { - return usage_error("ERROR: too many seekpoints requested\n"); - } - else { - strcat(option_values.requested_seek_points, option_argument); - strcat(option_values.requested_seek_points, ";"); - } - } - break; - case 'P': - FLAC__ASSERT(0 != option_argument); - option_values.padding = atoi(option_argument); - if(option_values.padding < 0) - return usage_error("ERROR: argument to -%c must be >= 0; for no padding use -%c-\n", short_option, short_option); - break; - case 'b': - FLAC__ASSERT(0 != option_argument); - i = atoi(option_argument); - if((i < (int)FLAC__MIN_BLOCK_SIZE || i > (int)FLAC__MAX_BLOCK_SIZE)) - return usage_error("ERROR: invalid blocksize (-%c) '%d', must be >= %u and <= %u\n", short_option, i, FLAC__MIN_BLOCK_SIZE, FLAC__MAX_BLOCK_SIZE); - add_compression_setting_unsigned(CST_BLOCKSIZE, (unsigned)i); - break; - case 'e': - add_compression_setting_bool(CST_DO_EXHAUSTIVE_MODEL_SEARCH, true); - break; - case 'E': - add_compression_setting_bool(CST_DO_ESCAPE_CODING, true); - break; - case 'l': - FLAC__ASSERT(0 != option_argument); - i = atoi(option_argument); - if((i < 0 || i > (int)FLAC__MAX_LPC_ORDER)) - return usage_error("ERROR: invalid LPC order (-%c) '%d', must be >= %u and <= %u\n", short_option, i, 0, FLAC__MAX_LPC_ORDER); - add_compression_setting_unsigned(CST_MAX_LPC_ORDER, (unsigned)i); - break; - case 'A': - FLAC__ASSERT(0 != option_argument); - add_compression_setting_string(CST_APODIZATION, option_argument); - break; - case 'm': - add_compression_setting_bool(CST_DO_MID_SIDE, true); - add_compression_setting_bool(CST_LOOSE_MID_SIDE, false); - break; - case 'M': - add_compression_setting_bool(CST_DO_MID_SIDE, true); - add_compression_setting_bool(CST_LOOSE_MID_SIDE, true); - break; - case 'p': - add_compression_setting_bool(CST_DO_QLP_COEFF_PREC_SEARCH, true); - break; - case 'q': - FLAC__ASSERT(0 != option_argument); - i = atoi(option_argument); - if(i < 0 || (i > 0 && (i < (int)FLAC__MIN_QLP_COEFF_PRECISION || i > (int)FLAC__MAX_QLP_COEFF_PRECISION))) - return usage_error("ERROR: invalid value '%d' for qlp coeff precision (-%c), must be 0 or between %u and %u, inclusive\n", i, short_option, FLAC__MIN_QLP_COEFF_PRECISION, FLAC__MAX_QLP_COEFF_PRECISION); - add_compression_setting_unsigned(CST_QLP_COEFF_PRECISION, (unsigned)i); - break; - case 'r': - FLAC__ASSERT(0 != option_argument); - p = strchr(option_argument, ','); - if(0 == p) { - add_compression_setting_unsigned(CST_MIN_RESIDUAL_PARTITION_ORDER, 0); - i = atoi(option_argument); - if(i < 0) - return usage_error("ERROR: invalid value '%d' for residual partition order (-%c), must be between 0 and %u, inclusive\n", i, short_option, FLAC__MAX_RICE_PARTITION_ORDER); - add_compression_setting_unsigned(CST_MAX_RESIDUAL_PARTITION_ORDER, (unsigned)i); - } - else { - i = atoi(option_argument); - if(i < 0) - return usage_error("ERROR: invalid value '%d' for min residual partition order (-%c), must be between 0 and %u, inclusive\n", i, short_option, FLAC__MAX_RICE_PARTITION_ORDER); - add_compression_setting_unsigned(CST_MIN_RESIDUAL_PARTITION_ORDER, (unsigned)i); - i = atoi(++p); - if(i < 0) - return usage_error("ERROR: invalid value '%d' for max residual partition order (-%c), must be between 0 and %u, inclusive\n", i, short_option, FLAC__MAX_RICE_PARTITION_ORDER); - add_compression_setting_unsigned(CST_MAX_RESIDUAL_PARTITION_ORDER, (unsigned)i); - } - break; - case 'R': - i = atoi(option_argument); - if(i < 0) - return usage_error("ERROR: invalid value '%d' for Rice parameter search distance (-%c), must be >= 0\n", i, short_option); - add_compression_setting_unsigned(CST_RICE_PARAMETER_SEARCH_DIST, (unsigned)i); - break; - default: - FLAC__ASSERT(0); - } - } - - return 0; -} - -void free_options(void) -{ - unsigned i; - if(0 != option_values.filenames) { - for(i = 0; i < option_values.num_files; i++) { - if(0 != option_values.filenames[i]) - free(option_values.filenames[i]); - } - free(option_values.filenames); - } - if(0 != option_values.vorbis_comment) - FLAC__metadata_object_delete(option_values.vorbis_comment); - for(i = 0; i < option_values.num_pictures; i++) - FLAC__metadata_object_delete(option_values.pictures[i]); -} - -void add_compression_setting_bool(compression_setting_type_t type, FLAC__bool value) -{ - if(option_values.num_compression_settings >= sizeof(option_values.compression_settings)/sizeof(option_values.compression_settings[0])) - die("too many compression settings"); - option_values.compression_settings[option_values.num_compression_settings].type = type; - option_values.compression_settings[option_values.num_compression_settings].value.t_bool = value; - option_values.num_compression_settings++; -} - -void add_compression_setting_string(compression_setting_type_t type, const char *value) -{ - if(option_values.num_compression_settings >= sizeof(option_values.compression_settings)/sizeof(option_values.compression_settings[0])) - die("too many compression settings"); - option_values.compression_settings[option_values.num_compression_settings].type = type; - option_values.compression_settings[option_values.num_compression_settings].value.t_string = value; - option_values.num_compression_settings++; -} - -void add_compression_setting_unsigned(compression_setting_type_t type, unsigned value) -{ - if(option_values.num_compression_settings >= sizeof(option_values.compression_settings)/sizeof(option_values.compression_settings[0])) - die("too many compression settings"); - option_values.compression_settings[option_values.num_compression_settings].type = type; - option_values.compression_settings[option_values.num_compression_settings].value.t_unsigned = value; - option_values.num_compression_settings++; -} - -int usage_error(const char *message, ...) -{ - if(flac__utils_verbosity_ >= 1) { - va_list args; - - FLAC__ASSERT(0 != message); - - va_start(args, message); - - (void) vfprintf(stderr, message, args); - - va_end(args); - - printf("Type \"flac\" for a usage summary or \"flac --help\" for all options\n"); - } - - return 1; -} - -void show_version(void) -{ - printf("flac %s\n", FLAC__VERSION_STRING); -} - -static void usage_header(void) -{ - printf("===============================================================================\n"); - printf("flac - Command-line FLAC encoder/decoder version %s\n", FLAC__VERSION_STRING); - printf("Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson\n"); - printf("\n"); - printf("This program is free software; you can redistribute it and/or\n"); - printf("modify it under the terms of the GNU General Public License\n"); - printf("as published by the Free Software Foundation; either version 2\n"); - printf("of the License, or (at your option) any later version.\n"); - printf("\n"); - printf("This program is distributed in the hope that it will be useful,\n"); - printf("but WITHOUT ANY WARRANTY; without even the implied warranty of\n"); - printf("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"); - printf("GNU General Public License for more details.\n"); - printf("\n"); - printf("You should have received a copy of the GNU General Public License\n"); - printf("along with this program; if not, write to the Free Software\n"); - printf("Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"); - printf("===============================================================================\n"); -} - -static void usage_summary(void) -{ - printf("Usage:\n"); - printf("\n"); - printf(" Encoding: flac [<general-options>] [<encoding/format-options>] [INPUTFILE [...]]\n"); - printf(" Decoding: flac -d [<general-options>] [<format-options>] [FLACFILE [...]]\n"); - printf(" Testing: flac -t [<general-options>] [FLACFILE [...]]\n"); - printf("Analyzing: flac -a [<general-options>] [<analysis-options>] [FLACFILE [...]]\n"); - printf("\n"); -} - -void short_usage(void) -{ - usage_header(); - printf("\n"); - printf("This is the short help; for all options use 'flac --help'; for even more\n"); - printf("instructions use 'flac --explain'\n"); - printf("\n"); - printf("To encode:\n"); - printf(" flac [-#] [INPUTFILE [...]]\n"); - printf("\n"); - printf(" -# is -0 (fastest compression) to -8 (highest compression); -5 is the default\n"); - printf("\n"); - printf("To decode:\n"); - printf(" flac -d [INPUTFILE [...]]\n"); - printf("\n"); - printf("To test:\n"); - printf(" flac -t [INPUTFILE [...]]\n"); -} - -void show_help(void) -{ - usage_header(); - usage_summary(); - printf("general options:\n"); - printf(" -v, --version Show the flac version number\n"); - printf(" -h, --help Show this screen\n"); - printf(" -H, --explain Show detailed explanation of usage and options\n"); - printf(" -d, --decode Decode (the default behavior is to encode)\n"); - printf(" -t, --test Same as -d except no decoded file is written\n"); - printf(" -a, --analyze Same as -d except an analysis file is written\n"); - printf(" -c, --stdout Write output to stdout\n"); - printf(" -s, --silent Do not write runtime encode/decode statistics\n"); - printf(" --totally-silent Do not print anything, including errors\n"); - printf(" --no-utf8-convert Do not convert tags from local charset to UTF-8\n"); - printf(" -w, --warnings-as-errors Treat all warnings as errors\n"); - printf(" -f, --force Force overwriting of output files\n"); - printf(" -o, --output-name=FILENAME Force the output file name\n"); - printf(" --output-prefix=STRING Prepend STRING to output names\n"); - printf(" --delete-input-file Deletes after a successful encode/decode\n"); - printf(" --keep-foreign-metadata Save/restore WAVE or AIFF non-audio chunks\n"); - printf(" --skip={#|mm:ss.ss} Skip the given initial samples for each input\n"); - printf(" --until={#|[+|-]mm:ss.ss} Stop at the given sample for each input file\n"); -#if FLAC__HAS_OGG - printf(" --ogg Use Ogg as transport layer\n"); - printf(" --serial-number Serial number to use for the FLAC stream\n"); -#endif - printf("analysis options:\n"); - printf(" --residual-text Include residual signal in text output\n"); - printf(" --residual-gnuplot Generate gnuplot files of residual distribution\n"); - printf("decoding options:\n"); - printf(" -F, --decode-through-errors Continue decoding through stream errors\n"); - printf(" --cue=[#.#][-[#.#]] Set the beginning and ending cuepoints to decode\n"); - printf("encoding options:\n"); - printf(" -V, --verify Verify a correct encoding\n"); - printf(" --lax Allow encoder to generate non-Subset files\n"); -#if 0 /*@@@ currently undocumented */ - printf(" --ignore-chunk-sizes Ignore data chunk sizes in WAVE/AIFF files\n"); -#endif - printf(" --sector-align Align multiple files on sector boundaries\n"); - printf(" --replay-gain Calculate ReplayGain & store in FLAC tags\n"); - printf(" --cuesheet=FILENAME Import cuesheet and store in CUESHEET block\n"); - printf(" --picture=SPECIFICATION Import picture and store in PICTURE block\n"); - printf(" -T, --tag=FIELD=VALUE Add a FLAC tag; may appear multiple times\n"); - printf(" --tag-from-file=FIELD=FILENAME Like --tag but gets value from file\n"); - printf(" -S, --seekpoint={#|X|#x|#s} Add seek point(s)\n"); - printf(" -P, --padding=# Write a PADDING block of length #\n"); - printf(" -0, --compression-level-0, --fast Synonymous with -l 0 -b 1152 -r 3\n"); - printf(" -1, --compression-level-1 Synonymous with -l 0 -b 1152 -M -r 3\n"); - printf(" -2, --compression-level-2 Synonymous with -l 0 -b 1152 -m -r 3\n"); - printf(" -3, --compression-level-3 Synonymous with -l 6 -b 4096 -r 4\n"); - printf(" -4, --compression-level-4 Synonymous with -l 8 -b 4096 -M -r 4\n"); - printf(" -5, --compression-level-5 Synonymous with -l 8 -b 4096 -m -r 5\n"); - printf(" -6, --compression-level-6 Synonymous with -l 8 -b 4096 -m -r 6\n"); - printf(" -7, --compression-level-7 Synonymous with -l 8 -b 4096 -m -e -r 6\n"); - printf(" -8, --compression-level-8, --best Synonymous with -l 12 -b 4096 -m -e -r 6\n"); - printf(" -b, --blocksize=# Specify blocksize in samples\n"); - printf(" -m, --mid-side Try mid-side coding for each frame\n"); - printf(" -M, --adaptive-mid-side Adaptive mid-side coding for all frames\n"); - printf(" -e, --exhaustive-model-search Do exhaustive model search (expensive!)\n"); - printf(" -A, --apodization=\"function\" Window audio data with given the function\n"); - printf(" -l, --max-lpc-order=# Max LPC order; 0 => only fixed predictors\n"); - printf(" -p, --qlp-coeff-precision-search Exhaustively search LP coeff quantization\n"); - printf(" -q, --qlp-coeff-precision=# Specify precision in bits\n"); - printf(" -r, --rice-partition-order=[#,]# Set [min,]max residual partition order\n"); - printf("format options:\n"); - printf(" --endian={big|little} Set byte order for samples\n"); - printf(" --channels=# Number of channels\n"); - printf(" --bps=# Number of bits per sample\n"); - printf(" --sample-rate=# Sample rate in Hz\n"); - printf(" --sign={signed|unsigned} Sign of samples\n"); - printf(" --input-size=# Size of the raw input in bytes\n"); - printf(" --force-aiff-format Force decoding to AIFF format\n"); - printf(" --force-raw-format Treat input or output as raw samples\n"); - printf("negative options:\n"); - printf(" --no-adaptive-mid-side\n"); - printf(" --no-decode-through-errors\n"); - printf(" --no-delete-input-file\n"); - printf(" --no-keep-foreign-metadata\n"); - printf(" --no-exhaustive-model-search\n"); - printf(" --no-lax\n"); - printf(" --no-mid-side\n"); -#if FLAC__HAS_OGG - printf(" --no-ogg\n"); -#endif - printf(" --no-padding\n"); - printf(" --no-qlp-coeff-prec-search\n"); - printf(" --no-replay-gain\n"); - printf(" --no-residual-gnuplot\n"); - printf(" --no-residual-text\n"); -#if 0 /*@@@ currently undocumented */ - printf(" --no-ignore-chunk-sizes\n"); -#endif - printf(" --no-sector-align\n"); - printf(" --no-seektable\n"); - printf(" --no-silent\n"); - printf(" --no-force\n"); - printf(" --no-verify\n"); - printf(" --no-warnings-as-errors\n"); -} - -void show_explain(void) -{ - usage_header(); - usage_summary(); - printf("For encoding:\n"); - printf(" The input file(s) may be a PCM WAVE file, AIFF (or uncompressed AIFF-C)\n"); - printf(" file, or raw samples.\n"); - printf(" The output file(s) will be in native FLAC or Ogg FLAC format\n"); - printf("For decoding, the reverse is true.\n"); - printf("\n"); - printf("A single INPUTFILE may be - for stdin. No INPUTFILE implies stdin. Use of\n"); - printf("stdin implies -c (write to stdout). Normally you should use:\n"); - printf(" flac [options] -o outfilename or flac -d [options] -o outfilename\n"); - printf("instead of:\n"); - printf(" flac [options] > outfilename or flac -d [options] > outfilename\n"); - printf("since the former allows flac to seek backwards to write the STREAMINFO or\n"); - printf("WAVE/AIFF header contents when necessary.\n"); - printf("\n"); - printf("flac checks for the presence of a AIFF/WAVE header to decide whether or not to\n"); - printf("treat an input file as AIFF/WAVE format or raw samples. If any input file is\n"); - printf("raw you must specify the format options {-fb|fl} -fc -fp and -fs, which will\n"); - printf("apply to all raw files. You can force AIFF/WAVE files to be treated as raw\n"); - printf("files using -fr.\n"); - printf("\n"); - printf("general options:\n"); - printf(" -v, --version Show the flac version number\n"); - printf(" -h, --help Show basic usage a list of all options\n"); - printf(" -H, --explain Show this screen\n"); - printf(" -d, --decode Decode (the default behavior is to encode)\n"); - printf(" -t, --test Same as -d except no decoded file is written\n"); - printf(" -a, --analyze Same as -d except an analysis file is written\n"); - printf(" -c, --stdout Write output to stdout\n"); - printf(" -s, --silent Do not write runtime encode/decode statistics\n"); - printf(" --totally-silent Do not print anything of any kind, including\n"); - printf(" warnings or errors. The exit code will be the\n"); - printf(" only way to determine successful completion.\n"); - printf(" --no-utf8-convert Do not convert tags from local charset to UTF-8.\n"); - printf(" This is useful for scripts, and setting tags in\n"); - printf(" situations where the locale is wrong. This\n"); - printf(" option must appear before any tag options!\n"); - printf(" -w, --warnings-as-errors Treat all warnings as errors\n"); - printf(" -f, --force Force overwriting of output files\n"); - printf(" -o, --output-name=FILENAME Force the output file name; usually flac just\n"); - printf(" changes the extension. May only be used when\n"); - printf(" encoding a single file. May not be used in\n"); - printf(" conjunction with --output-prefix.\n"); - printf(" --output-prefix=STRING Prefix each output file name with the given\n"); - printf(" STRING. This can be useful for encoding or\n"); - printf(" decoding files to a different directory. Make\n"); - printf(" sure if your STRING is a path name that it ends\n"); - printf(" with a '/' slash.\n"); - printf(" --delete-input-file Automatically delete the input file after a\n"); - printf(" successful encode or decode. If there was an\n"); - printf(" error (including a verify error) the input file\n"); - printf(" is left intact.\n"); - printf(" --keep-foreign-metadata If encoding, save WAVE or AIFF non-audio chunks\n"); - printf(" in FLAC metadata. If decoding, restore any saved\n"); - printf(" non-audio chunks from FLAC metadata when writing\n"); - printf(" the decoded file. Foreign metadata cannot be\n"); - printf(" transcoded, e.g. WAVE chunks saved in a FLAC file\n"); - printf(" cannot be restored when decoding to AIFF. Input\n"); - printf(" and output must be regular files, not stdin/out.\n"); - printf(" --skip={#|mm:ss.ss} Skip the first # samples of each input file; can\n"); - printf(" be used both for encoding and decoding. The\n"); - printf(" alternative form mm:ss.ss can be used to specify\n"); - printf(" minutes, seconds, and fractions of a second.\n"); - printf(" --until={#|[+|-]mm:ss.ss} Stop at the given sample number for each input\n"); - printf(" file. The given sample number is not included\n"); - printf(" in the decoded output. The alternative form\n"); - printf(" mm:ss.ss can be used to specify minutes,\n"); - printf(" seconds, and fractions of a second. If a `+'\n"); - printf(" sign is at the beginning, the --until point is\n"); - printf(" relative to the --skip point. If a `-' sign is\n"); - printf(" at the beginning, the --until point is relative\n"); - printf(" to end of the audio.\n"); -#if FLAC__HAS_OGG - printf(" --ogg When encoding, generate Ogg FLAC output instead\n"); - printf(" of native FLAC. Ogg FLAC streams are FLAC\n"); - printf(" streams wrapped in an Ogg transport layer. The\n"); - printf(" resulting file should have an '.oga' extension\n"); - printf(" and will still be decodable by flac. When\n"); - printf(" decoding, force the input to be treated as\n"); - printf(" Ogg FLAC. This is useful when piping input\n"); - printf(" from stdin or when the filename does not end in\n"); - printf(" '.oga' or '.ogg'.\n"); - printf(" --serial-number Serial number to use for the FLAC stream. When\n"); - printf(" encoding and no serial number is given, flac\n"); - printf(" uses a random one. If encoding to multiple files\n"); - printf(" the serial number is incremented for each file.\n"); - printf(" When decoding and no number is given, flac uses\n"); - printf(" the serial number of the first page.\n"); -#endif - printf("analysis options:\n"); - printf(" --residual-text Include residual signal in text output. This\n"); - printf(" will make the file very big, much larger than\n"); - printf(" even the decoded file.\n"); - printf(" --residual-gnuplot Generate gnuplot files of residual distribution\n"); - printf(" of each subframe\n"); - printf("decoding options:\n"); - printf(" -F, --decode-through-errors By default flac stops decoding with an error\n"); - printf(" and removes the partially decoded file if it\n"); - printf(" encounters a bitstream error. With -F, errors\n"); - printf(" are still printed but flac will continue\n"); - printf(" decoding to completion. Note that errors may\n"); - printf(" cause the decoded audio to be missing some\n"); - printf(" samples or have silent sections.\n"); - printf(" --cue=[#.#][-[#.#]] Set the beginning and ending cuepoints to\n"); - printf(" decode. The optional first #.# is the track and\n"); - printf(" index point at which decoding will start; the\n"); - printf(" default is the beginning of the stream. The\n"); - printf(" optional second #.# is the track and index point\n"); - printf(" at which decoding will end; the default is the\n"); - printf(" end of the stream. If the cuepoint does not\n"); - printf(" exist, the closest one before it (for the start\n"); - printf(" point) or after it (for the end point) will be\n"); - printf(" used. The cuepoints are merely translated into\n"); - printf(" sample numbers then used as --skip and --until.\n"); - printf(" A CD track can always be cued by, for example,\n"); - printf(" --cue=9.1-10.1 for track 9, even if the CD has\n"); - printf(" no 10th track.\n"); - printf("encoding options:\n"); - printf(" -V, --verify Verify a correct encoding by decoding the\n"); - printf(" output in parallel and comparing to the\n"); - printf(" original\n"); - printf(" --lax Allow encoder to generate non-Subset files\n"); -#if 0 /*@@@ currently undocumented */ - printf(" --ignore-chunk-sizes Ignore data chunk sizes in WAVE/AIFF files;\n"); - printf(" useful when piping data from programs which\n"); - printf(" generate bogus data chunk sizes.\n"); -#endif - printf(" --sector-align Align encoding of multiple CD format WAVE files\n"); - printf(" on sector boundaries.\n"); - printf(" --replay-gain Calculate ReplayGain values and store them as\n"); - printf(" FLAC tags. Title gains/peaks will be computed\n"); - printf(" for each file, and an album gain/peak will be\n"); - printf(" computed for all files. All input files must\n"); - printf(" have the same resolution, sample rate, and\n"); - printf(" number of channels. The sample rate must be\n"); - printf(" one of 8, 11.025, 12, 16, 22.05, 24, 32, 44.1,\n"); - printf(" or 48 kHz. NOTE: this option may also leave a\n"); - printf(" few extra bytes in the PADDING block.\n"); - printf(" --cuesheet=FILENAME Import the given cuesheet file and store it in\n"); - printf(" a CUESHEET metadata block. This option may only\n"); - printf(" be used when encoding a single file. A\n"); - printf(" seekpoint will be added for each index point in\n"); - printf(" the cuesheet to the SEEKTABLE unless\n"); - printf(" --no-cued-seekpoints is specified.\n"); - printf(" --picture=SPECIFICATION Import a picture and store it in a PICTURE block.\n"); - printf(" More than one --picture command can be specified.\n"); - printf(" The SPECIFICATION can either be a simple filename\n"); - printf(" for the picture file, or a complete specification\n"); - printf(" whose parts are separated by | characters. Some\n"); - printf(" parts may be left empty to invoke default values.\n"); - printf(" Using a filename is shorthand for \"||||FILE\".\n"); - printf(" The SPECIFICATION format is:\n"); - printf(" [TYPE]|[MIME-TYPE]|[DESCRIPTION]|[WIDTHxHEIGHTxDEPTH[/COLORS]]|FILE\n"); - printf(" TYPE is optional; it is a number from one of:\n"); - printf(" 0: Other\n"); - printf(" 1: 32x32 pixels 'file icon' (PNG only)\n"); - printf(" 2: Other file icon\n"); - printf(" 3: Cover (front)\n"); - printf(" 4: Cover (back)\n"); - printf(" 5: Leaflet page\n"); - printf(" 6: Media (e.g. label side of CD)\n"); - printf(" 7: Lead artist/lead performer/soloist\n"); - printf(" 8: Artist/performer\n"); - printf(" 9: Conductor\n"); - printf(" 10: Band/Orchestra\n"); - printf(" 11: Composer\n"); - printf(" 12: Lyricist/text writer\n"); - printf(" 13: Recording Location\n"); - printf(" 14: During recording\n"); - printf(" 15: During performance\n"); - printf(" 16: Movie/video screen capture\n"); - printf(" 17: A bright coloured fish\n"); - printf(" 18: Illustration\n"); - printf(" 19: Band/artist logotype\n"); - printf(" 20: Publisher/Studio logotype\n"); - printf(" The default is 3 (front cover). There may only be one picture each\n"); - printf(" of type 1 and 2 in a file.\n"); - printf(" MIME-TYPE is optional; if left blank, it will be detected from the\n"); - printf(" file. For best compatibility with players, use pictures with MIME\n"); - printf(" type image/jpeg or image/png. The MIME type can also be --> to\n"); - printf(" mean that FILE is actually a URL to an image, though this use is\n"); - printf(" discouraged.\n"); - printf(" DESCRIPTION is optional; the default is an empty string\n"); - printf(" The next part specfies the resolution and color information. If\n"); - printf(" the MIME-TYPE is image/jpeg, image/png, or image/gif, you can\n"); - printf(" usually leave this empty and they can be detected from the file.\n"); - printf(" Otherwise, you must specify the width in pixels, height in pixels,\n"); - printf(" and color depth in bits-per-pixel. If the image has indexed colors\n"); - printf(" you should also specify the number of colors used.\n"); - printf(" FILE is the path to the picture file to be imported, or the URL if\n"); - printf(" MIME type is -->\n"); - printf(" -T, --tag=FIELD=VALUE Add a FLAC tag. Make sure to quote the\n"); - printf(" comment if necessary. This option may appear\n"); - printf(" more than once to add several comments. NOTE:\n"); - printf(" all tags will be added to all encoded files.\n"); - printf(" --tag-from-file=FIELD=FILENAME Like --tag, except FILENAME is a file\n"); - printf(" whose contents will be read verbatim to set the\n"); - printf(" tag value. The contents will be converted to\n"); - printf(" UTF-8 from the local charset. This can be used\n"); - printf(" to store a cuesheet in a tag (e.g.\n"); - printf(" --tag-from-file=\"CUESHEET=image.cue\"). Do not\n"); - printf(" try to store binary data in tag fields! Use\n"); - printf(" APPLICATION blocks for that.\n"); - printf(" -S, --seekpoint={#|X|#x|#s} Include a point or points in a SEEKTABLE\n"); - printf(" # : a specific sample number for a seek point\n"); - printf(" X : a placeholder point (always goes at the end of the SEEKTABLE)\n"); - printf(" #x : # evenly spaced seekpoints, the first being at sample 0\n"); - printf(" #s : a seekpoint every # seconds; # does not have to be a whole number\n"); - printf(" You may use many -S options; the resulting SEEKTABLE will be the unique-\n"); - printf(" ified union of all such values.\n"); - printf(" With no -S options, flac defaults to '-S 10s'. Use -S- for no SEEKTABLE.\n"); - printf(" Note: -S #x and -S #s will not work if the encoder can't determine the\n"); - printf(" input size before starting.\n"); - printf(" Note: if you use -S # and # is >= samples in the input, there will be\n"); - printf(" either no seek point entered (if the input size is determinable\n"); - printf(" before encoding starts) or a placeholder point (if input size is not\n"); - printf(" determinable)\n"); - printf(" -P, --padding=# Tell the encoder to write a PADDING metadata\n"); - printf(" block of the given length (in bytes) after the\n"); - printf(" STREAMINFO block. This is useful if you plan\n"); - printf(" to tag the file later with an APPLICATION\n"); - printf(" block; instead of having to rewrite the entire\n"); - printf(" file later just to insert your block, you can\n"); - printf(" write directly over the PADDING block. Note\n"); - printf(" that the total length of the PADDING block will\n"); - printf(" be 4 bytes longer than the length given because\n"); - printf(" of the 4 metadata block header bytes. You can\n"); - printf(" force no PADDING block at all to be written with\n"); - printf(" --no-padding. The encoder writes a PADDING\n"); - printf(" block of 8192 bytes by default, or 65536 bytes\n"); - printf(" if the input audio is more than 20 minutes long.\n"); - printf(" -b, --blocksize=# Specify the blocksize in samples; the default is\n"); - printf(" 1152 for -l 0, else 4096; must be one of 192,\n"); - printf(" 576, 1152, 2304, 4608, 256, 512, 1024, 2048,\n"); - printf(" 4096 (and 8192 or 16384 if the sample rate is\n"); - printf(" >48kHz) for Subset streams.\n"); - printf(" -0, --compression-level-0, --fast Synonymous with -l 0 -b 1152 -r 3\n"); - printf(" -1, --compression-level-1 Synonymous with -l 0 -b 1152 -M -r 3\n"); - printf(" -2, --compression-level-2 Synonymous with -l 0 -b 1152 -m -r 3\n"); - printf(" -3, --compression-level-3 Synonymous with -l 6 -b 4096 -r 4\n"); - printf(" -4, --compression-level-4 Synonymous with -l 8 -b 4096 -M -r 4\n"); - printf(" -5, --compression-level-5 Synonymous with -l 8 -b 4096 -m -r 5\n"); - printf(" -5 is the default setting\n"); - printf(" -6, --compression-level-6 Synonymous with -l 8 -b 4096 -m -r 6\n"); - printf(" -7, --compression-level-7 Synonymous with -l 8 -b 4096 -m -e -r 6\n"); - printf(" -8, --compression-level-8, --best Synonymous with -l 12 -b 4096 -m -e -r 6\n"); - printf(" -m, --mid-side Try mid-side coding for each frame\n"); - printf(" (stereo only)\n"); - printf(" -M, --adaptive-mid-side Adaptive mid-side coding for all frames\n"); - printf(" (stereo only)\n"); - printf(" -e, --exhaustive-model-search Do exhaustive model search (expensive!)\n"); - printf(" -A, --apodization=\"function\" Window audio data with given the function.\n"); - printf(" The functions are: bartlett, bartlett_hann,\n"); - printf(" blackman, blackman_harris_4term_92db,\n"); - printf(" connes, flattop, gauss(STDDEV), hamming,\n"); - printf(" hann, kaiser_bessel, nuttall, rectangle,\n"); - printf(" triangle, tukey(P), welch. More than one\n"); - printf(" may be specified but encoding time is a\n"); - printf(" multiple of the number of functions since\n"); - printf(" they are each tried in turn. The encoder\n"); - printf(" chooses suitable defaults in the absence\n"); - printf(" of any -A options.\n"); - printf(" -l, --max-lpc-order=# Max LPC order; 0 => only fixed predictors.\n"); - printf(" Must be <= 12 for Subset streams if sample\n"); - printf(" rate is <=48kHz.\n"); - printf(" -p, --qlp-coeff-precision-search Do exhaustive search of LP coefficient\n"); - printf(" quantization (expensive!); overrides -q;\n"); - printf(" does nothing if using -l 0\n"); - printf(" -q, --qlp-coeff-precision=# Specify precision in bits of quantized\n"); - printf(" linear-predictor coefficients; 0 => let\n"); - printf(" encoder decide (the minimun is %u, the\n", FLAC__MIN_QLP_COEFF_PRECISION); - printf(" default is -q 0)\n"); - printf(" -r, --rice-partition-order=[#,]# Set [min,]max residual partition order\n"); - printf(" (# is 0..16; min defaults to 0; the\n"); - printf(" default is -r 0; above 4 doesn't usually\n"); - printf(" help much)\n"); - printf("format options:\n"); - printf(" --endian={big|little} Set byte order for samples\n"); - printf(" --channels=# Number of channels\n"); - printf(" --bps=# Number of bits per sample\n"); - printf(" --sample-rate=# Sample rate in Hz\n"); - printf(" --sign={signed|unsigned} Sign of samples (the default is signed)\n"); - printf(" --input-size=# Size of the raw input in bytes. If you are\n"); - printf(" encoding raw samples from stdin, you must set\n"); - printf(" this option in order to be able to use --skip,\n"); - printf(" --until, --cue-sheet, or other options that need\n"); - printf(" to know the size of the input beforehand. If\n"); - printf(" the size given is greater than what is found in\n"); - printf(" the input stream, the encoder will complain\n"); - printf(" about an unexpected end-of-file. If the size\n"); - printf(" given is less, samples will be truncated.\n"); - printf(" --force-aiff-format Force the decoder to output AIFF format. This\n"); - printf(" option is not needed if the output filename (as\n"); - printf(" set by -o) ends with .aif or .aiff; this option\n"); - printf(" has no effect when encoding since input AIFF is\n"); - printf(" auto-detected.\n"); - printf(" --force-raw-format Force input (when encoding) or output (when\n"); - printf(" decoding) to be treated as raw samples\n"); - printf("negative options:\n"); - printf(" --no-adaptive-mid-side\n"); - printf(" --no-decode-through-errors\n"); - printf(" --no-delete-input-file\n"); - printf(" --no-keep-foreign-metadata\n"); - printf(" --no-exhaustive-model-search\n"); - printf(" --no-lax\n"); - printf(" --no-mid-side\n"); -#if FLAC__HAS_OGG - printf(" --no-ogg\n"); -#endif - printf(" --no-padding\n"); - printf(" --no-qlp-coeff-prec-search\n"); - printf(" --no-residual-gnuplot\n"); - printf(" --no-residual-text\n"); -#if 0 /*@@@ currently undocumented */ - printf(" --no-ignore-chunk-sizes\n"); -#endif - printf(" --no-sector-align\n"); - printf(" --no-seektable\n"); - printf(" --no-silent\n"); - printf(" --no-force\n"); - printf(" --no-verify\n"); - printf(" --no-warnings-as-errors\n"); -} - -void format_mistake(const char *infilename, FileFormat wrong, FileFormat right) -{ - /* WATCHOUT: indexed by FileFormat */ - static const char * const ff[] = { "raw", "WAVE", "AIFF", "FLAC", "Ogg FLAC" }; - flac__utils_printf(stderr, 1, "WARNING: %s is not a %s file; treating as a %s file\n", infilename, ff[wrong], ff[right]); -} - -int encode_file(const char *infilename, FLAC__bool is_first_file, FLAC__bool is_last_file) -{ - FILE *encode_infile; - FLAC__byte lookahead[12]; - unsigned lookahead_length = 0; - FileFormat input_format = RAW; - FLAC__bool is_aifc = false; - int retval; - off_t infilesize; - encode_options_t common_options; - const char *outfilename = get_encoded_outfilename(infilename); /* the final name of the encoded file */ - /* internal_outfilename is the file we will actually write to; it will be a temporary name if infilename==outfilename */ - char *internal_outfilename = 0; /* NULL implies 'use outfilename' */ - - if(0 == outfilename) { - flac__utils_printf(stderr, 1, "ERROR: filename too long: %s", infilename); - return 1; - } - - if(0 == strcmp(infilename, "-")) { - infilesize = (off_t)(-1); - encode_infile = grabbag__file_get_binary_stdin(); - } - else { - infilesize = grabbag__file_get_filesize(infilename); - if(0 == (encode_infile = fopen(infilename, "rb"))) { - flac__utils_printf(stderr, 1, "ERROR: can't open input file %s: %s\n", infilename, strerror(errno)); - return 1; - } - } - - if(!option_values.force_raw_format) { - /* first set format based on name */ - if(strlen(infilename) >= 4 && 0 == FLAC__STRCASECMP(infilename+(strlen(infilename)-4), ".wav")) - input_format = WAV; - else if(strlen(infilename) >= 4 && 0 == FLAC__STRCASECMP(infilename+(strlen(infilename)-4), ".aif")) - input_format = AIF; - else if(strlen(infilename) >= 5 && 0 == FLAC__STRCASECMP(infilename+(strlen(infilename)-5), ".aiff")) - input_format = AIF; - else if(strlen(infilename) >= 5 && 0 == FLAC__STRCASECMP(infilename+(strlen(infilename)-5), ".flac")) - input_format = FLAC; - else if(strlen(infilename) >= 4 && 0 == FLAC__STRCASECMP(infilename+(strlen(infilename)-4), ".oga")) - input_format = OGGFLAC; - else if(strlen(infilename) >= 4 && 0 == FLAC__STRCASECMP(infilename+(strlen(infilename)-4), ".ogg")) - input_format = OGGFLAC; - - /* attempt to guess the file type based on the first 12 bytes */ - if((lookahead_length = fread(lookahead, 1, 12, encode_infile)) < 12) { - if(input_format != RAW) { - format_mistake(infilename, input_format, RAW); - if(option_values.treat_warnings_as_errors) { - conditional_fclose(encode_infile); - return 1; - } - } - input_format = RAW; - } - else { - if(!strncmp((const char *)lookahead, "ID3", 3)) { - flac__utils_printf(stderr, 1, "ERROR: input file %s has an ID3v2 tag\n", infilename); - return 1; - } - else if(!strncmp((const char *)lookahead, "RIFF", 4) && !strncmp((const char *)lookahead+8, "WAVE", 4)) - input_format = WAV; - else if(!strncmp((const char *)lookahead, "FORM", 4) && !strncmp((const char *)lookahead+8, "AIFF", 4)) - input_format = AIF; - else if(!strncmp((const char *)lookahead, "FORM", 4) && !strncmp((const char *)lookahead+8, "AIFC", 4)) { - input_format = AIF; - is_aifc = true; - } - else if(!memcmp(lookahead, FLAC__STREAM_SYNC_STRING, sizeof(FLAC__STREAM_SYNC_STRING))) - input_format = FLAC; - /* this could be made more accurate by looking at the first packet */ - else if(!memcmp(lookahead, "OggS", 4)) - input_format = OGGFLAC; - else { - if(input_format != RAW) { - format_mistake(infilename, input_format, RAW); - if(option_values.treat_warnings_as_errors) { - conditional_fclose(encode_infile); - return 1; - } - } - input_format = RAW; - } - } - } - - if(option_values.keep_foreign_metadata) { - if(encode_infile == stdin || option_values.force_to_stdout) { - conditional_fclose(encode_infile); - return usage_error("ERROR: --keep-foreign-metadata cannot be used when encoding from stdin or to stdout\n"); - } - if(input_format != WAV && input_format != AIF) { - conditional_fclose(encode_infile); - return usage_error("ERROR: --keep-foreign-metadata can only be used with WAVE or AIFF input\n"); - } - } - - /* - * Error if output file already exists (and -f not used). - * Use grabbag__file_get_filesize() as a cheap way to check. - */ - if(!option_values.test_only && !option_values.force_file_overwrite && strcmp(outfilename, "-") && grabbag__file_get_filesize(outfilename) != (off_t)(-1)) { - if(input_format == FLAC) { - /* need more detailed error message when re-flac'ing to avoid confusing the user */ - flac__utils_printf(stderr, 1, - "ERROR: output file %s already exists.\n\n" - "By default flac encodes files to FLAC format; if you meant to decode this file\n" - "from FLAC to something else, use -d. If you meant to re-encode this file from\n" - "FLAC to FLAC again, use -f to force writing to the same file, or -o to specify\n" - "a different output filename.\n", - outfilename - ); - } - else if(input_format == OGGFLAC) { - /* need more detailed error message when re-flac'ing to avoid confusing the user */ - flac__utils_printf(stderr, 1, - "ERROR: output file %s already exists.\n\n" - "By default 'flac -ogg' encodes files to Ogg FLAC format; if you meant to decode\n" - "this file from Ogg FLAC to something else, use -d. If you meant to re-encode\n" - "this file from Ogg FLAC to Ogg FLAC again, use -f to force writing to the same\n" - "file, or -o to specify a different output filename.\n", - outfilename - ); - } - else - flac__utils_printf(stderr, 1, "ERROR: output file %s already exists, use -f to override\n", outfilename); - conditional_fclose(encode_infile); - return 1; - } - - if(option_values.format_input_size >= 0) { - if (input_format != RAW || infilesize >= 0) { - flac__utils_printf(stderr, 1, "ERROR: can only use --input-size when encoding raw samples from stdin\n"); - conditional_fclose(encode_infile); - return 1; - } - else { - infilesize = option_values.format_input_size; - } - } - - if(option_values.sector_align && (input_format == FLAC || input_format == OGGFLAC)) { - flac__utils_printf(stderr, 1, "ERROR: can't use --sector-align when the input file is FLAC or Ogg FLAC\n"); - conditional_fclose(encode_infile); - return 1; - } - if(option_values.sector_align && input_format == RAW && infilesize < 0) { - flac__utils_printf(stderr, 1, "ERROR: can't use --sector-align when the input size is unknown\n"); - conditional_fclose(encode_infile); - return 1; - } - - if(input_format == RAW) { - if(option_values.format_is_big_endian < 0 || option_values.format_is_unsigned_samples < 0 || option_values.format_channels < 0 || option_values.format_bps < 0 || option_values.format_sample_rate < 0) { - conditional_fclose(encode_infile); - return usage_error("ERROR: for encoding a raw file you must specify a value for --endian, --sign, --channels, --bps, and --sample-rate\n"); - } - } - - if(/*@@@@@@why no stdin?*/encode_infile == stdin || option_values.force_to_stdout) { - if(option_values.replay_gain) { - conditional_fclose(encode_infile); - return usage_error("ERROR: --replay-gain cannot be used when encoding to stdout\n"); - } - } - if(option_values.replay_gain && option_values.use_ogg) { - conditional_fclose(encode_infile); - return usage_error("ERROR: --replay-gain cannot be used when encoding to Ogg FLAC yet\n"); - } - - if(!flac__utils_parse_skip_until_specification(option_values.skip_specification, &common_options.skip_specification) || common_options.skip_specification.is_relative) { - conditional_fclose(encode_infile); - return usage_error("ERROR: invalid value for --skip\n"); - } - - if(!flac__utils_parse_skip_until_specification(option_values.until_specification, &common_options.until_specification)) { /*@@@@ more checks: no + without --skip, no - unless known total_samples_to_{en,de}code */ - conditional_fclose(encode_infile); - return usage_error("ERROR: invalid value for --until\n"); - } - /* if there is no "--until" we want to default to "--until=-0" */ - if(0 == option_values.until_specification) - common_options.until_specification.is_relative = true; - - common_options.verify = option_values.verify; - common_options.treat_warnings_as_errors = option_values.treat_warnings_as_errors; -#if FLAC__HAS_OGG - common_options.use_ogg = option_values.use_ogg; - /* set a random serial number if one has not yet been specified */ - if(!option_values.has_serial_number) { - option_values.serial_number = rand(); - option_values.has_serial_number = true; - } - common_options.serial_number = option_values.serial_number++; -#endif - common_options.lax = option_values.lax; - common_options.padding = option_values.padding; - common_options.num_compression_settings = option_values.num_compression_settings; - FLAC__ASSERT(sizeof(common_options.compression_settings) >= sizeof(option_values.compression_settings)); - memcpy(common_options.compression_settings, option_values.compression_settings, sizeof(option_values.compression_settings)); - common_options.requested_seek_points = option_values.requested_seek_points; - common_options.num_requested_seek_points = option_values.num_requested_seek_points; - common_options.cuesheet_filename = option_values.cuesheet_filename; - common_options.continue_through_decode_errors = option_values.continue_through_decode_errors; - common_options.cued_seekpoints = option_values.cued_seekpoints; - common_options.channel_map_none = option_values.channel_map_none; - common_options.is_first_file = is_first_file; - common_options.is_last_file = is_last_file; - common_options.align_reservoir = align_reservoir; - common_options.align_reservoir_samples = &align_reservoir_samples; - common_options.replay_gain = option_values.replay_gain; - common_options.ignore_chunk_sizes = option_values.ignore_chunk_sizes; - common_options.sector_align = option_values.sector_align; - common_options.vorbis_comment = option_values.vorbis_comment; - FLAC__ASSERT(sizeof(common_options.pictures) >= sizeof(option_values.pictures)); - memcpy(common_options.pictures, option_values.pictures, sizeof(option_values.pictures)); - common_options.num_pictures = option_values.num_pictures; - common_options.debug.disable_constant_subframes = option_values.debug.disable_constant_subframes; - common_options.debug.disable_fixed_subframes = option_values.debug.disable_fixed_subframes; - common_options.debug.disable_verbatim_subframes = option_values.debug.disable_verbatim_subframes; - common_options.debug.do_md5 = option_values.debug.do_md5; - - /* 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)) { - static const char *tmp_suffix = ".tmp,fl-ac+en'c"; - /*@@@@ still a remote possibility that a file with this filename exists */ - if(0 == (internal_outfilename = (char *)safe_malloc_add_3op_(strlen(outfilename), /*+*/strlen(tmp_suffix), /*+*/1))) { - flac__utils_printf(stderr, 1, "ERROR allocating memory for tempfile name\n"); - conditional_fclose(encode_infile); - return 1; - } - strcpy(internal_outfilename, outfilename); - strcat(internal_outfilename, tmp_suffix); - } - - if(input_format == RAW) { - raw_encode_options_t options; - - options.common = common_options; - options.is_big_endian = option_values.format_is_big_endian; - options.is_unsigned_samples = option_values.format_is_unsigned_samples; - options.channels = option_values.format_channels; - options.bps = option_values.format_bps; - options.sample_rate = option_values.format_sample_rate; - - retval = flac__encode_raw(encode_infile, infilesize, infilename, internal_outfilename? internal_outfilename : outfilename, lookahead, lookahead_length, options); - } - else if(input_format == FLAC || input_format == OGGFLAC) { - flac_encode_options_t options; - - options.common = common_options; - - retval = flac__encode_flac(encode_infile, infilesize, infilename, internal_outfilename? internal_outfilename : outfilename, lookahead, lookahead_length, options, input_format==OGGFLAC); - } - else { - wav_encode_options_t options; - - options.common = common_options; - options.foreign_metadata = 0; - - /* read foreign metadata if requested */ - if(option_values.keep_foreign_metadata) { - if(0 == (options.foreign_metadata = flac__foreign_metadata_new(input_format==AIF? FOREIGN_BLOCK_TYPE__AIFF : FOREIGN_BLOCK_TYPE__RIFF))) { - flac__utils_printf(stderr, 1, "ERROR: creating foreign metadata object\n"); - conditional_fclose(encode_infile); - return 1; - } - } - - if(input_format == AIF) - retval = flac__encode_aif(encode_infile, infilesize, infilename, internal_outfilename? internal_outfilename : outfilename, lookahead, lookahead_length, options, is_aifc); - else - retval = flac__encode_wav(encode_infile, infilesize, infilename, internal_outfilename? internal_outfilename : outfilename, lookahead, lookahead_length, options); - - if(options.foreign_metadata) - flac__foreign_metadata_delete(options.foreign_metadata); - } - - if(retval == 0) { - if(strcmp(outfilename, "-")) { - if(option_values.replay_gain) { - float title_gain, title_peak; - const char *error; - grabbag__replaygain_get_title(&title_gain, &title_peak); - if( - 0 != (error = grabbag__replaygain_store_to_file_reference(internal_outfilename? internal_outfilename : outfilename, /*preserve_modtime=*/true)) || - 0 != (error = grabbag__replaygain_store_to_file_title(internal_outfilename? internal_outfilename : outfilename, title_gain, title_peak, /*preserve_modtime=*/true)) - ) { - flac__utils_printf(stderr, 1, "%s: ERROR writing ReplayGain reference/title tags (%s)\n", outfilename, error); - retval = 1; - } - } - if(strcmp(infilename, "-")) - grabbag__file_copy_metadata(infilename, internal_outfilename? internal_outfilename : outfilename); - } - } - - /* rename temporary file if necessary */ - if(retval == 0 && internal_outfilename != 0) { - if(rename(internal_outfilename, outfilename) < 0) { -#if defined _MSC_VER || defined __MINGW32__ || defined __EMX__ - /* on some flavors of windows, rename() will fail if the destination already exists, so we unlink and try again */ - if(unlink(outfilename) < 0) { - flac__utils_printf(stderr, 1, "ERROR: moving new FLAC file %s back on top of original FLAC file %s, keeping both\n", internal_outfilename, outfilename); - retval = 1; - } - else if(rename(internal_outfilename, outfilename) < 0) { - flac__utils_printf(stderr, 1, "ERROR: moving new FLAC file %s back on top of original FLAC file %s, you must do it\n", internal_outfilename, outfilename); - retval = 1; - } -#else - flac__utils_printf(stderr, 1, "ERROR: moving new FLAC file %s back on top of original FLAC file %s, keeping both\n", internal_outfilename, outfilename); - retval = 1; -#endif - } - } - - /* handle --delete-input-file, but don't want to delete if piping from stdin, or if input filename and output filename are the same */ - if(retval == 0 && option_values.delete_input && strcmp(infilename, "-") && internal_outfilename == 0) - unlink(infilename); - - if(internal_outfilename != 0) - free(internal_outfilename); - - return retval; -} - -int decode_file(const char *infilename) -{ - int retval; - FLAC__bool treat_as_ogg = false; - FileFormat output_format = WAV; - decode_options_t common_options; - const char *outfilename = get_decoded_outfilename(infilename); - - if(0 == outfilename) { - flac__utils_printf(stderr, 1, "ERROR: filename too long: %s", infilename); - return 1; - } - - /* - * Error if output file already exists (and -f not used). - * Use grabbag__file_get_filesize() as a cheap way to check. - */ - if(!option_values.test_only && !option_values.force_file_overwrite && strcmp(outfilename, "-") && grabbag__file_get_filesize(outfilename) != (off_t)(-1)) { - flac__utils_printf(stderr, 1, "ERROR: output file %s already exists, use -f to override\n", outfilename); - return 1; - } - - if(option_values.force_raw_format) - output_format = RAW; - else if( - option_values.force_aiff_format || - (strlen(outfilename) >= 4 && 0 == FLAC__STRCASECMP(outfilename+(strlen(outfilename)-4), ".aif")) || - (strlen(outfilename) >= 5 && 0 == FLAC__STRCASECMP(outfilename+(strlen(outfilename)-5), ".aiff")) - ) - output_format = AIF; - else - output_format = WAV; - - if(!option_values.test_only && !option_values.analyze) { - if(output_format == RAW && (option_values.format_is_big_endian < 0 || option_values.format_is_unsigned_samples < 0)) - return usage_error("ERROR: for decoding to a raw file you must specify a value for --endian and --sign\n"); - } - - if(option_values.keep_foreign_metadata) { - if(0 == strcmp(infilename, "-") || 0 == strcmp(outfilename, "-")) - return usage_error("ERROR: --keep-foreign-metadata cannot be used when decoding from stdin or to stdout\n"); - if(output_format != WAV && output_format != AIF) - return usage_error("ERROR: --keep-foreign-metadata can only be used with WAVE or AIFF output\n"); - } - - if(option_values.use_ogg) - treat_as_ogg = true; - else if(strlen(infilename) >= 4 && 0 == FLAC__STRCASECMP(infilename+(strlen(infilename)-4), ".oga")) - treat_as_ogg = true; - else if(strlen(infilename) >= 4 && 0 == FLAC__STRCASECMP(infilename+(strlen(infilename)-4), ".ogg")) - treat_as_ogg = true; - else - treat_as_ogg = false; - -#if !FLAC__HAS_OGG - if(treat_as_ogg) { - flac__utils_printf(stderr, 1, "%s: Ogg support has not been built into this copy of flac\n", infilename); - return 1; - } -#endif - - if(!flac__utils_parse_skip_until_specification(option_values.skip_specification, &common_options.skip_specification) || common_options.skip_specification.is_relative) - return usage_error("ERROR: invalid value for --skip\n"); - - if(!flac__utils_parse_skip_until_specification(option_values.until_specification, &common_options.until_specification)) /*@@@ more checks: no + without --skip, no - unless known total_samples_to_{en,de}code */ - return usage_error("ERROR: invalid value for --until\n"); - /* if there is no "--until" we want to default to "--until=-0" */ - if(0 == option_values.until_specification) - common_options.until_specification.is_relative = true; - - if(option_values.cue_specification) { - if(!flac__utils_parse_cue_specification(option_values.cue_specification, &common_options.cue_specification)) - return usage_error("ERROR: invalid value for --cue\n"); - common_options.has_cue_specification = true; - } - else - common_options.has_cue_specification = false; - - common_options.treat_warnings_as_errors = option_values.treat_warnings_as_errors; - common_options.continue_through_decode_errors = option_values.continue_through_decode_errors; - common_options.replaygain_synthesis_spec = option_values.replaygain_synthesis_spec; -#if FLAC__HAS_OGG - common_options.is_ogg = treat_as_ogg; - common_options.use_first_serial_number = !option_values.has_serial_number; - common_options.serial_number = option_values.serial_number; -#endif - common_options.channel_map_none = option_values.channel_map_none; - - if(output_format == RAW) { - raw_decode_options_t options; - - options.common = common_options; - options.is_big_endian = option_values.format_is_big_endian; - options.is_unsigned_samples = option_values.format_is_unsigned_samples; - - retval = flac__decode_raw(infilename, option_values.test_only? 0 : outfilename, option_values.analyze, option_values.aopts, options); - } - else { - wav_decode_options_t options; - - options.common = common_options; - options.foreign_metadata = 0; - - /* read foreign metadata if requested */ - if(option_values.keep_foreign_metadata) { - if(0 == (options.foreign_metadata = flac__foreign_metadata_new(output_format==AIF? FOREIGN_BLOCK_TYPE__AIFF : FOREIGN_BLOCK_TYPE__RIFF))) { - flac__utils_printf(stderr, 1, "ERROR: creating foreign metadata object\n"); - return 1; - } - } - - if(output_format == AIF) - retval = flac__decode_aiff(infilename, option_values.test_only? 0 : outfilename, option_values.analyze, option_values.aopts, options); - else - retval = flac__decode_wav(infilename, option_values.test_only? 0 : outfilename, option_values.analyze, option_values.aopts, options); - - if(options.foreign_metadata) - flac__foreign_metadata_delete(options.foreign_metadata); - } - - if(retval == 0 && strcmp(infilename, "-")) { - if(strcmp(outfilename, "-")) - grabbag__file_copy_metadata(infilename, outfilename); - if(option_values.delete_input && !option_values.test_only && !option_values.analyze) - unlink(infilename); - } - - return retval; -} - -const char *get_encoded_outfilename(const char *infilename) -{ - const char *suffix = (option_values.use_ogg? ".oga" : ".flac"); - return get_outfilename(infilename, suffix); -} - -const char *get_decoded_outfilename(const char *infilename) -{ - const char *suffix; - if(option_values.analyze) { - suffix = ".ana"; - } - else if(option_values.force_raw_format) { - suffix = ".raw"; - } - else if(option_values.force_aiff_format) { - suffix = ".aiff"; - } - else { - suffix = ".wav"; - } - return get_outfilename(infilename, suffix); -} - -const char *get_outfilename(const char *infilename, const char *suffix) -{ - if(0 == option_values.cmdline_forced_outfilename) { - static char buffer[4096]; /* @@@ bad MAGIC NUMBER */ - - if(0 == strcmp(infilename, "-") || option_values.force_to_stdout) { - strcpy(buffer, "-"); - } - else { - char *p; - if (flac__strlcpy(buffer, option_values.output_prefix? option_values.output_prefix : "", sizeof buffer) >= sizeof buffer) - return 0; - if (flac__strlcat(buffer, infilename, sizeof buffer) >= sizeof buffer) - return 0; - /* the . must come after any / to avoid problems with, e.g. "some.directory/extensionless-filename" */ - if(0 == (p = strrchr(buffer, '.')) || strchr(p, '/')) { - if (flac__strlcat(buffer, suffix, sizeof buffer) >= sizeof buffer) - return 0; - } - else { - *p = '\0'; - if (flac__strlcat(buffer, suffix, sizeof buffer) >= sizeof buffer) - return 0; - } - } - return buffer; - } - else - return option_values.cmdline_forced_outfilename; -} - -void die(const char *message) -{ - FLAC__ASSERT(0 != message); - flac__utils_printf(stderr, 1, "ERROR: %s\n", message); - exit(1); -} - -int conditional_fclose(FILE *f) -{ - if(f == 0 || f == stdin || f == stdout) - return 0; - else - return fclose(f); -} - -char *local_strdup(const char *source) -{ - char *ret; - FLAC__ASSERT(0 != source); - if(0 == (ret = strdup(source))) - die("out of memory during strdup()"); - return ret; -} - -#ifdef _MSC_VER -/* There's no strtoll() in MSVC6 so we just write a specialized one */ -FLAC__int64 local__strtoll(const char *src, char **endptr) -{ - FLAC__bool neg = false; - FLAC__int64 ret = 0; - int c; - FLAC__ASSERT(0 != src); - if(*src == '-') { - neg = true; - src++; - } - while(0 != (c = *src)) { - c -= '0'; - if(c >= 0 && c <= 9) - ret = (ret * 10) + c; - else - break; - src++; - } - if(endptr) - *endptr = (char*)src; - return neg? -ret : ret; -} -#endif diff --git a/3rdparty/libflac/src/flac/utils.c b/3rdparty/libflac/src/flac/utils.c deleted file mode 100644 index bca8af761cc..00000000000 --- a/3rdparty/libflac/src/flac/utils.c +++ /dev/null @@ -1,316 +0,0 @@ -/* flac - Command-line FLAC encoder/decoder - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "utils.h" -#include "FLAC/assert.h" -#include "FLAC/metadata.h" -#include <math.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -const char *CHANNEL_MASK_TAG = "WAVEFORMATEXTENSIBLE_CHANNEL_MASK"; - -int flac__utils_verbosity_ = 2; - -static FLAC__bool local__parse_uint64_(const char *s, FLAC__uint64 *value) -{ - FLAC__uint64 ret = 0; - char c; - - if(*s == '\0') - return false; - - while('\0' != (c = *s++)) - if(c >= '0' && c <= '9') - ret = ret * 10 + (c - '0'); - else - return false; - - *value = ret; - return true; -} - -static FLAC__bool local__parse_timecode_(const char *s, double *value) -{ - double ret; - unsigned i; - char c; - - /* parse [0-9][0-9]*: */ - c = *s++; - if(c >= '0' && c <= '9') - i = (c - '0'); - else - return false; - while(':' != (c = *s++)) { - if(c >= '0' && c <= '9') - i = i * 10 + (c - '0'); - else - return false; - } - ret = (double)i * 60.; - - /* parse [0-9]*[.,]?[0-9]* i.e. a sign-less rational number (. or , OK for fractional seconds, to support different locales) */ - if(strspn(s, "1234567890.,") != strlen(s)) - return false; - { - const char *p = strpbrk(s, ".,"); - if(p && 0 != strpbrk(++p, ".,")) - return false; - } - ret += atof(s); - - *value = ret; - return true; -} - -static FLAC__bool local__parse_cue_(const char *s, const char *end, unsigned *track, unsigned *index) -{ - FLAC__bool got_track = false, got_index = false; - unsigned t = 0, i = 0; - char c; - - while(end? s < end : *s != '\0') { - c = *s++; - if(c >= '0' && c <= '9') { - t = t * 10 + (c - '0'); - got_track = true; - } - else if(c == '.') - break; - else - return false; - } - while(end? s < end : *s != '\0') { - c = *s++; - if(c >= '0' && c <= '9') { - i = i * 10 + (c - '0'); - got_index = true; - } - else - return false; - } - *track = t; - *index = i; - return got_track && got_index; -} - -/* - * this only works with sorted cuesheets (the spec strongly recommends but - * does not require sorted cuesheets). but if it's not sorted, picking a - * nearest cue point has no significance. - */ -static FLAC__uint64 local__find_closest_cue_(const FLAC__StreamMetadata_CueSheet *cuesheet, unsigned track, unsigned index, FLAC__uint64 total_samples, FLAC__bool look_forward) -{ - int t, i; - if(look_forward) { - for(t = 0; t < (int)cuesheet->num_tracks; t++) - for(i = 0; i < (int)cuesheet->tracks[t].num_indices; i++) - if(cuesheet->tracks[t].number > track || (cuesheet->tracks[t].number == track && cuesheet->tracks[t].indices[i].number >= index)) - return cuesheet->tracks[t].offset + cuesheet->tracks[t].indices[i].offset; - return total_samples; - } - else { - for(t = (int)cuesheet->num_tracks - 1; t >= 0; t--) - for(i = (int)cuesheet->tracks[t].num_indices - 1; i >= 0; i--) - if(cuesheet->tracks[t].number < track || (cuesheet->tracks[t].number == track && cuesheet->tracks[t].indices[i].number <= index)) - return cuesheet->tracks[t].offset + cuesheet->tracks[t].indices[i].offset; - return 0; - } -} - -void flac__utils_printf(FILE *stream, int level, const char *format, ...) -{ - if(flac__utils_verbosity_ >= level) { - va_list args; - - FLAC__ASSERT(0 != format); - - va_start(args, format); - - (void) vfprintf(stream, format, args); - - va_end(args); - } -} - -#ifdef FLAC__VALGRIND_TESTING -size_t flac__utils_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) -{ - size_t ret = fwrite(ptr, size, nmemb, stream); - if(!ferror(stream)) - fflush(stream); - return ret; -} -#endif - -FLAC__bool flac__utils_parse_skip_until_specification(const char *s, utils__SkipUntilSpecification *spec) -{ - FLAC__uint64 val; - FLAC__bool is_negative = false; - - FLAC__ASSERT(0 != spec); - - spec->is_relative = false; - spec->value_is_samples = true; - spec->value.samples = 0; - - if(0 != s) { - if(s[0] == '-') { - is_negative = true; - spec->is_relative = true; - s++; - } - else if(s[0] == '+') { - spec->is_relative = true; - s++; - } - - if(local__parse_uint64_(s, &val)) { - spec->value_is_samples = true; - spec->value.samples = (FLAC__int64)val; - if(is_negative) - spec->value.samples = -(spec->value.samples); - } - else { - double d; - if(!local__parse_timecode_(s, &d)) - return false; - spec->value_is_samples = false; - spec->value.seconds = d; - if(is_negative) - spec->value.seconds = -(spec->value.seconds); - } - } - - return true; -} - -void flac__utils_canonicalize_skip_until_specification(utils__SkipUntilSpecification *spec, unsigned sample_rate) -{ - FLAC__ASSERT(0 != spec); - if(!spec->value_is_samples) { - spec->value.samples = (FLAC__int64)(spec->value.seconds * (double)sample_rate); - spec->value_is_samples = true; - } -} - -FLAC__bool flac__utils_parse_cue_specification(const char *s, utils__CueSpecification *spec) -{ - const char *start = s, *end = 0; - - FLAC__ASSERT(0 != spec); - - spec->has_start_point = spec->has_end_point = false; - - s = strchr(s, '-'); - - if(0 != s) { - if(s == start) - start = 0; - end = s+1; - if(*end == '\0') - end = 0; - } - - if(start) { - if(!local__parse_cue_(start, s, &spec->start_track, &spec->start_index)) - return false; - spec->has_start_point = true; - } - - if(end) { - if(!local__parse_cue_(end, 0, &spec->end_track, &spec->end_index)) - return false; - spec->has_end_point = true; - } - - return true; -} - -void flac__utils_canonicalize_cue_specification(const utils__CueSpecification *cue_spec, const FLAC__StreamMetadata_CueSheet *cuesheet, FLAC__uint64 total_samples, utils__SkipUntilSpecification *skip_spec, utils__SkipUntilSpecification *until_spec) -{ - FLAC__ASSERT(0 != cue_spec); - FLAC__ASSERT(0 != cuesheet); - FLAC__ASSERT(0 != total_samples); - FLAC__ASSERT(0 != skip_spec); - FLAC__ASSERT(0 != until_spec); - - skip_spec->is_relative = false; - skip_spec->value_is_samples = true; - - until_spec->is_relative = false; - until_spec->value_is_samples = true; - - if(cue_spec->has_start_point) - skip_spec->value.samples = local__find_closest_cue_(cuesheet, cue_spec->start_track, cue_spec->start_index, total_samples, /*look_forward=*/false); - else - skip_spec->value.samples = 0; - - if(cue_spec->has_end_point) - until_spec->value.samples = local__find_closest_cue_(cuesheet, cue_spec->end_track, cue_spec->end_index, total_samples, /*look_forward=*/true); - else - until_spec->value.samples = total_samples; -} - -FLAC__bool flac__utils_set_channel_mask_tag(FLAC__StreamMetadata *object, FLAC__uint32 channel_mask) -{ - FLAC__StreamMetadata_VorbisComment_Entry entry = { 0, 0 }; - char tag[128]; - - FLAC__ASSERT(object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - FLAC__ASSERT(strlen(CHANNEL_MASK_TAG+1+2+16+1) <= sizeof(tag)); /* +1 for =, +2 for 0x, +16 for digits, +1 for NUL */ - entry.entry = (FLAC__byte*)tag; -#if defined _MSC_VER || defined __MINGW32__ - if((entry.length = _snprintf(tag, sizeof(tag), "%s=0x%04X", CHANNEL_MASK_TAG, (unsigned)channel_mask)) >= sizeof(tag)) -#else - if((entry.length = snprintf(tag, sizeof(tag), "%s=0x%04X", CHANNEL_MASK_TAG, (unsigned)channel_mask)) >= sizeof(tag)) -#endif - return false; - if(!FLAC__metadata_object_vorbiscomment_replace_comment(object, entry, /*all=*/true, /*copy=*/true)) - return false; - return true; -} - -FLAC__bool flac__utils_get_channel_mask_tag(const FLAC__StreamMetadata *object, FLAC__uint32 *channel_mask) -{ - int offset; - unsigned val; - char *p; - FLAC__ASSERT(object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - if(0 > (offset = FLAC__metadata_object_vorbiscomment_find_entry_from(object, /*offset=*/0, CHANNEL_MASK_TAG))) - return false; - if(object->data.vorbis_comment.comments[offset].length < strlen(CHANNEL_MASK_TAG)+4) - return false; - if(0 == (p = strchr((const char *)object->data.vorbis_comment.comments[offset].entry, '='))) /* should never happen, but just in case */ - return false; - if(strncmp(p, "=0x", 3)) - return false; - if(sscanf(p+3, "%x", &val) != 1) - return false; - *channel_mask = val; - return true; -} diff --git a/3rdparty/libflac/src/flac/utils.h b/3rdparty/libflac/src/flac/utils.h deleted file mode 100644 index 74ab29e3e3e..00000000000 --- a/3rdparty/libflac/src/flac/utils.h +++ /dev/null @@ -1,63 +0,0 @@ -/* flac - Command-line FLAC encoder/decoder - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef flac__utils_h -#define flac__utils_h - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "FLAC/ordinals.h" -#include "FLAC/format.h" /* for FLAC__StreamMetadata_CueSheet */ -#include <stdio.h> /* for FILE */ - -typedef struct { - FLAC__bool is_relative; /* i.e. specification string started with + or - */ - FLAC__bool value_is_samples; - union { - double seconds; - FLAC__int64 samples; - } value; -} utils__SkipUntilSpecification; - -typedef struct { - FLAC__bool has_start_point, has_end_point; - unsigned start_track, start_index; - unsigned end_track, end_index; -} utils__CueSpecification; - -#ifdef FLAC__VALGRIND_TESTING -size_t flac__utils_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream); -#else -#define flac__utils_fwrite fwrite -#endif - -extern int flac__utils_verbosity_; -void flac__utils_printf(FILE *stream, int level, const char *format, ...); - -FLAC__bool flac__utils_parse_skip_until_specification(const char *s, utils__SkipUntilSpecification *spec); -void flac__utils_canonicalize_skip_until_specification(utils__SkipUntilSpecification *spec, unsigned sample_rate); - -FLAC__bool flac__utils_parse_cue_specification(const char *s, utils__CueSpecification *spec); -void flac__utils_canonicalize_cue_specification(const utils__CueSpecification *cue_spec, const FLAC__StreamMetadata_CueSheet *cuesheet, FLAC__uint64 total_samples, utils__SkipUntilSpecification *skip_spec, utils__SkipUntilSpecification *until_spec); - -FLAC__bool flac__utils_set_channel_mask_tag(FLAC__StreamMetadata *object, FLAC__uint32 channel_mask); -FLAC__bool flac__utils_get_channel_mask_tag(const FLAC__StreamMetadata *object, FLAC__uint32 *channel_mask); - -#endif diff --git a/3rdparty/libflac/src/flac/vorbiscomment.c b/3rdparty/libflac/src/flac/vorbiscomment.c deleted file mode 100644 index 6b35a1e6359..00000000000 --- a/3rdparty/libflac/src/flac/vorbiscomment.c +++ /dev/null @@ -1,248 +0,0 @@ -/* flac - Command-line FLAC encoder/decoder - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "vorbiscomment.h" -#include "FLAC/assert.h" -#include "FLAC/metadata.h" -#include "share/grabbag.h" /* for grabbag__file_get_filesize() */ -#include "share/utf8.h" -#include <ctype.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - - -/* - * This struct and the following 4 static functions are copied from - * ../metaflac/. Maybe someday there will be a convenience - * library for Vorbis comment parsing. - */ -typedef struct { - char *field; /* the whole field as passed on the command line, i.e. "NAME=VALUE" */ - char *field_name; - /* according to the vorbis spec, field values can contain \0 so simple C strings are not enough here */ - unsigned field_value_length; - char *field_value; - FLAC__bool field_value_from_file; /* true if field_value holds a filename for the value, false for plain value */ -} Argument_VcField; - -static void die(const char *message) -{ - FLAC__ASSERT(0 != message); - fprintf(stderr, "ERROR: %s\n", message); - exit(1); -} - -static char *local_strdup(const char *source) -{ - char *ret; - FLAC__ASSERT(0 != source); - if(0 == (ret = strdup(source))) - die("out of memory during strdup()"); - return ret; -} - -static FLAC__bool parse_vorbis_comment_field(const char *field_ref, char **field, char **name, char **value, unsigned *length, const char **violation) -{ - static const char * const violations[] = { - "field name contains invalid character", - "field contains no '=' character" - }; - - char *p, *q, *s; - - if(0 != field) - *field = local_strdup(field_ref); - - s = local_strdup(field_ref); - - if(0 == (p = strchr(s, '='))) { - free(s); - *violation = violations[1]; - return false; - } - *p++ = '\0'; - - for(q = s; *q; q++) { - if(*q < 0x20 || *q > 0x7d || *q == 0x3d) { - free(s); - *violation = violations[0]; - return false; - } - } - - *name = local_strdup(s); - *value = local_strdup(p); - *length = strlen(p); - - free(s); - return true; -} - -/* slight modification: no 'filename' arg, and errors are passed back in 'violation' instead of printed to stderr */ -static FLAC__bool set_vc_field(FLAC__StreamMetadata *block, const Argument_VcField *field, FLAC__bool *needs_write, FLAC__bool raw, const char **violation) -{ - FLAC__StreamMetadata_VorbisComment_Entry entry; - char *converted; - - FLAC__ASSERT(0 != block); - FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - FLAC__ASSERT(0 != field); - FLAC__ASSERT(0 != needs_write); - - if(field->field_value_from_file) { - /* read the file into 'data' */ - FILE *f = 0; - char *data = 0; - const off_t size = grabbag__file_get_filesize(field->field_value); - if(size < 0) { - *violation = "can't open file for tag value"; - return false; - } - if(size >= 0x100000) { /* magic arbitrary limit, actual format limit is near 16MB */ - *violation = "file for tag value is too large"; - return false; - } - if(0 == (data = malloc(size+1))) - die("out of memory allocating tag value"); - data[size] = '\0'; - if(0 == (f = fopen(field->field_value, "rb")) || fread(data, 1, size, f) != (size_t)size) { - free(data); - if(f) - fclose(f); - *violation = "error while reading file for tag value"; - return false; - } - fclose(f); - if(strlen(data) != (size_t)size) { - free(data); - *violation = "file for tag value has embedded NULs"; - return false; - } - - /* move 'data' into 'converted', converting to UTF-8 if necessary */ - if(raw) { - converted = data; - } - else if(utf8_encode(data, &converted) >= 0) { - free(data); - } - else { - free(data); - *violation = "error converting file contents to UTF-8 for tag value"; - return false; - } - - /* create and entry and append it */ - if(!FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(&entry, field->field_name, converted)) { - free(converted); - *violation = "file for tag value is not valid UTF-8"; - return false; - } - free(converted); - if(!FLAC__metadata_object_vorbiscomment_append_comment(block, entry, /*copy=*/false)) { - *violation = "memory allocation failure"; - return false; - } - - *needs_write = true; - return true; - } - else { - FLAC__bool needs_free = false; - if(raw) { - entry.entry = (FLAC__byte *)field->field; - } - else if(utf8_encode(field->field, &converted) >= 0) { - entry.entry = (FLAC__byte *)converted; - needs_free = true; - } - else { - *violation = "error converting comment to UTF-8"; - return false; - } - entry.length = strlen((const char *)entry.entry); - if(!FLAC__format_vorbiscomment_entry_is_legal(entry.entry, entry.length)) { - if(needs_free) - free(converted); - /* - * our previous parsing has already established that the field - * name is OK, so it must be the field value - */ - *violation = "tag value for is not valid UTF-8"; - return false; - } - - if(!FLAC__metadata_object_vorbiscomment_append_comment(block, entry, /*copy=*/true)) { - if(needs_free) - free(converted); - *violation = "memory allocation failure"; - return false; - } - - *needs_write = true; - if(needs_free) - free(converted); - return true; - } -} - -/* - * The rest of the code is novel - */ - -static void free_field(Argument_VcField *obj) -{ - if(0 != obj->field) - free(obj->field); - if(0 != obj->field_name) - free(obj->field_name); - if(0 != obj->field_value) - free(obj->field_value); -} - -FLAC__bool flac__vorbiscomment_add(FLAC__StreamMetadata *block, const char *comment, FLAC__bool value_from_file, FLAC__bool raw, const char **violation) -{ - Argument_VcField parsed; - FLAC__bool dummy; - - FLAC__ASSERT(0 != block); - FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - FLAC__ASSERT(0 != comment); - - memset(&parsed, 0, sizeof(parsed)); - - parsed.field_value_from_file = value_from_file; - if(!parse_vorbis_comment_field(comment, &(parsed.field), &(parsed.field_name), &(parsed.field_value), &(parsed.field_value_length), violation)) { - free_field(&parsed); - return false; - } - - if(!set_vc_field(block, &parsed, &dummy, raw, violation)) { - free_field(&parsed); - return false; - } - else { - free_field(&parsed); - return true; - } -} diff --git a/3rdparty/libflac/src/flac/vorbiscomment.h b/3rdparty/libflac/src/flac/vorbiscomment.h deleted file mode 100644 index 1ff70067867..00000000000 --- a/3rdparty/libflac/src/flac/vorbiscomment.h +++ /dev/null @@ -1,26 +0,0 @@ -/* flac - Command-line FLAC encoder/decoder - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef flac__vorbiscomment_h -#define flac__vorbiscomment_h - -#include "FLAC/metadata.h" - -FLAC__bool flac__vorbiscomment_add(FLAC__StreamMetadata *block, const char *comment, FLAC__bool value_from_file, FLAC__bool raw, const char **violation); - -#endif diff --git a/3rdparty/libflac/src/libFLAC++/Makefile.am b/3rdparty/libflac/src/libFLAC++/Makefile.am deleted file mode 100644 index 360caa193dd..00000000000 --- a/3rdparty/libflac/src/libFLAC++/Makefile.am +++ /dev/null @@ -1,55 +0,0 @@ -# libFLAC++ - Free Lossless Audio Codec library -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -lib_LTLIBRARIES = libFLAC++.la - -m4datadir = $(datadir)/aclocal -m4data_DATA = libFLAC++.m4 - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = flac++.pc - -EXTRA_DIST = \ - Makefile.lite \ - flac++.pc.in \ - libFLAC++_dynamic.dsp \ - libFLAC++_dynamic.vcproj \ - libFLAC++_static.dsp \ - libFLAC++_static.vcproj \ - libFLAC++.m4 - -# see 'http://www.gnu.org/software/libtool/manual.html#Libtool-versioning' for numbering convention -libFLAC___la_LDFLAGS = -version-info 8:0:2 -libFLAC___la_LIBADD = ../libFLAC/libFLAC.la - -libFLAC___la_SOURCES = \ - metadata.cpp \ - stream_decoder.cpp \ - stream_encoder.cpp diff --git a/3rdparty/libflac/src/libFLAC++/Makefile.in b/3rdparty/libflac/src/libFLAC++/Makefile.in deleted file mode 100644 index 834b46444c2..00000000000 --- a/3rdparty/libflac/src/libFLAC++/Makefile.in +++ /dev/null @@ -1,607 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# libFLAC++ - Free Lossless Audio Codec library -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -lib_LTLIBRARIES = libFLAC++.la - -m4datadir = $(datadir)/aclocal -m4data_DATA = libFLAC++.m4 - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = flac++.pc - -EXTRA_DIST = \ - Makefile.lite \ - flac++.pc.in \ - libFLAC++_dynamic.dsp \ - libFLAC++_dynamic.vcproj \ - libFLAC++_static.dsp \ - libFLAC++_static.vcproj \ - libFLAC++.m4 - - -# see 'http://www.gnu.org/software/libtool/manual.html#Libtool-versioning' for numbering convention -libFLAC___la_LDFLAGS = -version-info 8:0:2 -libFLAC___la_LIBADD = ../libFLAC/libFLAC.la - -libFLAC___la_SOURCES = \ - metadata.cpp \ - stream_decoder.cpp \ - stream_encoder.cpp - -subdir = src/libFLAC++ -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = flac++.pc -LTLIBRARIES = $(lib_LTLIBRARIES) - -libFLAC___la_DEPENDENCIES = ../libFLAC/libFLAC.la -am_libFLAC___la_OBJECTS = metadata.lo stream_decoder.lo \ - stream_encoder.lo -libFLAC___la_OBJECTS = $(am_libFLAC___la_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/metadata.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/stream_decoder.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/stream_encoder.Plo -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(libFLAC___la_SOURCES) -DATA = $(m4data_DATA) $(pkgconfig_DATA) - -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am flac++.pc.in -SOURCES = $(libFLAC___la_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/libFLAC++/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -flac++.pc: $(top_builddir)/config.status flac++.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -libLTLIBRARIES_INSTALL = $(INSTALL) -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(libdir) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ - else :; fi; \ - done - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - p="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" = "$$p" && dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libFLAC++.la: $(libFLAC___la_OBJECTS) $(libFLAC___la_DEPENDENCIES) - $(CXXLINK) -rpath $(libdir) $(libFLAC___la_LDFLAGS) $(libFLAC___la_OBJECTS) $(libFLAC___la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metadata.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream_decoder.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream_encoder.Plo@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCXX_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -.cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCXX_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -.cpp.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCXX_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -m4dataDATA_INSTALL = $(INSTALL_DATA) -install-m4dataDATA: $(m4data_DATA) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(m4datadir) - @list='$(m4data_DATA)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(m4dataDATA_INSTALL) $$d$$p $(DESTDIR)$(m4datadir)/$$f"; \ - $(m4dataDATA_INSTALL) $$d$$p $(DESTDIR)$(m4datadir)/$$f; \ - done - -uninstall-m4dataDATA: - @$(NORMAL_UNINSTALL) - @list='$(m4data_DATA)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " rm -f $(DESTDIR)$(m4datadir)/$$f"; \ - rm -f $(DESTDIR)$(m4datadir)/$$f; \ - done -pkgconfigDATA_INSTALL = $(INSTALL_DATA) -install-pkgconfigDATA: $(pkgconfig_DATA) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(pkgconfigdir) - @list='$(pkgconfig_DATA)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(pkgconfigDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgconfigdir)/$$f"; \ - $(pkgconfigDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgconfigdir)/$$f; \ - done - -uninstall-pkgconfigDATA: - @$(NORMAL_UNINSTALL) - @list='$(pkgconfig_DATA)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " rm -f $(DESTDIR)$(pkgconfigdir)/$$f"; \ - rm -f $(DESTDIR)$(pkgconfigdir)/$$f; \ - done - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(DATA) - -installdirs: - $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(m4datadir) $(DESTDIR)$(pkgconfigdir) -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: install-m4dataDATA install-pkgconfigDATA - -install-exec-am: install-libLTLIBRARIES - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ - uninstall-m4dataDATA uninstall-pkgconfigDATA - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am \ - install-libLTLIBRARIES install-m4dataDATA install-man \ - install-pkgconfigDATA install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-info-am \ - uninstall-libLTLIBRARIES uninstall-m4dataDATA \ - uninstall-pkgconfigDATA - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/libFLAC++/Makefile.lite b/3rdparty/libflac/src/libFLAC++/Makefile.lite deleted file mode 100644 index ec1f6781b9a..00000000000 --- a/3rdparty/libflac/src/libFLAC++/Makefile.lite +++ /dev/null @@ -1,47 +0,0 @@ -# libFLAC++ - Free Lossless Audio Codec library -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# -# GNU makefile -# - -topdir = ../.. - -LIB_NAME = libFLAC++ -INCLUDES = -I$(topdir)/include - -SRCS_CPP = \ - metadata.cpp \ - stream_decoder.cpp \ - stream_encoder.cpp - -include $(topdir)/build/lib.mk - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/3rdparty/libflac/src/libFLAC++/flac++.pc.in b/3rdparty/libflac/src/libFLAC++/flac++.pc.in deleted file mode 100644 index f5483117b90..00000000000 --- a/3rdparty/libflac/src/libFLAC++/flac++.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: FLAC++ -Description: Free Lossless Audio Codec Library (C++ API) -Version: @VERSION@ -Requires: flac -Libs: -L${libdir} -lFLAC++ -lm -Cflags: -I${includedir}/FLAC++ diff --git a/3rdparty/libflac/src/libFLAC++/libFLAC++.m4 b/3rdparty/libflac/src/libFLAC++/libFLAC++.m4 deleted file mode 100644 index bf37529dde6..00000000000 --- a/3rdparty/libflac/src/libFLAC++/libFLAC++.m4 +++ /dev/null @@ -1,117 +0,0 @@ -# Configure paths for libFLAC++ -# "Inspired" by ogg.m4 -# Caller must first run AM_PATH_LIBFLAC - -dnl AM_PATH_LIBFLACPP([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) -dnl Test for libFLAC++, and define LIBFLACPP_CFLAGS, LIBFLACPP_LIBS, LIBFLACPP_LIBDIR -dnl -AC_DEFUN([AM_PATH_LIBFLACPP], -[dnl -dnl Get the cflags and libraries -dnl -AC_ARG_WITH(libFLACPP,[ --with-libFLACPP=PFX Prefix where libFLAC++ is installed (optional)], libFLACPP_prefix="$withval", libFLACPP_prefix="") -AC_ARG_WITH(libFLACPP-libraries,[ --with-libFLACPP-libraries=DIR Directory where libFLAC++ library is installed (optional)], libFLACPP_libraries="$withval", libFLACPP_libraries="") -AC_ARG_WITH(libFLACPP-includes,[ --with-libFLACPP-includes=DIR Directory where libFLAC++ header files are installed (optional)], libFLACPP_includes="$withval", libFLACPP_includes="") -AC_ARG_ENABLE(libFLACPPtest, [ --disable-libFLACPPtest Do not try to compile and run a test libFLAC++ program],, enable_libFLACPPtest=yes) - - if test "x$libFLACPP_libraries" != "x" ; then - LIBFLACPP_LIBDIR="$libFLACPP_libraries" - elif test "x$libFLACPP_prefix" != "x" ; then - LIBFLACPP_LIBDIR="$libFLACPP_prefix/lib" - elif test "x$prefix" != "xNONE" ; then - LIBFLACPP_LIBDIR="$libdir" - fi - - LIBFLACPP_LIBS="-L$LIBFLACPP_LIBDIR -lFLAC++ $LIBFLAC_LIBS" - - if test "x$libFLACPP_includes" != "x" ; then - LIBFLACPP_CFLAGS="-I$libFLACPP_includes" - elif test "x$libFLACPP_prefix" != "x" ; then - LIBFLACPP_CFLAGS="-I$libFLACPP_prefix/include" - elif test "$prefix" != "xNONE"; then - LIBFLACPP_CFLAGS="" - fi - - LIBFLACPP_CFLAGS="$LIBFLACPP_CFLAGS $LIBFLAC_CFLAGS" - - AC_MSG_CHECKING(for libFLAC++) - no_libFLACPP="" - - - if test "x$enable_libFLACPPtest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_CXXFLAGS="$CXXFLAGS" - ac_save_LIBS="$LIBS" - ac_save_LD_LIBRARY_PATH="$LD_LIBRARY_PATH" - CFLAGS="$CFLAGS $LIBFLACPP_CFLAGS" - CXXFLAGS="$CXXFLAGS $LIBFLACPP_CFLAGS" - LIBS="$LIBS $LIBFLACPP_LIBS" - LD_LIBRARY_PATH="$LIBFLACPP_LIBDIR:$LIBFLAC_LIBDIR:$LD_LIBRARY_PATH" -dnl -dnl Now check if the installed libFLAC++ is sufficiently new. -dnl - rm -f conf.libFLAC++test - AC_TRY_RUN([ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <FLAC++/decoder.h> - -int main () -{ - system("touch conf.libFLAC++test"); - return 0; -} - -],, no_libFLACPP=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - CXXFLAGS="$ac_save_CXXFLAGS" - LIBS="$ac_save_LIBS" - LD_LIBRARY_PATH="$ac_save_LD_LIBRARY_PATH" - fi - - if test "x$no_libFLACPP" = "x" ; then - AC_MSG_RESULT(yes) - ifelse([$1], , :, [$1]) - else - AC_MSG_RESULT(no) - if test -f conf.libFLAC++test ; then - : - else - echo "*** Could not run libFLAC++ test program, checking why..." - CFLAGS="$CFLAGS $LIBFLACPP_CFLAGS" - CXXFLAGS="$CXXFLAGS $LIBFLACPP_CFLAGS" - LIBS="$LIBS $LIBFLACPP_LIBS" - LD_LIBRARY_PATH="$LIBFLACPP_LIBDIR:$LIBFLAC_LIBDIR:$LD_LIBRARY_PATH" - AC_TRY_LINK([ -#include <stdio.h> -#include <FLAC++/decoder.h> -], [ return 0; ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding libFLAC++ or finding the wrong" - echo "*** version of libFLAC++. If it is not finding libFLAC++, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means libFLAC++ was incorrectly installed" - echo "*** or that you have moved libFLAC++ since it was installed. In the latter case, you" - echo "*** may want to edit the libFLAC++-config script: $LIBFLACPP_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - CXXFLAGS="$ac_save_CXXFLAGS" - LIBS="$ac_save_LIBS" - LD_LIBRARY_PATH="$ac_save_LD_LIBRARY_PATH" - fi - LIBFLACPP_CFLAGS="" - LIBFLACPP_LIBDIR="" - LIBFLACPP_LIBS="" - ifelse([$2], , :, [$2]) - fi - AC_SUBST(LIBFLACPP_CFLAGS) - AC_SUBST(LIBFLACPP_LIBDIR) - AC_SUBST(LIBFLACPP_LIBS) - rm -f conf.libFLAC++test -]) diff --git a/3rdparty/libflac/src/libFLAC++/libFLAC++_dynamic.dsp b/3rdparty/libflac/src/libFLAC++/libFLAC++_dynamic.dsp deleted file mode 100644 index 4cf8d8adcb8..00000000000 --- a/3rdparty/libflac/src/libFLAC++/libFLAC++_dynamic.dsp +++ /dev/null @@ -1,139 +0,0 @@ -# Microsoft Developer Studio Project File - Name="libFLAC++_dynamic" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=libFLAC++_dynamic - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libFLAC++_dynamic.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libFLAC++_dynamic.mak" CFG="libFLAC++_dynamic - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libFLAC++_dynamic - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libFLAC++_dynamic - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "libFLAC++" -# PROP Scc_LocalPath "..\.." -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libFLAC++_dynamic - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\obj\release\lib" -# PROP Intermediate_Dir "Release_dynamic" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I ".\include" /I "..\..\include" /D "NDEBUG" /D "FLACPP_API_EXPORTS" /D "_WINDOWS" /D "_WINDLL" /D "WIN32" /D "_USRDLL" /FR /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" /d "_USRDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 ..\..\obj\release\lib\libFLAC.lib /nologo /subsystem:windows /dll /machine:I386 /out:"..\..\obj\release\bin/libFLAC++.dll" - -!ELSEIF "$(CFG)" == "libFLAC++_dynamic - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\obj\debug\lib" -# PROP Intermediate_Dir "Debug_dynamic" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I ".\include" /I "..\..\include" /D "_DEBUG" /D "DEBUG" /D "FLACPP_API_EXPORTS" /D "_WINDOWS" /D "_WINDLL" /D "WIN32" /D "_USRDLL" /FR /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" /d "_USRDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\..\obj\debug\lib\libFLAC.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"..\..\obj\debug\bin/libFLAC++.dll" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "libFLAC++_dynamic - Win32 Release" -# Name "libFLAC++_dynamic - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp" -# Begin Source File - -SOURCE=.\metadata.cpp -# End Source File -# Begin Source File - -SOURCE=.\stream_decoder.cpp -# End Source File -# Begin Source File - -SOURCE=.\stream_encoder.cpp -# End Source File -# End Group -# Begin Group "Private Header Files" - -# PROP Default_Filter "" -# End Group -# Begin Group "Protected Header Files" - -# PROP Default_Filter "" -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE="..\..\include\FLAC++\all.h" -# End Source File -# Begin Source File - -SOURCE="..\..\include\FLAC++\decoder.h" -# End Source File -# Begin Source File - -SOURCE="..\..\include\FLAC++\encoder.h" -# End Source File -# Begin Source File - -SOURCE="..\..\include\FLAC++\export.h" -# End Source File -# Begin Source File - -SOURCE="..\..\include\FLAC++\metadata.h" -# End Source File -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/libFLAC++/libFLAC++_dynamic.vcproj b/3rdparty/libflac/src/libFLAC++/libFLAC++_dynamic.vcproj deleted file mode 100644 index 01aa2ea39fd..00000000000 --- a/3rdparty/libflac/src/libFLAC++/libFLAC++_dynamic.vcproj +++ /dev/null @@ -1,230 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="libFLAC++_dynamic" - ProjectGUID="{4cefbc85-c215-11db-8314-0800200c9a66}" - RootNamespace="libFLAC++_dynamic" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\obj\debug\lib" - IntermediateDirectory="Debug_dynamic" - ConfigurationType="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".\include;..\..\include" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FLACPP_API_EXPORTS;DEBUG" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="2" - GenerateDebugInformation="true" - SubSystem="2" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\obj\release\lib" - IntermediateDirectory="Release_dynamic" - ConfigurationType="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".\include;..\..\include" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FLACPP_API_EXPORTS" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="1" - GenerateDebugInformation="true" - SubSystem="2" - OptimizeReferences="2" - EnableCOMDATFolding="2" - LinkTimeCodeGeneration="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\metadata.cpp" - > - </File> - <File - RelativePath=".\stream_decoder.cpp" - > - </File> - <File - RelativePath=".\stream_encoder.cpp" - > - </File> - </Filter> - <Filter - Name="Public Header Files" - > - <File - RelativePath="..\..\include\FLAC++\all.h" - > - </File> - <File - RelativePath="..\..\include\FLAC++\decoder.h" - > - </File> - <File - RelativePath="..\..\include\FLAC++\encoder.h" - > - </File> - <File - RelativePath="..\..\include\FLAC++\export.h" - > - </File> - <File - RelativePath="..\..\include\FLAC++\metadata.h" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/libFLAC++/libFLAC++_static.dsp b/3rdparty/libflac/src/libFLAC++/libFLAC++_static.dsp deleted file mode 100644 index f887419e8dc..00000000000 --- a/3rdparty/libflac/src/libFLAC++/libFLAC++_static.dsp +++ /dev/null @@ -1,132 +0,0 @@ -# Microsoft Developer Studio Project File - Name="libFLAC++_static" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=libFLAC++_static - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libFLAC++_static.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libFLAC++_static.mak" CFG="libFLAC++_static - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libFLAC++_static - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "libFLAC++_static - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "libFLAC++" -# PROP Scc_LocalPath "..\.." -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libFLAC++_static - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\obj\release\lib" -# PROP Intermediate_Dir "Release_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I ".\include" /I "..\..\include" /D "FLAC__NO_DLL" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "libFLAC++_static - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\obj\debug\lib" -# PROP Intermediate_Dir "Debug_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I ".\include" /I "..\..\include" /D "FLAC__NO_DLL" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "libFLAC++_static - Win32 Release" -# Name "libFLAC++_static - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp" -# Begin Source File - -SOURCE=.\metadata.cpp -# End Source File -# Begin Source File - -SOURCE=.\stream_decoder.cpp -# End Source File -# Begin Source File - -SOURCE=.\stream_encoder.cpp -# End Source File -# End Group -# Begin Group "Private Header Files" - -# PROP Default_Filter "" -# End Group -# Begin Group "Protected Header Files" - -# PROP Default_Filter "" -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE="..\..\include\FLAC++\all.h" -# End Source File -# Begin Source File - -SOURCE="..\..\include\FLAC++\decoder.h" -# End Source File -# Begin Source File - -SOURCE="..\..\include\FLAC++\encoder.h" -# End Source File -# Begin Source File - -SOURCE="..\..\include\FLAC++\export.h" -# End Source File -# Begin Source File - -SOURCE="..\..\include\FLAC++\metadata.h" -# End Source File -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/libFLAC++/libFLAC++_static.vcproj b/3rdparty/libflac/src/libFLAC++/libFLAC++_static.vcproj deleted file mode 100644 index 9d752239307..00000000000 --- a/3rdparty/libflac/src/libFLAC++/libFLAC++_static.vcproj +++ /dev/null @@ -1,203 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="libFLAC++_static" - ProjectGUID="{4cefbc86-c215-11db-8314-0800200c9a66}" - RootNamespace="libFLAC++_static" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\obj\debug\lib" - IntermediateDirectory="Debug_static" - ConfigurationType="4" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".\include;..\..\include" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;FLAC__NO_DLL;DEBUG" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\..\obj\debug\lib\$(ProjectName).lib" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\obj\release\lib" - IntermediateDirectory="Release_static" - ConfigurationType="4" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".\include;..\..\include" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__NO_DLL" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\..\obj\release\lib\$(ProjectName).lib" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\metadata.cpp" - > - </File> - <File - RelativePath=".\stream_decoder.cpp" - > - </File> - <File - RelativePath=".\stream_encoder.cpp" - > - </File> - </Filter> - <Filter - Name="Public Header Files" - > - <File - RelativePath="..\..\include\FLAC++\all.h" - > - </File> - <File - RelativePath="..\..\include\FLAC++\decoder.h" - > - </File> - <File - RelativePath="..\..\include\FLAC++\encoder.h" - > - </File> - <File - RelativePath="..\..\include\FLAC++\export.h" - > - </File> - <File - RelativePath="..\..\include\FLAC++\metadata.h" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/libFLAC++/metadata.cpp b/3rdparty/libflac/src/libFLAC++/metadata.cpp deleted file mode 100644 index 7039624582f..00000000000 --- a/3rdparty/libflac/src/libFLAC++/metadata.cpp +++ /dev/null @@ -1,1589 +0,0 @@ -/* libFLAC++ - Free Lossless Audio Codec library - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#define __STDC_LIMIT_MACROS 1 /* otherwise SIZE_MAX is not defined for c++ */ -#include "share/alloc.h" -#include "FLAC++/metadata.h" -#include "FLAC/assert.h" -#include <stdlib.h> // for malloc(), free() -#include <string.h> // for memcpy() etc. - -#ifdef _MSC_VER -// warning C4800: 'int' : forcing to bool 'true' or 'false' (performance warning) -#pragma warning ( disable : 4800 ) -#endif - -namespace FLAC { - namespace Metadata { - - // local utility routines - - namespace local { - - Prototype *construct_block(::FLAC__StreamMetadata *object) - { - Prototype *ret = 0; - switch(object->type) { - case FLAC__METADATA_TYPE_STREAMINFO: - ret = new StreamInfo(object, /*copy=*/false); - break; - case FLAC__METADATA_TYPE_PADDING: - ret = new Padding(object, /*copy=*/false); - break; - case FLAC__METADATA_TYPE_APPLICATION: - ret = new Application(object, /*copy=*/false); - break; - case FLAC__METADATA_TYPE_SEEKTABLE: - ret = new SeekTable(object, /*copy=*/false); - break; - case FLAC__METADATA_TYPE_VORBIS_COMMENT: - ret = new VorbisComment(object, /*copy=*/false); - break; - case FLAC__METADATA_TYPE_CUESHEET: - ret = new CueSheet(object, /*copy=*/false); - break; - case FLAC__METADATA_TYPE_PICTURE: - ret = new Picture(object, /*copy=*/false); - break; - default: - ret = new Unknown(object, /*copy=*/false); - break; - } - return ret; - } - - } - - FLACPP_API Prototype *clone(const Prototype *object) - { - FLAC__ASSERT(0 != object); - - const StreamInfo *streaminfo = dynamic_cast<const StreamInfo *>(object); - const Padding *padding = dynamic_cast<const Padding *>(object); - const Application *application = dynamic_cast<const Application *>(object); - const SeekTable *seektable = dynamic_cast<const SeekTable *>(object); - const VorbisComment *vorbiscomment = dynamic_cast<const VorbisComment *>(object); - const CueSheet *cuesheet = dynamic_cast<const CueSheet *>(object); - const Picture *picture = dynamic_cast<const Picture *>(object); - const Unknown *unknown = dynamic_cast<const Unknown *>(object); - - if(0 != streaminfo) - return new StreamInfo(*streaminfo); - else if(0 != padding) - return new Padding(*padding); - else if(0 != application) - return new Application(*application); - else if(0 != seektable) - return new SeekTable(*seektable); - else if(0 != vorbiscomment) - return new VorbisComment(*vorbiscomment); - else if(0 != cuesheet) - return new CueSheet(*cuesheet); - else if(0 != picture) - return new Picture(*picture); - else if(0 != unknown) - return new Unknown(*unknown); - else { - FLAC__ASSERT(0); - return 0; - } - } - - // - // Prototype - // - - Prototype::Prototype(const Prototype &object): - object_(::FLAC__metadata_object_clone(object.object_)), - is_reference_(false) - { - FLAC__ASSERT(object.is_valid()); - } - - Prototype::Prototype(const ::FLAC__StreamMetadata &object): - object_(::FLAC__metadata_object_clone(&object)), - is_reference_(false) - { - } - - Prototype::Prototype(const ::FLAC__StreamMetadata *object): - object_(::FLAC__metadata_object_clone(object)), - is_reference_(false) - { - FLAC__ASSERT(0 != object); - } - - Prototype::Prototype(::FLAC__StreamMetadata *object, bool copy): - object_(copy? ::FLAC__metadata_object_clone(object) : object), - is_reference_(false) - { - FLAC__ASSERT(0 != object); - } - - Prototype::~Prototype() - { - clear(); - } - - void Prototype::clear() - { - if(0 != object_ && !is_reference_) - FLAC__metadata_object_delete(object_); - object_ = 0; - } - - Prototype &Prototype::operator=(const Prototype &object) - { - FLAC__ASSERT(object.is_valid()); - clear(); - is_reference_ = false; - object_ = ::FLAC__metadata_object_clone(object.object_); - return *this; - } - - Prototype &Prototype::operator=(const ::FLAC__StreamMetadata &object) - { - clear(); - is_reference_ = false; - object_ = ::FLAC__metadata_object_clone(&object); - return *this; - } - - Prototype &Prototype::operator=(const ::FLAC__StreamMetadata *object) - { - FLAC__ASSERT(0 != object); - clear(); - is_reference_ = false; - object_ = ::FLAC__metadata_object_clone(object); - return *this; - } - - Prototype &Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy) - { - FLAC__ASSERT(0 != object); - clear(); - object_ = (copy? ::FLAC__metadata_object_clone(object) : object); - is_reference_ = false; - return *this; - } - - bool Prototype::get_is_last() const - { - FLAC__ASSERT(is_valid()); - return (bool)object_->is_last; - } - - FLAC__MetadataType Prototype::get_type() const - { - FLAC__ASSERT(is_valid()); - return object_->type; - } - - unsigned Prototype::get_length() const - { - FLAC__ASSERT(is_valid()); - return object_->length; - } - - void Prototype::set_is_last(bool value) - { - FLAC__ASSERT(is_valid()); - object_->is_last = value; - } - - - // - // StreamInfo - // - - StreamInfo::StreamInfo(): - Prototype(FLAC__metadata_object_new(FLAC__METADATA_TYPE_STREAMINFO), /*copy=*/false) - { } - - StreamInfo::~StreamInfo() - { } - - unsigned StreamInfo::get_min_blocksize() const - { - FLAC__ASSERT(is_valid()); - return object_->data.stream_info.min_blocksize; - } - - unsigned StreamInfo::get_max_blocksize() const - { - FLAC__ASSERT(is_valid()); - return object_->data.stream_info.max_blocksize; - } - - unsigned StreamInfo::get_min_framesize() const - { - FLAC__ASSERT(is_valid()); - return object_->data.stream_info.min_framesize; - } - - unsigned StreamInfo::get_max_framesize() const - { - FLAC__ASSERT(is_valid()); - return object_->data.stream_info.max_framesize; - } - - unsigned StreamInfo::get_sample_rate() const - { - FLAC__ASSERT(is_valid()); - return object_->data.stream_info.sample_rate; - } - - unsigned StreamInfo::get_channels() const - { - FLAC__ASSERT(is_valid()); - return object_->data.stream_info.channels; - } - - unsigned StreamInfo::get_bits_per_sample() const - { - FLAC__ASSERT(is_valid()); - return object_->data.stream_info.bits_per_sample; - } - - FLAC__uint64 StreamInfo::get_total_samples() const - { - FLAC__ASSERT(is_valid()); - return object_->data.stream_info.total_samples; - } - - const FLAC__byte *StreamInfo::get_md5sum() const - { - FLAC__ASSERT(is_valid()); - return object_->data.stream_info.md5sum; - } - - void StreamInfo::set_min_blocksize(unsigned value) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(value >= FLAC__MIN_BLOCK_SIZE); - FLAC__ASSERT(value <= FLAC__MAX_BLOCK_SIZE); - object_->data.stream_info.min_blocksize = value; - } - - void StreamInfo::set_max_blocksize(unsigned value) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(value >= FLAC__MIN_BLOCK_SIZE); - FLAC__ASSERT(value <= FLAC__MAX_BLOCK_SIZE); - object_->data.stream_info.max_blocksize = value; - } - - void StreamInfo::set_min_framesize(unsigned value) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(value < (1u << FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN)); - object_->data.stream_info.min_framesize = value; - } - - void StreamInfo::set_max_framesize(unsigned value) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(value < (1u << FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN)); - object_->data.stream_info.max_framesize = value; - } - - void StreamInfo::set_sample_rate(unsigned value) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(FLAC__format_sample_rate_is_valid(value)); - object_->data.stream_info.sample_rate = value; - } - - void StreamInfo::set_channels(unsigned value) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(value > 0); - FLAC__ASSERT(value <= FLAC__MAX_CHANNELS); - object_->data.stream_info.channels = value; - } - - void StreamInfo::set_bits_per_sample(unsigned value) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(value >= FLAC__MIN_BITS_PER_SAMPLE); - FLAC__ASSERT(value <= FLAC__MAX_BITS_PER_SAMPLE); - object_->data.stream_info.bits_per_sample = value; - } - - void StreamInfo::set_total_samples(FLAC__uint64 value) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(value < (((FLAC__uint64)1) << FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN)); - object_->data.stream_info.total_samples = value; - } - - void StreamInfo::set_md5sum(const FLAC__byte value[16]) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(0 != value); - memcpy(object_->data.stream_info.md5sum, value, 16); - } - - - // - // Padding - // - - Padding::Padding(): - Prototype(FLAC__metadata_object_new(FLAC__METADATA_TYPE_PADDING), /*copy=*/false) - { } - - Padding::~Padding() - { } - - void Padding::set_length(unsigned length) - { - FLAC__ASSERT(is_valid()); - object_->length = length; - } - - - // - // Application - // - - Application::Application(): - Prototype(FLAC__metadata_object_new(FLAC__METADATA_TYPE_APPLICATION), /*copy=*/false) - { } - - Application::~Application() - { } - - const FLAC__byte *Application::get_id() const - { - FLAC__ASSERT(is_valid()); - return object_->data.application.id; - } - - const FLAC__byte *Application::get_data() const - { - FLAC__ASSERT(is_valid()); - return object_->data.application.data; - } - - void Application::set_id(const FLAC__byte value[4]) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(0 != value); - memcpy(object_->data.application.id, value, 4); - } - - bool Application::set_data(const FLAC__byte *data, unsigned length) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_object_application_set_data(object_, (FLAC__byte*)data, length, true); - } - - bool Application::set_data(FLAC__byte *data, unsigned length, bool copy) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_object_application_set_data(object_, data, length, copy); - } - - - // - // SeekTable - // - - SeekTable::SeekTable(): - Prototype(FLAC__metadata_object_new(FLAC__METADATA_TYPE_SEEKTABLE), /*copy=*/false) - { } - - SeekTable::~SeekTable() - { } - - unsigned SeekTable::get_num_points() const - { - FLAC__ASSERT(is_valid()); - return object_->data.seek_table.num_points; - } - - ::FLAC__StreamMetadata_SeekPoint SeekTable::get_point(unsigned index) const - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(index < object_->data.seek_table.num_points); - return object_->data.seek_table.points[index]; - } - - void SeekTable::set_point(unsigned index, const ::FLAC__StreamMetadata_SeekPoint &point) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(index < object_->data.seek_table.num_points); - ::FLAC__metadata_object_seektable_set_point(object_, index, point); - } - - bool SeekTable::insert_point(unsigned index, const ::FLAC__StreamMetadata_SeekPoint &point) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(index <= object_->data.seek_table.num_points); - return (bool)::FLAC__metadata_object_seektable_insert_point(object_, index, point); - } - - bool SeekTable::delete_point(unsigned index) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(index < object_->data.seek_table.num_points); - return (bool)::FLAC__metadata_object_seektable_delete_point(object_, index); - } - - bool SeekTable::is_legal() const - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_object_seektable_is_legal(object_); - } - - - // - // VorbisComment::Entry - // - - VorbisComment::Entry::Entry() - { - zero(); - } - - VorbisComment::Entry::Entry(const char *field, unsigned field_length) - { - zero(); - construct(field, field_length); - } - - VorbisComment::Entry::Entry(const char *field) - { - zero(); - construct(field); - } - - VorbisComment::Entry::Entry(const char *field_name, const char *field_value, unsigned field_value_length) - { - zero(); - construct(field_name, field_value, field_value_length); - } - - VorbisComment::Entry::Entry(const char *field_name, const char *field_value) - { - zero(); - construct(field_name, field_value); - } - - VorbisComment::Entry::Entry(const Entry &entry) - { - FLAC__ASSERT(entry.is_valid()); - zero(); - construct((const char *)entry.entry_.entry, entry.entry_.length); - } - - VorbisComment::Entry &VorbisComment::Entry::operator=(const Entry &entry) - { - FLAC__ASSERT(entry.is_valid()); - clear(); - construct((const char *)entry.entry_.entry, entry.entry_.length); - return *this; - } - - VorbisComment::Entry::~Entry() - { - clear(); - } - - bool VorbisComment::Entry::is_valid() const - { - return is_valid_; - } - - unsigned VorbisComment::Entry::get_field_length() const - { - FLAC__ASSERT(is_valid()); - return entry_.length; - } - - unsigned VorbisComment::Entry::get_field_name_length() const - { - FLAC__ASSERT(is_valid()); - return field_name_length_; - } - - unsigned VorbisComment::Entry::get_field_value_length() const - { - FLAC__ASSERT(is_valid()); - return field_value_length_; - } - - ::FLAC__StreamMetadata_VorbisComment_Entry VorbisComment::Entry::get_entry() const - { - FLAC__ASSERT(is_valid()); - return entry_; - } - - const char *VorbisComment::Entry::get_field() const - { - FLAC__ASSERT(is_valid()); - return (const char *)entry_.entry; - } - - const char *VorbisComment::Entry::get_field_name() const - { - FLAC__ASSERT(is_valid()); - return field_name_; - } - - const char *VorbisComment::Entry::get_field_value() const - { - FLAC__ASSERT(is_valid()); - return field_value_; - } - - bool VorbisComment::Entry::set_field(const char *field, unsigned field_length) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(0 != field); - - if(!::FLAC__format_vorbiscomment_entry_is_legal((const ::FLAC__byte*)field, field_length)) - return is_valid_ = false; - - clear_entry(); - - if(0 == (entry_.entry = (FLAC__byte*)safe_malloc_add_2op_(field_length, /*+*/1))) { - is_valid_ = false; - } - else { - entry_.length = field_length; - memcpy(entry_.entry, field, field_length); - entry_.entry[field_length] = '\0'; - (void) parse_field(); - } - - return is_valid_; - } - - bool VorbisComment::Entry::set_field(const char *field) - { - return set_field(field, strlen(field)); - } - - bool VorbisComment::Entry::set_field_name(const char *field_name) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(0 != field_name); - - if(!::FLAC__format_vorbiscomment_entry_name_is_legal(field_name)) - return is_valid_ = false; - - clear_field_name(); - - if(0 == (field_name_ = strdup(field_name))) { - is_valid_ = false; - } - else { - field_name_length_ = strlen(field_name_); - compose_field(); - } - - return is_valid_; - } - - bool VorbisComment::Entry::set_field_value(const char *field_value, unsigned field_value_length) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(0 != field_value); - - if(!::FLAC__format_vorbiscomment_entry_value_is_legal((const FLAC__byte*)field_value, field_value_length)) - return is_valid_ = false; - - clear_field_value(); - - if(0 == (field_value_ = (char *)safe_malloc_add_2op_(field_value_length, /*+*/1))) { - is_valid_ = false; - } - else { - field_value_length_ = field_value_length; - memcpy(field_value_, field_value, field_value_length); - field_value_[field_value_length] = '\0'; - compose_field(); - } - - return is_valid_; - } - - bool VorbisComment::Entry::set_field_value(const char *field_value) - { - return set_field_value(field_value, strlen(field_value)); - } - - void VorbisComment::Entry::zero() - { - is_valid_ = true; - entry_.length = 0; - entry_.entry = 0; - field_name_ = 0; - field_name_length_ = 0; - field_value_ = 0; - field_value_length_ = 0; - } - - void VorbisComment::Entry::clear() - { - clear_entry(); - clear_field_name(); - clear_field_value(); - is_valid_ = true; - } - - void VorbisComment::Entry::clear_entry() - { - if(0 != entry_.entry) { - free(entry_.entry); - entry_.entry = 0; - entry_.length = 0; - } - } - - void VorbisComment::Entry::clear_field_name() - { - if(0 != field_name_) { - free(field_name_); - field_name_ = 0; - field_name_length_ = 0; - } - } - - void VorbisComment::Entry::clear_field_value() - { - if(0 != field_value_) { - free(field_value_); - field_value_ = 0; - field_value_length_ = 0; - } - } - - void VorbisComment::Entry::construct(const char *field, unsigned field_length) - { - if(set_field(field, field_length)) - parse_field(); - } - - void VorbisComment::Entry::construct(const char *field) - { - construct(field, strlen(field)); - } - - void VorbisComment::Entry::construct(const char *field_name, const char *field_value, unsigned field_value_length) - { - if(set_field_name(field_name) && set_field_value(field_value, field_value_length)) - compose_field(); - } - - void VorbisComment::Entry::construct(const char *field_name, const char *field_value) - { - construct(field_name, field_value, strlen(field_value)); - } - - void VorbisComment::Entry::compose_field() - { - clear_entry(); - - if(0 == (entry_.entry = (FLAC__byte*)safe_malloc_add_4op_(field_name_length_, /*+*/1, /*+*/field_value_length_, /*+*/1))) { - is_valid_ = false; - } - else { - memcpy(entry_.entry, field_name_, field_name_length_); - entry_.length += field_name_length_; - memcpy(entry_.entry + entry_.length, "=", 1); - entry_.length += 1; - memcpy(entry_.entry + entry_.length, field_value_, field_value_length_); - entry_.length += field_value_length_; - entry_.entry[entry_.length] = '\0'; - is_valid_ = true; - } - } - - void VorbisComment::Entry::parse_field() - { - clear_field_name(); - clear_field_value(); - - const char *p = (const char *)memchr(entry_.entry, '=', entry_.length); - - if(0 == p) - p = (const char *)entry_.entry + entry_.length; - - field_name_length_ = (unsigned)(p - (const char *)entry_.entry); - if(0 == (field_name_ = (char *)safe_malloc_add_2op_(field_name_length_, /*+*/1))) { // +1 for the trailing \0 - is_valid_ = false; - return; - } - memcpy(field_name_, entry_.entry, field_name_length_); - field_name_[field_name_length_] = '\0'; - - if(entry_.length - field_name_length_ == 0) { - field_value_length_ = 0; - if(0 == (field_value_ = (char *)safe_malloc_(0))) { - is_valid_ = false; - return; - } - } - else { - field_value_length_ = entry_.length - field_name_length_ - 1; - if(0 == (field_value_ = (char *)safe_malloc_add_2op_(field_value_length_, /*+*/1))) { // +1 for the trailing \0 - is_valid_ = false; - return; - } - memcpy(field_value_, ++p, field_value_length_); - field_value_[field_value_length_] = '\0'; - } - - is_valid_ = true; - } - - - // - // VorbisComment - // - - VorbisComment::VorbisComment(): - Prototype(FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT), /*copy=*/false) - { } - - VorbisComment::~VorbisComment() - { } - - unsigned VorbisComment::get_num_comments() const - { - FLAC__ASSERT(is_valid()); - return object_->data.vorbis_comment.num_comments; - } - - const FLAC__byte *VorbisComment::get_vendor_string() const - { - FLAC__ASSERT(is_valid()); - return object_->data.vorbis_comment.vendor_string.entry; - } - - VorbisComment::Entry VorbisComment::get_comment(unsigned index) const - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(index < object_->data.vorbis_comment.num_comments); - return Entry((const char *)object_->data.vorbis_comment.comments[index].entry, object_->data.vorbis_comment.comments[index].length); - } - - bool VorbisComment::set_vendor_string(const FLAC__byte *string) - { - FLAC__ASSERT(is_valid()); - // vendor_string is a special kind of entry - const ::FLAC__StreamMetadata_VorbisComment_Entry vendor_string = { strlen((const char *)string), (FLAC__byte*)string }; // we can cheat on const-ness because we make a copy below: - return (bool)::FLAC__metadata_object_vorbiscomment_set_vendor_string(object_, vendor_string, /*copy=*/true); - } - - bool VorbisComment::set_comment(unsigned index, const VorbisComment::Entry &entry) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(index < object_->data.vorbis_comment.num_comments); - return (bool)::FLAC__metadata_object_vorbiscomment_set_comment(object_, index, entry.get_entry(), /*copy=*/true); - } - - bool VorbisComment::insert_comment(unsigned index, const VorbisComment::Entry &entry) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(index <= object_->data.vorbis_comment.num_comments); - return (bool)::FLAC__metadata_object_vorbiscomment_insert_comment(object_, index, entry.get_entry(), /*copy=*/true); - } - - bool VorbisComment::append_comment(const VorbisComment::Entry &entry) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_object_vorbiscomment_append_comment(object_, entry.get_entry(), /*copy=*/true); - } - - bool VorbisComment::delete_comment(unsigned index) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(index < object_->data.vorbis_comment.num_comments); - return (bool)::FLAC__metadata_object_vorbiscomment_delete_comment(object_, index); - } - - - // - // CueSheet::Track - // - - CueSheet::Track::Track(): - object_(::FLAC__metadata_object_cuesheet_track_new()) - { } - - CueSheet::Track::Track(const ::FLAC__StreamMetadata_CueSheet_Track *track): - object_(::FLAC__metadata_object_cuesheet_track_clone(track)) - { } - - CueSheet::Track::Track(const Track &track): - object_(::FLAC__metadata_object_cuesheet_track_clone(track.object_)) - { } - - CueSheet::Track &CueSheet::Track::operator=(const Track &track) - { - if(0 != object_) - ::FLAC__metadata_object_cuesheet_track_delete(object_); - object_ = ::FLAC__metadata_object_cuesheet_track_clone(track.object_); - return *this; - } - - CueSheet::Track::~Track() - { - if(0 != object_) - ::FLAC__metadata_object_cuesheet_track_delete(object_); - } - - bool CueSheet::Track::is_valid() const - { - return(0 != object_); - } - - ::FLAC__StreamMetadata_CueSheet_Index CueSheet::Track::get_index(unsigned i) const - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(i < object_->num_indices); - return object_->indices[i]; - } - - void CueSheet::Track::set_isrc(const char value[12]) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(0 != value); - memcpy(object_->isrc, value, 12); - object_->isrc[12] = '\0'; - } - - void CueSheet::Track::set_type(unsigned value) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(value <= 1); - object_->type = value; - } - - void CueSheet::Track::set_index(unsigned i, const ::FLAC__StreamMetadata_CueSheet_Index &index) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(i < object_->num_indices); - object_->indices[i] = index; - } - - - // - // CueSheet - // - - CueSheet::CueSheet(): - Prototype(FLAC__metadata_object_new(FLAC__METADATA_TYPE_CUESHEET), /*copy=*/false) - { } - - CueSheet::~CueSheet() - { } - - const char *CueSheet::get_media_catalog_number() const - { - FLAC__ASSERT(is_valid()); - return object_->data.cue_sheet.media_catalog_number; - } - - FLAC__uint64 CueSheet::get_lead_in() const - { - FLAC__ASSERT(is_valid()); - return object_->data.cue_sheet.lead_in; - } - - bool CueSheet::get_is_cd() const - { - FLAC__ASSERT(is_valid()); - return object_->data.cue_sheet.is_cd? true : false; - } - - unsigned CueSheet::get_num_tracks() const - { - FLAC__ASSERT(is_valid()); - return object_->data.cue_sheet.num_tracks; - } - - CueSheet::Track CueSheet::get_track(unsigned i) const - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(i < object_->data.cue_sheet.num_tracks); - return Track(object_->data.cue_sheet.tracks + i); - } - - void CueSheet::set_media_catalog_number(const char value[128]) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(0 != value); - memcpy(object_->data.cue_sheet.media_catalog_number, value, 128); - object_->data.cue_sheet.media_catalog_number[128] = '\0'; - } - - void CueSheet::set_lead_in(FLAC__uint64 value) - { - FLAC__ASSERT(is_valid()); - object_->data.cue_sheet.lead_in = value; - } - - void CueSheet::set_is_cd(bool value) - { - FLAC__ASSERT(is_valid()); - object_->data.cue_sheet.is_cd = value; - } - - void CueSheet::set_index(unsigned track_num, unsigned index_num, const ::FLAC__StreamMetadata_CueSheet_Index &index) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(track_num < object_->data.cue_sheet.num_tracks); - FLAC__ASSERT(index_num < object_->data.cue_sheet.tracks[track_num].num_indices); - object_->data.cue_sheet.tracks[track_num].indices[index_num] = index; - } - - bool CueSheet::insert_index(unsigned track_num, unsigned index_num, const ::FLAC__StreamMetadata_CueSheet_Index &index) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(track_num < object_->data.cue_sheet.num_tracks); - FLAC__ASSERT(index_num <= object_->data.cue_sheet.tracks[track_num].num_indices); - return (bool)::FLAC__metadata_object_cuesheet_track_insert_index(object_, track_num, index_num, index); - } - - bool CueSheet::delete_index(unsigned track_num, unsigned index_num) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(track_num < object_->data.cue_sheet.num_tracks); - FLAC__ASSERT(index_num < object_->data.cue_sheet.tracks[track_num].num_indices); - return (bool)::FLAC__metadata_object_cuesheet_track_delete_index(object_, track_num, index_num); - } - - bool CueSheet::set_track(unsigned i, const CueSheet::Track &track) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(i < object_->data.cue_sheet.num_tracks); - // We can safely const_cast since copy=true - return (bool)::FLAC__metadata_object_cuesheet_set_track(object_, i, const_cast< ::FLAC__StreamMetadata_CueSheet_Track*>(track.get_track()), /*copy=*/true); - } - - bool CueSheet::insert_track(unsigned i, const CueSheet::Track &track) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(i <= object_->data.cue_sheet.num_tracks); - // We can safely const_cast since copy=true - return (bool)::FLAC__metadata_object_cuesheet_insert_track(object_, i, const_cast< ::FLAC__StreamMetadata_CueSheet_Track*>(track.get_track()), /*copy=*/true); - } - - bool CueSheet::delete_track(unsigned i) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(i < object_->data.cue_sheet.num_tracks); - return (bool)::FLAC__metadata_object_cuesheet_delete_track(object_, i); - } - - bool CueSheet::is_legal(bool check_cd_da_subset, const char **violation) const - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_object_cuesheet_is_legal(object_, check_cd_da_subset, violation); - } - - FLAC__uint32 CueSheet::calculate_cddb_id() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__metadata_object_cuesheet_calculate_cddb_id(object_); - } - - - // - // Picture - // - - Picture::Picture(): - Prototype(FLAC__metadata_object_new(FLAC__METADATA_TYPE_PICTURE), /*copy=*/false) - { } - - Picture::~Picture() - { } - - ::FLAC__StreamMetadata_Picture_Type Picture::get_type() const - { - FLAC__ASSERT(is_valid()); - return object_->data.picture.type; - } - - const char *Picture::get_mime_type() const - { - FLAC__ASSERT(is_valid()); - return object_->data.picture.mime_type; - } - - const FLAC__byte *Picture::get_description() const - { - FLAC__ASSERT(is_valid()); - return object_->data.picture.description; - } - - FLAC__uint32 Picture::get_width() const - { - FLAC__ASSERT(is_valid()); - return object_->data.picture.width; - } - - FLAC__uint32 Picture::get_height() const - { - FLAC__ASSERT(is_valid()); - return object_->data.picture.height; - } - - FLAC__uint32 Picture::get_depth() const - { - FLAC__ASSERT(is_valid()); - return object_->data.picture.depth; - } - - FLAC__uint32 Picture::get_colors() const - { - FLAC__ASSERT(is_valid()); - return object_->data.picture.colors; - } - - FLAC__uint32 Picture::get_data_length() const - { - FLAC__ASSERT(is_valid()); - return object_->data.picture.data_length; - } - - const FLAC__byte *Picture::get_data() const - { - FLAC__ASSERT(is_valid()); - return object_->data.picture.data; - } - - void Picture::set_type(::FLAC__StreamMetadata_Picture_Type type) - { - FLAC__ASSERT(is_valid()); - object_->data.picture.type = type; - } - - bool Picture::set_mime_type(const char *string) - { - FLAC__ASSERT(is_valid()); - // We can safely const_cast since copy=true - return (bool)::FLAC__metadata_object_picture_set_mime_type(object_, const_cast<char*>(string), /*copy=*/true); - } - - bool Picture::set_description(const FLAC__byte *string) - { - FLAC__ASSERT(is_valid()); - // We can safely const_cast since copy=true - return (bool)::FLAC__metadata_object_picture_set_description(object_, const_cast<FLAC__byte*>(string), /*copy=*/true); - } - - void Picture::set_width(FLAC__uint32 value) const - { - FLAC__ASSERT(is_valid()); - object_->data.picture.width = value; - } - - void Picture::set_height(FLAC__uint32 value) const - { - FLAC__ASSERT(is_valid()); - object_->data.picture.height = value; - } - - void Picture::set_depth(FLAC__uint32 value) const - { - FLAC__ASSERT(is_valid()); - object_->data.picture.depth = value; - } - - void Picture::set_colors(FLAC__uint32 value) const - { - FLAC__ASSERT(is_valid()); - object_->data.picture.colors = value; - } - - bool Picture::set_data(const FLAC__byte *data, FLAC__uint32 data_length) - { - FLAC__ASSERT(is_valid()); - // We can safely const_cast since copy=true - return (bool)::FLAC__metadata_object_picture_set_data(object_, const_cast<FLAC__byte*>(data), data_length, /*copy=*/true); - } - - - // - // Unknown - // - - Unknown::Unknown(): - Prototype(FLAC__metadata_object_new(FLAC__METADATA_TYPE_APPLICATION), /*copy=*/false) - { } - - Unknown::~Unknown() - { } - - const FLAC__byte *Unknown::get_data() const - { - FLAC__ASSERT(is_valid()); - return object_->data.application.data; - } - - bool Unknown::set_data(const FLAC__byte *data, unsigned length) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_object_application_set_data(object_, (FLAC__byte*)data, length, true); - } - - bool Unknown::set_data(FLAC__byte *data, unsigned length, bool copy) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_object_application_set_data(object_, data, length, copy); - } - - - // ============================================================ - // - // Level 0 - // - // ============================================================ - - FLACPP_API bool get_streaminfo(const char *filename, StreamInfo &streaminfo) - { - FLAC__ASSERT(0 != filename); - - ::FLAC__StreamMetadata object; - - if(::FLAC__metadata_get_streaminfo(filename, &object)) { - streaminfo = object; - return true; - } - else - return false; - } - - FLACPP_API bool get_tags(const char *filename, VorbisComment *&tags) - { - FLAC__ASSERT(0 != filename); - - ::FLAC__StreamMetadata *object; - - tags = 0; - - if(::FLAC__metadata_get_tags(filename, &object)) { - tags = new VorbisComment(object, /*copy=*/false); - return true; - } - else - return false; - } - - FLACPP_API bool get_tags(const char *filename, VorbisComment &tags) - { - FLAC__ASSERT(0 != filename); - - ::FLAC__StreamMetadata *object; - - if(::FLAC__metadata_get_tags(filename, &object)) { - tags.assign(object, /*copy=*/false); - return true; - } - else - return false; - } - - FLACPP_API bool get_cuesheet(const char *filename, CueSheet *&cuesheet) - { - FLAC__ASSERT(0 != filename); - - ::FLAC__StreamMetadata *object; - - cuesheet = 0; - - if(::FLAC__metadata_get_cuesheet(filename, &object)) { - cuesheet = new CueSheet(object, /*copy=*/false); - return true; - } - else - return false; - } - - FLACPP_API bool get_cuesheet(const char *filename, CueSheet &cuesheet) - { - FLAC__ASSERT(0 != filename); - - ::FLAC__StreamMetadata *object; - - if(::FLAC__metadata_get_cuesheet(filename, &object)) { - cuesheet.assign(object, /*copy=*/false); - return true; - } - else - return false; - } - - FLACPP_API bool get_picture(const char *filename, Picture *&picture, ::FLAC__StreamMetadata_Picture_Type type, const char *mime_type, const FLAC__byte *description, unsigned max_width, unsigned max_height, unsigned max_depth, unsigned max_colors) - { - FLAC__ASSERT(0 != filename); - - ::FLAC__StreamMetadata *object; - - picture = 0; - - if(::FLAC__metadata_get_picture(filename, &object, type, mime_type, description, max_width, max_height, max_depth, max_colors)) { - picture = new Picture(object, /*copy=*/false); - return true; - } - else - return false; - } - - FLACPP_API bool get_picture(const char *filename, Picture &picture, ::FLAC__StreamMetadata_Picture_Type type, const char *mime_type, const FLAC__byte *description, unsigned max_width, unsigned max_height, unsigned max_depth, unsigned max_colors) - { - FLAC__ASSERT(0 != filename); - - ::FLAC__StreamMetadata *object; - - if(::FLAC__metadata_get_picture(filename, &object, type, mime_type, description, max_width, max_height, max_depth, max_colors)) { - picture.assign(object, /*copy=*/false); - return true; - } - else - return false; - } - - - // ============================================================ - // - // Level 1 - // - // ============================================================ - - SimpleIterator::SimpleIterator(): - iterator_(::FLAC__metadata_simple_iterator_new()) - { } - - SimpleIterator::~SimpleIterator() - { - clear(); - } - - void SimpleIterator::clear() - { - if(0 != iterator_) - FLAC__metadata_simple_iterator_delete(iterator_); - iterator_ = 0; - } - - bool SimpleIterator::init(const char *filename, bool read_only, bool preserve_file_stats) - { - FLAC__ASSERT(0 != filename); - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_simple_iterator_init(iterator_, filename, read_only, preserve_file_stats); - } - - bool SimpleIterator::is_valid() const - { - return 0 != iterator_; - } - - SimpleIterator::Status SimpleIterator::status() - { - FLAC__ASSERT(is_valid()); - return Status(::FLAC__metadata_simple_iterator_status(iterator_)); - } - - bool SimpleIterator::is_writable() const - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_simple_iterator_is_writable(iterator_); - } - - bool SimpleIterator::next() - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_simple_iterator_next(iterator_); - } - - bool SimpleIterator::prev() - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_simple_iterator_prev(iterator_); - } - - //@@@@ add to tests - bool SimpleIterator::is_last() const - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_simple_iterator_is_last(iterator_); - } - - //@@@@ add to tests - off_t SimpleIterator::get_block_offset() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__metadata_simple_iterator_get_block_offset(iterator_); - } - - ::FLAC__MetadataType SimpleIterator::get_block_type() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__metadata_simple_iterator_get_block_type(iterator_); - } - - //@@@@ add to tests - unsigned SimpleIterator::get_block_length() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__metadata_simple_iterator_get_block_length(iterator_); - } - - //@@@@ add to tests - bool SimpleIterator::get_application_id(FLAC__byte *id) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_simple_iterator_get_application_id(iterator_, id); - } - - Prototype *SimpleIterator::get_block() - { - FLAC__ASSERT(is_valid()); - return local::construct_block(::FLAC__metadata_simple_iterator_get_block(iterator_)); - } - - bool SimpleIterator::set_block(Prototype *block, bool use_padding) - { - FLAC__ASSERT(0 != block); - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_simple_iterator_set_block(iterator_, block->object_, use_padding); - } - - bool SimpleIterator::insert_block_after(Prototype *block, bool use_padding) - { - FLAC__ASSERT(0 != block); - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_simple_iterator_insert_block_after(iterator_, block->object_, use_padding); - } - - bool SimpleIterator::delete_block(bool use_padding) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_simple_iterator_delete_block(iterator_, use_padding); - } - - - // ============================================================ - // - // Level 2 - // - // ============================================================ - - Chain::Chain(): - chain_(::FLAC__metadata_chain_new()) - { } - - Chain::~Chain() - { - clear(); - } - - void Chain::clear() - { - if(0 != chain_) - FLAC__metadata_chain_delete(chain_); - chain_ = 0; - } - - bool Chain::is_valid() const - { - return 0 != chain_; - } - - Chain::Status Chain::status() - { - FLAC__ASSERT(is_valid()); - return Status(::FLAC__metadata_chain_status(chain_)); - } - - bool Chain::read(const char *filename, bool is_ogg) - { - FLAC__ASSERT(0 != filename); - FLAC__ASSERT(is_valid()); - return is_ogg? - (bool)::FLAC__metadata_chain_read_ogg(chain_, filename) : - (bool)::FLAC__metadata_chain_read(chain_, filename) - ; - } - - bool Chain::read(FLAC__IOHandle handle, ::FLAC__IOCallbacks callbacks, bool is_ogg) - { - FLAC__ASSERT(is_valid()); - return is_ogg? - (bool)::FLAC__metadata_chain_read_ogg_with_callbacks(chain_, handle, callbacks) : - (bool)::FLAC__metadata_chain_read_with_callbacks(chain_, handle, callbacks) - ; - } - - bool Chain::check_if_tempfile_needed(bool use_padding) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_chain_check_if_tempfile_needed(chain_, use_padding); - } - - bool Chain::write(bool use_padding, bool preserve_file_stats) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_chain_write(chain_, use_padding, preserve_file_stats); - } - - bool Chain::write(bool use_padding, ::FLAC__IOHandle handle, ::FLAC__IOCallbacks callbacks) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_chain_write_with_callbacks(chain_, use_padding, handle, callbacks); - } - - bool Chain::write(bool use_padding, ::FLAC__IOHandle handle, ::FLAC__IOCallbacks callbacks, ::FLAC__IOHandle temp_handle, ::FLAC__IOCallbacks temp_callbacks) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_chain_write_with_callbacks_and_tempfile(chain_, use_padding, handle, callbacks, temp_handle, temp_callbacks); - } - - void Chain::merge_padding() - { - FLAC__ASSERT(is_valid()); - ::FLAC__metadata_chain_merge_padding(chain_); - } - - void Chain::sort_padding() - { - FLAC__ASSERT(is_valid()); - ::FLAC__metadata_chain_sort_padding(chain_); - } - - - Iterator::Iterator(): - iterator_(::FLAC__metadata_iterator_new()) - { } - - Iterator::~Iterator() - { - clear(); - } - - void Iterator::clear() - { - if(0 != iterator_) - FLAC__metadata_iterator_delete(iterator_); - iterator_ = 0; - } - - bool Iterator::is_valid() const - { - return 0 != iterator_; - } - - void Iterator::init(Chain &chain) - { - FLAC__ASSERT(is_valid()); - FLAC__ASSERT(chain.is_valid()); - ::FLAC__metadata_iterator_init(iterator_, chain.chain_); - } - - bool Iterator::next() - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_iterator_next(iterator_); - } - - bool Iterator::prev() - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_iterator_prev(iterator_); - } - - ::FLAC__MetadataType Iterator::get_block_type() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__metadata_iterator_get_block_type(iterator_); - } - - Prototype *Iterator::get_block() - { - FLAC__ASSERT(is_valid()); - Prototype *block = local::construct_block(::FLAC__metadata_iterator_get_block(iterator_)); - if(0 != block) - block->set_reference(true); - return block; - } - - bool Iterator::set_block(Prototype *block) - { - FLAC__ASSERT(0 != block); - FLAC__ASSERT(is_valid()); - bool ret = (bool)::FLAC__metadata_iterator_set_block(iterator_, block->object_); - if(ret) { - block->set_reference(true); - delete block; - } - return ret; - } - - bool Iterator::delete_block(bool replace_with_padding) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__metadata_iterator_delete_block(iterator_, replace_with_padding); - } - - bool Iterator::insert_block_before(Prototype *block) - { - FLAC__ASSERT(0 != block); - FLAC__ASSERT(is_valid()); - bool ret = (bool)::FLAC__metadata_iterator_insert_block_before(iterator_, block->object_); - if(ret) { - block->set_reference(true); - delete block; - } - return ret; - } - - bool Iterator::insert_block_after(Prototype *block) - { - FLAC__ASSERT(0 != block); - FLAC__ASSERT(is_valid()); - bool ret = (bool)::FLAC__metadata_iterator_insert_block_after(iterator_, block->object_); - if(ret) { - block->set_reference(true); - delete block; - } - return ret; - } - - } -} diff --git a/3rdparty/libflac/src/libFLAC++/stream_decoder.cpp b/3rdparty/libflac/src/libFLAC++/stream_decoder.cpp deleted file mode 100644 index fee69ba0de3..00000000000 --- a/3rdparty/libflac/src/libFLAC++/stream_decoder.cpp +++ /dev/null @@ -1,389 +0,0 @@ -/* libFLAC++ - Free Lossless Audio Codec library - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "FLAC++/decoder.h" -#include "FLAC/assert.h" - -#ifdef _MSC_VER -// warning C4800: 'int' : forcing to bool 'true' or 'false' (performance warning) -#pragma warning ( disable : 4800 ) -#endif - -namespace FLAC { - namespace Decoder { - - // ------------------------------------------------------------ - // - // Stream - // - // ------------------------------------------------------------ - - Stream::Stream(): - decoder_(::FLAC__stream_decoder_new()) - { } - - Stream::~Stream() - { - if(0 != decoder_) { - (void)::FLAC__stream_decoder_finish(decoder_); - ::FLAC__stream_decoder_delete(decoder_); - } - } - - bool Stream::is_valid() const - { - return 0 != decoder_; - } - - bool Stream::set_ogg_serial_number(long value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_decoder_set_ogg_serial_number(decoder_, value); - } - - bool Stream::set_md5_checking(bool value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_decoder_set_md5_checking(decoder_, value); - } - - bool Stream::set_metadata_respond(::FLAC__MetadataType type) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_decoder_set_metadata_respond(decoder_, type); - } - - bool Stream::set_metadata_respond_application(const FLAC__byte id[4]) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_decoder_set_metadata_respond_application(decoder_, id); - } - - bool Stream::set_metadata_respond_all() - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_decoder_set_metadata_respond_all(decoder_); - } - - bool Stream::set_metadata_ignore(::FLAC__MetadataType type) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_decoder_set_metadata_ignore(decoder_, type); - } - - bool Stream::set_metadata_ignore_application(const FLAC__byte id[4]) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_decoder_set_metadata_ignore_application(decoder_, id); - } - - bool Stream::set_metadata_ignore_all() - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_decoder_set_metadata_ignore_all(decoder_); - } - - Stream::State Stream::get_state() const - { - FLAC__ASSERT(is_valid()); - return State(::FLAC__stream_decoder_get_state(decoder_)); - } - - bool Stream::get_md5_checking() const - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_decoder_get_md5_checking(decoder_); - } - - FLAC__uint64 Stream::get_total_samples() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_decoder_get_total_samples(decoder_); - } - - unsigned Stream::get_channels() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_decoder_get_channels(decoder_); - } - - ::FLAC__ChannelAssignment Stream::get_channel_assignment() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_decoder_get_channel_assignment(decoder_); - } - - unsigned Stream::get_bits_per_sample() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_decoder_get_bits_per_sample(decoder_); - } - - unsigned Stream::get_sample_rate() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_decoder_get_sample_rate(decoder_); - } - - unsigned Stream::get_blocksize() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_decoder_get_blocksize(decoder_); - } - - bool Stream::get_decode_position(FLAC__uint64 *position) const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_decoder_get_decode_position(decoder_, position); - } - - ::FLAC__StreamDecoderInitStatus Stream::init() - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_decoder_init_stream(decoder_, read_callback_, seek_callback_, tell_callback_, length_callback_, eof_callback_, write_callback_, metadata_callback_, error_callback_, /*client_data=*/(void*)this); - } - - ::FLAC__StreamDecoderInitStatus Stream::init_ogg() - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_decoder_init_ogg_stream(decoder_, read_callback_, seek_callback_, tell_callback_, length_callback_, eof_callback_, write_callback_, metadata_callback_, error_callback_, /*client_data=*/(void*)this); - } - - bool Stream::finish() - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_decoder_finish(decoder_); - } - - bool Stream::flush() - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_decoder_flush(decoder_); - } - - bool Stream::reset() - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_decoder_reset(decoder_); - } - - bool Stream::process_single() - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_decoder_process_single(decoder_); - } - - bool Stream::process_until_end_of_metadata() - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_decoder_process_until_end_of_metadata(decoder_); - } - - bool Stream::process_until_end_of_stream() - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_decoder_process_until_end_of_stream(decoder_); - } - - bool Stream::skip_single_frame() - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_decoder_skip_single_frame(decoder_); - } - - bool Stream::seek_absolute(FLAC__uint64 sample) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_decoder_seek_absolute(decoder_, sample); - } - - ::FLAC__StreamDecoderSeekStatus Stream::seek_callback(FLAC__uint64 absolute_byte_offset) - { - (void)absolute_byte_offset; - return ::FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED; - } - - ::FLAC__StreamDecoderTellStatus Stream::tell_callback(FLAC__uint64 *absolute_byte_offset) - { - (void)absolute_byte_offset; - return ::FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED; - } - - ::FLAC__StreamDecoderLengthStatus Stream::length_callback(FLAC__uint64 *stream_length) - { - (void)stream_length; - return ::FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED; - } - - bool Stream::eof_callback() - { - return false; - } - - void Stream::metadata_callback(const ::FLAC__StreamMetadata *metadata) - { - (void)metadata; - } - - ::FLAC__StreamDecoderReadStatus Stream::read_callback_(const ::FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data) - { - (void)decoder; - FLAC__ASSERT(0 != client_data); - Stream *instance = reinterpret_cast<Stream *>(client_data); - FLAC__ASSERT(0 != instance); - return instance->read_callback(buffer, bytes); - } - - ::FLAC__StreamDecoderSeekStatus Stream::seek_callback_(const ::FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) - { - (void) decoder; - FLAC__ASSERT(0 != client_data); - Stream *instance = reinterpret_cast<Stream *>(client_data); - FLAC__ASSERT(0 != instance); - return instance->seek_callback(absolute_byte_offset); - } - - ::FLAC__StreamDecoderTellStatus Stream::tell_callback_(const ::FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data) - { - (void) decoder; - FLAC__ASSERT(0 != client_data); - Stream *instance = reinterpret_cast<Stream *>(client_data); - FLAC__ASSERT(0 != instance); - return instance->tell_callback(absolute_byte_offset); - } - - ::FLAC__StreamDecoderLengthStatus Stream::length_callback_(const ::FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data) - { - (void) decoder; - FLAC__ASSERT(0 != client_data); - Stream *instance = reinterpret_cast<Stream *>(client_data); - FLAC__ASSERT(0 != instance); - return instance->length_callback(stream_length); - } - - FLAC__bool Stream::eof_callback_(const ::FLAC__StreamDecoder *decoder, void *client_data) - { - (void) decoder; - FLAC__ASSERT(0 != client_data); - Stream *instance = reinterpret_cast<Stream *>(client_data); - FLAC__ASSERT(0 != instance); - return instance->eof_callback(); - } - - ::FLAC__StreamDecoderWriteStatus Stream::write_callback_(const ::FLAC__StreamDecoder *decoder, const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data) - { - (void)decoder; - FLAC__ASSERT(0 != client_data); - Stream *instance = reinterpret_cast<Stream *>(client_data); - FLAC__ASSERT(0 != instance); - return instance->write_callback(frame, buffer); - } - - void Stream::metadata_callback_(const ::FLAC__StreamDecoder *decoder, const ::FLAC__StreamMetadata *metadata, void *client_data) - { - (void)decoder; - FLAC__ASSERT(0 != client_data); - Stream *instance = reinterpret_cast<Stream *>(client_data); - FLAC__ASSERT(0 != instance); - instance->metadata_callback(metadata); - } - - void Stream::error_callback_(const ::FLAC__StreamDecoder *decoder, ::FLAC__StreamDecoderErrorStatus status, void *client_data) - { - (void)decoder; - FLAC__ASSERT(0 != client_data); - Stream *instance = reinterpret_cast<Stream *>(client_data); - FLAC__ASSERT(0 != instance); - instance->error_callback(status); - } - - // ------------------------------------------------------------ - // - // File - // - // ------------------------------------------------------------ - - File::File(): - Stream() - { } - - File::~File() - { - } - - ::FLAC__StreamDecoderInitStatus File::init(FILE *file) - { - FLAC__ASSERT(0 != decoder_); - return ::FLAC__stream_decoder_init_FILE(decoder_, file, write_callback_, metadata_callback_, error_callback_, /*client_data=*/(void*)this); - } - - ::FLAC__StreamDecoderInitStatus File::init(const char *filename) - { - FLAC__ASSERT(0 != decoder_); - return ::FLAC__stream_decoder_init_file(decoder_, filename, write_callback_, metadata_callback_, error_callback_, /*client_data=*/(void*)this); - } - - ::FLAC__StreamDecoderInitStatus File::init(const std::string &filename) - { - return init(filename.c_str()); - } - - ::FLAC__StreamDecoderInitStatus File::init_ogg(FILE *file) - { - FLAC__ASSERT(0 != decoder_); - return ::FLAC__stream_decoder_init_ogg_FILE(decoder_, file, write_callback_, metadata_callback_, error_callback_, /*client_data=*/(void*)this); - } - - ::FLAC__StreamDecoderInitStatus File::init_ogg(const char *filename) - { - FLAC__ASSERT(0 != decoder_); - return ::FLAC__stream_decoder_init_ogg_file(decoder_, filename, write_callback_, metadata_callback_, error_callback_, /*client_data=*/(void*)this); - } - - ::FLAC__StreamDecoderInitStatus File::init_ogg(const std::string &filename) - { - return init_ogg(filename.c_str()); - } - - // This is a dummy to satisfy the pure virtual from Stream; the - // read callback will never be called since we are initializing - // with FLAC__stream_decoder_init_FILE() or - // FLAC__stream_decoder_init_file() and those supply the read - // callback internally. - ::FLAC__StreamDecoderReadStatus File::read_callback(FLAC__byte buffer[], size_t *bytes) - { - (void)buffer, (void)bytes; - FLAC__ASSERT(false); - return ::FLAC__STREAM_DECODER_READ_STATUS_ABORT; // double protection - } - - } -} diff --git a/3rdparty/libflac/src/libFLAC++/stream_encoder.cpp b/3rdparty/libflac/src/libFLAC++/stream_encoder.cpp deleted file mode 100644 index cf65f230661..00000000000 --- a/3rdparty/libflac/src/libFLAC++/stream_encoder.cpp +++ /dev/null @@ -1,511 +0,0 @@ -/* libFLAC++ - Free Lossless Audio Codec library - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "FLAC++/encoder.h" -#include "FLAC++/metadata.h" -#include "FLAC/assert.h" - -#ifdef _MSC_VER -// warning C4800: 'int' : forcing to bool 'true' or 'false' (performance warning) -#pragma warning ( disable : 4800 ) -#endif - -namespace FLAC { - namespace Encoder { - - // ------------------------------------------------------------ - // - // Stream - // - // ------------------------------------------------------------ - - Stream::Stream(): - encoder_(::FLAC__stream_encoder_new()) - { } - - Stream::~Stream() - { - if(0 != encoder_) { - (void)::FLAC__stream_encoder_finish(encoder_); - ::FLAC__stream_encoder_delete(encoder_); - } - } - - bool Stream::is_valid() const - { - return 0 != encoder_; - } - - bool Stream::set_ogg_serial_number(long value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_ogg_serial_number(encoder_, value); - } - - bool Stream::set_verify(bool value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_verify(encoder_, value); - } - - bool Stream::set_streamable_subset(bool value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_streamable_subset(encoder_, value); - } - - bool Stream::set_channels(unsigned value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_channels(encoder_, value); - } - - bool Stream::set_bits_per_sample(unsigned value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_bits_per_sample(encoder_, value); - } - - bool Stream::set_sample_rate(unsigned value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_sample_rate(encoder_, value); - } - - bool Stream::set_compression_level(unsigned value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_compression_level(encoder_, value); - } - - bool Stream::set_blocksize(unsigned value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_blocksize(encoder_, value); - } - - bool Stream::set_do_mid_side_stereo(bool value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_do_mid_side_stereo(encoder_, value); - } - - bool Stream::set_loose_mid_side_stereo(bool value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_loose_mid_side_stereo(encoder_, value); - } - - bool Stream::set_apodization(const char *specification) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_apodization(encoder_, specification); - } - - bool Stream::set_max_lpc_order(unsigned value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_max_lpc_order(encoder_, value); - } - - bool Stream::set_qlp_coeff_precision(unsigned value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_qlp_coeff_precision(encoder_, value); - } - - bool Stream::set_do_qlp_coeff_prec_search(bool value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_do_qlp_coeff_prec_search(encoder_, value); - } - - bool Stream::set_do_escape_coding(bool value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_do_escape_coding(encoder_, value); - } - - bool Stream::set_do_exhaustive_model_search(bool value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_do_exhaustive_model_search(encoder_, value); - } - - bool Stream::set_min_residual_partition_order(unsigned value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_min_residual_partition_order(encoder_, value); - } - - bool Stream::set_max_residual_partition_order(unsigned value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_max_residual_partition_order(encoder_, value); - } - - bool Stream::set_rice_parameter_search_dist(unsigned value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_rice_parameter_search_dist(encoder_, value); - } - - bool Stream::set_total_samples_estimate(FLAC__uint64 value) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_total_samples_estimate(encoder_, value); - } - - bool Stream::set_metadata(::FLAC__StreamMetadata **metadata, unsigned num_blocks) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_set_metadata(encoder_, metadata, num_blocks); - } - - bool Stream::set_metadata(FLAC::Metadata::Prototype **metadata, unsigned num_blocks) - { - FLAC__ASSERT(is_valid()); -#if (defined _MSC_VER) || (defined __BORLANDC__) || (defined __SUNPRO_CC) - // MSVC++ can't handle: - // ::FLAC__StreamMetadata *m[num_blocks]; - // so we do this ugly workaround - ::FLAC__StreamMetadata **m = new ::FLAC__StreamMetadata*[num_blocks]; -#else - ::FLAC__StreamMetadata *m[num_blocks]; -#endif - for(unsigned i = 0; i < num_blocks; i++) { - // we can get away with the const_cast since we know the encoder will only correct the is_last flags - m[i] = const_cast< ::FLAC__StreamMetadata*>((const ::FLAC__StreamMetadata*)metadata[i]); - } -#if (defined _MSC_VER) || (defined __BORLANDC__) || (defined __SUNPRO_CC) - // complete the hack - const bool ok = (bool)::FLAC__stream_encoder_set_metadata(encoder_, m, num_blocks); - delete [] m; - return ok; -#else - return (bool)::FLAC__stream_encoder_set_metadata(encoder_, m, num_blocks); -#endif - } - - Stream::State Stream::get_state() const - { - FLAC__ASSERT(is_valid()); - return State(::FLAC__stream_encoder_get_state(encoder_)); - } - - Decoder::Stream::State Stream::get_verify_decoder_state() const - { - FLAC__ASSERT(is_valid()); - return Decoder::Stream::State(::FLAC__stream_encoder_get_verify_decoder_state(encoder_)); - } - - void Stream::get_verify_decoder_error_stats(FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got) - { - FLAC__ASSERT(is_valid()); - ::FLAC__stream_encoder_get_verify_decoder_error_stats(encoder_, absolute_sample, frame_number, channel, sample, expected, got); - } - - bool Stream::get_verify() const - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_get_verify(encoder_); - } - - bool Stream::get_streamable_subset() const - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_get_streamable_subset(encoder_); - } - - bool Stream::get_do_mid_side_stereo() const - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_get_do_mid_side_stereo(encoder_); - } - - bool Stream::get_loose_mid_side_stereo() const - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_get_loose_mid_side_stereo(encoder_); - } - - unsigned Stream::get_channels() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_encoder_get_channels(encoder_); - } - - unsigned Stream::get_bits_per_sample() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_encoder_get_bits_per_sample(encoder_); - } - - unsigned Stream::get_sample_rate() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_encoder_get_sample_rate(encoder_); - } - - unsigned Stream::get_blocksize() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_encoder_get_blocksize(encoder_); - } - - unsigned Stream::get_max_lpc_order() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_encoder_get_max_lpc_order(encoder_); - } - - unsigned Stream::get_qlp_coeff_precision() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_encoder_get_qlp_coeff_precision(encoder_); - } - - bool Stream::get_do_qlp_coeff_prec_search() const - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_get_do_qlp_coeff_prec_search(encoder_); - } - - bool Stream::get_do_escape_coding() const - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_get_do_escape_coding(encoder_); - } - - bool Stream::get_do_exhaustive_model_search() const - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_get_do_exhaustive_model_search(encoder_); - } - - unsigned Stream::get_min_residual_partition_order() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_encoder_get_min_residual_partition_order(encoder_); - } - - unsigned Stream::get_max_residual_partition_order() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_encoder_get_max_residual_partition_order(encoder_); - } - - unsigned Stream::get_rice_parameter_search_dist() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_encoder_get_rice_parameter_search_dist(encoder_); - } - - FLAC__uint64 Stream::get_total_samples_estimate() const - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_encoder_get_total_samples_estimate(encoder_); - } - - ::FLAC__StreamEncoderInitStatus Stream::init() - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_encoder_init_stream(encoder_, write_callback_, seek_callback_, tell_callback_, metadata_callback_, /*client_data=*/(void*)this); - } - - ::FLAC__StreamEncoderInitStatus Stream::init_ogg() - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_encoder_init_ogg_stream(encoder_, read_callback_, write_callback_, seek_callback_, tell_callback_, metadata_callback_, /*client_data=*/(void*)this); - } - - bool Stream::finish() - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_finish(encoder_); - } - - bool Stream::process(const FLAC__int32 * const buffer[], unsigned samples) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_process(encoder_, buffer, samples); - } - - bool Stream::process_interleaved(const FLAC__int32 buffer[], unsigned samples) - { - FLAC__ASSERT(is_valid()); - return (bool)::FLAC__stream_encoder_process_interleaved(encoder_, buffer, samples); - } - - ::FLAC__StreamEncoderReadStatus Stream::read_callback(FLAC__byte buffer[], size_t *bytes) - { - (void)buffer, (void)bytes; - return ::FLAC__STREAM_ENCODER_READ_STATUS_UNSUPPORTED; - } - - ::FLAC__StreamEncoderSeekStatus Stream::seek_callback(FLAC__uint64 absolute_byte_offset) - { - (void)absolute_byte_offset; - return ::FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED; - } - - ::FLAC__StreamEncoderTellStatus Stream::tell_callback(FLAC__uint64 *absolute_byte_offset) - { - (void)absolute_byte_offset; - return ::FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED; - } - - void Stream::metadata_callback(const ::FLAC__StreamMetadata *metadata) - { - (void)metadata; - } - - ::FLAC__StreamEncoderReadStatus Stream::read_callback_(const ::FLAC__StreamEncoder *encoder, FLAC__byte buffer[], size_t *bytes, void *client_data) - { - (void)encoder; - FLAC__ASSERT(0 != client_data); - Stream *instance = reinterpret_cast<Stream *>(client_data); - FLAC__ASSERT(0 != instance); - return instance->read_callback(buffer, bytes); - } - - ::FLAC__StreamEncoderWriteStatus Stream::write_callback_(const ::FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data) - { - (void)encoder; - FLAC__ASSERT(0 != client_data); - Stream *instance = reinterpret_cast<Stream *>(client_data); - FLAC__ASSERT(0 != instance); - return instance->write_callback(buffer, bytes, samples, current_frame); - } - - ::FLAC__StreamEncoderSeekStatus Stream::seek_callback_(const ::FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data) - { - (void)encoder; - FLAC__ASSERT(0 != client_data); - Stream *instance = reinterpret_cast<Stream *>(client_data); - FLAC__ASSERT(0 != instance); - return instance->seek_callback(absolute_byte_offset); - } - - ::FLAC__StreamEncoderTellStatus Stream::tell_callback_(const ::FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data) - { - (void)encoder; - FLAC__ASSERT(0 != client_data); - Stream *instance = reinterpret_cast<Stream *>(client_data); - FLAC__ASSERT(0 != instance); - return instance->tell_callback(absolute_byte_offset); - } - - void Stream::metadata_callback_(const ::FLAC__StreamEncoder *encoder, const ::FLAC__StreamMetadata *metadata, void *client_data) - { - (void)encoder; - FLAC__ASSERT(0 != client_data); - Stream *instance = reinterpret_cast<Stream *>(client_data); - FLAC__ASSERT(0 != instance); - instance->metadata_callback(metadata); - } - - // ------------------------------------------------------------ - // - // File - // - // ------------------------------------------------------------ - - File::File(): - Stream() - { } - - File::~File() - { - } - - ::FLAC__StreamEncoderInitStatus File::init(FILE *file) - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_encoder_init_FILE(encoder_, file, progress_callback_, /*client_data=*/(void*)this); - } - - ::FLAC__StreamEncoderInitStatus File::init(const char *filename) - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_encoder_init_file(encoder_, filename, progress_callback_, /*client_data=*/(void*)this); - } - - ::FLAC__StreamEncoderInitStatus File::init(const std::string &filename) - { - return init(filename.c_str()); - } - - ::FLAC__StreamEncoderInitStatus File::init_ogg(FILE *file) - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_encoder_init_ogg_FILE(encoder_, file, progress_callback_, /*client_data=*/(void*)this); - } - - ::FLAC__StreamEncoderInitStatus File::init_ogg(const char *filename) - { - FLAC__ASSERT(is_valid()); - return ::FLAC__stream_encoder_init_ogg_file(encoder_, filename, progress_callback_, /*client_data=*/(void*)this); - } - - ::FLAC__StreamEncoderInitStatus File::init_ogg(const std::string &filename) - { - return init_ogg(filename.c_str()); - } - - // This is a dummy to satisfy the pure virtual from Stream; the - // read callback will never be called since we are initializing - // with FLAC__stream_decoder_init_FILE() or - // FLAC__stream_decoder_init_file() and those supply the read - // callback internally. - ::FLAC__StreamEncoderWriteStatus File::write_callback(const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame) - { - (void)buffer, (void)bytes, (void)samples, (void)current_frame; - FLAC__ASSERT(false); - return ::FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR; // double protection - } - - void File::progress_callback(FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate) - { - (void)bytes_written, (void)samples_written, (void)frames_written, (void)total_frames_estimate; - } - - void File::progress_callback_(const ::FLAC__StreamEncoder *encoder, FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate, void *client_data) - { - (void)encoder; - FLAC__ASSERT(0 != client_data); - File *instance = reinterpret_cast<File *>(client_data); - FLAC__ASSERT(0 != instance); - instance->progress_callback(bytes_written, samples_written, frames_written, total_frames_estimate); - } - - } -} diff --git a/3rdparty/libflac/src/libFLAC/Makefile.am b/3rdparty/libflac/src/libFLAC/Makefile.am deleted file mode 100644 index cbfb0acbb4d..00000000000 --- a/3rdparty/libflac/src/libFLAC/Makefile.am +++ /dev/null @@ -1,118 +0,0 @@ -# libFLAC - Free Lossless Audio Codec library -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -lib_LTLIBRARIES = libFLAC.la -if DEBUG -DEBUGCFLAGS = -DFLAC__OVERFLOW_DETECT -endif -if FLaC__CPU_PPC -# The -force_cpusubtype_ALL is needed to insert a ppc64 instruction -# into cpu.c with an asm(). -if FLaC__SYS_DARWIN -#@@@ PPC optimizations temporarily disabled -CPUCFLAGS = -faltivec -force_cpusubtype_ALL -DFLAC__NO_ASM -else -# Linux-gcc for PPC does not have -force_cpusubtype_ALL, it is Darwin-specific -#@@@ PPC optimizations temporarily disabled -CPUCFLAGS = -maltivec -mabi=altivec -DFLAC__NO_ASM -endif -endif - -AM_CFLAGS = $(DEBUGCFLAGS) $(CPUCFLAGS) @OGG_CFLAGS@ - -if FLaC__NO_ASM -else -if FLaC__CPU_IA32 -if FLaC__HAS_NASM -ARCH_SUBDIRS = ia32 -LOCAL_EXTRA_LIBADD = ia32/libFLAC-asm.la -endif -endif -if FLaC__CPU_PPC -ARCH_SUBDIRS = ppc -if FLaC__HAS_AS__TEMPORARILY_DISABLED -LOCAL_EXTRA_LIBADD = ppc/as/libFLAC-asm.la -LOCAL_EXTRA_LDFLAGS = "-Wl,-read_only_relocs,warning" -else -if FLaC__HAS_GAS__TEMPORARILY_DISABLED -LOCAL_EXTRA_LIBADD = ppc/gas/libFLAC-asm.la -LOCAL_EXTRA_LDFLAGS = "" -endif -endif -endif -endif - -libFLAC_la_LIBADD = $(LOCAL_EXTRA_LIBADD) @OGG_LIBS@ - -SUBDIRS = $(ARCH_SUBDIRS) include . - -m4datadir = $(datadir)/aclocal -m4data_DATA = libFLAC.m4 - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = flac.pc - -EXTRA_DIST = \ - Makefile.lite \ - flac.pc.in \ - libFLAC_dynamic.dsp \ - libFLAC_dynamic.vcproj \ - libFLAC_static.dsp \ - libFLAC_static.vcproj \ - libFLAC.m4 - -if FLaC__HAS_OGG -extra_ogg_sources = \ - ogg_decoder_aspect.c \ - ogg_encoder_aspect.c \ - ogg_helper.c \ - ogg_mapping.c -endif -# see 'http://www.gnu.org/software/libtool/manual.html#Libtool-versioning' for numbering convention -libFLAC_la_LDFLAGS = -version-info 10:0:2 -lm $(LOCAL_EXTRA_LDFLAGS) -libFLAC_la_SOURCES = \ - bitmath.c \ - bitreader.c \ - bitwriter.c \ - cpu.c \ - crc.c \ - fixed.c \ - float.c \ - format.c \ - lpc.c \ - md5.c \ - memory.c \ - metadata_iterators.c \ - metadata_object.c \ - stream_decoder.c \ - stream_encoder.c \ - stream_encoder_framing.c \ - window.c \ - $(extra_ogg_sources) diff --git a/3rdparty/libflac/src/libFLAC/Makefile.in b/3rdparty/libflac/src/libFLAC/Makefile.in deleted file mode 100644 index 75bfbbb215c..00000000000 --- a/3rdparty/libflac/src/libFLAC/Makefile.in +++ /dev/null @@ -1,872 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# libFLAC - Free Lossless Audio Codec library -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -lib_LTLIBRARIES = libFLAC.la -@DEBUG_TRUE@DEBUGCFLAGS = -DFLAC__OVERFLOW_DETECT -# The -force_cpusubtype_ALL is needed to insert a ppc64 instruction -# into cpu.c with an asm(). -#@@@ PPC optimizations temporarily disabled -@FLaC__CPU_PPC_TRUE@@FLaC__SYS_DARWIN_TRUE@CPUCFLAGS = -faltivec -force_cpusubtype_ALL -DFLAC__NO_ASM -# Linux-gcc for PPC does not have -force_cpusubtype_ALL, it is Darwin-specific -#@@@ PPC optimizations temporarily disabled -@FLaC__CPU_PPC_TRUE@@FLaC__SYS_DARWIN_FALSE@CPUCFLAGS = -maltivec -mabi=altivec -DFLAC__NO_ASM - -AM_CFLAGS = $(DEBUGCFLAGS) $(CPUCFLAGS) @OGG_CFLAGS@ -@FLaC__CPU_PPC_TRUE@@FLaC__NO_ASM_FALSE@ARCH_SUBDIRS = ppc - -@FLaC__CPU_IA32_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@ARCH_SUBDIRS = ia32 -@FLaC__CPU_IA32_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@LOCAL_EXTRA_LIBADD = ia32/libFLAC-asm.la -@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__NO_ASM_FALSE@LOCAL_EXTRA_LIBADD = ppc/as/libFLAC-asm.la -@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__NO_ASM_FALSE@LOCAL_EXTRA_LIBADD = ppc/gas/libFLAC-asm.la -@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__NO_ASM_FALSE@LOCAL_EXTRA_LDFLAGS = "-Wl,-read_only_relocs,warning" -@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__NO_ASM_FALSE@LOCAL_EXTRA_LDFLAGS = "" - -libFLAC_la_LIBADD = $(LOCAL_EXTRA_LIBADD) @OGG_LIBS@ - -SUBDIRS = $(ARCH_SUBDIRS) include . - -m4datadir = $(datadir)/aclocal -m4data_DATA = libFLAC.m4 - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = flac.pc - -EXTRA_DIST = \ - Makefile.lite \ - flac.pc.in \ - libFLAC_dynamic.dsp \ - libFLAC_dynamic.vcproj \ - libFLAC_static.dsp \ - libFLAC_static.vcproj \ - libFLAC.m4 - - -@FLaC__HAS_OGG_TRUE@extra_ogg_sources = \ -@FLaC__HAS_OGG_TRUE@ ogg_decoder_aspect.c \ -@FLaC__HAS_OGG_TRUE@ ogg_encoder_aspect.c \ -@FLaC__HAS_OGG_TRUE@ ogg_helper.c \ -@FLaC__HAS_OGG_TRUE@ ogg_mapping.c - -# see 'http://www.gnu.org/software/libtool/manual.html#Libtool-versioning' for numbering convention -libFLAC_la_LDFLAGS = -version-info 10:0:2 -lm $(LOCAL_EXTRA_LDFLAGS) -libFLAC_la_SOURCES = \ - bitmath.c \ - bitreader.c \ - bitwriter.c \ - cpu.c \ - crc.c \ - fixed.c \ - float.c \ - format.c \ - lpc.c \ - md5.c \ - memory.c \ - metadata_iterators.c \ - metadata_object.c \ - stream_decoder.c \ - stream_encoder.c \ - stream_encoder_framing.c \ - window.c \ - $(extra_ogg_sources) - -subdir = src/libFLAC -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = flac.pc -LTLIBRARIES = $(lib_LTLIBRARIES) - -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = \ -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@ ppc/gas/libFLAC-asm.la -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = \ -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@ ppc/gas/libFLAC-asm.la -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = \ -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@ ppc/as/libFLAC-asm.la -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = \ -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@ ppc/as/libFLAC-asm.la -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = \ -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@ ppc/as/libFLAC-asm.la -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = \ -@FLaC__CPU_IA32_FALSE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@ ppc/as/libFLAC-asm.la -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = \ -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@ ia32/libFLAC-asm.la -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = \ -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@ ia32/libFLAC-asm.la -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = \ -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@ ia32/libFLAC-asm.la -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = \ -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_FALSE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@ ia32/libFLAC-asm.la -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = \ -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@ ia32/libFLAC-asm.la -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = \ -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@ ppc/gas/libFLAC-asm.la -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = \ -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@ ia32/libFLAC-asm.la \ -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@ ppc/gas/libFLAC-asm.la -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = \ -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@ ppc/as/libFLAC-asm.la -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = \ -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@ ia32/libFLAC-asm.la \ -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@ ppc/as/libFLAC-asm.la -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = \ -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_FALSE@@FLaC__NO_ASM_FALSE@ ppc/as/libFLAC-asm.la -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_TRUE@libFLAC_la_DEPENDENCIES = -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@libFLAC_la_DEPENDENCIES = \ -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@ ia32/libFLAC-asm.la \ -@FLaC__CPU_IA32_TRUE@@FLaC__CPU_PPC_TRUE@@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@@FLaC__HAS_NASM_TRUE@@FLaC__NO_ASM_FALSE@ ppc/as/libFLAC-asm.la -am__libFLAC_la_SOURCES_DIST = bitmath.c bitreader.c bitwriter.c cpu.c \ - crc.c fixed.c float.c format.c lpc.c md5.c memory.c \ - metadata_iterators.c metadata_object.c stream_decoder.c \ - stream_encoder.c stream_encoder_framing.c window.c \ - ogg_decoder_aspect.c ogg_encoder_aspect.c ogg_helper.c \ - ogg_mapping.c -@FLaC__HAS_OGG_TRUE@am__objects_1 = ogg_decoder_aspect.lo \ -@FLaC__HAS_OGG_TRUE@ ogg_encoder_aspect.lo ogg_helper.lo \ -@FLaC__HAS_OGG_TRUE@ ogg_mapping.lo -am_libFLAC_la_OBJECTS = bitmath.lo bitreader.lo bitwriter.lo cpu.lo \ - crc.lo fixed.lo float.lo format.lo lpc.lo md5.lo memory.lo \ - metadata_iterators.lo metadata_object.lo stream_decoder.lo \ - stream_encoder.lo stream_encoder_framing.lo window.lo \ - $(am__objects_1) -libFLAC_la_OBJECTS = $(am_libFLAC_la_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/bitmath.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/bitreader.Plo ./$(DEPDIR)/bitwriter.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/cpu.Plo ./$(DEPDIR)/crc.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/fixed.Plo ./$(DEPDIR)/float.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/format.Plo ./$(DEPDIR)/lpc.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/md5.Plo ./$(DEPDIR)/memory.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/metadata_iterators.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/metadata_object.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/ogg_decoder_aspect.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/ogg_encoder_aspect.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/ogg_helper.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/ogg_mapping.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/stream_decoder.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/stream_encoder.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/stream_encoder_framing.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/window.Plo -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(am__libFLAC_la_SOURCES_DIST) -DATA = $(m4data_DATA) $(pkgconfig_DATA) - - -RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ - ps-recursive install-info-recursive uninstall-info-recursive \ - all-recursive install-data-recursive install-exec-recursive \ - installdirs-recursive install-recursive uninstall-recursive \ - check-recursive installcheck-recursive -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am flac.pc.in -DIST_SUBDIRS = ppc ia32 include . -SOURCES = $(libFLAC_la_SOURCES) - -all: all-recursive - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/libFLAC/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -flac.pc: $(top_builddir)/config.status flac.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -libLTLIBRARIES_INSTALL = $(INSTALL) -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(libdir) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \ - $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \ - else :; fi; \ - done - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - p="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \ - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" = "$$p" && dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libFLAC.la: $(libFLAC_la_OBJECTS) $(libFLAC_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libFLAC_la_LDFLAGS) $(libFLAC_la_OBJECTS) $(libFLAC_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitmath.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitreader.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitwriter.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fixed.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/float.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/format.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lpc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metadata_iterators.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metadata_object.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogg_decoder_aspect.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogg_encoder_aspect.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogg_helper.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ogg_mapping.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream_decoder.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream_encoder.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream_encoder_framing.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/window.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -m4dataDATA_INSTALL = $(INSTALL_DATA) -install-m4dataDATA: $(m4data_DATA) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(m4datadir) - @list='$(m4data_DATA)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(m4dataDATA_INSTALL) $$d$$p $(DESTDIR)$(m4datadir)/$$f"; \ - $(m4dataDATA_INSTALL) $$d$$p $(DESTDIR)$(m4datadir)/$$f; \ - done - -uninstall-m4dataDATA: - @$(NORMAL_UNINSTALL) - @list='$(m4data_DATA)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " rm -f $(DESTDIR)$(m4datadir)/$$f"; \ - rm -f $(DESTDIR)$(m4datadir)/$$f; \ - done -pkgconfigDATA_INSTALL = $(INSTALL_DATA) -install-pkgconfigDATA: $(pkgconfig_DATA) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(pkgconfigdir) - @list='$(pkgconfig_DATA)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(pkgconfigDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgconfigdir)/$$f"; \ - $(pkgconfigDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgconfigdir)/$$f; \ - done - -uninstall-pkgconfigDATA: - @$(NORMAL_UNINSTALL) - @list='$(pkgconfig_DATA)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " rm -f $(DESTDIR)$(pkgconfigdir)/$$f"; \ - rm -f $(DESTDIR)$(pkgconfigdir)/$$f; \ - done - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if (etags --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - else \ - include_option=--include; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile $(LTLIBRARIES) $(DATA) -installdirs: installdirs-recursive -installdirs-am: - $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(m4datadir) $(DESTDIR)$(pkgconfigdir) - -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - mostlyclean-am - -distclean: distclean-recursive - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-recursive - -dvi-am: - -info: info-recursive - -info-am: - -install-data-am: install-m4dataDATA install-pkgconfigDATA - -install-exec-am: install-libLTLIBRARIES - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \ - uninstall-m4dataDATA uninstall-pkgconfigDATA - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ - clean-generic clean-libLTLIBRARIES clean-libtool \ - clean-recursive ctags ctags-recursive distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am \ - dvi-recursive info info-am info-recursive install install-am \ - install-data install-data-am install-data-recursive \ - install-exec install-exec-am install-exec-recursive \ - install-info install-info-am install-info-recursive \ - install-libLTLIBRARIES install-m4dataDATA install-man \ - install-pkgconfigDATA install-recursive install-strip \ - installcheck installcheck-am installdirs installdirs-am \ - installdirs-recursive maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ - pdf pdf-am pdf-recursive ps ps-am ps-recursive tags \ - tags-recursive uninstall uninstall-am uninstall-info-am \ - uninstall-info-recursive uninstall-libLTLIBRARIES \ - uninstall-m4dataDATA uninstall-pkgconfigDATA \ - uninstall-recursive - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/libFLAC/Makefile.lite b/3rdparty/libflac/src/libFLAC/Makefile.lite deleted file mode 100644 index 8ea37f87e7c..00000000000 --- a/3rdparty/libflac/src/libFLAC/Makefile.lite +++ /dev/null @@ -1,90 +0,0 @@ -# libFLAC - Free Lossless Audio Codec library -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# -# GNU makefile -# - -topdir = ../.. - -LIB_NAME = libFLAC -ifeq ($(DARWIN_BUILD),yes) -DEFINES = -DFLAC__CPU_PPC -DFLAC__USE_ALTIVEC -DFLAC__ALIGN_MALLOC_DATA -else -ifeq ($(SOLARIS_BUILD),yes) -DEFINES = -DFLAC__NO_ASM -DFLAC__ALIGN_MALLOC_DATA -else -DEFINES = -DFLAC__CPU_IA32 -DFLAC__USE_3DNOW -DFLAC__HAS_NASM -DFLAC__ALIGN_MALLOC_DATA -endif -endif -INCLUDES = -I./include -I$(topdir)/include -I$(OGG_INCLUDE_DIR) -DEBUG_CFLAGS = -DFLAC__OVERFLOW_DETECT - -ifeq ($(DARWIN_BUILD),yes) -SRCS_S = \ - ppc/as/lpc_asm.s -else -ifeq ($(SOLARIS_BUILD),yes) -else -SRCS_NASM = \ - ia32/bitreader_asm.nasm \ - ia32/cpu_asm.nasm \ - ia32/fixed_asm.nasm \ - ia32/lpc_asm.nasm \ - ia32/stream_encoder_asm.nasm -endif -endif - -SRCS_C = \ - bitmath.c \ - bitreader.c \ - bitwriter.c \ - cpu.c \ - crc.c \ - fixed.c \ - float.c \ - format.c \ - lpc.c \ - md5.c \ - memory.c \ - metadata_iterators.c \ - metadata_object.c \ - ogg_decoder_aspect.c \ - ogg_encoder_aspect.c \ - ogg_helper.c \ - ogg_mapping.c \ - stream_decoder.c \ - stream_encoder.c \ - stream_encoder_framing.c \ - window.c - -include $(topdir)/build/lib.mk - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/3rdparty/libflac/src/libFLAC/bitmath.c b/3rdparty/libflac/src/libFLAC/bitmath.c deleted file mode 100644 index af19c35445a..00000000000 --- a/3rdparty/libflac/src/libFLAC/bitmath.c +++ /dev/null @@ -1,149 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include "private/bitmath.h" -#include "FLAC/assert.h" - -/* An example of what FLAC__bitmath_ilog2() computes: - * - * ilog2( 0) = assertion failure - * ilog2( 1) = 0 - * ilog2( 2) = 1 - * ilog2( 3) = 1 - * ilog2( 4) = 2 - * ilog2( 5) = 2 - * ilog2( 6) = 2 - * ilog2( 7) = 2 - * ilog2( 8) = 3 - * ilog2( 9) = 3 - * ilog2(10) = 3 - * ilog2(11) = 3 - * ilog2(12) = 3 - * ilog2(13) = 3 - * ilog2(14) = 3 - * ilog2(15) = 3 - * ilog2(16) = 4 - * ilog2(17) = 4 - * ilog2(18) = 4 - */ -unsigned FLAC__bitmath_ilog2(FLAC__uint32 v) -{ - unsigned l = 0; - FLAC__ASSERT(v > 0); - while(v >>= 1) - l++; - return l; -} - -unsigned FLAC__bitmath_ilog2_wide(FLAC__uint64 v) -{ - unsigned l = 0; - FLAC__ASSERT(v > 0); - while(v >>= 1) - l++; - return l; -} - -/* An example of what FLAC__bitmath_silog2() computes: - * - * silog2(-10) = 5 - * silog2(- 9) = 5 - * silog2(- 8) = 4 - * silog2(- 7) = 4 - * silog2(- 6) = 4 - * silog2(- 5) = 4 - * silog2(- 4) = 3 - * silog2(- 3) = 3 - * silog2(- 2) = 2 - * silog2(- 1) = 2 - * silog2( 0) = 0 - * silog2( 1) = 2 - * silog2( 2) = 3 - * silog2( 3) = 3 - * silog2( 4) = 4 - * silog2( 5) = 4 - * silog2( 6) = 4 - * silog2( 7) = 4 - * silog2( 8) = 5 - * silog2( 9) = 5 - * silog2( 10) = 5 - */ -unsigned FLAC__bitmath_silog2(int v) -{ - while(1) { - if(v == 0) { - return 0; - } - else if(v > 0) { - unsigned l = 0; - while(v) { - l++; - v >>= 1; - } - return l+1; - } - else if(v == -1) { - return 2; - } - else { - v++; - v = -v; - } - } -} - -unsigned FLAC__bitmath_silog2_wide(FLAC__int64 v) -{ - while(1) { - if(v == 0) { - return 0; - } - else if(v > 0) { - unsigned l = 0; - while(v) { - l++; - v >>= 1; - } - return l+1; - } - else if(v == -1) { - return 2; - } - else { - v++; - v = -v; - } - } -} diff --git a/3rdparty/libflac/src/libFLAC/bitreader.c b/3rdparty/libflac/src/libFLAC/bitreader.c deleted file mode 100644 index b48847d5e28..00000000000 --- a/3rdparty/libflac/src/libFLAC/bitreader.c +++ /dev/null @@ -1,1331 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdlib.h> /* for malloc() */ -#include <string.h> /* for memcpy(), memset() */ -#include "private/bitmath.h" -#include "private/bitreader.h" -#include "private/crc.h" -#include "FLAC/assert.h" -#include "share/endswap.h" - -/* Things should be fastest when this matches the machine word size */ -/* WATCHOUT: if you change this you must also change the following #defines down to COUNT_ZERO_MSBS below to match */ -/* WATCHOUT: there are a few places where the code will not work unless brword is >= 32 bits wide */ -/* also, some sections currently only have fast versions for 4 or 8 bytes per word */ -typedef FLAC__uint32 brword; -#define FLAC__BYTES_PER_WORD 4 -#define FLAC__BITS_PER_WORD 32 -#define FLAC__WORD_ALL_ONES ((FLAC__uint32)0xffffffff) -/* SWAP_BE_WORD_TO_HOST swaps bytes in a brword (which is always big-endian) if necessary to match host byte order */ -#if WORDS_BIGENDIAN -#define SWAP_BE_WORD_TO_HOST(x) (x) -#else -#define SWAP_BE_WORD_TO_HOST(x) ENDSWAP_32(x) -#endif -/* counts the # of zero MSBs in a word */ -#define COUNT_ZERO_MSBS(word) ( \ - (word) <= 0xffff ? \ - ( (word) <= 0xff? byte_to_unary_table[word] + 24 : byte_to_unary_table[(word) >> 8] + 16 ) : \ - ( (word) <= 0xffffff? byte_to_unary_table[word >> 16] + 8 : byte_to_unary_table[(word) >> 24] ) \ -) -/* this alternate might be slightly faster on some systems/compilers: */ -#define COUNT_ZERO_MSBS2(word) ( (word) <= 0xff ? byte_to_unary_table[word] + 24 : ((word) <= 0xffff ? byte_to_unary_table[(word) >> 8] + 16 : ((word) <= 0xffffff ? byte_to_unary_table[(word) >> 16] + 8 : byte_to_unary_table[(word) >> 24])) ) - - -/* - * This should be at least twice as large as the largest number of words - * required to represent any 'number' (in any encoding) you are going to - * read. With FLAC this is on the order of maybe a few hundred bits. - * If the buffer is smaller than that, the decoder won't be able to read - * in a whole number that is in a variable length encoding (e.g. Rice). - * But to be practical it should be at least 1K bytes. - * - * Increase this number to decrease the number of read callbacks, at the - * expense of using more memory. Or decrease for the reverse effect, - * keeping in mind the limit from the first paragraph. The optimal size - * also depends on the CPU cache size and other factors; some twiddling - * may be necessary to squeeze out the best performance. - */ -static const unsigned FLAC__BITREADER_DEFAULT_CAPACITY = 65536u / FLAC__BITS_PER_WORD; /* in words */ - -static const unsigned char byte_to_unary_table[] = { - 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -#ifdef min -#undef min -#endif -#define min(x,y) ((x)<(y)?(x):(y)) -#ifdef max -#undef max -#endif -#define max(x,y) ((x)>(y)?(x):(y)) - -/* adjust for compilers that can't understand using LLU suffix for uint64_t literals */ -#ifdef _MSC_VER -#define FLAC__U64L(x) x -#else -#define FLAC__U64L(x) x##LLU -#endif - -#ifndef FLaC__INLINE -#define FLaC__INLINE -#endif - -/* WATCHOUT: assembly routines rely on the order in which these fields are declared */ -struct FLAC__BitReader { - /* any partially-consumed word at the head will stay right-justified as bits are consumed from the left */ - /* any incomplete word at the tail will be left-justified, and bytes from the read callback are added on the right */ - brword *buffer; - unsigned capacity; /* in words */ - unsigned words; /* # of completed words in buffer */ - unsigned bytes; /* # of bytes in incomplete word at buffer[words] */ - unsigned consumed_words; /* #words ... */ - unsigned consumed_bits; /* ... + (#bits of head word) already consumed from the front of buffer */ - unsigned read_crc16; /* the running frame CRC */ - unsigned crc16_align; /* the number of bits in the current consumed word that should not be CRC'd */ - FLAC__BitReaderReadCallback read_callback; - void *client_data; - FLAC__CPUInfo cpu_info; -}; - -static FLaC__INLINE void crc16_update_word_(FLAC__BitReader *br, brword word) -{ - register unsigned crc = br->read_crc16; -#if FLAC__BYTES_PER_WORD == 4 - switch(br->crc16_align) { - case 0: crc = FLAC__CRC16_UPDATE((unsigned)(word >> 24), crc); - case 8: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 16) & 0xff), crc); - case 16: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 8) & 0xff), crc); - case 24: br->read_crc16 = FLAC__CRC16_UPDATE((unsigned)(word & 0xff), crc); - } -#elif FLAC__BYTES_PER_WORD == 8 - switch(br->crc16_align) { - case 0: crc = FLAC__CRC16_UPDATE((unsigned)(word >> 56), crc); - case 8: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 48) & 0xff), crc); - case 16: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 40) & 0xff), crc); - case 24: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 32) & 0xff), crc); - case 32: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 24) & 0xff), crc); - case 40: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 16) & 0xff), crc); - case 48: crc = FLAC__CRC16_UPDATE((unsigned)((word >> 8) & 0xff), crc); - case 56: br->read_crc16 = FLAC__CRC16_UPDATE((unsigned)(word & 0xff), crc); - } -#else - for( ; br->crc16_align < FLAC__BITS_PER_WORD; br->crc16_align += 8) - crc = FLAC__CRC16_UPDATE((unsigned)((word >> (FLAC__BITS_PER_WORD-8-br->crc16_align)) & 0xff), crc); - br->read_crc16 = crc; -#endif - br->crc16_align = 0; -} - -/* would be static except it needs to be called by asm routines */ -FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br) -{ - unsigned start, end; - size_t bytes; - FLAC__byte *target; - - /* first shift the unconsumed buffer data toward the front as much as possible */ - if(br->consumed_words > 0) { - start = br->consumed_words; - end = br->words + (br->bytes? 1:0); - memmove(br->buffer, br->buffer+start, FLAC__BYTES_PER_WORD * (end - start)); - - br->words -= start; - br->consumed_words = 0; - } - - /* - * set the target for reading, taking into account word alignment and endianness - */ - bytes = (br->capacity - br->words) * FLAC__BYTES_PER_WORD - br->bytes; - if(bytes == 0) - return false; /* no space left, buffer is too small; see note for FLAC__BITREADER_DEFAULT_CAPACITY */ - target = ((FLAC__byte*)(br->buffer+br->words)) + br->bytes; - - /* before reading, if the existing reader looks like this (say brword is 32 bits wide) - * bitstream : 11 22 33 44 55 br->words=1 br->bytes=1 (partial tail word is left-justified) - * buffer[BE]: 11 22 33 44 55 ?? ?? ?? (shown layed out as bytes sequentially in memory) - * buffer[LE]: 44 33 22 11 ?? ?? ?? 55 (?? being don't-care) - * ^^-------target, bytes=3 - * on LE machines, have to byteswap the odd tail word so nothing is - * overwritten: - */ -#if WORDS_BIGENDIAN -#else - if(br->bytes) - br->buffer[br->words] = SWAP_BE_WORD_TO_HOST(br->buffer[br->words]); -#endif - - /* now it looks like: - * bitstream : 11 22 33 44 55 br->words=1 br->bytes=1 - * buffer[BE]: 11 22 33 44 55 ?? ?? ?? - * buffer[LE]: 44 33 22 11 55 ?? ?? ?? - * ^^-------target, bytes=3 - */ - - /* read in the data; note that the callback may return a smaller number of bytes */ - if(!br->read_callback(target, &bytes, br->client_data)) - return false; - - /* after reading bytes 66 77 88 99 AA BB CC DD EE FF from the client: - * bitstream : 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF - * buffer[BE]: 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ?? - * buffer[LE]: 44 33 22 11 55 66 77 88 99 AA BB CC DD EE FF ?? - * now have to byteswap on LE machines: - */ -#if WORDS_BIGENDIAN -#else - end = (br->words*FLAC__BYTES_PER_WORD + br->bytes + bytes + (FLAC__BYTES_PER_WORD-1)) / FLAC__BYTES_PER_WORD; - for(start = br->words; start < end; start++) - br->buffer[start] = SWAP_BE_WORD_TO_HOST(br->buffer[start]); -#endif - - /* now it looks like: - * bitstream : 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF - * buffer[BE]: 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF ?? - * buffer[LE]: 44 33 22 11 88 77 66 55 CC BB AA 99 ?? FF EE DD - * finally we'll update the reader values: - */ - end = br->words*FLAC__BYTES_PER_WORD + br->bytes + bytes; - br->words = end / FLAC__BYTES_PER_WORD; - br->bytes = end % FLAC__BYTES_PER_WORD; - - return true; -} - -/*********************************************************************** - * - * Class constructor/destructor - * - ***********************************************************************/ - -FLAC__BitReader *FLAC__bitreader_new(void) -{ - FLAC__BitReader *br = (FLAC__BitReader*)calloc(1, sizeof(FLAC__BitReader)); - - /* calloc() implies: - memset(br, 0, sizeof(FLAC__BitReader)); - br->buffer = 0; - br->capacity = 0; - br->words = br->bytes = 0; - br->consumed_words = br->consumed_bits = 0; - br->read_callback = 0; - br->client_data = 0; - */ - return br; -} - -void FLAC__bitreader_delete(FLAC__BitReader *br) -{ - FLAC__ASSERT(0 != br); - - FLAC__bitreader_free(br); - free(br); -} - -/*********************************************************************** - * - * Public class methods - * - ***********************************************************************/ - -FLAC__bool FLAC__bitreader_init(FLAC__BitReader *br, FLAC__CPUInfo cpu, FLAC__BitReaderReadCallback rcb, void *cd) -{ - FLAC__ASSERT(0 != br); - - br->words = br->bytes = 0; - br->consumed_words = br->consumed_bits = 0; - br->capacity = FLAC__BITREADER_DEFAULT_CAPACITY; - br->buffer = (brword*)malloc(sizeof(brword) * br->capacity); - if(br->buffer == 0) - return false; - br->read_callback = rcb; - br->client_data = cd; - br->cpu_info = cpu; - - return true; -} - -void FLAC__bitreader_free(FLAC__BitReader *br) -{ - FLAC__ASSERT(0 != br); - - if(0 != br->buffer) - free(br->buffer); - br->buffer = 0; - br->capacity = 0; - br->words = br->bytes = 0; - br->consumed_words = br->consumed_bits = 0; - br->read_callback = 0; - br->client_data = 0; -} - -FLAC__bool FLAC__bitreader_clear(FLAC__BitReader *br) -{ - br->words = br->bytes = 0; - br->consumed_words = br->consumed_bits = 0; - return true; -} - -void FLAC__bitreader_dump(const FLAC__BitReader *br, FILE *out) -{ - unsigned i, j; - if(br == 0) { - fprintf(out, "bitreader is NULL\n"); - } - else { - fprintf(out, "bitreader: capacity=%u words=%u bytes=%u consumed: words=%u, bits=%u\n", br->capacity, br->words, br->bytes, br->consumed_words, br->consumed_bits); - - for(i = 0; i < br->words; i++) { - fprintf(out, "%08X: ", i); - for(j = 0; j < FLAC__BITS_PER_WORD; j++) - if(i < br->consumed_words || (i == br->consumed_words && j < br->consumed_bits)) - fprintf(out, "."); - else - fprintf(out, "%01u", br->buffer[i] & (1 << (FLAC__BITS_PER_WORD-j-1)) ? 1:0); - fprintf(out, "\n"); - } - if(br->bytes > 0) { - fprintf(out, "%08X: ", i); - for(j = 0; j < br->bytes*8; j++) - if(i < br->consumed_words || (i == br->consumed_words && j < br->consumed_bits)) - fprintf(out, "."); - else - fprintf(out, "%01u", br->buffer[i] & (1 << (br->bytes*8-j-1)) ? 1:0); - fprintf(out, "\n"); - } - } -} - -void FLAC__bitreader_reset_read_crc16(FLAC__BitReader *br, FLAC__uint16 seed) -{ - FLAC__ASSERT(0 != br); - FLAC__ASSERT(0 != br->buffer); - FLAC__ASSERT((br->consumed_bits & 7) == 0); - - br->read_crc16 = (unsigned)seed; - br->crc16_align = br->consumed_bits; -} - -FLAC__uint16 FLAC__bitreader_get_read_crc16(FLAC__BitReader *br) -{ - FLAC__ASSERT(0 != br); - FLAC__ASSERT(0 != br->buffer); - FLAC__ASSERT((br->consumed_bits & 7) == 0); - FLAC__ASSERT(br->crc16_align <= br->consumed_bits); - - /* CRC any tail bytes in a partially-consumed word */ - if(br->consumed_bits) { - const brword tail = br->buffer[br->consumed_words]; - for( ; br->crc16_align < br->consumed_bits; br->crc16_align += 8) - br->read_crc16 = FLAC__CRC16_UPDATE((unsigned)((tail >> (FLAC__BITS_PER_WORD-8-br->crc16_align)) & 0xff), br->read_crc16); - } - return br->read_crc16; -} - -FLaC__INLINE FLAC__bool FLAC__bitreader_is_consumed_byte_aligned(const FLAC__BitReader *br) -{ - return ((br->consumed_bits & 7) == 0); -} - -FLaC__INLINE unsigned FLAC__bitreader_bits_left_for_byte_alignment(const FLAC__BitReader *br) -{ - return 8 - (br->consumed_bits & 7); -} - -FLaC__INLINE unsigned FLAC__bitreader_get_input_bits_unconsumed(const FLAC__BitReader *br) -{ - return (br->words-br->consumed_words)*FLAC__BITS_PER_WORD + br->bytes*8 - br->consumed_bits; -} - -FLaC__INLINE FLAC__bool FLAC__bitreader_read_raw_uint32(FLAC__BitReader *br, FLAC__uint32 *val, unsigned bits) -{ - FLAC__ASSERT(0 != br); - FLAC__ASSERT(0 != br->buffer); - - FLAC__ASSERT(bits <= 32); - FLAC__ASSERT((br->capacity*FLAC__BITS_PER_WORD) * 2 >= bits); - FLAC__ASSERT(br->consumed_words <= br->words); - - /* WATCHOUT: code does not work with <32bit words; we can make things much faster with this assertion */ - FLAC__ASSERT(FLAC__BITS_PER_WORD >= 32); - - if(bits == 0) { /* OPT: investigate if this can ever happen, maybe change to assertion */ - *val = 0; - return true; - } - - while((br->words-br->consumed_words)*FLAC__BITS_PER_WORD + br->bytes*8 - br->consumed_bits < bits) { - if(!bitreader_read_from_client_(br)) - return false; - } - if(br->consumed_words < br->words) { /* if we've not consumed up to a partial tail word... */ - /* OPT: taking out the consumed_bits==0 "else" case below might make things faster if less code allows the compiler to inline this function */ - if(br->consumed_bits) { - /* this also works when consumed_bits==0, it's just a little slower than necessary for that case */ - const unsigned n = FLAC__BITS_PER_WORD - br->consumed_bits; - const brword word = br->buffer[br->consumed_words]; - if(bits < n) { - *val = (word & (FLAC__WORD_ALL_ONES >> br->consumed_bits)) >> (n-bits); - br->consumed_bits += bits; - return true; - } - *val = word & (FLAC__WORD_ALL_ONES >> br->consumed_bits); - bits -= n; - crc16_update_word_(br, word); - br->consumed_words++; - br->consumed_bits = 0; - if(bits) { /* if there are still bits left to read, there have to be less than 32 so they will all be in the next word */ - *val <<= bits; - *val |= (br->buffer[br->consumed_words] >> (FLAC__BITS_PER_WORD-bits)); - br->consumed_bits = bits; - } - return true; - } - else { - const brword word = br->buffer[br->consumed_words]; - if(bits < FLAC__BITS_PER_WORD) { - *val = word >> (FLAC__BITS_PER_WORD-bits); - br->consumed_bits = bits; - return true; - } - /* at this point 'bits' must be == FLAC__BITS_PER_WORD; because of previous assertions, it can't be larger */ - *val = word; - crc16_update_word_(br, word); - br->consumed_words++; - return true; - } - } - else { - /* in this case we're starting our read at a partial tail word; - * the reader has guaranteed that we have at least 'bits' bits - * available to read, which makes this case simpler. - */ - /* OPT: taking out the consumed_bits==0 "else" case below might make things faster if less code allows the compiler to inline this function */ - if(br->consumed_bits) { - /* this also works when consumed_bits==0, it's just a little slower than necessary for that case */ - FLAC__ASSERT(br->consumed_bits + bits <= br->bytes*8); - *val = (br->buffer[br->consumed_words] & (FLAC__WORD_ALL_ONES >> br->consumed_bits)) >> (FLAC__BITS_PER_WORD-br->consumed_bits-bits); - br->consumed_bits += bits; - return true; - } - else { - *val = br->buffer[br->consumed_words] >> (FLAC__BITS_PER_WORD-bits); - br->consumed_bits += bits; - return true; - } - } -} - -FLAC__bool FLAC__bitreader_read_raw_int32(FLAC__BitReader *br, FLAC__int32 *val, unsigned bits) -{ - /* OPT: inline raw uint32 code here, or make into a macro if possible in the .h file */ - if(!FLAC__bitreader_read_raw_uint32(br, (FLAC__uint32*)val, bits)) - return false; - /* sign-extend: */ - *val <<= (32-bits); - *val >>= (32-bits); - return true; -} - -FLAC__bool FLAC__bitreader_read_raw_uint64(FLAC__BitReader *br, FLAC__uint64 *val, unsigned bits) -{ - FLAC__uint32 hi, lo; - - if(bits > 32) { - if(!FLAC__bitreader_read_raw_uint32(br, &hi, bits-32)) - return false; - if(!FLAC__bitreader_read_raw_uint32(br, &lo, 32)) - return false; - *val = hi; - *val <<= 32; - *val |= lo; - } - else { - if(!FLAC__bitreader_read_raw_uint32(br, &lo, bits)) - return false; - *val = lo; - } - return true; -} - -FLaC__INLINE FLAC__bool FLAC__bitreader_read_uint32_little_endian(FLAC__BitReader *br, FLAC__uint32 *val) -{ - FLAC__uint32 x8, x32 = 0; - - /* this doesn't need to be that fast as currently it is only used for vorbis comments */ - - if(!FLAC__bitreader_read_raw_uint32(br, &x32, 8)) - return false; - - if(!FLAC__bitreader_read_raw_uint32(br, &x8, 8)) - return false; - x32 |= (x8 << 8); - - if(!FLAC__bitreader_read_raw_uint32(br, &x8, 8)) - return false; - x32 |= (x8 << 16); - - if(!FLAC__bitreader_read_raw_uint32(br, &x8, 8)) - return false; - x32 |= (x8 << 24); - - *val = x32; - return true; -} - -FLAC__bool FLAC__bitreader_skip_bits_no_crc(FLAC__BitReader *br, unsigned bits) -{ - /* - * OPT: a faster implementation is possible but probably not that useful - * since this is only called a couple of times in the metadata readers. - */ - FLAC__ASSERT(0 != br); - FLAC__ASSERT(0 != br->buffer); - - if(bits > 0) { - const unsigned n = br->consumed_bits & 7; - unsigned m; - FLAC__uint32 x; - - if(n != 0) { - m = min(8-n, bits); - if(!FLAC__bitreader_read_raw_uint32(br, &x, m)) - return false; - bits -= m; - } - m = bits / 8; - if(m > 0) { - if(!FLAC__bitreader_skip_byte_block_aligned_no_crc(br, m)) - return false; - bits %= 8; - } - if(bits > 0) { - if(!FLAC__bitreader_read_raw_uint32(br, &x, bits)) - return false; - } - } - - return true; -} - -FLAC__bool FLAC__bitreader_skip_byte_block_aligned_no_crc(FLAC__BitReader *br, unsigned nvals) -{ - FLAC__uint32 x; - - FLAC__ASSERT(0 != br); - FLAC__ASSERT(0 != br->buffer); - FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(br)); - - /* step 1: skip over partial head word to get word aligned */ - while(nvals && br->consumed_bits) { /* i.e. run until we read 'nvals' bytes or we hit the end of the head word */ - if(!FLAC__bitreader_read_raw_uint32(br, &x, 8)) - return false; - nvals--; - } - if(0 == nvals) - return true; - /* step 2: skip whole words in chunks */ - while(nvals >= FLAC__BYTES_PER_WORD) { - if(br->consumed_words < br->words) { - br->consumed_words++; - nvals -= FLAC__BYTES_PER_WORD; - } - else if(!bitreader_read_from_client_(br)) - return false; - } - /* step 3: skip any remainder from partial tail bytes */ - while(nvals) { - if(!FLAC__bitreader_read_raw_uint32(br, &x, 8)) - return false; - nvals--; - } - - return true; -} - -FLAC__bool FLAC__bitreader_read_byte_block_aligned_no_crc(FLAC__BitReader *br, FLAC__byte *val, unsigned nvals) -{ - FLAC__uint32 x; - - FLAC__ASSERT(0 != br); - FLAC__ASSERT(0 != br->buffer); - FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(br)); - - /* step 1: read from partial head word to get word aligned */ - while(nvals && br->consumed_bits) { /* i.e. run until we read 'nvals' bytes or we hit the end of the head word */ - if(!FLAC__bitreader_read_raw_uint32(br, &x, 8)) - return false; - *val++ = (FLAC__byte)x; - nvals--; - } - if(0 == nvals) - return true; - /* step 2: read whole words in chunks */ - while(nvals >= FLAC__BYTES_PER_WORD) { - if(br->consumed_words < br->words) { - const brword word = br->buffer[br->consumed_words++]; -#if FLAC__BYTES_PER_WORD == 4 - val[0] = (FLAC__byte)(word >> 24); - val[1] = (FLAC__byte)(word >> 16); - val[2] = (FLAC__byte)(word >> 8); - val[3] = (FLAC__byte)word; -#elif FLAC__BYTES_PER_WORD == 8 - val[0] = (FLAC__byte)(word >> 56); - val[1] = (FLAC__byte)(word >> 48); - val[2] = (FLAC__byte)(word >> 40); - val[3] = (FLAC__byte)(word >> 32); - val[4] = (FLAC__byte)(word >> 24); - val[5] = (FLAC__byte)(word >> 16); - val[6] = (FLAC__byte)(word >> 8); - val[7] = (FLAC__byte)word; -#else - for(x = 0; x < FLAC__BYTES_PER_WORD; x++) - val[x] = (FLAC__byte)(word >> (8*(FLAC__BYTES_PER_WORD-x-1))); -#endif - val += FLAC__BYTES_PER_WORD; - nvals -= FLAC__BYTES_PER_WORD; - } - else if(!bitreader_read_from_client_(br)) - return false; - } - /* step 3: read any remainder from partial tail bytes */ - while(nvals) { - if(!FLAC__bitreader_read_raw_uint32(br, &x, 8)) - return false; - *val++ = (FLAC__byte)x; - nvals--; - } - - return true; -} - -FLaC__INLINE FLAC__bool FLAC__bitreader_read_unary_unsigned(FLAC__BitReader *br, unsigned *val) -#if 0 /* slow but readable version */ -{ - unsigned bit; - - FLAC__ASSERT(0 != br); - FLAC__ASSERT(0 != br->buffer); - - *val = 0; - while(1) { - if(!FLAC__bitreader_read_bit(br, &bit)) - return false; - if(bit) - break; - else - *val++; - } - return true; -} -#else -{ - unsigned i; - - FLAC__ASSERT(0 != br); - FLAC__ASSERT(0 != br->buffer); - - *val = 0; - while(1) { - while(br->consumed_words < br->words) { /* if we've not consumed up to a partial tail word... */ - brword b = br->buffer[br->consumed_words] << br->consumed_bits; - if(b) { - i = COUNT_ZERO_MSBS(b); - *val += i; - i++; - br->consumed_bits += i; - if(br->consumed_bits >= FLAC__BITS_PER_WORD) { /* faster way of testing if(br->consumed_bits == FLAC__BITS_PER_WORD) */ - crc16_update_word_(br, br->buffer[br->consumed_words]); - br->consumed_words++; - br->consumed_bits = 0; - } - return true; - } - else { - *val += FLAC__BITS_PER_WORD - br->consumed_bits; - crc16_update_word_(br, br->buffer[br->consumed_words]); - br->consumed_words++; - br->consumed_bits = 0; - /* didn't find stop bit yet, have to keep going... */ - } - } - /* at this point we've eaten up all the whole words; have to try - * reading through any tail bytes before calling the read callback. - * this is a repeat of the above logic adjusted for the fact we - * don't have a whole word. note though if the client is feeding - * us data a byte at a time (unlikely), br->consumed_bits may not - * be zero. - */ - if(br->bytes) { - const unsigned end = br->bytes * 8; - brword b = (br->buffer[br->consumed_words] & (FLAC__WORD_ALL_ONES << (FLAC__BITS_PER_WORD-end))) << br->consumed_bits; - if(b) { - i = COUNT_ZERO_MSBS(b); - *val += i; - i++; - br->consumed_bits += i; - FLAC__ASSERT(br->consumed_bits < FLAC__BITS_PER_WORD); - return true; - } - else { - *val += end - br->consumed_bits; - br->consumed_bits += end; - FLAC__ASSERT(br->consumed_bits < FLAC__BITS_PER_WORD); - /* didn't find stop bit yet, have to keep going... */ - } - } - if(!bitreader_read_from_client_(br)) - return false; - } -} -#endif - -FLAC__bool FLAC__bitreader_read_rice_signed(FLAC__BitReader *br, int *val, unsigned parameter) -{ - FLAC__uint32 lsbs = 0, msbs = 0; - unsigned uval; - - FLAC__ASSERT(0 != br); - FLAC__ASSERT(0 != br->buffer); - FLAC__ASSERT(parameter <= 31); - - /* read the unary MSBs and end bit */ - if(!FLAC__bitreader_read_unary_unsigned(br, &msbs)) - return false; - - /* read the binary LSBs */ - if(!FLAC__bitreader_read_raw_uint32(br, &lsbs, parameter)) - return false; - - /* compose the value */ - uval = (msbs << parameter) | lsbs; - if(uval & 1) - *val = -((int)(uval >> 1)) - 1; - else - *val = (int)(uval >> 1); - - return true; -} - -/* this is by far the most heavily used reader call. it ain't pretty but it's fast */ -/* a lot of the logic is copied, then adapted, from FLAC__bitreader_read_unary_unsigned() and FLAC__bitreader_read_raw_uint32() */ -FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter) -/* OPT: possibly faster version for use with MSVC */ -#ifdef _MSC_VER -{ - unsigned i; - unsigned uval = 0; - unsigned bits; /* the # of binary LSBs left to read to finish a rice codeword */ - - /* try and get br->consumed_words and br->consumed_bits into register; - * must remember to flush them back to *br before calling other - * bitwriter functions that use them, and before returning */ - register unsigned cwords; - register unsigned cbits; - - FLAC__ASSERT(0 != br); - FLAC__ASSERT(0 != br->buffer); - /* WATCHOUT: code does not work with <32bit words; we can make things much faster with this assertion */ - FLAC__ASSERT(FLAC__BITS_PER_WORD >= 32); - FLAC__ASSERT(parameter < 32); - /* the above two asserts also guarantee that the binary part never straddles more that 2 words, so we don't have to loop to read it */ - - if(nvals == 0) - return true; - - cbits = br->consumed_bits; - cwords = br->consumed_words; - - while(1) { - - /* read unary part */ - while(1) { - while(cwords < br->words) { /* if we've not consumed up to a partial tail word... */ - brword b = br->buffer[cwords] << cbits; - if(b) { -#if 0 /* slower, probably due to bad register allocation... */ && defined FLAC__CPU_IA32 && !defined FLAC__NO_ASM && FLAC__BITS_PER_WORD == 32 - __asm { - bsr eax, b - not eax - and eax, 31 - mov i, eax - } -#else - i = COUNT_ZERO_MSBS(b); -#endif - uval += i; - bits = parameter; - i++; - cbits += i; - if(cbits == FLAC__BITS_PER_WORD) { - crc16_update_word_(br, br->buffer[cwords]); - cwords++; - cbits = 0; - } - goto break1; - } - else { - uval += FLAC__BITS_PER_WORD - cbits; - crc16_update_word_(br, br->buffer[cwords]); - cwords++; - cbits = 0; - /* didn't find stop bit yet, have to keep going... */ - } - } - /* at this point we've eaten up all the whole words; have to try - * reading through any tail bytes before calling the read callback. - * this is a repeat of the above logic adjusted for the fact we - * don't have a whole word. note though if the client is feeding - * us data a byte at a time (unlikely), br->consumed_bits may not - * be zero. - */ - if(br->bytes) { - const unsigned end = br->bytes * 8; - brword b = (br->buffer[cwords] & (FLAC__WORD_ALL_ONES << (FLAC__BITS_PER_WORD-end))) << cbits; - if(b) { - i = COUNT_ZERO_MSBS(b); - uval += i; - bits = parameter; - i++; - cbits += i; - FLAC__ASSERT(cbits < FLAC__BITS_PER_WORD); - goto break1; - } - else { - uval += end - cbits; - cbits += end; - FLAC__ASSERT(cbits < FLAC__BITS_PER_WORD); - /* didn't find stop bit yet, have to keep going... */ - } - } - /* flush registers and read; bitreader_read_from_client_() does - * not touch br->consumed_bits at all but we still need to set - * it in case it fails and we have to return false. - */ - br->consumed_bits = cbits; - br->consumed_words = cwords; - if(!bitreader_read_from_client_(br)) - return false; - cwords = br->consumed_words; - } -break1: - /* read binary part */ - FLAC__ASSERT(cwords <= br->words); - - if(bits) { - while((br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits < bits) { - /* flush registers and read; bitreader_read_from_client_() does - * not touch br->consumed_bits at all but we still need to set - * it in case it fails and we have to return false. - */ - br->consumed_bits = cbits; - br->consumed_words = cwords; - if(!bitreader_read_from_client_(br)) - return false; - cwords = br->consumed_words; - } - if(cwords < br->words) { /* if we've not consumed up to a partial tail word... */ - if(cbits) { - /* this also works when consumed_bits==0, it's just a little slower than necessary for that case */ - const unsigned n = FLAC__BITS_PER_WORD - cbits; - const brword word = br->buffer[cwords]; - if(bits < n) { - uval <<= bits; - uval |= (word & (FLAC__WORD_ALL_ONES >> cbits)) >> (n-bits); - cbits += bits; - goto break2; - } - uval <<= n; - uval |= word & (FLAC__WORD_ALL_ONES >> cbits); - bits -= n; - crc16_update_word_(br, word); - cwords++; - cbits = 0; - if(bits) { /* if there are still bits left to read, there have to be less than 32 so they will all be in the next word */ - uval <<= bits; - uval |= (br->buffer[cwords] >> (FLAC__BITS_PER_WORD-bits)); - cbits = bits; - } - goto break2; - } - else { - FLAC__ASSERT(bits < FLAC__BITS_PER_WORD); - uval <<= bits; - uval |= br->buffer[cwords] >> (FLAC__BITS_PER_WORD-bits); - cbits = bits; - goto break2; - } - } - else { - /* in this case we're starting our read at a partial tail word; - * the reader has guaranteed that we have at least 'bits' bits - * available to read, which makes this case simpler. - */ - uval <<= bits; - if(cbits) { - /* this also works when consumed_bits==0, it's just a little slower than necessary for that case */ - FLAC__ASSERT(cbits + bits <= br->bytes*8); - uval |= (br->buffer[cwords] & (FLAC__WORD_ALL_ONES >> cbits)) >> (FLAC__BITS_PER_WORD-cbits-bits); - cbits += bits; - goto break2; - } - else { - uval |= br->buffer[cwords] >> (FLAC__BITS_PER_WORD-bits); - cbits += bits; - goto break2; - } - } - } -break2: - /* compose the value */ - *vals = (int)(uval >> 1 ^ -(int)(uval & 1)); - - /* are we done? */ - --nvals; - if(nvals == 0) { - br->consumed_bits = cbits; - br->consumed_words = cwords; - return true; - } - - uval = 0; - ++vals; - - } -} -#else -{ - unsigned i; - unsigned uval = 0; - - /* try and get br->consumed_words and br->consumed_bits into register; - * must remember to flush them back to *br before calling other - * bitwriter functions that use them, and before returning */ - register unsigned cwords; - register unsigned cbits; - unsigned ucbits; /* keep track of the number of unconsumed bits in the buffer */ - - FLAC__ASSERT(0 != br); - FLAC__ASSERT(0 != br->buffer); - /* WATCHOUT: code does not work with <32bit words; we can make things much faster with this assertion */ - FLAC__ASSERT(FLAC__BITS_PER_WORD >= 32); - FLAC__ASSERT(parameter < 32); - /* the above two asserts also guarantee that the binary part never straddles more than 2 words, so we don't have to loop to read it */ - - if(nvals == 0) - return true; - - cbits = br->consumed_bits; - cwords = br->consumed_words; - ucbits = (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits; - - while(1) { - - /* read unary part */ - while(1) { - while(cwords < br->words) { /* if we've not consumed up to a partial tail word... */ - brword b = br->buffer[cwords] << cbits; - if(b) { -#if 0 /* is not discernably faster... */ && defined FLAC__CPU_IA32 && !defined FLAC__NO_ASM && FLAC__BITS_PER_WORD == 32 && defined __GNUC__ - asm volatile ( - "bsrl %1, %0;" - "notl %0;" - "andl $31, %0;" - : "=r"(i) - : "r"(b) - ); -#else - i = COUNT_ZERO_MSBS(b); -#endif - uval += i; - cbits += i; - cbits++; /* skip over stop bit */ - if(cbits >= FLAC__BITS_PER_WORD) { /* faster way of testing if(cbits == FLAC__BITS_PER_WORD) */ - crc16_update_word_(br, br->buffer[cwords]); - cwords++; - cbits = 0; - } - goto break1; - } - else { - uval += FLAC__BITS_PER_WORD - cbits; - crc16_update_word_(br, br->buffer[cwords]); - cwords++; - cbits = 0; - /* didn't find stop bit yet, have to keep going... */ - } - } - /* at this point we've eaten up all the whole words; have to try - * reading through any tail bytes before calling the read callback. - * this is a repeat of the above logic adjusted for the fact we - * don't have a whole word. note though if the client is feeding - * us data a byte at a time (unlikely), br->consumed_bits may not - * be zero. - */ - if(br->bytes) { - const unsigned end = br->bytes * 8; - brword b = (br->buffer[cwords] & ~(FLAC__WORD_ALL_ONES >> end)) << cbits; - if(b) { - i = COUNT_ZERO_MSBS(b); - uval += i; - cbits += i; - cbits++; /* skip over stop bit */ - FLAC__ASSERT(cbits < FLAC__BITS_PER_WORD); - goto break1; - } - else { - uval += end - cbits; - cbits += end; - FLAC__ASSERT(cbits < FLAC__BITS_PER_WORD); - /* didn't find stop bit yet, have to keep going... */ - } - } - /* flush registers and read; bitreader_read_from_client_() does - * not touch br->consumed_bits at all but we still need to set - * it in case it fails and we have to return false. - */ - br->consumed_bits = cbits; - br->consumed_words = cwords; - if(!bitreader_read_from_client_(br)) - return false; - cwords = br->consumed_words; - ucbits = (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits + uval; - /* + uval to offset our count by the # of unary bits already - * consumed before the read, because we will add these back - * in all at once at break1 - */ - } -break1: - ucbits -= uval; - ucbits--; /* account for stop bit */ - - /* read binary part */ - FLAC__ASSERT(cwords <= br->words); - - if(parameter) { - while(ucbits < parameter) { - /* flush registers and read; bitreader_read_from_client_() does - * not touch br->consumed_bits at all but we still need to set - * it in case it fails and we have to return false. - */ - br->consumed_bits = cbits; - br->consumed_words = cwords; - if(!bitreader_read_from_client_(br)) - return false; - cwords = br->consumed_words; - ucbits = (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits; - } - if(cwords < br->words) { /* if we've not consumed up to a partial tail word... */ - if(cbits) { - /* this also works when consumed_bits==0, it's just slower than necessary for that case */ - const unsigned n = FLAC__BITS_PER_WORD - cbits; - const brword word = br->buffer[cwords]; - if(parameter < n) { - uval <<= parameter; - uval |= (word & (FLAC__WORD_ALL_ONES >> cbits)) >> (n-parameter); - cbits += parameter; - } - else { - uval <<= n; - uval |= word & (FLAC__WORD_ALL_ONES >> cbits); - crc16_update_word_(br, word); - cwords++; - cbits = parameter - n; - if(cbits) { /* parameter > n, i.e. if there are still bits left to read, there have to be less than 32 so they will all be in the next word */ - uval <<= cbits; - uval |= (br->buffer[cwords] >> (FLAC__BITS_PER_WORD-cbits)); - } - } - } - else { - cbits = parameter; - uval <<= parameter; - uval |= br->buffer[cwords] >> (FLAC__BITS_PER_WORD-cbits); - } - } - else { - /* in this case we're starting our read at a partial tail word; - * the reader has guaranteed that we have at least 'parameter' - * bits available to read, which makes this case simpler. - */ - uval <<= parameter; - if(cbits) { - /* this also works when consumed_bits==0, it's just a little slower than necessary for that case */ - FLAC__ASSERT(cbits + parameter <= br->bytes*8); - uval |= (br->buffer[cwords] & (FLAC__WORD_ALL_ONES >> cbits)) >> (FLAC__BITS_PER_WORD-cbits-parameter); - cbits += parameter; - } - else { - cbits = parameter; - uval |= br->buffer[cwords] >> (FLAC__BITS_PER_WORD-cbits); - } - } - } - - ucbits -= parameter; - - /* compose the value */ - *vals = (int)(uval >> 1 ^ -(int)(uval & 1)); - - /* are we done? */ - --nvals; - if(nvals == 0) { - br->consumed_bits = cbits; - br->consumed_words = cwords; - return true; - } - - uval = 0; - ++vals; - - } -} -#endif - -#if 0 /* UNUSED */ -FLAC__bool FLAC__bitreader_read_golomb_signed(FLAC__BitReader *br, int *val, unsigned parameter) -{ - FLAC__uint32 lsbs = 0, msbs = 0; - unsigned bit, uval, k; - - FLAC__ASSERT(0 != br); - FLAC__ASSERT(0 != br->buffer); - - k = FLAC__bitmath_ilog2(parameter); - - /* read the unary MSBs and end bit */ - if(!FLAC__bitreader_read_unary_unsigned(br, &msbs)) - return false; - - /* read the binary LSBs */ - if(!FLAC__bitreader_read_raw_uint32(br, &lsbs, k)) - return false; - - if(parameter == 1u<<k) { - /* compose the value */ - uval = (msbs << k) | lsbs; - } - else { - unsigned d = (1 << (k+1)) - parameter; - if(lsbs >= d) { - if(!FLAC__bitreader_read_bit(br, &bit)) - return false; - lsbs <<= 1; - lsbs |= bit; - lsbs -= d; - } - /* compose the value */ - uval = msbs * parameter + lsbs; - } - - /* unfold unsigned to signed */ - if(uval & 1) - *val = -((int)(uval >> 1)) - 1; - else - *val = (int)(uval >> 1); - - return true; -} - -FLAC__bool FLAC__bitreader_read_golomb_unsigned(FLAC__BitReader *br, unsigned *val, unsigned parameter) -{ - FLAC__uint32 lsbs, msbs = 0; - unsigned bit, k; - - FLAC__ASSERT(0 != br); - FLAC__ASSERT(0 != br->buffer); - - k = FLAC__bitmath_ilog2(parameter); - - /* read the unary MSBs and end bit */ - if(!FLAC__bitreader_read_unary_unsigned(br, &msbs)) - return false; - - /* read the binary LSBs */ - if(!FLAC__bitreader_read_raw_uint32(br, &lsbs, k)) - return false; - - if(parameter == 1u<<k) { - /* compose the value */ - *val = (msbs << k) | lsbs; - } - else { - unsigned d = (1 << (k+1)) - parameter; - if(lsbs >= d) { - if(!FLAC__bitreader_read_bit(br, &bit)) - return false; - lsbs <<= 1; - lsbs |= bit; - lsbs -= d; - } - /* compose the value */ - *val = msbs * parameter + lsbs; - } - - return true; -} -#endif /* UNUSED */ - -/* on return, if *val == 0xffffffff then the utf-8 sequence was invalid, but the return value will be true */ -FLAC__bool FLAC__bitreader_read_utf8_uint32(FLAC__BitReader *br, FLAC__uint32 *val, FLAC__byte *raw, unsigned *rawlen) -{ - FLAC__uint32 v = 0; - FLAC__uint32 x; - unsigned i; - - if(!FLAC__bitreader_read_raw_uint32(br, &x, 8)) - return false; - if(raw) - raw[(*rawlen)++] = (FLAC__byte)x; - if(!(x & 0x80)) { /* 0xxxxxxx */ - v = x; - i = 0; - } - else if(x & 0xC0 && !(x & 0x20)) { /* 110xxxxx */ - v = x & 0x1F; - i = 1; - } - else if(x & 0xE0 && !(x & 0x10)) { /* 1110xxxx */ - v = x & 0x0F; - i = 2; - } - else if(x & 0xF0 && !(x & 0x08)) { /* 11110xxx */ - v = x & 0x07; - i = 3; - } - else if(x & 0xF8 && !(x & 0x04)) { /* 111110xx */ - v = x & 0x03; - i = 4; - } - else if(x & 0xFC && !(x & 0x02)) { /* 1111110x */ - v = x & 0x01; - i = 5; - } - else { - *val = 0xffffffff; - return true; - } - for( ; i; i--) { - if(!FLAC__bitreader_read_raw_uint32(br, &x, 8)) - return false; - if(raw) - raw[(*rawlen)++] = (FLAC__byte)x; - if(!(x & 0x80) || (x & 0x40)) { /* 10xxxxxx */ - *val = 0xffffffff; - return true; - } - v <<= 6; - v |= (x & 0x3F); - } - *val = v; - return true; -} - -/* on return, if *val == 0xffffffffffffffff then the utf-8 sequence was invalid, but the return value will be true */ -FLAC__bool FLAC__bitreader_read_utf8_uint64(FLAC__BitReader *br, FLAC__uint64 *val, FLAC__byte *raw, unsigned *rawlen) -{ - FLAC__uint64 v = 0; - FLAC__uint32 x; - unsigned i; - - if(!FLAC__bitreader_read_raw_uint32(br, &x, 8)) - return false; - if(raw) - raw[(*rawlen)++] = (FLAC__byte)x; - if(!(x & 0x80)) { /* 0xxxxxxx */ - v = x; - i = 0; - } - else if(x & 0xC0 && !(x & 0x20)) { /* 110xxxxx */ - v = x & 0x1F; - i = 1; - } - else if(x & 0xE0 && !(x & 0x10)) { /* 1110xxxx */ - v = x & 0x0F; - i = 2; - } - else if(x & 0xF0 && !(x & 0x08)) { /* 11110xxx */ - v = x & 0x07; - i = 3; - } - else if(x & 0xF8 && !(x & 0x04)) { /* 111110xx */ - v = x & 0x03; - i = 4; - } - else if(x & 0xFC && !(x & 0x02)) { /* 1111110x */ - v = x & 0x01; - i = 5; - } - else if(x & 0xFE && !(x & 0x01)) { /* 11111110 */ - v = 0; - i = 6; - } - else { - *val = FLAC__U64L(0xffffffffffffffff); - return true; - } - for( ; i; i--) { - if(!FLAC__bitreader_read_raw_uint32(br, &x, 8)) - return false; - if(raw) - raw[(*rawlen)++] = (FLAC__byte)x; - if(!(x & 0x80) || (x & 0x40)) { /* 10xxxxxx */ - *val = FLAC__U64L(0xffffffffffffffff); - return true; - } - v <<= 6; - v |= (x & 0x3F); - } - *val = v; - return true; -} diff --git a/3rdparty/libflac/src/libFLAC/bitwriter.c b/3rdparty/libflac/src/libFLAC/bitwriter.c deleted file mode 100644 index 441122ee883..00000000000 --- a/3rdparty/libflac/src/libFLAC/bitwriter.c +++ /dev/null @@ -1,865 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdlib.h> /* for malloc() */ -#include <string.h> /* for memcpy(), memset() */ -#include "private/bitwriter.h" -#include "private/crc.h" -#include "FLAC/assert.h" -#include "share/alloc.h" -#include "share/endswap.h" - -/* Things should be fastest when this matches the machine word size */ -/* WATCHOUT: if you change this you must also change the following #defines down to SWAP_BE_WORD_TO_HOST below to match */ -/* WATCHOUT: there are a few places where the code will not work unless bwword is >= 32 bits wide */ -typedef FLAC__uint32 bwword; -#define FLAC__BYTES_PER_WORD 4 -#define FLAC__BITS_PER_WORD 32 -#define FLAC__WORD_ALL_ONES ((FLAC__uint32)0xffffffff) -/* SWAP_BE_WORD_TO_HOST swaps bytes in a bwword (which is always big-endian) if necessary to match host byte order */ -#if WORDS_BIGENDIAN -#define SWAP_BE_WORD_TO_HOST(x) (x) -#else -#define SWAP_BE_WORD_TO_HOST(x) ENDSWAP_32(x) -#endif - -/* - * The default capacity here doesn't matter too much. The buffer always grows - * to hold whatever is written to it. Usually the encoder will stop adding at - * a frame or metadata block, then write that out and clear the buffer for the - * next one. - */ -static const unsigned FLAC__BITWRITER_DEFAULT_CAPACITY = 32768u / sizeof(bwword); /* size in words */ -/* When growing, increment 4K at a time */ -static const unsigned FLAC__BITWRITER_DEFAULT_INCREMENT = 4096u / sizeof(bwword); /* size in words */ - -#define FLAC__WORDS_TO_BITS(words) ((words) * FLAC__BITS_PER_WORD) -#define FLAC__TOTAL_BITS(bw) (FLAC__WORDS_TO_BITS((bw)->words) + (bw)->bits) - -#ifdef min -#undef min -#endif -#define min(x,y) ((x)<(y)?(x):(y)) - -/* adjust for compilers that can't understand using LLU suffix for uint64_t literals */ -#ifdef _MSC_VER -#define FLAC__U64L(x) x -#else -#define FLAC__U64L(x) x##LLU -#endif - -#ifndef FLaC__INLINE -#define FLaC__INLINE -#endif - -struct FLAC__BitWriter { - bwword *buffer; - bwword accum; /* accumulator; bits are right-justified; when full, accum is appended to buffer */ - unsigned capacity; /* capacity of buffer in words */ - unsigned words; /* # of complete words in buffer */ - unsigned bits; /* # of used bits in accum */ -}; - -/* * WATCHOUT: The current implementation only grows the buffer. */ -static FLAC__bool bitwriter_grow_(FLAC__BitWriter *bw, unsigned bits_to_add) -{ - unsigned new_capacity; - bwword *new_buffer; - - FLAC__ASSERT(0 != bw); - FLAC__ASSERT(0 != bw->buffer); - - /* calculate total words needed to store 'bits_to_add' additional bits */ - new_capacity = bw->words + ((bw->bits + bits_to_add + FLAC__BITS_PER_WORD - 1) / FLAC__BITS_PER_WORD); - - /* it's possible (due to pessimism in the growth estimation that - * leads to this call) that we don't actually need to grow - */ - if(bw->capacity >= new_capacity) - return true; - - /* round up capacity increase to the nearest FLAC__BITWRITER_DEFAULT_INCREMENT */ - if((new_capacity - bw->capacity) % FLAC__BITWRITER_DEFAULT_INCREMENT) - new_capacity += FLAC__BITWRITER_DEFAULT_INCREMENT - ((new_capacity - bw->capacity) % FLAC__BITWRITER_DEFAULT_INCREMENT); - /* make sure we got everything right */ - FLAC__ASSERT(0 == (new_capacity - bw->capacity) % FLAC__BITWRITER_DEFAULT_INCREMENT); - FLAC__ASSERT(new_capacity > bw->capacity); - FLAC__ASSERT(new_capacity >= bw->words + ((bw->bits + bits_to_add + FLAC__BITS_PER_WORD - 1) / FLAC__BITS_PER_WORD)); - - new_buffer = (bwword*)safe_realloc_mul_2op_(bw->buffer, sizeof(bwword), /*times*/new_capacity); - if(new_buffer == 0) - return false; - bw->buffer = new_buffer; - bw->capacity = new_capacity; - return true; -} - - -/*********************************************************************** - * - * Class constructor/destructor - * - ***********************************************************************/ - -FLAC__BitWriter *FLAC__bitwriter_new(void) -{ - FLAC__BitWriter *bw = (FLAC__BitWriter*)calloc(1, sizeof(FLAC__BitWriter)); - /* note that calloc() sets all members to 0 for us */ - return bw; -} - -void FLAC__bitwriter_delete(FLAC__BitWriter *bw) -{ - FLAC__ASSERT(0 != bw); - - FLAC__bitwriter_free(bw); - free(bw); -} - -/*********************************************************************** - * - * Public class methods - * - ***********************************************************************/ - -FLAC__bool FLAC__bitwriter_init(FLAC__BitWriter *bw) -{ - FLAC__ASSERT(0 != bw); - - bw->words = bw->bits = 0; - bw->capacity = FLAC__BITWRITER_DEFAULT_CAPACITY; - bw->buffer = (bwword*)malloc(sizeof(bwword) * bw->capacity); - if(bw->buffer == 0) - return false; - - return true; -} - -void FLAC__bitwriter_free(FLAC__BitWriter *bw) -{ - FLAC__ASSERT(0 != bw); - - if(0 != bw->buffer) - free(bw->buffer); - bw->buffer = 0; - bw->capacity = 0; - bw->words = bw->bits = 0; -} - -void FLAC__bitwriter_clear(FLAC__BitWriter *bw) -{ - bw->words = bw->bits = 0; -} - -void FLAC__bitwriter_dump(const FLAC__BitWriter *bw, FILE *out) -{ - unsigned i, j; - if(bw == 0) { - fprintf(out, "bitwriter is NULL\n"); - } - else { - fprintf(out, "bitwriter: capacity=%u words=%u bits=%u total_bits=%u\n", bw->capacity, bw->words, bw->bits, FLAC__TOTAL_BITS(bw)); - - for(i = 0; i < bw->words; i++) { - fprintf(out, "%08X: ", i); - for(j = 0; j < FLAC__BITS_PER_WORD; j++) - fprintf(out, "%01u", bw->buffer[i] & (1 << (FLAC__BITS_PER_WORD-j-1)) ? 1:0); - fprintf(out, "\n"); - } - if(bw->bits > 0) { - fprintf(out, "%08X: ", i); - for(j = 0; j < bw->bits; j++) - fprintf(out, "%01u", bw->accum & (1 << (bw->bits-j-1)) ? 1:0); - fprintf(out, "\n"); - } - } -} - -FLAC__bool FLAC__bitwriter_get_write_crc16(FLAC__BitWriter *bw, FLAC__uint16 *crc) -{ - const FLAC__byte *buffer; - size_t bytes; - - FLAC__ASSERT((bw->bits & 7) == 0); /* assert that we're byte-aligned */ - - if(!FLAC__bitwriter_get_buffer(bw, &buffer, &bytes)) - return false; - - *crc = (FLAC__uint16)FLAC__crc16(buffer, bytes); - FLAC__bitwriter_release_buffer(bw); - return true; -} - -FLAC__bool FLAC__bitwriter_get_write_crc8(FLAC__BitWriter *bw, FLAC__byte *crc) -{ - const FLAC__byte *buffer; - size_t bytes; - - FLAC__ASSERT((bw->bits & 7) == 0); /* assert that we're byte-aligned */ - - if(!FLAC__bitwriter_get_buffer(bw, &buffer, &bytes)) - return false; - - *crc = FLAC__crc8(buffer, bytes); - FLAC__bitwriter_release_buffer(bw); - return true; -} - -FLAC__bool FLAC__bitwriter_is_byte_aligned(const FLAC__BitWriter *bw) -{ - return ((bw->bits & 7) == 0); -} - -unsigned FLAC__bitwriter_get_input_bits_unconsumed(const FLAC__BitWriter *bw) -{ - return FLAC__TOTAL_BITS(bw); -} - -FLAC__bool FLAC__bitwriter_get_buffer(FLAC__BitWriter *bw, const FLAC__byte **buffer, size_t *bytes) -{ - FLAC__ASSERT((bw->bits & 7) == 0); - /* double protection */ - if(bw->bits & 7) - return false; - /* if we have bits in the accumulator we have to flush those to the buffer first */ - if(bw->bits) { - FLAC__ASSERT(bw->words <= bw->capacity); - if(bw->words == bw->capacity && !bitwriter_grow_(bw, FLAC__BITS_PER_WORD)) - return false; - /* append bits as complete word to buffer, but don't change bw->accum or bw->bits */ - bw->buffer[bw->words] = SWAP_BE_WORD_TO_HOST(bw->accum << (FLAC__BITS_PER_WORD-bw->bits)); - } - /* now we can just return what we have */ - *buffer = (FLAC__byte*)bw->buffer; - *bytes = (FLAC__BYTES_PER_WORD * bw->words) + (bw->bits >> 3); - return true; -} - -void FLAC__bitwriter_release_buffer(FLAC__BitWriter *bw) -{ - /* nothing to do. in the future, strict checking of a 'writer-is-in- - * get-mode' flag could be added everywhere and then cleared here - */ - (void)bw; -} - -FLaC__INLINE FLAC__bool FLAC__bitwriter_write_zeroes(FLAC__BitWriter *bw, unsigned bits) -{ - unsigned n; - - FLAC__ASSERT(0 != bw); - FLAC__ASSERT(0 != bw->buffer); - - if(bits == 0) - return true; - /* slightly pessimistic size check but faster than "<= bw->words + (bw->bits+bits+FLAC__BITS_PER_WORD-1)/FLAC__BITS_PER_WORD" */ - if(bw->capacity <= bw->words + bits && !bitwriter_grow_(bw, bits)) - return false; - /* first part gets to word alignment */ - if(bw->bits) { - n = min(FLAC__BITS_PER_WORD - bw->bits, bits); - bw->accum <<= n; - bits -= n; - bw->bits += n; - if(bw->bits == FLAC__BITS_PER_WORD) { - bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum); - bw->bits = 0; - } - else - return true; - } - /* do whole words */ - while(bits >= FLAC__BITS_PER_WORD) { - bw->buffer[bw->words++] = 0; - bits -= FLAC__BITS_PER_WORD; - } - /* do any leftovers */ - if(bits > 0) { - bw->accum = 0; - bw->bits = bits; - } - return true; -} - -FLaC__INLINE FLAC__bool FLAC__bitwriter_write_raw_uint32(FLAC__BitWriter *bw, FLAC__uint32 val, unsigned bits) -{ - register unsigned left; - - /* WATCHOUT: code does not work with <32bit words; we can make things much faster with this assertion */ - FLAC__ASSERT(FLAC__BITS_PER_WORD >= 32); - - FLAC__ASSERT(0 != bw); - FLAC__ASSERT(0 != bw->buffer); - - FLAC__ASSERT(bits <= 32); - if(bits == 0) - return true; - - /* slightly pessimistic size check but faster than "<= bw->words + (bw->bits+bits+FLAC__BITS_PER_WORD-1)/FLAC__BITS_PER_WORD" */ - if(bw->capacity <= bw->words + bits && !bitwriter_grow_(bw, bits)) - return false; - - left = FLAC__BITS_PER_WORD - bw->bits; - if(bits < left) { - bw->accum <<= bits; - bw->accum |= val; - bw->bits += bits; - } - else if(bw->bits) { /* WATCHOUT: if bw->bits == 0, left==FLAC__BITS_PER_WORD and bw->accum<<=left is a NOP instead of setting to 0 */ - bw->accum <<= left; - bw->accum |= val >> (bw->bits = bits - left); - bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum); - bw->accum = val; - } - else { - bw->accum = val; - bw->bits = 0; - bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(val); - } - - return true; -} - -FLaC__INLINE FLAC__bool FLAC__bitwriter_write_raw_int32(FLAC__BitWriter *bw, FLAC__int32 val, unsigned bits) -{ - /* zero-out unused bits */ - if(bits < 32) - val &= (~(0xffffffff << bits)); - - return FLAC__bitwriter_write_raw_uint32(bw, (FLAC__uint32)val, bits); -} - -FLaC__INLINE FLAC__bool FLAC__bitwriter_write_raw_uint64(FLAC__BitWriter *bw, FLAC__uint64 val, unsigned bits) -{ - /* this could be a little faster but it's not used for much */ - if(bits > 32) { - return - FLAC__bitwriter_write_raw_uint32(bw, (FLAC__uint32)(val>>32), bits-32) && - FLAC__bitwriter_write_raw_uint32(bw, (FLAC__uint32)val, 32); - } - else - return FLAC__bitwriter_write_raw_uint32(bw, (FLAC__uint32)val, bits); -} - -FLaC__INLINE FLAC__bool FLAC__bitwriter_write_raw_uint32_little_endian(FLAC__BitWriter *bw, FLAC__uint32 val) -{ - /* this doesn't need to be that fast as currently it is only used for vorbis comments */ - - if(!FLAC__bitwriter_write_raw_uint32(bw, val & 0xff, 8)) - return false; - if(!FLAC__bitwriter_write_raw_uint32(bw, (val>>8) & 0xff, 8)) - return false; - if(!FLAC__bitwriter_write_raw_uint32(bw, (val>>16) & 0xff, 8)) - return false; - if(!FLAC__bitwriter_write_raw_uint32(bw, val>>24, 8)) - return false; - - return true; -} - -FLaC__INLINE FLAC__bool FLAC__bitwriter_write_byte_block(FLAC__BitWriter *bw, const FLAC__byte vals[], unsigned nvals) -{ - unsigned i; - - /* this could be faster but currently we don't need it to be since it's only used for writing metadata */ - for(i = 0; i < nvals; i++) { - if(!FLAC__bitwriter_write_raw_uint32(bw, (FLAC__uint32)(vals[i]), 8)) - return false; - } - - return true; -} - -FLAC__bool FLAC__bitwriter_write_unary_unsigned(FLAC__BitWriter *bw, unsigned val) -{ - if(val < 32) - return FLAC__bitwriter_write_raw_uint32(bw, 1, ++val); - else - return - FLAC__bitwriter_write_zeroes(bw, val) && - FLAC__bitwriter_write_raw_uint32(bw, 1, 1); -} - -unsigned FLAC__bitwriter_rice_bits(FLAC__int32 val, unsigned parameter) -{ - FLAC__uint32 uval; - - FLAC__ASSERT(parameter < sizeof(unsigned)*8); - - /* fold signed to unsigned; actual formula is: negative(v)? -2v-1 : 2v */ - uval = (val<<1) ^ (val>>31); - - return 1 + parameter + (uval >> parameter); -} - -#if 0 /* UNUSED */ -unsigned FLAC__bitwriter_golomb_bits_signed(int val, unsigned parameter) -{ - unsigned bits, msbs, uval; - unsigned k; - - FLAC__ASSERT(parameter > 0); - - /* fold signed to unsigned */ - if(val < 0) - uval = (unsigned)(((-(++val)) << 1) + 1); - else - uval = (unsigned)(val << 1); - - k = FLAC__bitmath_ilog2(parameter); - if(parameter == 1u<<k) { - FLAC__ASSERT(k <= 30); - - msbs = uval >> k; - bits = 1 + k + msbs; - } - else { - unsigned q, r, d; - - d = (1 << (k+1)) - parameter; - q = uval / parameter; - r = uval - (q * parameter); - - bits = 1 + q + k; - if(r >= d) - bits++; - } - return bits; -} - -unsigned FLAC__bitwriter_golomb_bits_unsigned(unsigned uval, unsigned parameter) -{ - unsigned bits, msbs; - unsigned k; - - FLAC__ASSERT(parameter > 0); - - k = FLAC__bitmath_ilog2(parameter); - if(parameter == 1u<<k) { - FLAC__ASSERT(k <= 30); - - msbs = uval >> k; - bits = 1 + k + msbs; - } - else { - unsigned q, r, d; - - d = (1 << (k+1)) - parameter; - q = uval / parameter; - r = uval - (q * parameter); - - bits = 1 + q + k; - if(r >= d) - bits++; - } - return bits; -} -#endif /* UNUSED */ - -FLAC__bool FLAC__bitwriter_write_rice_signed(FLAC__BitWriter *bw, FLAC__int32 val, unsigned parameter) -{ - unsigned total_bits, interesting_bits, msbs; - FLAC__uint32 uval, pattern; - - FLAC__ASSERT(0 != bw); - FLAC__ASSERT(0 != bw->buffer); - FLAC__ASSERT(parameter < 8*sizeof(uval)); - - /* fold signed to unsigned; actual formula is: negative(v)? -2v-1 : 2v */ - uval = (val<<1) ^ (val>>31); - - msbs = uval >> parameter; - interesting_bits = 1 + parameter; - total_bits = interesting_bits + msbs; - pattern = 1 << parameter; /* the unary end bit */ - pattern |= (uval & ((1<<parameter)-1)); /* the binary LSBs */ - - if(total_bits <= 32) - return FLAC__bitwriter_write_raw_uint32(bw, pattern, total_bits); - else - return - FLAC__bitwriter_write_zeroes(bw, msbs) && /* write the unary MSBs */ - FLAC__bitwriter_write_raw_uint32(bw, pattern, interesting_bits); /* write the unary end bit and binary LSBs */ -} - -FLAC__bool FLAC__bitwriter_write_rice_signed_block(FLAC__BitWriter *bw, const FLAC__int32 *vals, unsigned nvals, unsigned parameter) -{ - const FLAC__uint32 mask1 = FLAC__WORD_ALL_ONES << parameter; /* we val|=mask1 to set the stop bit above it... */ - const FLAC__uint32 mask2 = FLAC__WORD_ALL_ONES >> (31-parameter); /* ...then mask off the bits above the stop bit with val&=mask2*/ - FLAC__uint32 uval; - unsigned left; - const unsigned lsbits = 1 + parameter; - unsigned msbits; - - FLAC__ASSERT(0 != bw); - FLAC__ASSERT(0 != bw->buffer); - FLAC__ASSERT(parameter < 8*sizeof(bwword)-1); - /* WATCHOUT: code does not work with <32bit words; we can make things much faster with this assertion */ - FLAC__ASSERT(FLAC__BITS_PER_WORD >= 32); - - while(nvals) { - /* fold signed to unsigned; actual formula is: negative(v)? -2v-1 : 2v */ - uval = (*vals<<1) ^ (*vals>>31); - - msbits = uval >> parameter; - -#if 0 /* OPT: can remove this special case if it doesn't make up for the extra compare (doesn't make a statistically significant difference with msvc or gcc/x86) */ - if(bw->bits && bw->bits + msbits + lsbits <= FLAC__BITS_PER_WORD) { /* i.e. if the whole thing fits in the current bwword */ - /* ^^^ if bw->bits is 0 then we may have filled the buffer and have no free bwword to work in */ - bw->bits = bw->bits + msbits + lsbits; - uval |= mask1; /* set stop bit */ - uval &= mask2; /* mask off unused top bits */ - /* NOT: bw->accum <<= msbits + lsbits because msbits+lsbits could be 32, then the shift would be a NOP */ - bw->accum <<= msbits; - bw->accum <<= lsbits; - bw->accum |= uval; - if(bw->bits == FLAC__BITS_PER_WORD) { - bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum); - bw->bits = 0; - /* burying the capacity check down here means we have to grow the buffer a little if there are more vals to do */ - if(bw->capacity <= bw->words && nvals > 1 && !bitwriter_grow_(bw, 1)) { - FLAC__ASSERT(bw->capacity == bw->words); - return false; - } - } - } - else { -#elif 1 /*@@@@@@ OPT: try this version with MSVC6 to see if better, not much difference for gcc-4 */ - if(bw->bits && bw->bits + msbits + lsbits < FLAC__BITS_PER_WORD) { /* i.e. if the whole thing fits in the current bwword */ - /* ^^^ if bw->bits is 0 then we may have filled the buffer and have no free bwword to work in */ - bw->bits = bw->bits + msbits + lsbits; - uval |= mask1; /* set stop bit */ - uval &= mask2; /* mask off unused top bits */ - bw->accum <<= msbits + lsbits; - bw->accum |= uval; - } - else { -#endif - /* slightly pessimistic size check but faster than "<= bw->words + (bw->bits+msbits+lsbits+FLAC__BITS_PER_WORD-1)/FLAC__BITS_PER_WORD" */ - /* OPT: pessimism may cause flurry of false calls to grow_ which eat up all savings before it */ - if(bw->capacity <= bw->words + bw->bits + msbits + 1/*lsbits always fit in 1 bwword*/ && !bitwriter_grow_(bw, msbits+lsbits)) - return false; - - if(msbits) { - /* first part gets to word alignment */ - if(bw->bits) { - left = FLAC__BITS_PER_WORD - bw->bits; - if(msbits < left) { - bw->accum <<= msbits; - bw->bits += msbits; - goto break1; - } - else { - bw->accum <<= left; - msbits -= left; - bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum); - bw->bits = 0; - } - } - /* do whole words */ - while(msbits >= FLAC__BITS_PER_WORD) { - bw->buffer[bw->words++] = 0; - msbits -= FLAC__BITS_PER_WORD; - } - /* do any leftovers */ - if(msbits > 0) { - bw->accum = 0; - bw->bits = msbits; - } - } -break1: - uval |= mask1; /* set stop bit */ - uval &= mask2; /* mask off unused top bits */ - - left = FLAC__BITS_PER_WORD - bw->bits; - if(lsbits < left) { - bw->accum <<= lsbits; - bw->accum |= uval; - bw->bits += lsbits; - } - else { - /* if bw->bits == 0, left==FLAC__BITS_PER_WORD which will always - * be > lsbits (because of previous assertions) so it would have - * triggered the (lsbits<left) case above. - */ - FLAC__ASSERT(bw->bits); - FLAC__ASSERT(left < FLAC__BITS_PER_WORD); - bw->accum <<= left; - bw->accum |= uval >> (bw->bits = lsbits - left); - bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum); - bw->accum = uval; - } -#if 1 - } -#endif - vals++; - nvals--; - } - return true; -} - -#if 0 /* UNUSED */ -FLAC__bool FLAC__bitwriter_write_golomb_signed(FLAC__BitWriter *bw, int val, unsigned parameter) -{ - unsigned total_bits, msbs, uval; - unsigned k; - - FLAC__ASSERT(0 != bw); - FLAC__ASSERT(0 != bw->buffer); - FLAC__ASSERT(parameter > 0); - - /* fold signed to unsigned */ - if(val < 0) - uval = (unsigned)(((-(++val)) << 1) + 1); - else - uval = (unsigned)(val << 1); - - k = FLAC__bitmath_ilog2(parameter); - if(parameter == 1u<<k) { - unsigned pattern; - - FLAC__ASSERT(k <= 30); - - msbs = uval >> k; - total_bits = 1 + k + msbs; - pattern = 1 << k; /* the unary end bit */ - pattern |= (uval & ((1u<<k)-1)); /* the binary LSBs */ - - if(total_bits <= 32) { - if(!FLAC__bitwriter_write_raw_uint32(bw, pattern, total_bits)) - return false; - } - else { - /* write the unary MSBs */ - if(!FLAC__bitwriter_write_zeroes(bw, msbs)) - return false; - /* write the unary end bit and binary LSBs */ - if(!FLAC__bitwriter_write_raw_uint32(bw, pattern, k+1)) - return false; - } - } - else { - unsigned q, r, d; - - d = (1 << (k+1)) - parameter; - q = uval / parameter; - r = uval - (q * parameter); - /* write the unary MSBs */ - if(!FLAC__bitwriter_write_zeroes(bw, q)) - return false; - /* write the unary end bit */ - if(!FLAC__bitwriter_write_raw_uint32(bw, 1, 1)) - return false; - /* write the binary LSBs */ - if(r >= d) { - if(!FLAC__bitwriter_write_raw_uint32(bw, r+d, k+1)) - return false; - } - else { - if(!FLAC__bitwriter_write_raw_uint32(bw, r, k)) - return false; - } - } - return true; -} - -FLAC__bool FLAC__bitwriter_write_golomb_unsigned(FLAC__BitWriter *bw, unsigned uval, unsigned parameter) -{ - unsigned total_bits, msbs; - unsigned k; - - FLAC__ASSERT(0 != bw); - FLAC__ASSERT(0 != bw->buffer); - FLAC__ASSERT(parameter > 0); - - k = FLAC__bitmath_ilog2(parameter); - if(parameter == 1u<<k) { - unsigned pattern; - - FLAC__ASSERT(k <= 30); - - msbs = uval >> k; - total_bits = 1 + k + msbs; - pattern = 1 << k; /* the unary end bit */ - pattern |= (uval & ((1u<<k)-1)); /* the binary LSBs */ - - if(total_bits <= 32) { - if(!FLAC__bitwriter_write_raw_uint32(bw, pattern, total_bits)) - return false; - } - else { - /* write the unary MSBs */ - if(!FLAC__bitwriter_write_zeroes(bw, msbs)) - return false; - /* write the unary end bit and binary LSBs */ - if(!FLAC__bitwriter_write_raw_uint32(bw, pattern, k+1)) - return false; - } - } - else { - unsigned q, r, d; - - d = (1 << (k+1)) - parameter; - q = uval / parameter; - r = uval - (q * parameter); - /* write the unary MSBs */ - if(!FLAC__bitwriter_write_zeroes(bw, q)) - return false; - /* write the unary end bit */ - if(!FLAC__bitwriter_write_raw_uint32(bw, 1, 1)) - return false; - /* write the binary LSBs */ - if(r >= d) { - if(!FLAC__bitwriter_write_raw_uint32(bw, r+d, k+1)) - return false; - } - else { - if(!FLAC__bitwriter_write_raw_uint32(bw, r, k)) - return false; - } - } - return true; -} -#endif /* UNUSED */ - -FLAC__bool FLAC__bitwriter_write_utf8_uint32(FLAC__BitWriter *bw, FLAC__uint32 val) -{ - FLAC__bool ok = 1; - - FLAC__ASSERT(0 != bw); - FLAC__ASSERT(0 != bw->buffer); - - FLAC__ASSERT(!(val & 0x80000000)); /* this version only handles 31 bits */ - - if(val < 0x80) { - return FLAC__bitwriter_write_raw_uint32(bw, val, 8); - } - else if(val < 0x800) { - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0xC0 | (val>>6), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (val&0x3F), 8); - } - else if(val < 0x10000) { - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0xE0 | (val>>12), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | ((val>>6)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (val&0x3F), 8); - } - else if(val < 0x200000) { - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0xF0 | (val>>18), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | ((val>>12)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | ((val>>6)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (val&0x3F), 8); - } - else if(val < 0x4000000) { - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0xF8 | (val>>24), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | ((val>>18)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | ((val>>12)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | ((val>>6)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (val&0x3F), 8); - } - else { - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0xFC | (val>>30), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | ((val>>24)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | ((val>>18)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | ((val>>12)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | ((val>>6)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (val&0x3F), 8); - } - - return ok; -} - -FLAC__bool FLAC__bitwriter_write_utf8_uint64(FLAC__BitWriter *bw, FLAC__uint64 val) -{ - FLAC__bool ok = 1; - - FLAC__ASSERT(0 != bw); - FLAC__ASSERT(0 != bw->buffer); - - FLAC__ASSERT(!(val & FLAC__U64L(0xFFFFFFF000000000))); /* this version only handles 36 bits */ - - if(val < 0x80) { - return FLAC__bitwriter_write_raw_uint32(bw, (FLAC__uint32)val, 8); - } - else if(val < 0x800) { - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0xC0 | (FLAC__uint32)(val>>6), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)(val&0x3F), 8); - } - else if(val < 0x10000) { - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0xE0 | (FLAC__uint32)(val>>12), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)((val>>6)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)(val&0x3F), 8); - } - else if(val < 0x200000) { - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0xF0 | (FLAC__uint32)(val>>18), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)((val>>12)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)((val>>6)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)(val&0x3F), 8); - } - else if(val < 0x4000000) { - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0xF8 | (FLAC__uint32)(val>>24), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)((val>>18)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)((val>>12)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)((val>>6)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)(val&0x3F), 8); - } - else if(val < 0x80000000) { - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0xFC | (FLAC__uint32)(val>>30), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)((val>>24)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)((val>>18)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)((val>>12)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)((val>>6)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)(val&0x3F), 8); - } - else { - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0xFE, 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)((val>>30)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)((val>>24)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)((val>>18)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)((val>>12)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)((val>>6)&0x3F), 8); - ok &= FLAC__bitwriter_write_raw_uint32(bw, 0x80 | (FLAC__uint32)(val&0x3F), 8); - } - - return ok; -} - -FLAC__bool FLAC__bitwriter_zero_pad_to_byte_boundary(FLAC__BitWriter *bw) -{ - /* 0-pad to byte boundary */ - if(bw->bits & 7u) - return FLAC__bitwriter_write_zeroes(bw, 8 - (bw->bits & 7u)); - else - return true; -} diff --git a/3rdparty/libflac/src/libFLAC/cpu.c b/3rdparty/libflac/src/libFLAC/cpu.c deleted file mode 100644 index e5ea78ea37c..00000000000 --- a/3rdparty/libflac/src/libFLAC/cpu.c +++ /dev/null @@ -1,422 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include "private/cpu.h" -#include <stdlib.h> -#include <stdio.h> - -#if defined FLAC__CPU_IA32 -# include <signal.h> -#elif defined FLAC__CPU_PPC -# if !defined FLAC__NO_ASM -# if defined FLAC__SYS_DARWIN -# include <sys/sysctl.h> -# include <mach/mach.h> -# include <mach/mach_host.h> -# include <mach/host_info.h> -# include <mach/machine.h> -# ifndef CPU_SUBTYPE_POWERPC_970 -# define CPU_SUBTYPE_POWERPC_970 ((cpu_subtype_t) 100) -# endif -# else /* FLAC__SYS_DARWIN */ - -# include <signal.h> -# include <setjmp.h> - -static sigjmp_buf jmpbuf; -static volatile sig_atomic_t canjump = 0; - -static void sigill_handler (int sig) -{ - if (!canjump) { - signal (sig, SIG_DFL); - raise (sig); - } - canjump = 0; - siglongjmp (jmpbuf, 1); -} -# endif /* FLAC__SYS_DARWIN */ -# endif /* FLAC__NO_ASM */ -#endif /* FLAC__CPU_PPC */ - -#if defined (__NetBSD__) || defined(__OpenBSD__) -#include <sys/param.h> -#include <sys/sysctl.h> -#include <machine/cpu.h> -#endif - -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) -#include <sys/types.h> -#include <sys/sysctl.h> -#endif - -#if defined(__APPLE__) -/* how to get sysctlbyname()? */ -#endif - -#if defined(FLAC__CPU_IA32) && !defined(FLAC__NO_ASM) && defined (FLAC__HAS_NASM) -/* these are flags in EDX of CPUID AX=00000001 */ -static const unsigned FLAC__CPUINFO_IA32_CPUID_CMOV = 0x00008000; -static const unsigned FLAC__CPUINFO_IA32_CPUID_MMX = 0x00800000; -static const unsigned FLAC__CPUINFO_IA32_CPUID_FXSR = 0x01000000; -static const unsigned FLAC__CPUINFO_IA32_CPUID_SSE = 0x02000000; -static const unsigned FLAC__CPUINFO_IA32_CPUID_SSE2 = 0x04000000; -/* these are flags in ECX of CPUID AX=00000001 */ -static const unsigned FLAC__CPUINFO_IA32_CPUID_SSE3 = 0x00000001; -static const unsigned FLAC__CPUINFO_IA32_CPUID_SSSE3 = 0x00000200; -#ifdef FLAC__USE_3DNOW -/* these are flags in EDX of CPUID AX=80000001 */ -static const unsigned FLAC__CPUINFO_IA32_CPUID_EXTENDED_AMD_3DNOW = 0x80000000; -static const unsigned FLAC__CPUINFO_IA32_CPUID_EXTENDED_AMD_EXT3DNOW = 0x40000000; -static const unsigned FLAC__CPUINFO_IA32_CPUID_EXTENDED_AMD_EXTMMX = 0x00400000; -#endif -#endif - - -/* - * Extra stuff needed for detection of OS support for SSE on IA-32 - */ -#if defined(FLAC__CPU_IA32) && !defined FLAC__NO_ASM && defined FLAC__HAS_NASM && !defined FLAC__NO_SSE_OS && !defined FLAC__SSE_OS -# if defined(__linux__) -/* - * If the OS doesn't support SSE, we will get here with a SIGILL. We - * modify the return address to jump over the offending SSE instruction - * and also the operation following it that indicates the instruction - * executed successfully. In this way we use no global variables and - * stay thread-safe. - * - * 3 + 3 + 6: - * 3 bytes for "xorps xmm0,xmm0" - * 3 bytes for estimate of how long the follwing "inc var" instruction is - * 6 bytes extra in case our estimate is wrong - * 12 bytes puts us in the NOP "landing zone" - */ -# undef USE_OBSOLETE_SIGCONTEXT_FLAVOR /* #define this to use the older signal handler method */ -# ifdef USE_OBSOLETE_SIGCONTEXT_FLAVOR - static void sigill_handler_sse_os(int signal, struct sigcontext sc) - { - (void)signal; - sc.eip += 3 + 3 + 6; - } -# else -# include <sys/ucontext.h> - static void sigill_handler_sse_os(int signal, siginfo_t *si, void *uc) - { - (void)signal, (void)si; - ((ucontext_t*)uc)->uc_mcontext.gregs[14/*REG_EIP*/] += 3 + 3 + 6; - } -# endif -# elif defined(_MSC_VER) -# include <windows.h> -# undef USE_TRY_CATCH_FLAVOR /* #define this to use the try/catch method for catching illegal opcode exception */ -# ifdef USE_TRY_CATCH_FLAVOR -# else - LONG CALLBACK sigill_handler_sse_os(EXCEPTION_POINTERS *ep) - { - if(ep->ExceptionRecord->ExceptionCode == EXCEPTION_ILLEGAL_INSTRUCTION) { - ep->ContextRecord->Eip += 3 + 3 + 6; - return EXCEPTION_CONTINUE_EXECUTION; - } - return EXCEPTION_CONTINUE_SEARCH; - } -# endif -# endif -#endif - - -void FLAC__cpu_info(FLAC__CPUInfo *info) -{ -/* - * IA32-specific - */ -#ifdef FLAC__CPU_IA32 - info->type = FLAC__CPUINFO_TYPE_IA32; -#if !defined FLAC__NO_ASM && defined FLAC__HAS_NASM - info->use_asm = true; /* we assume a minimum of 80386 with FLAC__CPU_IA32 */ - info->data.ia32.cpuid = FLAC__cpu_have_cpuid_asm_ia32()? true : false; - info->data.ia32.bswap = info->data.ia32.cpuid; /* CPUID => BSWAP since it came after */ - info->data.ia32.cmov = false; - info->data.ia32.mmx = false; - info->data.ia32.fxsr = false; - info->data.ia32.sse = false; - info->data.ia32.sse2 = false; - info->data.ia32.sse3 = false; - info->data.ia32.ssse3 = false; - info->data.ia32._3dnow = false; - info->data.ia32.ext3dnow = false; - info->data.ia32.extmmx = false; - if(info->data.ia32.cpuid) { - /* http://www.sandpile.org/ia32/cpuid.htm */ - FLAC__uint32 flags_edx, flags_ecx; - FLAC__cpu_info_asm_ia32(&flags_edx, &flags_ecx); - info->data.ia32.cmov = (flags_edx & FLAC__CPUINFO_IA32_CPUID_CMOV )? true : false; - info->data.ia32.mmx = (flags_edx & FLAC__CPUINFO_IA32_CPUID_MMX )? true : false; - info->data.ia32.fxsr = (flags_edx & FLAC__CPUINFO_IA32_CPUID_FXSR )? true : false; - info->data.ia32.sse = (flags_edx & FLAC__CPUINFO_IA32_CPUID_SSE )? true : false; - info->data.ia32.sse2 = (flags_edx & FLAC__CPUINFO_IA32_CPUID_SSE2 )? true : false; - info->data.ia32.sse3 = (flags_ecx & FLAC__CPUINFO_IA32_CPUID_SSE3 )? true : false; - info->data.ia32.ssse3 = (flags_ecx & FLAC__CPUINFO_IA32_CPUID_SSSE3)? true : false; - -#ifdef FLAC__USE_3DNOW - flags_edx = FLAC__cpu_info_extended_amd_asm_ia32(); - info->data.ia32._3dnow = (flags_edx & FLAC__CPUINFO_IA32_CPUID_EXTENDED_AMD_3DNOW )? true : false; - info->data.ia32.ext3dnow = (flags_edx & FLAC__CPUINFO_IA32_CPUID_EXTENDED_AMD_EXT3DNOW)? true : false; - info->data.ia32.extmmx = (flags_edx & FLAC__CPUINFO_IA32_CPUID_EXTENDED_AMD_EXTMMX )? true : false; -#else - info->data.ia32._3dnow = info->data.ia32.ext3dnow = info->data.ia32.extmmx = false; -#endif - -#ifdef DEBUG - fprintf(stderr, "CPU info (IA-32):\n"); - fprintf(stderr, " CPUID ...... %c\n", info->data.ia32.cpuid ? 'Y' : 'n'); - fprintf(stderr, " BSWAP ...... %c\n", info->data.ia32.bswap ? 'Y' : 'n'); - fprintf(stderr, " CMOV ....... %c\n", info->data.ia32.cmov ? 'Y' : 'n'); - fprintf(stderr, " MMX ........ %c\n", info->data.ia32.mmx ? 'Y' : 'n'); - fprintf(stderr, " FXSR ....... %c\n", info->data.ia32.fxsr ? 'Y' : 'n'); - fprintf(stderr, " SSE ........ %c\n", info->data.ia32.sse ? 'Y' : 'n'); - fprintf(stderr, " SSE2 ....... %c\n", info->data.ia32.sse2 ? 'Y' : 'n'); - fprintf(stderr, " SSE3 ....... %c\n", info->data.ia32.sse3 ? 'Y' : 'n'); - fprintf(stderr, " SSSE3 ...... %c\n", info->data.ia32.ssse3 ? 'Y' : 'n'); - fprintf(stderr, " 3DNow! ..... %c\n", info->data.ia32._3dnow ? 'Y' : 'n'); - fprintf(stderr, " 3DNow!-ext . %c\n", info->data.ia32.ext3dnow? 'Y' : 'n'); - fprintf(stderr, " 3DNow!-MMX . %c\n", info->data.ia32.extmmx ? 'Y' : 'n'); -#endif - - /* - * now have to check for OS support of SSE/SSE2 - */ - if(info->data.ia32.fxsr || info->data.ia32.sse || info->data.ia32.sse2) { -#if defined FLAC__NO_SSE_OS - /* assume user knows better than us; turn it off */ - info->data.ia32.fxsr = info->data.ia32.sse = info->data.ia32.sse2 = info->data.ia32.sse3 = info->data.ia32.ssse3 = false; -#elif defined FLAC__SSE_OS - /* assume user knows better than us; leave as detected above */ -#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__APPLE__) - int sse = 0; - size_t len; - /* at least one of these must work: */ - len = sizeof(sse); sse = sse || (sysctlbyname("hw.instruction_sse", &sse, &len, NULL, 0) == 0 && sse); - len = sizeof(sse); sse = sse || (sysctlbyname("hw.optional.sse" , &sse, &len, NULL, 0) == 0 && sse); /* __APPLE__ ? */ - if(!sse) - info->data.ia32.fxsr = info->data.ia32.sse = info->data.ia32.sse2 = info->data.ia32.sse3 = info->data.ia32.ssse3 = false; -#elif defined(__NetBSD__) || defined (__OpenBSD__) -# if __NetBSD_Version__ >= 105250000 || (defined __OpenBSD__) - int val = 0, mib[2] = { CTL_MACHDEP, CPU_SSE }; - size_t len = sizeof(val); - if(sysctl(mib, 2, &val, &len, NULL, 0) < 0 || !val) - info->data.ia32.fxsr = info->data.ia32.sse = info->data.ia32.sse2 = info->data.ia32.sse3 = info->data.ia32.ssse3 = false; - else { /* double-check SSE2 */ - mib[1] = CPU_SSE2; - len = sizeof(val); - if(sysctl(mib, 2, &val, &len, NULL, 0) < 0 || !val) - info->data.ia32.sse2 = info->data.ia32.sse3 = info->data.ia32.ssse3 = false; - } -# else - info->data.ia32.fxsr = info->data.ia32.sse = info->data.ia32.sse2 = info->data.ia32.sse3 = info->data.ia32.ssse3 = false; -# endif -#elif defined(__linux__) - int sse = 0; - struct sigaction sigill_save; -#ifdef USE_OBSOLETE_SIGCONTEXT_FLAVOR - if(0 == sigaction(SIGILL, NULL, &sigill_save) && signal(SIGILL, (void (*)(int))sigill_handler_sse_os) != SIG_ERR) -#else - struct sigaction sigill_sse; - sigill_sse.sa_sigaction = sigill_handler_sse_os; - __sigemptyset(&sigill_sse.sa_mask); - sigill_sse.sa_flags = SA_SIGINFO | SA_RESETHAND; /* SA_RESETHAND just in case our SIGILL return jump breaks, so we don't get stuck in a loop */ - if(0 == sigaction(SIGILL, &sigill_sse, &sigill_save)) -#endif - { - /* http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html */ - /* see sigill_handler_sse_os() for an explanation of the following: */ - asm volatile ( - "xorl %0,%0\n\t" /* for some reason, still need to do this to clear 'sse' var */ - "xorps %%xmm0,%%xmm0\n\t" /* will cause SIGILL if unsupported by OS */ - "incl %0\n\t" /* SIGILL handler will jump over this */ - /* landing zone */ - "nop\n\t" /* SIGILL jump lands here if "inc" is 9 bytes */ - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" - "nop\n\t" /* SIGILL jump lands here if "inc" is 3 bytes (expected) */ - "nop\n\t" - "nop" /* SIGILL jump lands here if "inc" is 1 byte */ - : "=r"(sse) - : "r"(sse) - ); - - sigaction(SIGILL, &sigill_save, NULL); - } - - if(!sse) - info->data.ia32.fxsr = info->data.ia32.sse = info->data.ia32.sse2 = info->data.ia32.sse3 = info->data.ia32.ssse3 = false; -#elif defined(_MSC_VER) -# ifdef USE_TRY_CATCH_FLAVOR - _try { - __asm { -# if _MSC_VER <= 1200 - /* VC6 assembler doesn't know SSE, have to emit bytecode instead */ - _emit 0x0F - _emit 0x57 - _emit 0xC0 -# else - xorps xmm0,xmm0 -# endif - } - } - _except(EXCEPTION_EXECUTE_HANDLER) { - if (_exception_code() == STATUS_ILLEGAL_INSTRUCTION) - info->data.ia32.fxsr = info->data.ia32.sse = info->data.ia32.sse2 = info->data.ia32.sse3 = info->data.ia32.ssse3 = false; - } -# else - int sse = 0; - LPTOP_LEVEL_EXCEPTION_FILTER save = SetUnhandledExceptionFilter(sigill_handler_sse_os); - /* see GCC version above for explanation */ - /* http://msdn2.microsoft.com/en-us/library/4ks26t93.aspx */ - /* http://www.codeproject.com/cpp/gccasm.asp */ - /* http://www.hick.org/~mmiller/msvc_inline_asm.html */ - __asm { -# if _MSC_VER <= 1200 - /* VC6 assembler doesn't know SSE, have to emit bytecode instead */ - _emit 0x0F - _emit 0x57 - _emit 0xC0 -# else - xorps xmm0,xmm0 -# endif - inc sse - nop - nop - nop - nop - nop - nop - nop - nop - nop - } - SetUnhandledExceptionFilter(save); - if(!sse) - info->data.ia32.fxsr = info->data.ia32.sse = info->data.ia32.sse2 = info->data.ia32.sse3 = info->data.ia32.ssse3 = false; -# endif -#else - /* no way to test, disable to be safe */ - info->data.ia32.fxsr = info->data.ia32.sse = info->data.ia32.sse2 = info->data.ia32.sse3 = info->data.ia32.ssse3 = false; -#endif -#ifdef DEBUG - fprintf(stderr, " SSE OS sup . %c\n", info->data.ia32.sse ? 'Y' : 'n'); -#endif - - } - } -#else - info->use_asm = false; -#endif - -/* - * PPC-specific - */ -#elif defined FLAC__CPU_PPC - info->type = FLAC__CPUINFO_TYPE_PPC; -# if !defined FLAC__NO_ASM - info->use_asm = true; -# ifdef FLAC__USE_ALTIVEC -# if defined FLAC__SYS_DARWIN - { - int val = 0, mib[2] = { CTL_HW, HW_VECTORUNIT }; - size_t len = sizeof(val); - info->data.ppc.altivec = !(sysctl(mib, 2, &val, &len, NULL, 0) || !val); - } - { - host_basic_info_data_t hostInfo; - mach_msg_type_number_t infoCount; - - infoCount = HOST_BASIC_INFO_COUNT; - host_info(mach_host_self(), HOST_BASIC_INFO, (host_info_t)&hostInfo, &infoCount); - - info->data.ppc.ppc64 = (hostInfo.cpu_type == CPU_TYPE_POWERPC) && (hostInfo.cpu_subtype == CPU_SUBTYPE_POWERPC_970); - } -# else /* FLAC__USE_ALTIVEC && !FLAC__SYS_DARWIN */ - { - /* no Darwin, do it the brute-force way */ - /* @@@@@@ this is not thread-safe; replace with SSE OS method above or remove */ - info->data.ppc.altivec = 0; - info->data.ppc.ppc64 = 0; - - signal (SIGILL, sigill_handler); - canjump = 0; - if (!sigsetjmp (jmpbuf, 1)) { - canjump = 1; - - asm volatile ( - "mtspr 256, %0\n\t" - "vand %%v0, %%v0, %%v0" - : - : "r" (-1) - ); - - info->data.ppc.altivec = 1; - } - canjump = 0; - if (!sigsetjmp (jmpbuf, 1)) { - int x = 0; - canjump = 1; - - /* PPC64 hardware implements the cntlzd instruction */ - asm volatile ("cntlzd %0, %1" : "=r" (x) : "r" (x) ); - - info->data.ppc.ppc64 = 1; - } - signal (SIGILL, SIG_DFL); /*@@@@@@ should save and restore old signal */ - } -# endif -# else /* !FLAC__USE_ALTIVEC */ - info->data.ppc.altivec = 0; - info->data.ppc.ppc64 = 0; -# endif -# else - info->use_asm = false; -# endif - -/* - * unknown CPI - */ -#else - info->type = FLAC__CPUINFO_TYPE_UNKNOWN; - info->use_asm = false; -#endif -} diff --git a/3rdparty/libflac/src/libFLAC/crc.c b/3rdparty/libflac/src/libFLAC/crc.c deleted file mode 100644 index 52574f87c80..00000000000 --- a/3rdparty/libflac/src/libFLAC/crc.c +++ /dev/null @@ -1,142 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include "private/crc.h" - -/* CRC-8, poly = x^8 + x^2 + x^1 + x^0, init = 0 */ - -FLAC__byte const FLAC__crc8_table[256] = { - 0x00, 0x07, 0x0E, 0x09, 0x1C, 0x1B, 0x12, 0x15, - 0x38, 0x3F, 0x36, 0x31, 0x24, 0x23, 0x2A, 0x2D, - 0x70, 0x77, 0x7E, 0x79, 0x6C, 0x6B, 0x62, 0x65, - 0x48, 0x4F, 0x46, 0x41, 0x54, 0x53, 0x5A, 0x5D, - 0xE0, 0xE7, 0xEE, 0xE9, 0xFC, 0xFB, 0xF2, 0xF5, - 0xD8, 0xDF, 0xD6, 0xD1, 0xC4, 0xC3, 0xCA, 0xCD, - 0x90, 0x97, 0x9E, 0x99, 0x8C, 0x8B, 0x82, 0x85, - 0xA8, 0xAF, 0xA6, 0xA1, 0xB4, 0xB3, 0xBA, 0xBD, - 0xC7, 0xC0, 0xC9, 0xCE, 0xDB, 0xDC, 0xD5, 0xD2, - 0xFF, 0xF8, 0xF1, 0xF6, 0xE3, 0xE4, 0xED, 0xEA, - 0xB7, 0xB0, 0xB9, 0xBE, 0xAB, 0xAC, 0xA5, 0xA2, - 0x8F, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9D, 0x9A, - 0x27, 0x20, 0x29, 0x2E, 0x3B, 0x3C, 0x35, 0x32, - 0x1F, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0D, 0x0A, - 0x57, 0x50, 0x59, 0x5E, 0x4B, 0x4C, 0x45, 0x42, - 0x6F, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7D, 0x7A, - 0x89, 0x8E, 0x87, 0x80, 0x95, 0x92, 0x9B, 0x9C, - 0xB1, 0xB6, 0xBF, 0xB8, 0xAD, 0xAA, 0xA3, 0xA4, - 0xF9, 0xFE, 0xF7, 0xF0, 0xE5, 0xE2, 0xEB, 0xEC, - 0xC1, 0xC6, 0xCF, 0xC8, 0xDD, 0xDA, 0xD3, 0xD4, - 0x69, 0x6E, 0x67, 0x60, 0x75, 0x72, 0x7B, 0x7C, - 0x51, 0x56, 0x5F, 0x58, 0x4D, 0x4A, 0x43, 0x44, - 0x19, 0x1E, 0x17, 0x10, 0x05, 0x02, 0x0B, 0x0C, - 0x21, 0x26, 0x2F, 0x28, 0x3D, 0x3A, 0x33, 0x34, - 0x4E, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5C, 0x5B, - 0x76, 0x71, 0x78, 0x7F, 0x6A, 0x6D, 0x64, 0x63, - 0x3E, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2C, 0x2B, - 0x06, 0x01, 0x08, 0x0F, 0x1A, 0x1D, 0x14, 0x13, - 0xAE, 0xA9, 0xA0, 0xA7, 0xB2, 0xB5, 0xBC, 0xBB, - 0x96, 0x91, 0x98, 0x9F, 0x8A, 0x8D, 0x84, 0x83, - 0xDE, 0xD9, 0xD0, 0xD7, 0xC2, 0xC5, 0xCC, 0xCB, - 0xE6, 0xE1, 0xE8, 0xEF, 0xFA, 0xFD, 0xF4, 0xF3 -}; - -/* CRC-16, poly = x^16 + x^15 + x^2 + x^0, init = 0 */ - -unsigned FLAC__crc16_table[256] = { - 0x0000, 0x8005, 0x800f, 0x000a, 0x801b, 0x001e, 0x0014, 0x8011, - 0x8033, 0x0036, 0x003c, 0x8039, 0x0028, 0x802d, 0x8027, 0x0022, - 0x8063, 0x0066, 0x006c, 0x8069, 0x0078, 0x807d, 0x8077, 0x0072, - 0x0050, 0x8055, 0x805f, 0x005a, 0x804b, 0x004e, 0x0044, 0x8041, - 0x80c3, 0x00c6, 0x00cc, 0x80c9, 0x00d8, 0x80dd, 0x80d7, 0x00d2, - 0x00f0, 0x80f5, 0x80ff, 0x00fa, 0x80eb, 0x00ee, 0x00e4, 0x80e1, - 0x00a0, 0x80a5, 0x80af, 0x00aa, 0x80bb, 0x00be, 0x00b4, 0x80b1, - 0x8093, 0x0096, 0x009c, 0x8099, 0x0088, 0x808d, 0x8087, 0x0082, - 0x8183, 0x0186, 0x018c, 0x8189, 0x0198, 0x819d, 0x8197, 0x0192, - 0x01b0, 0x81b5, 0x81bf, 0x01ba, 0x81ab, 0x01ae, 0x01a4, 0x81a1, - 0x01e0, 0x81e5, 0x81ef, 0x01ea, 0x81fb, 0x01fe, 0x01f4, 0x81f1, - 0x81d3, 0x01d6, 0x01dc, 0x81d9, 0x01c8, 0x81cd, 0x81c7, 0x01c2, - 0x0140, 0x8145, 0x814f, 0x014a, 0x815b, 0x015e, 0x0154, 0x8151, - 0x8173, 0x0176, 0x017c, 0x8179, 0x0168, 0x816d, 0x8167, 0x0162, - 0x8123, 0x0126, 0x012c, 0x8129, 0x0138, 0x813d, 0x8137, 0x0132, - 0x0110, 0x8115, 0x811f, 0x011a, 0x810b, 0x010e, 0x0104, 0x8101, - 0x8303, 0x0306, 0x030c, 0x8309, 0x0318, 0x831d, 0x8317, 0x0312, - 0x0330, 0x8335, 0x833f, 0x033a, 0x832b, 0x032e, 0x0324, 0x8321, - 0x0360, 0x8365, 0x836f, 0x036a, 0x837b, 0x037e, 0x0374, 0x8371, - 0x8353, 0x0356, 0x035c, 0x8359, 0x0348, 0x834d, 0x8347, 0x0342, - 0x03c0, 0x83c5, 0x83cf, 0x03ca, 0x83db, 0x03de, 0x03d4, 0x83d1, - 0x83f3, 0x03f6, 0x03fc, 0x83f9, 0x03e8, 0x83ed, 0x83e7, 0x03e2, - 0x83a3, 0x03a6, 0x03ac, 0x83a9, 0x03b8, 0x83bd, 0x83b7, 0x03b2, - 0x0390, 0x8395, 0x839f, 0x039a, 0x838b, 0x038e, 0x0384, 0x8381, - 0x0280, 0x8285, 0x828f, 0x028a, 0x829b, 0x029e, 0x0294, 0x8291, - 0x82b3, 0x02b6, 0x02bc, 0x82b9, 0x02a8, 0x82ad, 0x82a7, 0x02a2, - 0x82e3, 0x02e6, 0x02ec, 0x82e9, 0x02f8, 0x82fd, 0x82f7, 0x02f2, - 0x02d0, 0x82d5, 0x82df, 0x02da, 0x82cb, 0x02ce, 0x02c4, 0x82c1, - 0x8243, 0x0246, 0x024c, 0x8249, 0x0258, 0x825d, 0x8257, 0x0252, - 0x0270, 0x8275, 0x827f, 0x027a, 0x826b, 0x026e, 0x0264, 0x8261, - 0x0220, 0x8225, 0x822f, 0x022a, 0x823b, 0x023e, 0x0234, 0x8231, - 0x8213, 0x0216, 0x021c, 0x8219, 0x0208, 0x820d, 0x8207, 0x0202 -}; - - -void FLAC__crc8_update(const FLAC__byte data, FLAC__uint8 *crc) -{ - *crc = FLAC__crc8_table[*crc ^ data]; -} - -void FLAC__crc8_update_block(const FLAC__byte *data, unsigned len, FLAC__uint8 *crc) -{ - while(len--) - *crc = FLAC__crc8_table[*crc ^ *data++]; -} - -FLAC__uint8 FLAC__crc8(const FLAC__byte *data, unsigned len) -{ - FLAC__uint8 crc = 0; - - while(len--) - crc = FLAC__crc8_table[crc ^ *data++]; - - return crc; -} - -unsigned FLAC__crc16(const FLAC__byte *data, unsigned len) -{ - unsigned crc = 0; - - while(len--) - crc = ((crc<<8) ^ FLAC__crc16_table[(crc>>8) ^ *data++]) & 0xffff; - - return crc; -} diff --git a/3rdparty/libflac/src/libFLAC/fixed.c b/3rdparty/libflac/src/libFLAC/fixed.c deleted file mode 100644 index e92faf3d8ff..00000000000 --- a/3rdparty/libflac/src/libFLAC/fixed.c +++ /dev/null @@ -1,435 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <math.h> -#include <string.h> -#include "private/bitmath.h" -#include "private/fixed.h" -#include "FLAC/assert.h" - -#ifndef M_LN2 -/* math.h in VC++ doesn't seem to have this (how Microsoft is that?) */ -#define M_LN2 0.69314718055994530942 -#endif - -#ifdef min -#undef min -#endif -#define min(x,y) ((x) < (y)? (x) : (y)) - -#ifdef local_abs -#undef local_abs -#endif -#define local_abs(x) ((unsigned)((x)<0? -(x) : (x))) - -#ifdef FLAC__INTEGER_ONLY_LIBRARY -/* rbps stands for residual bits per sample - * - * (ln(2) * err) - * rbps = log (-----------) - * 2 ( n ) - */ -static FLAC__fixedpoint local__compute_rbps_integerized(FLAC__uint32 err, FLAC__uint32 n) -{ - FLAC__uint32 rbps; - unsigned bits; /* the number of bits required to represent a number */ - int fracbits; /* the number of bits of rbps that comprise the fractional part */ - - FLAC__ASSERT(sizeof(rbps) == sizeof(FLAC__fixedpoint)); - FLAC__ASSERT(err > 0); - FLAC__ASSERT(n > 0); - - FLAC__ASSERT(n <= FLAC__MAX_BLOCK_SIZE); - if(err <= n) - return 0; - /* - * The above two things tell us 1) n fits in 16 bits; 2) err/n > 1. - * These allow us later to know we won't lose too much precision in the - * fixed-point division (err<<fracbits)/n. - */ - - fracbits = (8*sizeof(err)) - (FLAC__bitmath_ilog2(err)+1); - - err <<= fracbits; - err /= n; - /* err now holds err/n with fracbits fractional bits */ - - /* - * Whittle err down to 16 bits max. 16 significant bits is enough for - * our purposes. - */ - FLAC__ASSERT(err > 0); - bits = FLAC__bitmath_ilog2(err)+1; - if(bits > 16) { - err >>= (bits-16); - fracbits -= (bits-16); - } - rbps = (FLAC__uint32)err; - - /* Multiply by fixed-point version of ln(2), with 16 fractional bits */ - rbps *= FLAC__FP_LN2; - fracbits += 16; - FLAC__ASSERT(fracbits >= 0); - - /* FLAC__fixedpoint_log2 requires fracbits%4 to be 0 */ - { - const int f = fracbits & 3; - if(f) { - rbps >>= f; - fracbits -= f; - } - } - - rbps = FLAC__fixedpoint_log2(rbps, fracbits, (unsigned)(-1)); - - if(rbps == 0) - return 0; - - /* - * The return value must have 16 fractional bits. Since the whole part - * of the base-2 log of a 32 bit number must fit in 5 bits, and fracbits - * must be >= -3, these assertion allows us to be able to shift rbps - * left if necessary to get 16 fracbits without losing any bits of the - * whole part of rbps. - * - * There is a slight chance due to accumulated error that the whole part - * will require 6 bits, so we use 6 in the assertion. Really though as - * long as it fits in 13 bits (32 - (16 - (-3))) we are fine. - */ - FLAC__ASSERT((int)FLAC__bitmath_ilog2(rbps)+1 <= fracbits + 6); - FLAC__ASSERT(fracbits >= -3); - - /* now shift the decimal point into place */ - if(fracbits < 16) - return rbps << (16-fracbits); - else if(fracbits > 16) - return rbps >> (fracbits-16); - else - return rbps; -} - -static FLAC__fixedpoint local__compute_rbps_wide_integerized(FLAC__uint64 err, FLAC__uint32 n) -{ - FLAC__uint32 rbps; - unsigned bits; /* the number of bits required to represent a number */ - int fracbits; /* the number of bits of rbps that comprise the fractional part */ - - FLAC__ASSERT(sizeof(rbps) == sizeof(FLAC__fixedpoint)); - FLAC__ASSERT(err > 0); - FLAC__ASSERT(n > 0); - - FLAC__ASSERT(n <= FLAC__MAX_BLOCK_SIZE); - if(err <= n) - return 0; - /* - * The above two things tell us 1) n fits in 16 bits; 2) err/n > 1. - * These allow us later to know we won't lose too much precision in the - * fixed-point division (err<<fracbits)/n. - */ - - fracbits = (8*sizeof(err)) - (FLAC__bitmath_ilog2_wide(err)+1); - - err <<= fracbits; - err /= n; - /* err now holds err/n with fracbits fractional bits */ - - /* - * Whittle err down to 16 bits max. 16 significant bits is enough for - * our purposes. - */ - FLAC__ASSERT(err > 0); - bits = FLAC__bitmath_ilog2_wide(err)+1; - if(bits > 16) { - err >>= (bits-16); - fracbits -= (bits-16); - } - rbps = (FLAC__uint32)err; - - /* Multiply by fixed-point version of ln(2), with 16 fractional bits */ - rbps *= FLAC__FP_LN2; - fracbits += 16; - FLAC__ASSERT(fracbits >= 0); - - /* FLAC__fixedpoint_log2 requires fracbits%4 to be 0 */ - { - const int f = fracbits & 3; - if(f) { - rbps >>= f; - fracbits -= f; - } - } - - rbps = FLAC__fixedpoint_log2(rbps, fracbits, (unsigned)(-1)); - - if(rbps == 0) - return 0; - - /* - * The return value must have 16 fractional bits. Since the whole part - * of the base-2 log of a 32 bit number must fit in 5 bits, and fracbits - * must be >= -3, these assertion allows us to be able to shift rbps - * left if necessary to get 16 fracbits without losing any bits of the - * whole part of rbps. - * - * There is a slight chance due to accumulated error that the whole part - * will require 6 bits, so we use 6 in the assertion. Really though as - * long as it fits in 13 bits (32 - (16 - (-3))) we are fine. - */ - FLAC__ASSERT((int)FLAC__bitmath_ilog2(rbps)+1 <= fracbits + 6); - FLAC__ASSERT(fracbits >= -3); - - /* now shift the decimal point into place */ - if(fracbits < 16) - return rbps << (16-fracbits); - else if(fracbits > 16) - return rbps >> (fracbits-16); - else - return rbps; -} -#endif - -#ifndef FLAC__INTEGER_ONLY_LIBRARY -unsigned FLAC__fixed_compute_best_predictor(const FLAC__int32 data[], unsigned data_len, FLAC__float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]) -#else -unsigned FLAC__fixed_compute_best_predictor(const FLAC__int32 data[], unsigned data_len, FLAC__fixedpoint residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]) -#endif -{ - FLAC__int32 last_error_0 = data[-1]; - FLAC__int32 last_error_1 = data[-1] - data[-2]; - FLAC__int32 last_error_2 = last_error_1 - (data[-2] - data[-3]); - FLAC__int32 last_error_3 = last_error_2 - (data[-2] - 2*data[-3] + data[-4]); - FLAC__int32 error, save; - FLAC__uint32 total_error_0 = 0, total_error_1 = 0, total_error_2 = 0, total_error_3 = 0, total_error_4 = 0; - unsigned i, order; - - for(i = 0; i < data_len; i++) { - error = data[i] ; total_error_0 += local_abs(error); save = error; - error -= last_error_0; total_error_1 += local_abs(error); last_error_0 = save; save = error; - error -= last_error_1; total_error_2 += local_abs(error); last_error_1 = save; save = error; - error -= last_error_2; total_error_3 += local_abs(error); last_error_2 = save; save = error; - error -= last_error_3; total_error_4 += local_abs(error); last_error_3 = save; - } - - if(total_error_0 < min(min(min(total_error_1, total_error_2), total_error_3), total_error_4)) - order = 0; - else if(total_error_1 < min(min(total_error_2, total_error_3), total_error_4)) - order = 1; - else if(total_error_2 < min(total_error_3, total_error_4)) - order = 2; - else if(total_error_3 < total_error_4) - order = 3; - else - order = 4; - - /* Estimate the expected number of bits per residual signal sample. */ - /* 'total_error*' is linearly related to the variance of the residual */ - /* signal, so we use it directly to compute E(|x|) */ - FLAC__ASSERT(data_len > 0 || total_error_0 == 0); - FLAC__ASSERT(data_len > 0 || total_error_1 == 0); - FLAC__ASSERT(data_len > 0 || total_error_2 == 0); - FLAC__ASSERT(data_len > 0 || total_error_3 == 0); - FLAC__ASSERT(data_len > 0 || total_error_4 == 0); -#ifndef FLAC__INTEGER_ONLY_LIBRARY - residual_bits_per_sample[0] = (FLAC__float)((total_error_0 > 0) ? log(M_LN2 * (FLAC__double)total_error_0 / (FLAC__double)data_len) / M_LN2 : 0.0); - residual_bits_per_sample[1] = (FLAC__float)((total_error_1 > 0) ? log(M_LN2 * (FLAC__double)total_error_1 / (FLAC__double)data_len) / M_LN2 : 0.0); - residual_bits_per_sample[2] = (FLAC__float)((total_error_2 > 0) ? log(M_LN2 * (FLAC__double)total_error_2 / (FLAC__double)data_len) / M_LN2 : 0.0); - residual_bits_per_sample[3] = (FLAC__float)((total_error_3 > 0) ? log(M_LN2 * (FLAC__double)total_error_3 / (FLAC__double)data_len) / M_LN2 : 0.0); - residual_bits_per_sample[4] = (FLAC__float)((total_error_4 > 0) ? log(M_LN2 * (FLAC__double)total_error_4 / (FLAC__double)data_len) / M_LN2 : 0.0); -#else - residual_bits_per_sample[0] = (total_error_0 > 0) ? local__compute_rbps_integerized(total_error_0, data_len) : 0; - residual_bits_per_sample[1] = (total_error_1 > 0) ? local__compute_rbps_integerized(total_error_1, data_len) : 0; - residual_bits_per_sample[2] = (total_error_2 > 0) ? local__compute_rbps_integerized(total_error_2, data_len) : 0; - residual_bits_per_sample[3] = (total_error_3 > 0) ? local__compute_rbps_integerized(total_error_3, data_len) : 0; - residual_bits_per_sample[4] = (total_error_4 > 0) ? local__compute_rbps_integerized(total_error_4, data_len) : 0; -#endif - - return order; -} - -#ifndef FLAC__INTEGER_ONLY_LIBRARY -unsigned FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], unsigned data_len, FLAC__float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]) -#else -unsigned FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], unsigned data_len, FLAC__fixedpoint residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]) -#endif -{ - FLAC__int32 last_error_0 = data[-1]; - FLAC__int32 last_error_1 = data[-1] - data[-2]; - FLAC__int32 last_error_2 = last_error_1 - (data[-2] - data[-3]); - FLAC__int32 last_error_3 = last_error_2 - (data[-2] - 2*data[-3] + data[-4]); - FLAC__int32 error, save; - /* total_error_* are 64-bits to avoid overflow when encoding - * erratic signals when the bits-per-sample and blocksize are - * large. - */ - FLAC__uint64 total_error_0 = 0, total_error_1 = 0, total_error_2 = 0, total_error_3 = 0, total_error_4 = 0; - unsigned i, order; - - for(i = 0; i < data_len; i++) { - error = data[i] ; total_error_0 += local_abs(error); save = error; - error -= last_error_0; total_error_1 += local_abs(error); last_error_0 = save; save = error; - error -= last_error_1; total_error_2 += local_abs(error); last_error_1 = save; save = error; - error -= last_error_2; total_error_3 += local_abs(error); last_error_2 = save; save = error; - error -= last_error_3; total_error_4 += local_abs(error); last_error_3 = save; - } - - if(total_error_0 < min(min(min(total_error_1, total_error_2), total_error_3), total_error_4)) - order = 0; - else if(total_error_1 < min(min(total_error_2, total_error_3), total_error_4)) - order = 1; - else if(total_error_2 < min(total_error_3, total_error_4)) - order = 2; - else if(total_error_3 < total_error_4) - order = 3; - else - order = 4; - - /* Estimate the expected number of bits per residual signal sample. */ - /* 'total_error*' is linearly related to the variance of the residual */ - /* signal, so we use it directly to compute E(|x|) */ - FLAC__ASSERT(data_len > 0 || total_error_0 == 0); - FLAC__ASSERT(data_len > 0 || total_error_1 == 0); - FLAC__ASSERT(data_len > 0 || total_error_2 == 0); - FLAC__ASSERT(data_len > 0 || total_error_3 == 0); - FLAC__ASSERT(data_len > 0 || total_error_4 == 0); -#ifndef FLAC__INTEGER_ONLY_LIBRARY -#if defined _MSC_VER || defined __MINGW32__ - /* with MSVC you have to spoon feed it the casting */ - residual_bits_per_sample[0] = (FLAC__float)((total_error_0 > 0) ? log(M_LN2 * (FLAC__double)(FLAC__int64)total_error_0 / (FLAC__double)data_len) / M_LN2 : 0.0); - residual_bits_per_sample[1] = (FLAC__float)((total_error_1 > 0) ? log(M_LN2 * (FLAC__double)(FLAC__int64)total_error_1 / (FLAC__double)data_len) / M_LN2 : 0.0); - residual_bits_per_sample[2] = (FLAC__float)((total_error_2 > 0) ? log(M_LN2 * (FLAC__double)(FLAC__int64)total_error_2 / (FLAC__double)data_len) / M_LN2 : 0.0); - residual_bits_per_sample[3] = (FLAC__float)((total_error_3 > 0) ? log(M_LN2 * (FLAC__double)(FLAC__int64)total_error_3 / (FLAC__double)data_len) / M_LN2 : 0.0); - residual_bits_per_sample[4] = (FLAC__float)((total_error_4 > 0) ? log(M_LN2 * (FLAC__double)(FLAC__int64)total_error_4 / (FLAC__double)data_len) / M_LN2 : 0.0); -#else - residual_bits_per_sample[0] = (FLAC__float)((total_error_0 > 0) ? log(M_LN2 * (FLAC__double)total_error_0 / (FLAC__double)data_len) / M_LN2 : 0.0); - residual_bits_per_sample[1] = (FLAC__float)((total_error_1 > 0) ? log(M_LN2 * (FLAC__double)total_error_1 / (FLAC__double)data_len) / M_LN2 : 0.0); - residual_bits_per_sample[2] = (FLAC__float)((total_error_2 > 0) ? log(M_LN2 * (FLAC__double)total_error_2 / (FLAC__double)data_len) / M_LN2 : 0.0); - residual_bits_per_sample[3] = (FLAC__float)((total_error_3 > 0) ? log(M_LN2 * (FLAC__double)total_error_3 / (FLAC__double)data_len) / M_LN2 : 0.0); - residual_bits_per_sample[4] = (FLAC__float)((total_error_4 > 0) ? log(M_LN2 * (FLAC__double)total_error_4 / (FLAC__double)data_len) / M_LN2 : 0.0); -#endif -#else - residual_bits_per_sample[0] = (total_error_0 > 0) ? local__compute_rbps_wide_integerized(total_error_0, data_len) : 0; - residual_bits_per_sample[1] = (total_error_1 > 0) ? local__compute_rbps_wide_integerized(total_error_1, data_len) : 0; - residual_bits_per_sample[2] = (total_error_2 > 0) ? local__compute_rbps_wide_integerized(total_error_2, data_len) : 0; - residual_bits_per_sample[3] = (total_error_3 > 0) ? local__compute_rbps_wide_integerized(total_error_3, data_len) : 0; - residual_bits_per_sample[4] = (total_error_4 > 0) ? local__compute_rbps_wide_integerized(total_error_4, data_len) : 0; -#endif - - return order; -} - -void FLAC__fixed_compute_residual(const FLAC__int32 data[], unsigned data_len, unsigned order, FLAC__int32 residual[]) -{ - const int idata_len = (int)data_len; - int i; - - switch(order) { - case 0: - FLAC__ASSERT(sizeof(residual[0]) == sizeof(data[0])); - memcpy(residual, data, sizeof(residual[0])*data_len); - break; - case 1: - for(i = 0; i < idata_len; i++) - residual[i] = data[i] - data[i-1]; - break; - case 2: - for(i = 0; i < idata_len; i++) -#if 1 /* OPT: may be faster with some compilers on some systems */ - residual[i] = data[i] - (data[i-1] << 1) + data[i-2]; -#else - residual[i] = data[i] - 2*data[i-1] + data[i-2]; -#endif - break; - case 3: - for(i = 0; i < idata_len; i++) -#if 1 /* OPT: may be faster with some compilers on some systems */ - residual[i] = data[i] - (((data[i-1]-data[i-2])<<1) + (data[i-1]-data[i-2])) - data[i-3]; -#else - residual[i] = data[i] - 3*data[i-1] + 3*data[i-2] - data[i-3]; -#endif - break; - case 4: - for(i = 0; i < idata_len; i++) -#if 1 /* OPT: may be faster with some compilers on some systems */ - residual[i] = data[i] - ((data[i-1]+data[i-3])<<2) + ((data[i-2]<<2) + (data[i-2]<<1)) + data[i-4]; -#else - residual[i] = data[i] - 4*data[i-1] + 6*data[i-2] - 4*data[i-3] + data[i-4]; -#endif - break; - default: - FLAC__ASSERT(0); - } -} - -void FLAC__fixed_restore_signal(const FLAC__int32 residual[], unsigned data_len, unsigned order, FLAC__int32 data[]) -{ - int i, idata_len = (int)data_len; - - switch(order) { - case 0: - FLAC__ASSERT(sizeof(residual[0]) == sizeof(data[0])); - memcpy(data, residual, sizeof(residual[0])*data_len); - break; - case 1: - for(i = 0; i < idata_len; i++) - data[i] = residual[i] + data[i-1]; - break; - case 2: - for(i = 0; i < idata_len; i++) -#if 1 /* OPT: may be faster with some compilers on some systems */ - data[i] = residual[i] + (data[i-1]<<1) - data[i-2]; -#else - data[i] = residual[i] + 2*data[i-1] - data[i-2]; -#endif - break; - case 3: - for(i = 0; i < idata_len; i++) -#if 1 /* OPT: may be faster with some compilers on some systems */ - data[i] = residual[i] + (((data[i-1]-data[i-2])<<1) + (data[i-1]-data[i-2])) + data[i-3]; -#else - data[i] = residual[i] + 3*data[i-1] - 3*data[i-2] + data[i-3]; -#endif - break; - case 4: - for(i = 0; i < idata_len; i++) -#if 1 /* OPT: may be faster with some compilers on some systems */ - data[i] = residual[i] + ((data[i-1]+data[i-3])<<2) - ((data[i-2]<<2) + (data[i-2]<<1)) - data[i-4]; -#else - data[i] = residual[i] + 4*data[i-1] - 6*data[i-2] + 4*data[i-3] - data[i-4]; -#endif - break; - default: - FLAC__ASSERT(0); - } -} diff --git a/3rdparty/libflac/src/libFLAC/flac.pc.in b/3rdparty/libflac/src/libFLAC/flac.pc.in deleted file mode 100644 index 8fc39f83026..00000000000 --- a/3rdparty/libflac/src/libFLAC/flac.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: FLAC -Description: Free Lossless Audio Codec Library -Version: @VERSION@ -Libs: -L${libdir} -lFLAC -lm -Cflags: -I${includedir}/FLAC diff --git a/3rdparty/libflac/src/libFLAC/float.c b/3rdparty/libflac/src/libFLAC/float.c deleted file mode 100644 index 60fa7e8371a..00000000000 --- a/3rdparty/libflac/src/libFLAC/float.c +++ /dev/null @@ -1,308 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include "FLAC/assert.h" - -#include "private/float.h" - -#ifdef FLAC__INTEGER_ONLY_LIBRARY - -/* adjust for compilers that can't understand using LLU suffix for uint64_t literals */ -#ifdef _MSC_VER -#define FLAC__U64L(x) x -#else -#define FLAC__U64L(x) x##LLU -#endif - -const FLAC__fixedpoint FLAC__FP_ZERO = 0; -const FLAC__fixedpoint FLAC__FP_ONE_HALF = 0x00008000; -const FLAC__fixedpoint FLAC__FP_ONE = 0x00010000; -const FLAC__fixedpoint FLAC__FP_LN2 = 45426; -const FLAC__fixedpoint FLAC__FP_E = 178145; - -/* Lookup tables for Knuth's logarithm algorithm */ -#define LOG2_LOOKUP_PRECISION 16 -static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = { - { - /* - * 0 fraction bits - */ - /* undefined */ 0x00000000, - /* lg(2/1) = */ 0x00000001, - /* lg(4/3) = */ 0x00000000, - /* lg(8/7) = */ 0x00000000, - /* lg(16/15) = */ 0x00000000, - /* lg(32/31) = */ 0x00000000, - /* lg(64/63) = */ 0x00000000, - /* lg(128/127) = */ 0x00000000, - /* lg(256/255) = */ 0x00000000, - /* lg(512/511) = */ 0x00000000, - /* lg(1024/1023) = */ 0x00000000, - /* lg(2048/2047) = */ 0x00000000, - /* lg(4096/4095) = */ 0x00000000, - /* lg(8192/8191) = */ 0x00000000, - /* lg(16384/16383) = */ 0x00000000, - /* lg(32768/32767) = */ 0x00000000 - }, - { - /* - * 4 fraction bits - */ - /* undefined */ 0x00000000, - /* lg(2/1) = */ 0x00000010, - /* lg(4/3) = */ 0x00000007, - /* lg(8/7) = */ 0x00000003, - /* lg(16/15) = */ 0x00000001, - /* lg(32/31) = */ 0x00000001, - /* lg(64/63) = */ 0x00000000, - /* lg(128/127) = */ 0x00000000, - /* lg(256/255) = */ 0x00000000, - /* lg(512/511) = */ 0x00000000, - /* lg(1024/1023) = */ 0x00000000, - /* lg(2048/2047) = */ 0x00000000, - /* lg(4096/4095) = */ 0x00000000, - /* lg(8192/8191) = */ 0x00000000, - /* lg(16384/16383) = */ 0x00000000, - /* lg(32768/32767) = */ 0x00000000 - }, - { - /* - * 8 fraction bits - */ - /* undefined */ 0x00000000, - /* lg(2/1) = */ 0x00000100, - /* lg(4/3) = */ 0x0000006a, - /* lg(8/7) = */ 0x00000031, - /* lg(16/15) = */ 0x00000018, - /* lg(32/31) = */ 0x0000000c, - /* lg(64/63) = */ 0x00000006, - /* lg(128/127) = */ 0x00000003, - /* lg(256/255) = */ 0x00000001, - /* lg(512/511) = */ 0x00000001, - /* lg(1024/1023) = */ 0x00000000, - /* lg(2048/2047) = */ 0x00000000, - /* lg(4096/4095) = */ 0x00000000, - /* lg(8192/8191) = */ 0x00000000, - /* lg(16384/16383) = */ 0x00000000, - /* lg(32768/32767) = */ 0x00000000 - }, - { - /* - * 12 fraction bits - */ - /* undefined */ 0x00000000, - /* lg(2/1) = */ 0x00001000, - /* lg(4/3) = */ 0x000006a4, - /* lg(8/7) = */ 0x00000315, - /* lg(16/15) = */ 0x0000017d, - /* lg(32/31) = */ 0x000000bc, - /* lg(64/63) = */ 0x0000005d, - /* lg(128/127) = */ 0x0000002e, - /* lg(256/255) = */ 0x00000017, - /* lg(512/511) = */ 0x0000000c, - /* lg(1024/1023) = */ 0x00000006, - /* lg(2048/2047) = */ 0x00000003, - /* lg(4096/4095) = */ 0x00000001, - /* lg(8192/8191) = */ 0x00000001, - /* lg(16384/16383) = */ 0x00000000, - /* lg(32768/32767) = */ 0x00000000 - }, - { - /* - * 16 fraction bits - */ - /* undefined */ 0x00000000, - /* lg(2/1) = */ 0x00010000, - /* lg(4/3) = */ 0x00006a40, - /* lg(8/7) = */ 0x00003151, - /* lg(16/15) = */ 0x000017d6, - /* lg(32/31) = */ 0x00000bba, - /* lg(64/63) = */ 0x000005d1, - /* lg(128/127) = */ 0x000002e6, - /* lg(256/255) = */ 0x00000172, - /* lg(512/511) = */ 0x000000b9, - /* lg(1024/1023) = */ 0x0000005c, - /* lg(2048/2047) = */ 0x0000002e, - /* lg(4096/4095) = */ 0x00000017, - /* lg(8192/8191) = */ 0x0000000c, - /* lg(16384/16383) = */ 0x00000006, - /* lg(32768/32767) = */ 0x00000003 - }, - { - /* - * 20 fraction bits - */ - /* undefined */ 0x00000000, - /* lg(2/1) = */ 0x00100000, - /* lg(4/3) = */ 0x0006a3fe, - /* lg(8/7) = */ 0x00031513, - /* lg(16/15) = */ 0x00017d60, - /* lg(32/31) = */ 0x0000bb9d, - /* lg(64/63) = */ 0x00005d10, - /* lg(128/127) = */ 0x00002e59, - /* lg(256/255) = */ 0x00001721, - /* lg(512/511) = */ 0x00000b8e, - /* lg(1024/1023) = */ 0x000005c6, - /* lg(2048/2047) = */ 0x000002e3, - /* lg(4096/4095) = */ 0x00000171, - /* lg(8192/8191) = */ 0x000000b9, - /* lg(16384/16383) = */ 0x0000005c, - /* lg(32768/32767) = */ 0x0000002e - }, - { - /* - * 24 fraction bits - */ - /* undefined */ 0x00000000, - /* lg(2/1) = */ 0x01000000, - /* lg(4/3) = */ 0x006a3fe6, - /* lg(8/7) = */ 0x00315130, - /* lg(16/15) = */ 0x0017d605, - /* lg(32/31) = */ 0x000bb9ca, - /* lg(64/63) = */ 0x0005d0fc, - /* lg(128/127) = */ 0x0002e58f, - /* lg(256/255) = */ 0x0001720e, - /* lg(512/511) = */ 0x0000b8d8, - /* lg(1024/1023) = */ 0x00005c61, - /* lg(2048/2047) = */ 0x00002e2d, - /* lg(4096/4095) = */ 0x00001716, - /* lg(8192/8191) = */ 0x00000b8b, - /* lg(16384/16383) = */ 0x000005c5, - /* lg(32768/32767) = */ 0x000002e3 - }, - { - /* - * 28 fraction bits - */ - /* undefined */ 0x00000000, - /* lg(2/1) = */ 0x10000000, - /* lg(4/3) = */ 0x06a3fe5c, - /* lg(8/7) = */ 0x03151301, - /* lg(16/15) = */ 0x017d6049, - /* lg(32/31) = */ 0x00bb9ca6, - /* lg(64/63) = */ 0x005d0fba, - /* lg(128/127) = */ 0x002e58f7, - /* lg(256/255) = */ 0x001720da, - /* lg(512/511) = */ 0x000b8d87, - /* lg(1024/1023) = */ 0x0005c60b, - /* lg(2048/2047) = */ 0x0002e2d7, - /* lg(4096/4095) = */ 0x00017160, - /* lg(8192/8191) = */ 0x0000b8ad, - /* lg(16384/16383) = */ 0x00005c56, - /* lg(32768/32767) = */ 0x00002e2b - } -}; - -#if 0 -static const FLAC__uint64 log2_lookup_wide[] = { - { - /* - * 32 fraction bits - */ - /* undefined */ 0x00000000, - /* lg(2/1) = */ FLAC__U64L(0x100000000), - /* lg(4/3) = */ FLAC__U64L(0x6a3fe5c6), - /* lg(8/7) = */ FLAC__U64L(0x31513015), - /* lg(16/15) = */ FLAC__U64L(0x17d60497), - /* lg(32/31) = */ FLAC__U64L(0x0bb9ca65), - /* lg(64/63) = */ FLAC__U64L(0x05d0fba2), - /* lg(128/127) = */ FLAC__U64L(0x02e58f74), - /* lg(256/255) = */ FLAC__U64L(0x01720d9c), - /* lg(512/511) = */ FLAC__U64L(0x00b8d875), - /* lg(1024/1023) = */ FLAC__U64L(0x005c60aa), - /* lg(2048/2047) = */ FLAC__U64L(0x002e2d72), - /* lg(4096/4095) = */ FLAC__U64L(0x00171600), - /* lg(8192/8191) = */ FLAC__U64L(0x000b8ad2), - /* lg(16384/16383) = */ FLAC__U64L(0x0005c55d), - /* lg(32768/32767) = */ FLAC__U64L(0x0002e2ac) - }, - { - /* - * 48 fraction bits - */ - /* undefined */ 0x00000000, - /* lg(2/1) = */ FLAC__U64L(0x1000000000000), - /* lg(4/3) = */ FLAC__U64L(0x6a3fe5c60429), - /* lg(8/7) = */ FLAC__U64L(0x315130157f7a), - /* lg(16/15) = */ FLAC__U64L(0x17d60496cfbb), - /* lg(32/31) = */ FLAC__U64L(0xbb9ca64ecac), - /* lg(64/63) = */ FLAC__U64L(0x5d0fba187cd), - /* lg(128/127) = */ FLAC__U64L(0x2e58f7441ee), - /* lg(256/255) = */ FLAC__U64L(0x1720d9c06a8), - /* lg(512/511) = */ FLAC__U64L(0xb8d8752173), - /* lg(1024/1023) = */ FLAC__U64L(0x5c60aa252e), - /* lg(2048/2047) = */ FLAC__U64L(0x2e2d71b0d8), - /* lg(4096/4095) = */ FLAC__U64L(0x1716001719), - /* lg(8192/8191) = */ FLAC__U64L(0xb8ad1de1b), - /* lg(16384/16383) = */ FLAC__U64L(0x5c55d640d), - /* lg(32768/32767) = */ FLAC__U64L(0x2e2abcf52) - } -}; -#endif - -FLAC__uint32 FLAC__fixedpoint_log2(FLAC__uint32 x, unsigned fracbits, unsigned precision) -{ - const FLAC__uint32 ONE = (1u << fracbits); - const FLAC__uint32 *table = log2_lookup[fracbits >> 2]; - - FLAC__ASSERT(fracbits < 32); - FLAC__ASSERT((fracbits & 0x3) == 0); - - if(x < ONE) - return 0; - - if(precision > LOG2_LOOKUP_PRECISION) - precision = LOG2_LOOKUP_PRECISION; - - /* Knuth's algorithm for computing logarithms, optimized for base-2 with lookup tables */ - { - FLAC__uint32 y = 0; - FLAC__uint32 z = x >> 1, k = 1; - while (x > ONE && k < precision) { - if (x - z >= ONE) { - x -= z; - z = x >> k; - y += table[k]; - } - else { - z >>= 1; - k++; - } - } - return y; - } -} - -#endif /* defined FLAC__INTEGER_ONLY_LIBRARY */ diff --git a/3rdparty/libflac/src/libFLAC/format.c b/3rdparty/libflac/src/libFLAC/format.c deleted file mode 100644 index 3480905108a..00000000000 --- a/3rdparty/libflac/src/libFLAC/format.c +++ /dev/null @@ -1,593 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdio.h> -#include <stdlib.h> /* for qsort() */ -#include <string.h> /* for memset() */ -#include "FLAC/assert.h" -#include "FLAC/format.h" -#include "private/format.h" - -#ifndef FLaC__INLINE -#define FLaC__INLINE -#endif - -#ifdef min -#undef min -#endif -#define min(a,b) ((a)<(b)?(a):(b)) - -/* adjust for compilers that can't understand using LLU suffix for uint64_t literals */ -#ifdef _MSC_VER -#define FLAC__U64L(x) x -#else -#define FLAC__U64L(x) x##LLU -#endif - -/* VERSION should come from configure */ -FLAC_API const char *FLAC__VERSION_STRING = VERSION; - -#if defined _MSC_VER || defined __BORLANDC__ || defined __MINW32__ -/* yet one more hack because of MSVC6: */ -FLAC_API const char *FLAC__VENDOR_STRING = "reference libFLAC 1.2.1 20070917"; -#else -FLAC_API const char *FLAC__VENDOR_STRING = "reference libFLAC " VERSION " 20070917"; -#endif - -FLAC_API const FLAC__byte FLAC__STREAM_SYNC_STRING[4] = { 'f','L','a','C' }; -FLAC_API const unsigned FLAC__STREAM_SYNC = 0x664C6143; -FLAC_API const unsigned FLAC__STREAM_SYNC_LEN = 32; /* bits */ - -FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN = 16; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN = 16; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN = 24; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN = 24; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_SAMPLE_RATE_LEN = 20; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN = 3; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN = 5; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN = 36; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MD5SUM_LEN = 128; /* bits */ - -FLAC_API const unsigned FLAC__STREAM_METADATA_APPLICATION_ID_LEN = 32; /* bits */ - -FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_SAMPLE_NUMBER_LEN = 64; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_STREAM_OFFSET_LEN = 64; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_FRAME_SAMPLES_LEN = 16; /* bits */ - -FLAC_API const FLAC__uint64 FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER = FLAC__U64L(0xffffffffffffffff); - -FLAC_API const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN = 32; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN = 32; /* bits */ - -FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN = 64; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN = 8; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN = 3*8; /* bits */ - -FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN = 64; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN = 8; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN = 12*8; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN = 1; /* bit */ -FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN = 1; /* bit */ -FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN = 6+13*8; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN = 8; /* bits */ - -FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN = 128*8; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN = 64; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN = 1; /* bit */ -FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN = 7+258*8; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN = 8; /* bits */ - -FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_TYPE_LEN = 32; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN = 32; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN = 32; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN = 32; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN = 32; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN = 32; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_COLORS_LEN = 32; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN = 32; /* bits */ - -FLAC_API const unsigned FLAC__STREAM_METADATA_IS_LAST_LEN = 1; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_TYPE_LEN = 7; /* bits */ -FLAC_API const unsigned FLAC__STREAM_METADATA_LENGTH_LEN = 24; /* bits */ - -FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC = 0x3ffe; -FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC_LEN = 14; /* bits */ -FLAC_API const unsigned FLAC__FRAME_HEADER_RESERVED_LEN = 1; /* bits */ -FLAC_API const unsigned FLAC__FRAME_HEADER_BLOCKING_STRATEGY_LEN = 1; /* bits */ -FLAC_API const unsigned FLAC__FRAME_HEADER_BLOCK_SIZE_LEN = 4; /* bits */ -FLAC_API const unsigned FLAC__FRAME_HEADER_SAMPLE_RATE_LEN = 4; /* bits */ -FLAC_API const unsigned FLAC__FRAME_HEADER_CHANNEL_ASSIGNMENT_LEN = 4; /* bits */ -FLAC_API const unsigned FLAC__FRAME_HEADER_BITS_PER_SAMPLE_LEN = 3; /* bits */ -FLAC_API const unsigned FLAC__FRAME_HEADER_ZERO_PAD_LEN = 1; /* bits */ -FLAC_API const unsigned FLAC__FRAME_HEADER_CRC_LEN = 8; /* bits */ - -FLAC_API const unsigned FLAC__FRAME_FOOTER_CRC_LEN = 16; /* bits */ - -FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_TYPE_LEN = 2; /* bits */ -FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN = 4; /* bits */ -FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN = 4; /* bits */ -FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN = 5; /* bits */ -FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_RAW_LEN = 5; /* bits */ - -FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER = 15; /* == (1<<FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN)-1 */ -FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_ESCAPE_PARAMETER = 31; /* == (1<<FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN)-1 */ - -FLAC_API const char * const FLAC__EntropyCodingMethodTypeString[] = { - "PARTITIONED_RICE", - "PARTITIONED_RICE2" -}; - -FLAC_API const unsigned FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN = 4; /* bits */ -FLAC_API const unsigned FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN = 5; /* bits */ - -FLAC_API const unsigned FLAC__SUBFRAME_ZERO_PAD_LEN = 1; /* bits */ -FLAC_API const unsigned FLAC__SUBFRAME_TYPE_LEN = 6; /* bits */ -FLAC_API const unsigned FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN = 1; /* bits */ - -FLAC_API const unsigned FLAC__SUBFRAME_TYPE_CONSTANT_BYTE_ALIGNED_MASK = 0x00; -FLAC_API const unsigned FLAC__SUBFRAME_TYPE_VERBATIM_BYTE_ALIGNED_MASK = 0x02; -FLAC_API const unsigned FLAC__SUBFRAME_TYPE_FIXED_BYTE_ALIGNED_MASK = 0x10; -FLAC_API const unsigned FLAC__SUBFRAME_TYPE_LPC_BYTE_ALIGNED_MASK = 0x40; - -FLAC_API const char * const FLAC__SubframeTypeString[] = { - "CONSTANT", - "VERBATIM", - "FIXED", - "LPC" -}; - -FLAC_API const char * const FLAC__ChannelAssignmentString[] = { - "INDEPENDENT", - "LEFT_SIDE", - "RIGHT_SIDE", - "MID_SIDE" -}; - -FLAC_API const char * const FLAC__FrameNumberTypeString[] = { - "FRAME_NUMBER_TYPE_FRAME_NUMBER", - "FRAME_NUMBER_TYPE_SAMPLE_NUMBER" -}; - -FLAC_API const char * const FLAC__MetadataTypeString[] = { - "STREAMINFO", - "PADDING", - "APPLICATION", - "SEEKTABLE", - "VORBIS_COMMENT", - "CUESHEET", - "PICTURE" -}; - -FLAC_API const char * const FLAC__StreamMetadata_Picture_TypeString[] = { - "Other", - "32x32 pixels 'file icon' (PNG only)", - "Other file icon", - "Cover (front)", - "Cover (back)", - "Leaflet page", - "Media (e.g. label side of CD)", - "Lead artist/lead performer/soloist", - "Artist/performer", - "Conductor", - "Band/Orchestra", - "Composer", - "Lyricist/text writer", - "Recording Location", - "During recording", - "During performance", - "Movie/video screen capture", - "A bright coloured fish", - "Illustration", - "Band/artist logotype", - "Publisher/Studio logotype" -}; - -FLAC_API FLAC__bool FLAC__format_sample_rate_is_valid(unsigned sample_rate) -{ - if(sample_rate == 0 || sample_rate > FLAC__MAX_SAMPLE_RATE) { - return false; - } - else - return true; -} - -FLAC_API FLAC__bool FLAC__format_sample_rate_is_subset(unsigned sample_rate) -{ - if( - !FLAC__format_sample_rate_is_valid(sample_rate) || - ( - sample_rate >= (1u << 16) && - !(sample_rate % 1000 == 0 || sample_rate % 10 == 0) - ) - ) { - return false; - } - else - return true; -} - -/* @@@@ add to unit tests; it is already indirectly tested by the metadata_object tests */ -FLAC_API FLAC__bool FLAC__format_seektable_is_legal(const FLAC__StreamMetadata_SeekTable *seek_table) -{ - unsigned i; - FLAC__uint64 prev_sample_number = 0; - FLAC__bool got_prev = false; - - FLAC__ASSERT(0 != seek_table); - - for(i = 0; i < seek_table->num_points; i++) { - if(got_prev) { - if( - seek_table->points[i].sample_number != FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER && - seek_table->points[i].sample_number <= prev_sample_number - ) - return false; - } - prev_sample_number = seek_table->points[i].sample_number; - got_prev = true; - } - - return true; -} - -/* used as the sort predicate for qsort() */ -static int seekpoint_compare_(const FLAC__StreamMetadata_SeekPoint *l, const FLAC__StreamMetadata_SeekPoint *r) -{ - /* we don't just 'return l->sample_number - r->sample_number' since the result (FLAC__int64) might overflow an 'int' */ - if(l->sample_number == r->sample_number) - return 0; - else if(l->sample_number < r->sample_number) - return -1; - else - return 1; -} - -/* @@@@ add to unit tests; it is already indirectly tested by the metadata_object tests */ -FLAC_API unsigned FLAC__format_seektable_sort(FLAC__StreamMetadata_SeekTable *seek_table) -{ - unsigned i, j; - FLAC__bool first; - - FLAC__ASSERT(0 != seek_table); - - /* sort the seekpoints */ - qsort(seek_table->points, seek_table->num_points, sizeof(FLAC__StreamMetadata_SeekPoint), (int (*)(const void *, const void *))seekpoint_compare_); - - /* uniquify the seekpoints */ - first = true; - for(i = j = 0; i < seek_table->num_points; i++) { - if(seek_table->points[i].sample_number != FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER) { - if(!first) { - if(seek_table->points[i].sample_number == seek_table->points[j-1].sample_number) - continue; - } - } - first = false; - seek_table->points[j++] = seek_table->points[i]; - } - - for(i = j; i < seek_table->num_points; i++) { - seek_table->points[i].sample_number = FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER; - seek_table->points[i].stream_offset = 0; - seek_table->points[i].frame_samples = 0; - } - - return j; -} - -/* - * also disallows non-shortest-form encodings, c.f. - * http://www.unicode.org/versions/corrigendum1.html - * and a more clear explanation at the end of this section: - * http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - */ -static FLaC__INLINE unsigned utf8len_(const FLAC__byte *utf8) -{ - FLAC__ASSERT(0 != utf8); - if ((utf8[0] & 0x80) == 0) { - return 1; - } - else if ((utf8[0] & 0xE0) == 0xC0 && (utf8[1] & 0xC0) == 0x80) { - if ((utf8[0] & 0xFE) == 0xC0) /* overlong sequence check */ - return 0; - return 2; - } - else if ((utf8[0] & 0xF0) == 0xE0 && (utf8[1] & 0xC0) == 0x80 && (utf8[2] & 0xC0) == 0x80) { - if (utf8[0] == 0xE0 && (utf8[1] & 0xE0) == 0x80) /* overlong sequence check */ - return 0; - /* illegal surrogates check (U+D800...U+DFFF and U+FFFE...U+FFFF) */ - if (utf8[0] == 0xED && (utf8[1] & 0xE0) == 0xA0) /* D800-DFFF */ - return 0; - if (utf8[0] == 0xEF && utf8[1] == 0xBF && (utf8[2] & 0xFE) == 0xBE) /* FFFE-FFFF */ - return 0; - return 3; - } - else if ((utf8[0] & 0xF8) == 0xF0 && (utf8[1] & 0xC0) == 0x80 && (utf8[2] & 0xC0) == 0x80 && (utf8[3] & 0xC0) == 0x80) { - if (utf8[0] == 0xF0 && (utf8[1] & 0xF0) == 0x80) /* overlong sequence check */ - return 0; - return 4; - } - else if ((utf8[0] & 0xFC) == 0xF8 && (utf8[1] & 0xC0) == 0x80 && (utf8[2] & 0xC0) == 0x80 && (utf8[3] & 0xC0) == 0x80 && (utf8[4] & 0xC0) == 0x80) { - if (utf8[0] == 0xF8 && (utf8[1] & 0xF8) == 0x80) /* overlong sequence check */ - return 0; - return 5; - } - else if ((utf8[0] & 0xFE) == 0xFC && (utf8[1] & 0xC0) == 0x80 && (utf8[2] & 0xC0) == 0x80 && (utf8[3] & 0xC0) == 0x80 && (utf8[4] & 0xC0) == 0x80 && (utf8[5] & 0xC0) == 0x80) { - if (utf8[0] == 0xFC && (utf8[1] & 0xFC) == 0x80) /* overlong sequence check */ - return 0; - return 6; - } - else { - return 0; - } -} - -FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_name_is_legal(const char *name) -{ - char c; - for(c = *name; c; c = *(++name)) - if(c < 0x20 || c == 0x3d || c > 0x7d) - return false; - return true; -} - -FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_value_is_legal(const FLAC__byte *value, unsigned length) -{ - if(length == (unsigned)(-1)) { - while(*value) { - unsigned n = utf8len_(value); - if(n == 0) - return false; - value += n; - } - } - else { - const FLAC__byte *end = value + length; - while(value < end) { - unsigned n = utf8len_(value); - if(n == 0) - return false; - value += n; - } - if(value != end) - return false; - } - return true; -} - -FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_is_legal(const FLAC__byte *entry, unsigned length) -{ - const FLAC__byte *s, *end; - - for(s = entry, end = s + length; s < end && *s != '='; s++) { - if(*s < 0x20 || *s > 0x7D) - return false; - } - if(s == end) - return false; - - s++; /* skip '=' */ - - while(s < end) { - unsigned n = utf8len_(s); - if(n == 0) - return false; - s += n; - } - if(s != end) - return false; - - return true; -} - -/* @@@@ add to unit tests; it is already indirectly tested by the metadata_object tests */ -FLAC_API FLAC__bool FLAC__format_cuesheet_is_legal(const FLAC__StreamMetadata_CueSheet *cue_sheet, FLAC__bool check_cd_da_subset, const char **violation) -{ - unsigned i, j; - - if(check_cd_da_subset) { - if(cue_sheet->lead_in < 2 * 44100) { - if(violation) *violation = "CD-DA cue sheet must have a lead-in length of at least 2 seconds"; - return false; - } - if(cue_sheet->lead_in % 588 != 0) { - if(violation) *violation = "CD-DA cue sheet lead-in length must be evenly divisible by 588 samples"; - return false; - } - } - - if(cue_sheet->num_tracks == 0) { - if(violation) *violation = "cue sheet must have at least one track (the lead-out)"; - return false; - } - - if(check_cd_da_subset && cue_sheet->tracks[cue_sheet->num_tracks-1].number != 170) { - if(violation) *violation = "CD-DA cue sheet must have a lead-out track number 170 (0xAA)"; - return false; - } - - for(i = 0; i < cue_sheet->num_tracks; i++) { - if(cue_sheet->tracks[i].number == 0) { - if(violation) *violation = "cue sheet may not have a track number 0"; - return false; - } - - if(check_cd_da_subset) { - if(!((cue_sheet->tracks[i].number >= 1 && cue_sheet->tracks[i].number <= 99) || cue_sheet->tracks[i].number == 170)) { - if(violation) *violation = "CD-DA cue sheet track number must be 1-99 or 170"; - return false; - } - } - - if(check_cd_da_subset && cue_sheet->tracks[i].offset % 588 != 0) { - if(violation) { - if(i == cue_sheet->num_tracks-1) /* the lead-out track... */ - *violation = "CD-DA cue sheet lead-out offset must be evenly divisible by 588 samples"; - else - *violation = "CD-DA cue sheet track offset must be evenly divisible by 588 samples"; - } - return false; - } - - if(i < cue_sheet->num_tracks - 1) { - if(cue_sheet->tracks[i].num_indices == 0) { - if(violation) *violation = "cue sheet track must have at least one index point"; - return false; - } - - if(cue_sheet->tracks[i].indices[0].number > 1) { - if(violation) *violation = "cue sheet track's first index number must be 0 or 1"; - return false; - } - } - - for(j = 0; j < cue_sheet->tracks[i].num_indices; j++) { - if(check_cd_da_subset && cue_sheet->tracks[i].indices[j].offset % 588 != 0) { - if(violation) *violation = "CD-DA cue sheet track index offset must be evenly divisible by 588 samples"; - return false; - } - - if(j > 0) { - if(cue_sheet->tracks[i].indices[j].number != cue_sheet->tracks[i].indices[j-1].number + 1) { - if(violation) *violation = "cue sheet track index numbers must increase by 1"; - return false; - } - } - } - } - - return true; -} - -/* @@@@ add to unit tests; it is already indirectly tested by the metadata_object tests */ -FLAC_API FLAC__bool FLAC__format_picture_is_legal(const FLAC__StreamMetadata_Picture *picture, const char **violation) -{ - char *p; - FLAC__byte *b; - - for(p = picture->mime_type; *p; p++) { - if(*p < 0x20 || *p > 0x7e) { - if(violation) *violation = "MIME type string must contain only printable ASCII characters (0x20-0x7e)"; - return false; - } - } - - for(b = picture->description; *b; ) { - unsigned n = utf8len_(b); - if(n == 0) { - if(violation) *violation = "description string must be valid UTF-8"; - return false; - } - b += n; - } - - return true; -} - -/* - * These routines are private to libFLAC - */ -unsigned FLAC__format_get_max_rice_partition_order(unsigned blocksize, unsigned predictor_order) -{ - return - FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order( - FLAC__format_get_max_rice_partition_order_from_blocksize(blocksize), - blocksize, - predictor_order - ); -} - -unsigned FLAC__format_get_max_rice_partition_order_from_blocksize(unsigned blocksize) -{ - unsigned max_rice_partition_order = 0; - while(!(blocksize & 1)) { - max_rice_partition_order++; - blocksize >>= 1; - } - return min(FLAC__MAX_RICE_PARTITION_ORDER, max_rice_partition_order); -} - -unsigned FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order(unsigned limit, unsigned blocksize, unsigned predictor_order) -{ - unsigned max_rice_partition_order = limit; - - while(max_rice_partition_order > 0 && (blocksize >> max_rice_partition_order) <= predictor_order) - max_rice_partition_order--; - - FLAC__ASSERT( - (max_rice_partition_order == 0 && blocksize >= predictor_order) || - (max_rice_partition_order > 0 && blocksize >> max_rice_partition_order > predictor_order) - ); - - return max_rice_partition_order; -} - -void FLAC__format_entropy_coding_method_partitioned_rice_contents_init(FLAC__EntropyCodingMethod_PartitionedRiceContents *object) -{ - FLAC__ASSERT(0 != object); - - object->parameters = 0; - object->raw_bits = 0; - object->capacity_by_order = 0; -} - -void FLAC__format_entropy_coding_method_partitioned_rice_contents_clear(FLAC__EntropyCodingMethod_PartitionedRiceContents *object) -{ - FLAC__ASSERT(0 != object); - - if(0 != object->parameters) - free(object->parameters); - if(0 != object->raw_bits) - free(object->raw_bits); - FLAC__format_entropy_coding_method_partitioned_rice_contents_init(object); -} - -FLAC__bool FLAC__format_entropy_coding_method_partitioned_rice_contents_ensure_size(FLAC__EntropyCodingMethod_PartitionedRiceContents *object, unsigned max_partition_order) -{ - FLAC__ASSERT(0 != object); - - FLAC__ASSERT(object->capacity_by_order > 0 || (0 == object->parameters && 0 == object->raw_bits)); - - if(object->capacity_by_order < max_partition_order) { - if(0 == (object->parameters = (unsigned*)realloc(object->parameters, sizeof(unsigned)*((unsigned long long)1 << max_partition_order)))) - return false; - if(0 == (object->raw_bits = (unsigned*)realloc(object->raw_bits, sizeof(unsigned)*((unsigned long long)1 << max_partition_order)))) - return false; - memset(object->raw_bits, 0, sizeof(unsigned)*((unsigned long long)1 << max_partition_order)); - object->capacity_by_order = max_partition_order; - } - - return true; -} diff --git a/3rdparty/libflac/src/libFLAC/ia32/Makefile.am b/3rdparty/libflac/src/libFLAC/ia32/Makefile.am deleted file mode 100644 index 04a5b9841dd..00000000000 --- a/3rdparty/libflac/src/libFLAC/ia32/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -# libFLAC - Free Lossless Audio Codec library -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -SUFFIXES = .nasm .lo - -STRIP_NON_ASM = sh $(top_srcdir)/strip_non_asm_libtool_args.sh - -.nasm.lo: - $(LIBTOOL) --tag=CC --mode=compile $(STRIP_NON_ASM) $(NASM) -f $(OBJ_FORMAT) -d OBJ_FORMAT_$(OBJ_FORMAT) -i$(srcdir)/ $< -o $@ - -noinst_LTLIBRARIES = libFLAC-asm.la -libFLAC_asm_la_SOURCES = \ - bitreader_asm.nasm \ - cpu_asm.nasm \ - fixed_asm.nasm \ - lpc_asm.nasm \ - nasm.h \ - stream_encoder_asm.nasm diff --git a/3rdparty/libflac/src/libFLAC/ia32/Makefile.in b/3rdparty/libflac/src/libFLAC/ia32/Makefile.in deleted file mode 100644 index 3a14b13bcc5..00000000000 --- a/3rdparty/libflac/src/libFLAC/ia32/Makefile.in +++ /dev/null @@ -1,487 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# libFLAC - Free Lossless Audio Codec library -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -SUFFIXES = .nasm .lo - -STRIP_NON_ASM = sh $(top_srcdir)/strip_non_asm_libtool_args.sh - -noinst_LTLIBRARIES = libFLAC-asm.la -libFLAC_asm_la_SOURCES = \ - bitreader_asm.nasm \ - cpu_asm.nasm \ - fixed_asm.nasm \ - lpc_asm.nasm \ - nasm.h \ - stream_encoder_asm.nasm - -subdir = src/libFLAC/ia32 -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) - -libFLAC_asm_la_LDFLAGS = -libFLAC_asm_la_LIBADD = -am_libFLAC_asm_la_OBJECTS = bitreader_asm.lo cpu_asm.lo fixed_asm.lo \ - lpc_asm.lo stream_encoder_asm.lo -libFLAC_asm_la_OBJECTS = $(am_libFLAC_asm_la_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(libFLAC_asm_la_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(libFLAC_asm_la_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .nasm .lo -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/libFLAC/ia32/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" = "$$p" && dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libFLAC-asm.la: $(libFLAC_asm_la_OBJECTS) $(libFLAC_asm_la_DEPENDENCIES) - $(LINK) $(libFLAC_asm_la_LDFLAGS) $(libFLAC_asm_la_OBJECTS) $(libFLAC_asm_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am - - -.nasm.lo: - $(LIBTOOL) --tag=CC --mode=compile $(STRIP_NON_ASM) $(NASM) -f $(OBJ_FORMAT) -d OBJ_FORMAT_$(OBJ_FORMAT) -i$(srcdir)/ $< -o $@ -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/libFLAC/ia32/bitreader_asm.nasm b/3rdparty/libflac/src/libFLAC/ia32/bitreader_asm.nasm deleted file mode 100644 index 5d1bbfa4464..00000000000 --- a/3rdparty/libflac/src/libFLAC/ia32/bitreader_asm.nasm +++ /dev/null @@ -1,568 +0,0 @@ -; vim:filetype=nasm ts=8 - -; libFLAC - Free Lossless Audio Codec library -; Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions -; are met: -; -; - Redistributions of source code must retain the above copyright -; notice, this list of conditions and the following disclaimer. -; -; - Redistributions in binary form must reproduce the above copyright -; notice, this list of conditions and the following disclaimer in the -; documentation and/or other materials provided with the distribution. -; -; - Neither the name of the Xiph.org Foundation nor the names of its -; contributors may be used to endorse or promote products derived from -; this software without specific prior written permission. -; -; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -; ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -%include "nasm.h" - - data_section - -cextern FLAC__crc16_table ; unsigned FLAC__crc16_table[256]; -cextern bitreader_read_from_client_ ; FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br); - -cglobal FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap - - code_section - - -; ********************************************************************** -; -; void FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter) -; -; Some details like assertions and other checking is performed by the caller. - ALIGN 16 -cident FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap - - ;ASSERT(0 != br); - ;ASSERT(0 != br->buffer); - ; WATCHOUT: code only works if sizeof(brword)==32; we can make things much faster with this assertion - ;ASSERT(FLAC__BITS_PER_WORD == 32); - ;ASSERT(parameter < 32); - ; the above two asserts also guarantee that the binary part never straddles more than 2 words, so we don't have to loop to read it - - ;; peppered throughout the code at major checkpoints are keys like this as to where things are at that point in time - ;; [esp + 16] unsigned parameter - ;; [esp + 12] unsigned nvals - ;; [esp + 8] int vals[] - ;; [esp + 4] FLAC__BitReader *br - mov eax, [esp + 12] ; if(nvals == 0) - test eax, eax - ja .nvals_gt_0 - mov eax, 1 ; return true; - ret - -.nvals_gt_0: - push ebp - push ebx - push esi - push edi - sub esp, 4 - ;; [esp + 36] unsigned parameter - ;; [esp + 32] unsigned nvals - ;; [esp + 28] int vals[] - ;; [esp + 24] FLAC__BitReader *br - ;; [esp] ucbits - mov ebp, [esp + 24] ; ebp <- br == br->buffer - mov esi, [ebp + 16] ; esi <- br->consumed_words (aka 'cwords' in the C version) - mov ecx, [ebp + 20] ; ecx <- br->consumed_bits (aka 'cbits' in the C version) - xor edi, edi ; edi <- 0 'uval' - ;; ecx cbits - ;; esi cwords - ;; edi uval - ;; ebp br - ;; [ebp] br->buffer - ;; [ebp + 8] br->words - ;; [ebp + 12] br->bytes - ;; [ebp + 16] br->consumed_words - ;; [ebp + 20] br->consumed_bits - ;; [ebp + 24] br->read_crc - ;; [ebp + 28] br->crc16_align - - ; ucbits = (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits; - mov eax, [ebp + 8] ; eax <- br->words - sub eax, esi ; eax <- br->words-cwords - shl eax, 2 ; eax <- (br->words-cwords)*FLAC__BYTES_PER_WORD - add eax, [ebp + 12] ; eax <- (br->words-cwords)*FLAC__BYTES_PER_WORD + br->bytes - shl eax, 3 ; eax <- (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - sub eax, ecx ; eax <- (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits - mov [esp], eax ; ucbits <- eax - - ALIGN 16 -.val_loop: ; while(1) { - - ; - ; read unary part - ; -.unary_loop: ; while(1) { - ;; ecx cbits - ;; esi cwords - ;; edi uval - ;; ebp br - cmp esi, [ebp + 8] ; while(cwords < br->words) /* if we've not consumed up to a partial tail word... */ - jae near .c1_next1 -.c1_loop: ; { - mov ebx, [ebp] - mov eax, [ebx + 4*esi] ; b = br->buffer[cwords] - mov edx, eax ; edx = br->buffer[cwords] (saved for later use) - shl eax, cl ; b = br->buffer[cwords] << cbits - test eax, eax ; (still have to test since cbits may be 0, thus ZF not updated for shl eax,0) - jz near .c1_next2 ; if(b) { - bsr ebx, eax - not ebx - and ebx, 31 ; ebx = 'i' = # of leading 0 bits in 'b' (eax) - add ecx, ebx ; cbits += i; - add edi, ebx ; uval += i; - add ecx, byte 1 ; cbits++; /* skip over stop bit */ - test ecx, ~31 - jz near .break1 ; if(cbits >= FLAC__BITS_PER_WORD) { /* faster way of testing if(cbits == FLAC__BITS_PER_WORD) */ - ; crc16_update_word_(br, br->buffer[cwords]); - push edi ; [need more registers] - bswap edx ; edx = br->buffer[cwords] swapped; now we can CRC the bytes from LSByte to MSByte which makes things much easier - mov ecx, [ebp + 28] ; ecx <- br->crc16_align - mov eax, [ebp + 24] ; ax <- br->read_crc (a.k.a. crc) -%ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE - mov edi, _FLAC__crc16_table -%else - mov edi, FLAC__crc16_table -%endif - ;; eax (ax) crc a.k.a. br->read_crc - ;; ebx (bl) intermediate result index into FLAC__crc16_table[] - ;; ecx br->crc16_align - ;; edx byteswapped brword to CRC - ;; esi cwords - ;; edi unsigned FLAC__crc16_table[] - ;; ebp br - test ecx, ecx ; switch(br->crc16_align) ... - jnz .c0b4 ; [br->crc16_align is 0 the vast majority of the time so we optimize the common case] -.c0b0: xor dl, ah ; dl <- (crc>>8)^(word>>24) - movzx ebx, dl - mov ecx, [ebx*4 + edi] ; cx <- FLAC__crc16_table[(crc>>8)^(word>>24)] - shl eax, 8 ; ax <- (crc<<8) - xor eax, ecx ; crc <- ax <- (crc<<8) ^ FLAC__crc16_table[(crc>>8)^(word>>24)] -.c0b1: xor dh, ah ; dh <- (crc>>8)^((word>>16)&0xff)) - movzx ebx, dh - mov ecx, [ebx*4 + edi] ; cx <- FLAC__crc16_table[(crc>>8)^((word>>16)&0xff))] - shl eax, 8 ; ax <- (crc<<8) - xor eax, ecx ; crc <- ax <- (crc<<8) ^ FLAC__crc16_table[(crc>>8)^((word>>16)&0xff))] - shr edx, 16 -.c0b2: xor dl, ah ; dl <- (crc>>8)^((word>>8)&0xff)) - movzx ebx, dl - mov ecx, [ebx*4 + edi] ; cx <- FLAC__crc16_table[(crc>>8)^((word>>8)&0xff))] - shl eax, 8 ; ax <- (crc<<8) - xor eax, ecx ; crc <- ax <- (crc<<8) ^ FLAC__crc16_table[(crc>>8)^((word>>8)&0xff))] -.c0b3: xor dh, ah ; dh <- (crc>>8)^(word&0xff) - movzx ebx, dh - mov ecx, [ebx*4 + edi] ; cx <- FLAC__crc16_table[(crc>>8)^(word&0xff)] - shl eax, 8 ; ax <- (crc<<8) - xor eax, ecx ; crc <- ax <- (crc<<8) ^ FLAC__crc16_table[(crc>>8)^(word&0xff)] - movzx eax, ax - mov [ebp + 24], eax ; br->read_crc <- crc - pop edi - - add esi, byte 1 ; cwords++; - xor ecx, ecx ; cbits = 0; - ; } - jmp near .break1 ; goto break1; - ;; this section relocated out of the way for performance -.c0b4: - mov [ebp + 28], dword 0 ; br->crc16_align <- 0 - cmp ecx, 8 - je .c0b1 - shr edx, 16 - cmp ecx, 16 - je .c0b2 - jmp .c0b3 - - ;; this section relocated out of the way for performance -.c1b4: - mov [ebp + 28], dword 0 ; br->crc16_align <- 0 - cmp ecx, 8 - je .c1b1 - shr edx, 16 - cmp ecx, 16 - je .c1b2 - jmp .c1b3 - -.c1_next2: ; } else { - ;; ecx cbits - ;; edx current brword 'b' - ;; esi cwords - ;; edi uval - ;; ebp br - add edi, 32 - sub edi, ecx ; uval += FLAC__BITS_PER_WORD - cbits; - ; crc16_update_word_(br, br->buffer[cwords]); - push edi ; [need more registers] - bswap edx ; edx = br->buffer[cwords] swapped; now we can CRC the bytes from LSByte to MSByte which makes things much easier - mov ecx, [ebp + 28] ; ecx <- br->crc16_align - mov eax, [ebp + 24] ; ax <- br->read_crc (a.k.a. crc) -%ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE - mov edi, _FLAC__crc16_table -%else - mov edi, FLAC__crc16_table -%endif - ;; eax (ax) crc a.k.a. br->read_crc - ;; ebx (bl) intermediate result index into FLAC__crc16_table[] - ;; ecx br->crc16_align - ;; edx byteswapped brword to CRC - ;; esi cwords - ;; edi unsigned FLAC__crc16_table[] - ;; ebp br - test ecx, ecx ; switch(br->crc16_align) ... - jnz .c1b4 ; [br->crc16_align is 0 the vast majority of the time so we optimize the common case] -.c1b0: xor dl, ah ; dl <- (crc>>8)^(word>>24) - movzx ebx, dl - mov ecx, [ebx*4 + edi] ; cx <- FLAC__crc16_table[(crc>>8)^(word>>24)] - shl eax, 8 ; ax <- (crc<<8) - xor eax, ecx ; crc <- ax <- (crc<<8) ^ FLAC__crc16_table[(crc>>8)^(word>>24)] -.c1b1: xor dh, ah ; dh <- (crc>>8)^((word>>16)&0xff)) - movzx ebx, dh - mov ecx, [ebx*4 + edi] ; cx <- FLAC__crc16_table[(crc>>8)^((word>>16)&0xff))] - shl eax, 8 ; ax <- (crc<<8) - xor eax, ecx ; crc <- ax <- (crc<<8) ^ FLAC__crc16_table[(crc>>8)^((word>>16)&0xff))] - shr edx, 16 -.c1b2: xor dl, ah ; dl <- (crc>>8)^((word>>8)&0xff)) - movzx ebx, dl - mov ecx, [ebx*4 + edi] ; cx <- FLAC__crc16_table[(crc>>8)^((word>>8)&0xff))] - shl eax, 8 ; ax <- (crc<<8) - xor eax, ecx ; crc <- ax <- (crc<<8) ^ FLAC__crc16_table[(crc>>8)^((word>>8)&0xff))] -.c1b3: xor dh, ah ; dh <- (crc>>8)^(word&0xff) - movzx ebx, dh - mov ecx, [ebx*4 + edi] ; cx <- FLAC__crc16_table[(crc>>8)^(word&0xff)] - shl eax, 8 ; ax <- (crc<<8) - xor eax, ecx ; crc <- ax <- (crc<<8) ^ FLAC__crc16_table[(crc>>8)^(word&0xff)] - movzx eax, ax - mov [ebp + 24], eax ; br->read_crc <- crc - pop edi - - add esi, byte 1 ; cwords++; - xor ecx, ecx ; cbits = 0; - ; /* didn't find stop bit yet, have to keep going... */ - ; } - - cmp esi, [ebp + 8] ; } while(cwords < br->words) /* if we've not consumed up to a partial tail word... */ - jb near .c1_loop - -.c1_next1: - ; at this point we've eaten up all the whole words; have to try - ; reading through any tail bytes before calling the read callback. - ; this is a repeat of the above logic adjusted for the fact we - ; don't have a whole word. note though if the client is feeding - ; us data a byte at a time (unlikely), br->consumed_bits may not - ; be zero. - ;; ecx cbits - ;; esi cwords - ;; edi uval - ;; ebp br - mov edx, [ebp + 12] ; edx <- br->bytes - test edx, edx - jz .read1 ; if(br->bytes) { [NOTE: this case is rare so it doesn't have to be all that fast ] - mov ebx, [ebp] - shl edx, 3 ; edx <- const unsigned end = br->bytes * 8; - mov eax, [ebx + 4*esi] ; b = br->buffer[cwords] - xchg edx, ecx ; [edx <- cbits , ecx <- end] - mov ebx, 0xffffffff ; ebx <- FLAC__WORD_ALL_ONES - shr ebx, cl ; ebx <- FLAC__WORD_ALL_ONES >> end - not ebx ; ebx <- ~(FLAC__WORD_ALL_ONES >> end) - xchg edx, ecx ; [edx <- end , ecx <- cbits] - and eax, ebx ; b = (br->buffer[cwords] & ~(FLAC__WORD_ALL_ONES >> end)); - shl eax, cl ; b = (br->buffer[cwords] & ~(FLAC__WORD_ALL_ONES >> end)) << cbits; - test eax, eax ; (still have to test since cbits may be 0, thus ZF not updated for shl eax,0) - jz .c1_next3 ; if(b) { - bsr ebx, eax - not ebx - and ebx, 31 ; ebx = 'i' = # of leading 0 bits in 'b' (eax) - add ecx, ebx ; cbits += i; - add edi, ebx ; uval += i; - add ecx, byte 1 ; cbits++; /* skip over stop bit */ - jmp short .break1 ; goto break1; -.c1_next3: ; } else { - sub edi, ecx - add edi, edx ; uval += end - cbits; - add ecx, edx ; cbits += end - ; /* didn't find stop bit yet, have to keep going... */ - ; } - ; } -.read1: - ; flush registers and read; bitreader_read_from_client_() does - ; not touch br->consumed_bits at all but we still need to set - ; it in case it fails and we have to return false. - ;; ecx cbits - ;; esi cwords - ;; edi uval - ;; ebp br - mov [ebp + 16], esi ; br->consumed_words = cwords; - mov [ebp + 20], ecx ; br->consumed_bits = cbits; - push ecx ; /* save */ - push ebp ; /* push br argument */ -%ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE - call _bitreader_read_from_client_ -%else - call bitreader_read_from_client_ -%endif - pop edx ; /* discard, unused */ - pop ecx ; /* restore */ - mov esi, [ebp + 16] ; cwords = br->consumed_words; - ; ucbits = (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits; - mov ebx, [ebp + 8] ; ebx <- br->words - sub ebx, esi ; ebx <- br->words-cwords - shl ebx, 2 ; ebx <- (br->words-cwords)*FLAC__BYTES_PER_WORD - add ebx, [ebp + 12] ; ebx <- (br->words-cwords)*FLAC__BYTES_PER_WORD + br->bytes - shl ebx, 3 ; ebx <- (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - sub ebx, ecx ; ebx <- (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits - add ebx, edi ; ebx <- (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits + uval - ; + uval to offset our count by the # of unary bits already - ; consumed before the read, because we will add these back - ; in all at once at break1 - mov [esp], ebx ; ucbits <- ebx - test eax, eax ; if(!bitreader_read_from_client_(br)) - jnz near .unary_loop - jmp .end ; return false; /* eax (the return value) is already 0 */ - ; } /* end while(1) unary part */ - - ALIGN 16 -.break1: - ;; ecx cbits - ;; esi cwords - ;; edi uval - ;; ebp br - ;; [esp] ucbits - sub [esp], edi ; ucbits -= uval; - sub dword [esp], byte 1 ; ucbits--; /* account for stop bit */ - - ; - ; read binary part - ; - mov ebx, [esp + 36] ; ebx <- parameter - test ebx, ebx ; if(parameter) { - jz near .break2 -.read2: - cmp [esp], ebx ; while(ucbits < parameter) { - jae .c2_next1 - ; flush registers and read; bitreader_read_from_client_() does - ; not touch br->consumed_bits at all but we still need to set - ; it in case it fails and we have to return false. - mov [ebp + 16], esi ; br->consumed_words = cwords; - mov [ebp + 20], ecx ; br->consumed_bits = cbits; - push ecx ; /* save */ - push ebp ; /* push br argument */ -%ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE - call _bitreader_read_from_client_ -%else - call bitreader_read_from_client_ -%endif - pop edx ; /* discard, unused */ - pop ecx ; /* restore */ - mov esi, [ebp + 16] ; cwords = br->consumed_words; - ; ucbits = (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits; - mov edx, [ebp + 8] ; edx <- br->words - sub edx, esi ; edx <- br->words-cwords - shl edx, 2 ; edx <- (br->words-cwords)*FLAC__BYTES_PER_WORD - add edx, [ebp + 12] ; edx <- (br->words-cwords)*FLAC__BYTES_PER_WORD + br->bytes - shl edx, 3 ; edx <- (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - sub edx, ecx ; edx <- (br->words-cwords)*FLAC__BITS_PER_WORD + br->bytes*8 - cbits - mov [esp], edx ; ucbits <- edx - test eax, eax ; if(!bitreader_read_from_client_(br)) - jnz .read2 - jmp .end ; return false; /* eax (the return value) is already 0 */ - ; } -.c2_next1: - ;; ebx parameter - ;; ecx cbits - ;; esi cwords - ;; edi uval - ;; ebp br - ;; [esp] ucbits - cmp esi, [ebp + 8] ; if(cwords < br->words) { /* if we've not consumed up to a partial tail word... */ - jae near .c2_next2 - test ecx, ecx ; if(cbits) { - jz near .c2_next3 ; /* this also works when consumed_bits==0, it's just a little slower than necessary for that case */ - mov eax, 32 - mov edx, [ebp] - sub eax, ecx ; const unsigned n = FLAC__BITS_PER_WORD - cbits; - mov edx, [edx + 4*esi] ; const brword word = br->buffer[cwords]; - cmp ebx, eax ; if(parameter < n) { - jae .c2_next4 - ; uval <<= parameter; - ; uval |= (word & (FLAC__WORD_ALL_ONES >> cbits)) >> (n-parameter); - shl edx, cl - xchg ebx, ecx - shld edi, edx, cl - add ebx, ecx ; cbits += parameter; - xchg ebx, ecx ; ebx <- parameter, ecx <- cbits - jmp .break2 ; goto break2; - ; } -.c2_next4: - ; uval <<= n; - ; uval |= word & (FLAC__WORD_ALL_ONES >> cbits); -%if 1 - rol edx, cl ; @@@@@@OPT: may be faster to use rol to save edx so we can restore it for CRC'ing - ; @@@@@@OPT: or put parameter in ch instead and free up ebx completely again -%else - shl edx, cl -%endif - xchg eax, ecx - shld edi, edx, cl - xchg eax, ecx -%if 1 - ror edx, cl ; restored. -%else - mov edx, [ebp] - mov edx, [edx + 4*esi] -%endif - ; crc16_update_word_(br, br->buffer[cwords]); - push edi ; [need more registers] - push ebx ; [need more registers] - push eax ; [need more registers] - bswap edx ; edx = br->buffer[cwords] swapped; now we can CRC the bytes from LSByte to MSByte which makes things much easier - mov ecx, [ebp + 28] ; ecx <- br->crc16_align - mov eax, [ebp + 24] ; ax <- br->read_crc (a.k.a. crc) -%ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE - mov edi, _FLAC__crc16_table -%else - mov edi, FLAC__crc16_table -%endif - ;; eax (ax) crc a.k.a. br->read_crc - ;; ebx (bl) intermediate result index into FLAC__crc16_table[] - ;; ecx br->crc16_align - ;; edx byteswapped brword to CRC - ;; esi cwords - ;; edi unsigned FLAC__crc16_table[] - ;; ebp br - test ecx, ecx ; switch(br->crc16_align) ... - jnz .c2b4 ; [br->crc16_align is 0 the vast majority of the time so we optimize the common case] -.c2b0: xor dl, ah ; dl <- (crc>>8)^(word>>24) - movzx ebx, dl - mov ecx, [ebx*4 + edi] ; cx <- FLAC__crc16_table[(crc>>8)^(word>>24)] - shl eax, 8 ; ax <- (crc<<8) - xor eax, ecx ; crc <- ax <- (crc<<8) ^ FLAC__crc16_table[(crc>>8)^(word>>24)] -.c2b1: xor dh, ah ; dh <- (crc>>8)^((word>>16)&0xff)) - movzx ebx, dh - mov ecx, [ebx*4 + edi] ; cx <- FLAC__crc16_table[(crc>>8)^((word>>16)&0xff))] - shl eax, 8 ; ax <- (crc<<8) - xor eax, ecx ; crc <- ax <- (crc<<8) ^ FLAC__crc16_table[(crc>>8)^((word>>16)&0xff))] - shr edx, 16 -.c2b2: xor dl, ah ; dl <- (crc>>8)^((word>>8)&0xff)) - movzx ebx, dl - mov ecx, [ebx*4 + edi] ; cx <- FLAC__crc16_table[(crc>>8)^((word>>8)&0xff))] - shl eax, 8 ; ax <- (crc<<8) - xor eax, ecx ; crc <- ax <- (crc<<8) ^ FLAC__crc16_table[(crc>>8)^((word>>8)&0xff))] -.c2b3: xor dh, ah ; dh <- (crc>>8)^(word&0xff) - movzx ebx, dh - mov ecx, [ebx*4 + edi] ; cx <- FLAC__crc16_table[(crc>>8)^(word&0xff)] - shl eax, 8 ; ax <- (crc<<8) - xor eax, ecx ; crc <- ax <- (crc<<8) ^ FLAC__crc16_table[(crc>>8)^(word&0xff)] - movzx eax, ax - mov [ebp + 24], eax ; br->read_crc <- crc - pop eax - pop ebx - pop edi - add esi, byte 1 ; cwords++; - mov ecx, ebx - sub ecx, eax ; cbits = parameter - n; - jz .break2 ; if(cbits) { /* parameter > n, i.e. if there are still bits left to read, there have to be less than 32 so they will all be in the next word */ - ; uval <<= cbits; - ; uval |= (br->buffer[cwords] >> (FLAC__BITS_PER_WORD-cbits)); - mov eax, [ebp] - mov eax, [eax + 4*esi] - shld edi, eax, cl - ; } - jmp .break2 ; goto break2; - - ;; this section relocated out of the way for performance -.c2b4: - mov [ebp + 28], dword 0 ; br->crc16_align <- 0 - cmp ecx, 8 - je .c2b1 - shr edx, 16 - cmp ecx, 16 - je .c2b2 - jmp .c2b3 - -.c2_next3: ; } else { - mov ecx, ebx ; cbits = parameter; - ; uval <<= cbits; - ; uval |= (br->buffer[cwords] >> (FLAC__BITS_PER_WORD-cbits)); - mov eax, [ebp] - mov eax, [eax + 4*esi] - shld edi, eax, cl - jmp .break2 ; goto break2; - ; } -.c2_next2: ; } else { - ; in this case we're starting our read at a partial tail word; - ; the reader has guaranteed that we have at least 'parameter' - ; bits available to read, which makes this case simpler. - ; uval <<= parameter; - ; if(cbits) { - ; /* this also works when consumed_bits==0, it's just a little slower than necessary for that case */ - ; uval |= (br->buffer[cwords] & (FLAC__WORD_ALL_ONES >> cbits)) >> (FLAC__BITS_PER_WORD-cbits-parameter); - ; cbits += parameter; - ; goto break2; - ; } else { - ; cbits = parameter; - ; uval |= br->buffer[cwords] >> (FLAC__BITS_PER_WORD-cbits); - ; goto break2; - ; } - ; the above is much shorter in assembly: - mov eax, [ebp] - mov eax, [eax + 4*esi] ; eax <- br->buffer[cwords] - shl eax, cl ; eax <- br->buffer[cwords] << cbits - add ecx, ebx ; cbits += parameter - xchg ebx, ecx ; ebx <- cbits, ecx <- parameter - shld edi, eax, cl ; uval <<= parameter <<< 'parameter' bits of tail word - xchg ebx, ecx ; ebx <- parameter, ecx <- cbits - ; } - ; } -.break2: - sub [esp], ebx ; ucbits -= parameter; - - ; - ; compose the value - ; - mov ebx, [esp + 28] ; ebx <- vals - mov edx, edi ; edx <- uval - and edi, 1 ; edi <- uval & 1 - shr edx, 1 ; edx <- uval >> 1 - neg edi ; edi <- -(int)(uval & 1) - xor edx, edi ; edx <- (uval >> 1 ^ -(int)(uval & 1)) - mov [ebx], edx ; *vals <- edx - sub dword [esp + 32], byte 1 ; --nvals; - jz .finished ; if(nvals == 0) /* jump to finish */ - xor edi, edi ; uval = 0; - add dword [esp + 28], 4 ; ++vals - jmp .val_loop ; } - -.finished: - mov [ebp + 16], esi ; br->consumed_words = cwords; - mov [ebp + 20], ecx ; br->consumed_bits = cbits; - mov eax, 1 -.end: - add esp, 4 - pop edi - pop esi - pop ebx - pop ebp - ret - -end - -%ifdef OBJ_FORMAT_elf - section .note.GNU-stack noalloc -%endif diff --git a/3rdparty/libflac/src/libFLAC/ia32/cpu_asm.nasm b/3rdparty/libflac/src/libFLAC/ia32/cpu_asm.nasm deleted file mode 100644 index f5eb1102c2b..00000000000 --- a/3rdparty/libflac/src/libFLAC/ia32/cpu_asm.nasm +++ /dev/null @@ -1,121 +0,0 @@ -; vim:filetype=nasm ts=8 - -; libFLAC - Free Lossless Audio Codec library -; Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions -; are met: -; -; - Redistributions of source code must retain the above copyright -; notice, this list of conditions and the following disclaimer. -; -; - Redistributions in binary form must reproduce the above copyright -; notice, this list of conditions and the following disclaimer in the -; documentation and/or other materials provided with the distribution. -; -; - Neither the name of the Xiph.org Foundation nor the names of its -; contributors may be used to endorse or promote products derived from -; this software without specific prior written permission. -; -; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -; ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -%include "nasm.h" - - data_section - -cglobal FLAC__cpu_have_cpuid_asm_ia32 -cglobal FLAC__cpu_info_asm_ia32 -cglobal FLAC__cpu_info_extended_amd_asm_ia32 - - code_section - -; ********************************************************************** -; -; FLAC__uint32 FLAC__cpu_have_cpuid_asm_ia32() -; - -cident FLAC__cpu_have_cpuid_asm_ia32 - push ebx - pushfd - pop eax - mov edx, eax - xor eax, 0x00200000 - push eax - popfd - pushfd - pop eax - cmp eax, edx - jz .no_cpuid - mov eax, 1 - jmp .end -.no_cpuid: - xor eax, eax -.end: - pop ebx - ret - -; ********************************************************************** -; -; void FLAC__cpu_info_asm_ia32(FLAC__uint32 *flags_edx, FLAC__uint32 *flags_ecx) -; - -cident FLAC__cpu_info_asm_ia32 - ;[esp + 8] == flags_edx - ;[esp + 12] == flags_ecx - - push ebx - call FLAC__cpu_have_cpuid_asm_ia32 - test eax, eax - jz .no_cpuid - mov eax, 1 - cpuid - mov ebx, [esp + 8] - mov [ebx], edx - mov ebx, [esp + 12] - mov [ebx], ecx - jmp .end -.no_cpuid - xor eax, eax - mov ebx, [esp + 8] - mov [ebx], eax - mov ebx, [esp + 12] - mov [ebx], eax -.end - pop ebx - ret - -cident FLAC__cpu_info_extended_amd_asm_ia32 - push ebx - call FLAC__cpu_have_cpuid_asm_ia32 - test eax, eax - jz .no_cpuid - mov eax, 0x80000000 - cpuid - cmp eax, 0x80000001 - jb .no_cpuid - mov eax, 0x80000001 - cpuid - mov eax, edx - jmp .end -.no_cpuid - xor eax, eax -.end - pop ebx - ret - -end - -%ifdef OBJ_FORMAT_elf - section .note.GNU-stack noalloc -%endif diff --git a/3rdparty/libflac/src/libFLAC/ia32/fixed_asm.nasm b/3rdparty/libflac/src/libFLAC/ia32/fixed_asm.nasm deleted file mode 100644 index 0185f4d8763..00000000000 --- a/3rdparty/libflac/src/libFLAC/ia32/fixed_asm.nasm +++ /dev/null @@ -1,312 +0,0 @@ -; vim:filetype=nasm ts=8 - -; libFLAC - Free Lossless Audio Codec library -; Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions -; are met: -; -; - Redistributions of source code must retain the above copyright -; notice, this list of conditions and the following disclaimer. -; -; - Redistributions in binary form must reproduce the above copyright -; notice, this list of conditions and the following disclaimer in the -; documentation and/or other materials provided with the distribution. -; -; - Neither the name of the Xiph.org Foundation nor the names of its -; contributors may be used to endorse or promote products derived from -; this software without specific prior written permission. -; -; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -; ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -%include "nasm.h" - - data_section - -cglobal FLAC__fixed_compute_best_predictor_asm_ia32_mmx_cmov - - code_section - -; ********************************************************************** -; -; unsigned FLAC__fixed_compute_best_predictor(const FLAC__int32 *data, unsigned data_len, FLAC__float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]) -; { -; FLAC__int32 last_error_0 = data[-1]; -; FLAC__int32 last_error_1 = data[-1] - data[-2]; -; FLAC__int32 last_error_2 = last_error_1 - (data[-2] - data[-3]); -; FLAC__int32 last_error_3 = last_error_2 - (data[-2] - 2*data[-3] + data[-4]); -; FLAC__int32 error, save; -; FLAC__uint32 total_error_0 = 0, total_error_1 = 0, total_error_2 = 0, total_error_3 = 0, total_error_4 = 0; -; unsigned i, order; -; -; for(i = 0; i < data_len; i++) { -; error = data[i] ; total_error_0 += local_abs(error); save = error; -; error -= last_error_0; total_error_1 += local_abs(error); last_error_0 = save; save = error; -; error -= last_error_1; total_error_2 += local_abs(error); last_error_1 = save; save = error; -; error -= last_error_2; total_error_3 += local_abs(error); last_error_2 = save; save = error; -; error -= last_error_3; total_error_4 += local_abs(error); last_error_3 = save; -; } -; -; if(total_error_0 < min(min(min(total_error_1, total_error_2), total_error_3), total_error_4)) -; order = 0; -; else if(total_error_1 < min(min(total_error_2, total_error_3), total_error_4)) -; order = 1; -; else if(total_error_2 < min(total_error_3, total_error_4)) -; order = 2; -; else if(total_error_3 < total_error_4) -; order = 3; -; else -; order = 4; -; -; residual_bits_per_sample[0] = (FLAC__float)((data_len > 0 && total_error_0 > 0) ? log(M_LN2 * (FLAC__double)total_error_0 / (FLAC__double)data_len) / M_LN2 : 0.0); -; residual_bits_per_sample[1] = (FLAC__float)((data_len > 0 && total_error_1 > 0) ? log(M_LN2 * (FLAC__double)total_error_1 / (FLAC__double)data_len) / M_LN2 : 0.0); -; residual_bits_per_sample[2] = (FLAC__float)((data_len > 0 && total_error_2 > 0) ? log(M_LN2 * (FLAC__double)total_error_2 / (FLAC__double)data_len) / M_LN2 : 0.0); -; residual_bits_per_sample[3] = (FLAC__float)((data_len > 0 && total_error_3 > 0) ? log(M_LN2 * (FLAC__double)total_error_3 / (FLAC__double)data_len) / M_LN2 : 0.0); -; residual_bits_per_sample[4] = (FLAC__float)((data_len > 0 && total_error_4 > 0) ? log(M_LN2 * (FLAC__double)total_error_4 / (FLAC__double)data_len) / M_LN2 : 0.0); -; -; return order; -; } - ALIGN 16 -cident FLAC__fixed_compute_best_predictor_asm_ia32_mmx_cmov - - ; esp + 36 == data[] - ; esp + 40 == data_len - ; esp + 44 == residual_bits_per_sample[] - - push ebp - push ebx - push esi - push edi - sub esp, byte 16 - ; qword [esp] == temp space for loading FLAC__uint64s to FPU regs - - ; ebx == &data[i] - ; ecx == loop counter (i) - ; ebp == order - ; mm0 == total_error_1:total_error_0 - ; mm1 == total_error_2:total_error_3 - ; mm2 == :total_error_4 - ; mm3 == last_error_1:last_error_0 - ; mm4 == last_error_2:last_error_3 - - mov ecx, [esp + 40] ; ecx = data_len - test ecx, ecx - jz near .data_len_is_0 - - mov ebx, [esp + 36] ; ebx = data[] - movd mm3, [ebx - 4] ; mm3 = 0:last_error_0 - movd mm2, [ebx - 8] ; mm2 = 0:data[-2] - movd mm1, [ebx - 12] ; mm1 = 0:data[-3] - movd mm0, [ebx - 16] ; mm0 = 0:data[-4] - movq mm5, mm3 ; mm5 = 0:last_error_0 - psubd mm5, mm2 ; mm5 = 0:last_error_1 - punpckldq mm3, mm5 ; mm3 = last_error_1:last_error_0 - psubd mm2, mm1 ; mm2 = 0:data[-2] - data[-3] - psubd mm5, mm2 ; mm5 = 0:last_error_2 - movq mm4, mm5 ; mm4 = 0:last_error_2 - psubd mm4, mm2 ; mm4 = 0:last_error_2 - (data[-2] - data[-3]) - paddd mm4, mm1 ; mm4 = 0:last_error_2 - (data[-2] - 2 * data[-3]) - psubd mm4, mm0 ; mm4 = 0:last_error_3 - punpckldq mm4, mm5 ; mm4 = last_error_2:last_error_3 - pxor mm0, mm0 ; mm0 = total_error_1:total_error_0 - pxor mm1, mm1 ; mm1 = total_error_2:total_error_3 - pxor mm2, mm2 ; mm2 = 0:total_error_4 - - ALIGN 16 -.loop: - movd mm7, [ebx] ; mm7 = 0:error_0 - add ebx, byte 4 - movq mm6, mm7 ; mm6 = 0:error_0 - psubd mm7, mm3 ; mm7 = :error_1 - punpckldq mm6, mm7 ; mm6 = error_1:error_0 - movq mm5, mm6 ; mm5 = error_1:error_0 - movq mm7, mm6 ; mm7 = error_1:error_0 - psubd mm5, mm3 ; mm5 = error_2: - movq mm3, mm6 ; mm3 = error_1:error_0 - psrad mm6, 31 - pxor mm7, mm6 - psubd mm7, mm6 ; mm7 = abs(error_1):abs(error_0) - paddd mm0, mm7 ; mm0 = total_error_1:total_error_0 - movq mm6, mm5 ; mm6 = error_2: - psubd mm5, mm4 ; mm5 = error_3: - punpckhdq mm5, mm6 ; mm5 = error_2:error_3 - movq mm7, mm5 ; mm7 = error_2:error_3 - movq mm6, mm5 ; mm6 = error_2:error_3 - psubd mm5, mm4 ; mm5 = :error_4 - movq mm4, mm6 ; mm4 = error_2:error_3 - psrad mm6, 31 - pxor mm7, mm6 - psubd mm7, mm6 ; mm7 = abs(error_2):abs(error_3) - paddd mm1, mm7 ; mm1 = total_error_2:total_error_3 - movq mm6, mm5 ; mm6 = :error_4 - psrad mm5, 31 - pxor mm6, mm5 - psubd mm6, mm5 ; mm6 = :abs(error_4) - paddd mm2, mm6 ; mm2 = :total_error_4 - - dec ecx - jnz short .loop - -; if(total_error_0 < min(min(min(total_error_1, total_error_2), total_error_3), total_error_4)) -; order = 0; -; else if(total_error_1 < min(min(total_error_2, total_error_3), total_error_4)) -; order = 1; -; else if(total_error_2 < min(total_error_3, total_error_4)) -; order = 2; -; else if(total_error_3 < total_error_4) -; order = 3; -; else -; order = 4; - movq mm3, mm0 ; mm3 = total_error_1:total_error_0 - movd edi, mm2 ; edi = total_error_4 - movd esi, mm1 ; esi = total_error_3 - movd eax, mm0 ; eax = total_error_0 - punpckhdq mm1, mm1 ; mm1 = total_error_2:total_error_2 - punpckhdq mm3, mm3 ; mm3 = total_error_1:total_error_1 - movd edx, mm1 ; edx = total_error_2 - movd ecx, mm3 ; ecx = total_error_1 - - xor ebx, ebx - xor ebp, ebp - inc ebx - cmp ecx, eax - cmovb eax, ecx ; eax = min(total_error_0, total_error_1) - cmovbe ebp, ebx - inc ebx - cmp edx, eax - cmovb eax, edx ; eax = min(total_error_0, total_error_1, total_error_2) - cmovbe ebp, ebx - inc ebx - cmp esi, eax - cmovb eax, esi ; eax = min(total_error_0, total_error_1, total_error_2, total_error_3) - cmovbe ebp, ebx - inc ebx - cmp edi, eax - cmovb eax, edi ; eax = min(total_error_0, total_error_1, total_error_2, total_error_3, total_error_4) - cmovbe ebp, ebx - movd ebx, mm0 ; ebx = total_error_0 - emms - - ; residual_bits_per_sample[0] = (FLAC__float)((data_len > 0 && total_error_0 > 0) ? log(M_LN2 * (FLAC__double)total_error_0 / (FLAC__double)data_len) / M_LN2 : 0.0); - ; residual_bits_per_sample[1] = (FLAC__float)((data_len > 0 && total_error_1 > 0) ? log(M_LN2 * (FLAC__double)total_error_1 / (FLAC__double)data_len) / M_LN2 : 0.0); - ; residual_bits_per_sample[2] = (FLAC__float)((data_len > 0 && total_error_2 > 0) ? log(M_LN2 * (FLAC__double)total_error_2 / (FLAC__double)data_len) / M_LN2 : 0.0); - ; residual_bits_per_sample[3] = (FLAC__float)((data_len > 0 && total_error_3 > 0) ? log(M_LN2 * (FLAC__double)total_error_3 / (FLAC__double)data_len) / M_LN2 : 0.0); - ; residual_bits_per_sample[4] = (FLAC__float)((data_len > 0 && total_error_4 > 0) ? log(M_LN2 * (FLAC__double)total_error_4 / (FLAC__double)data_len) / M_LN2 : 0.0); - xor eax, eax - fild dword [esp + 40] ; ST = data_len (NOTE: assumes data_len is <2gigs) -.rbps_0: - test ebx, ebx - jz .total_error_0_is_0 - fld1 ; ST = 1.0 data_len - mov [esp], ebx - mov [esp + 4], eax ; [esp] = (FLAC__uint64)total_error_0 - mov ebx, [esp + 44] - fild qword [esp] ; ST = total_error_0 1.0 data_len - fdiv st2 ; ST = total_error_0/data_len 1.0 data_len - fldln2 ; ST = ln2 total_error_0/data_len 1.0 data_len - fmulp st1 ; ST = ln2*total_error_0/data_len 1.0 data_len - fyl2x ; ST = log2(ln2*total_error_0/data_len) data_len - fstp dword [ebx] ; residual_bits_per_sample[0] = log2(ln2*total_error_0/data_len) ST = data_len - jmp short .rbps_1 -.total_error_0_is_0: - mov ebx, [esp + 44] - mov [ebx], eax ; residual_bits_per_sample[0] = 0.0 -.rbps_1: - test ecx, ecx - jz .total_error_1_is_0 - fld1 ; ST = 1.0 data_len - mov [esp], ecx - mov [esp + 4], eax ; [esp] = (FLAC__uint64)total_error_1 - fild qword [esp] ; ST = total_error_1 1.0 data_len - fdiv st2 ; ST = total_error_1/data_len 1.0 data_len - fldln2 ; ST = ln2 total_error_1/data_len 1.0 data_len - fmulp st1 ; ST = ln2*total_error_1/data_len 1.0 data_len - fyl2x ; ST = log2(ln2*total_error_1/data_len) data_len - fstp dword [ebx + 4] ; residual_bits_per_sample[1] = log2(ln2*total_error_1/data_len) ST = data_len - jmp short .rbps_2 -.total_error_1_is_0: - mov [ebx + 4], eax ; residual_bits_per_sample[1] = 0.0 -.rbps_2: - test edx, edx - jz .total_error_2_is_0 - fld1 ; ST = 1.0 data_len - mov [esp], edx - mov [esp + 4], eax ; [esp] = (FLAC__uint64)total_error_2 - fild qword [esp] ; ST = total_error_2 1.0 data_len - fdiv st2 ; ST = total_error_2/data_len 1.0 data_len - fldln2 ; ST = ln2 total_error_2/data_len 1.0 data_len - fmulp st1 ; ST = ln2*total_error_2/data_len 1.0 data_len - fyl2x ; ST = log2(ln2*total_error_2/data_len) data_len - fstp dword [ebx + 8] ; residual_bits_per_sample[2] = log2(ln2*total_error_2/data_len) ST = data_len - jmp short .rbps_3 -.total_error_2_is_0: - mov [ebx + 8], eax ; residual_bits_per_sample[2] = 0.0 -.rbps_3: - test esi, esi - jz .total_error_3_is_0 - fld1 ; ST = 1.0 data_len - mov [esp], esi - mov [esp + 4], eax ; [esp] = (FLAC__uint64)total_error_3 - fild qword [esp] ; ST = total_error_3 1.0 data_len - fdiv st2 ; ST = total_error_3/data_len 1.0 data_len - fldln2 ; ST = ln2 total_error_3/data_len 1.0 data_len - fmulp st1 ; ST = ln2*total_error_3/data_len 1.0 data_len - fyl2x ; ST = log2(ln2*total_error_3/data_len) data_len - fstp dword [ebx + 12] ; residual_bits_per_sample[3] = log2(ln2*total_error_3/data_len) ST = data_len - jmp short .rbps_4 -.total_error_3_is_0: - mov [ebx + 12], eax ; residual_bits_per_sample[3] = 0.0 -.rbps_4: - test edi, edi - jz .total_error_4_is_0 - fld1 ; ST = 1.0 data_len - mov [esp], edi - mov [esp + 4], eax ; [esp] = (FLAC__uint64)total_error_4 - fild qword [esp] ; ST = total_error_4 1.0 data_len - fdiv st2 ; ST = total_error_4/data_len 1.0 data_len - fldln2 ; ST = ln2 total_error_4/data_len 1.0 data_len - fmulp st1 ; ST = ln2*total_error_4/data_len 1.0 data_len - fyl2x ; ST = log2(ln2*total_error_4/data_len) data_len - fstp dword [ebx + 16] ; residual_bits_per_sample[4] = log2(ln2*total_error_4/data_len) ST = data_len - jmp short .rbps_end -.total_error_4_is_0: - mov [ebx + 16], eax ; residual_bits_per_sample[4] = 0.0 -.rbps_end: - fstp st0 ; ST = [empty] - jmp short .end -.data_len_is_0: - ; data_len == 0, so residual_bits_per_sample[*] = 0.0 - xor ebp, ebp - mov edi, [esp + 44] - mov [edi], ebp - mov [edi + 4], ebp - mov [edi + 8], ebp - mov [edi + 12], ebp - mov [edi + 16], ebp - add ebp, byte 4 ; order = 4 - -.end: - mov eax, ebp ; return order - add esp, byte 16 - pop edi - pop esi - pop ebx - pop ebp - ret - -end - -%ifdef OBJ_FORMAT_elf - section .note.GNU-stack noalloc -%endif diff --git a/3rdparty/libflac/src/libFLAC/ia32/lpc_asm.nasm b/3rdparty/libflac/src/libFLAC/ia32/lpc_asm.nasm deleted file mode 100644 index 4bc4c91326f..00000000000 --- a/3rdparty/libflac/src/libFLAC/ia32/lpc_asm.nasm +++ /dev/null @@ -1,1511 +0,0 @@ -; vim:filetype=nasm ts=8 - -; libFLAC - Free Lossless Audio Codec library -; Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions -; are met: -; -; - Redistributions of source code must retain the above copyright -; notice, this list of conditions and the following disclaimer. -; -; - Redistributions in binary form must reproduce the above copyright -; notice, this list of conditions and the following disclaimer in the -; documentation and/or other materials provided with the distribution. -; -; - Neither the name of the Xiph.org Foundation nor the names of its -; contributors may be used to endorse or promote products derived from -; this software without specific prior written permission. -; -; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -; ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -%include "nasm.h" - - data_section - -cglobal FLAC__lpc_compute_autocorrelation_asm_ia32 -cglobal FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_4 -cglobal FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_8 -cglobal FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_12 -cglobal FLAC__lpc_compute_autocorrelation_asm_ia32_3dnow -cglobal FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32 -cglobal FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32_mmx -cglobal FLAC__lpc_restore_signal_asm_ia32 -cglobal FLAC__lpc_restore_signal_asm_ia32_mmx - - code_section - -; ********************************************************************** -; -; void FLAC__lpc_compute_autocorrelation_asm(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]) -; { -; FLAC__real d; -; unsigned sample, coeff; -; const unsigned limit = data_len - lag; -; -; FLAC__ASSERT(lag > 0); -; FLAC__ASSERT(lag <= data_len); -; -; for(coeff = 0; coeff < lag; coeff++) -; autoc[coeff] = 0.0; -; for(sample = 0; sample <= limit; sample++) { -; d = data[sample]; -; for(coeff = 0; coeff < lag; coeff++) -; autoc[coeff] += d * data[sample+coeff]; -; } -; for(; sample < data_len; sample++) { -; d = data[sample]; -; for(coeff = 0; coeff < data_len - sample; coeff++) -; autoc[coeff] += d * data[sample+coeff]; -; } -; } -; - ALIGN 16 -cident FLAC__lpc_compute_autocorrelation_asm_ia32 - ;[esp + 28] == autoc[] - ;[esp + 24] == lag - ;[esp + 20] == data_len - ;[esp + 16] == data[] - - ;ASSERT(lag > 0) - ;ASSERT(lag <= 33) - ;ASSERT(lag <= data_len) - -.begin: - push esi - push edi - push ebx - - ; for(coeff = 0; coeff < lag; coeff++) - ; autoc[coeff] = 0.0; - mov edi, [esp + 28] ; edi == autoc - mov ecx, [esp + 24] ; ecx = # of dwords (=lag) of 0 to write - xor eax, eax - rep stosd - - ; const unsigned limit = data_len - lag; - mov eax, [esp + 24] ; eax == lag - mov ecx, [esp + 20] - sub ecx, eax ; ecx == limit - - mov edi, [esp + 28] ; edi == autoc - mov esi, [esp + 16] ; esi == data - inc ecx ; we are looping <= limit so we add one to the counter - - ; for(sample = 0; sample <= limit; sample++) { - ; d = data[sample]; - ; for(coeff = 0; coeff < lag; coeff++) - ; autoc[coeff] += d * data[sample+coeff]; - ; } - fld dword [esi] ; ST = d <- data[sample] - ; each iteration is 11 bytes so we need (-eax)*11, so we do (-12*eax + eax) - lea edx, [eax + eax*2] - neg edx - lea edx, [eax + edx*4 + .jumper1_0 - .get_eip1] - call .get_eip1 -.get_eip1: - pop ebx - add edx, ebx - inc edx ; compensate for the shorter opcode on the last iteration - inc edx ; compensate for the shorter opcode on the last iteration - inc edx ; compensate for the shorter opcode on the last iteration - cmp eax, 33 - jne .loop1_start - sub edx, byte 9 ; compensate for the longer opcodes on the first iteration -.loop1_start: - jmp edx - - fld st0 ; ST = d d - fmul dword [esi + (32*4)] ; ST = d*data[sample+32] d WATCHOUT: not a byte displacement here! - fadd dword [edi + (32*4)] ; ST = autoc[32]+d*data[sample+32] d WATCHOUT: not a byte displacement here! - fstp dword [edi + (32*4)] ; autoc[32]+=d*data[sample+32] ST = d WATCHOUT: not a byte displacement here! - fld st0 ; ST = d d - fmul dword [esi + (31*4)] ; ST = d*data[sample+31] d - fadd dword [edi + (31*4)] ; ST = autoc[31]+d*data[sample+31] d - fstp dword [edi + (31*4)] ; autoc[31]+=d*data[sample+31] ST = d - fld st0 ; ST = d d - fmul dword [esi + (30*4)] ; ST = d*data[sample+30] d - fadd dword [edi + (30*4)] ; ST = autoc[30]+d*data[sample+30] d - fstp dword [edi + (30*4)] ; autoc[30]+=d*data[sample+30] ST = d - fld st0 ; ST = d d - fmul dword [esi + (29*4)] ; ST = d*data[sample+29] d - fadd dword [edi + (29*4)] ; ST = autoc[29]+d*data[sample+29] d - fstp dword [edi + (29*4)] ; autoc[29]+=d*data[sample+29] ST = d - fld st0 ; ST = d d - fmul dword [esi + (28*4)] ; ST = d*data[sample+28] d - fadd dword [edi + (28*4)] ; ST = autoc[28]+d*data[sample+28] d - fstp dword [edi + (28*4)] ; autoc[28]+=d*data[sample+28] ST = d - fld st0 ; ST = d d - fmul dword [esi + (27*4)] ; ST = d*data[sample+27] d - fadd dword [edi + (27*4)] ; ST = autoc[27]+d*data[sample+27] d - fstp dword [edi + (27*4)] ; autoc[27]+=d*data[sample+27] ST = d - fld st0 ; ST = d d - fmul dword [esi + (26*4)] ; ST = d*data[sample+26] d - fadd dword [edi + (26*4)] ; ST = autoc[26]+d*data[sample+26] d - fstp dword [edi + (26*4)] ; autoc[26]+=d*data[sample+26] ST = d - fld st0 ; ST = d d - fmul dword [esi + (25*4)] ; ST = d*data[sample+25] d - fadd dword [edi + (25*4)] ; ST = autoc[25]+d*data[sample+25] d - fstp dword [edi + (25*4)] ; autoc[25]+=d*data[sample+25] ST = d - fld st0 ; ST = d d - fmul dword [esi + (24*4)] ; ST = d*data[sample+24] d - fadd dword [edi + (24*4)] ; ST = autoc[24]+d*data[sample+24] d - fstp dword [edi + (24*4)] ; autoc[24]+=d*data[sample+24] ST = d - fld st0 ; ST = d d - fmul dword [esi + (23*4)] ; ST = d*data[sample+23] d - fadd dword [edi + (23*4)] ; ST = autoc[23]+d*data[sample+23] d - fstp dword [edi + (23*4)] ; autoc[23]+=d*data[sample+23] ST = d - fld st0 ; ST = d d - fmul dword [esi + (22*4)] ; ST = d*data[sample+22] d - fadd dword [edi + (22*4)] ; ST = autoc[22]+d*data[sample+22] d - fstp dword [edi + (22*4)] ; autoc[22]+=d*data[sample+22] ST = d - fld st0 ; ST = d d - fmul dword [esi + (21*4)] ; ST = d*data[sample+21] d - fadd dword [edi + (21*4)] ; ST = autoc[21]+d*data[sample+21] d - fstp dword [edi + (21*4)] ; autoc[21]+=d*data[sample+21] ST = d - fld st0 ; ST = d d - fmul dword [esi + (20*4)] ; ST = d*data[sample+20] d - fadd dword [edi + (20*4)] ; ST = autoc[20]+d*data[sample+20] d - fstp dword [edi + (20*4)] ; autoc[20]+=d*data[sample+20] ST = d - fld st0 ; ST = d d - fmul dword [esi + (19*4)] ; ST = d*data[sample+19] d - fadd dword [edi + (19*4)] ; ST = autoc[19]+d*data[sample+19] d - fstp dword [edi + (19*4)] ; autoc[19]+=d*data[sample+19] ST = d - fld st0 ; ST = d d - fmul dword [esi + (18*4)] ; ST = d*data[sample+18] d - fadd dword [edi + (18*4)] ; ST = autoc[18]+d*data[sample+18] d - fstp dword [edi + (18*4)] ; autoc[18]+=d*data[sample+18] ST = d - fld st0 ; ST = d d - fmul dword [esi + (17*4)] ; ST = d*data[sample+17] d - fadd dword [edi + (17*4)] ; ST = autoc[17]+d*data[sample+17] d - fstp dword [edi + (17*4)] ; autoc[17]+=d*data[sample+17] ST = d - fld st0 ; ST = d d - fmul dword [esi + (16*4)] ; ST = d*data[sample+16] d - fadd dword [edi + (16*4)] ; ST = autoc[16]+d*data[sample+16] d - fstp dword [edi + (16*4)] ; autoc[16]+=d*data[sample+16] ST = d - fld st0 ; ST = d d - fmul dword [esi + (15*4)] ; ST = d*data[sample+15] d - fadd dword [edi + (15*4)] ; ST = autoc[15]+d*data[sample+15] d - fstp dword [edi + (15*4)] ; autoc[15]+=d*data[sample+15] ST = d - fld st0 ; ST = d d - fmul dword [esi + (14*4)] ; ST = d*data[sample+14] d - fadd dword [edi + (14*4)] ; ST = autoc[14]+d*data[sample+14] d - fstp dword [edi + (14*4)] ; autoc[14]+=d*data[sample+14] ST = d - fld st0 ; ST = d d - fmul dword [esi + (13*4)] ; ST = d*data[sample+13] d - fadd dword [edi + (13*4)] ; ST = autoc[13]+d*data[sample+13] d - fstp dword [edi + (13*4)] ; autoc[13]+=d*data[sample+13] ST = d - fld st0 ; ST = d d - fmul dword [esi + (12*4)] ; ST = d*data[sample+12] d - fadd dword [edi + (12*4)] ; ST = autoc[12]+d*data[sample+12] d - fstp dword [edi + (12*4)] ; autoc[12]+=d*data[sample+12] ST = d - fld st0 ; ST = d d - fmul dword [esi + (11*4)] ; ST = d*data[sample+11] d - fadd dword [edi + (11*4)] ; ST = autoc[11]+d*data[sample+11] d - fstp dword [edi + (11*4)] ; autoc[11]+=d*data[sample+11] ST = d - fld st0 ; ST = d d - fmul dword [esi + (10*4)] ; ST = d*data[sample+10] d - fadd dword [edi + (10*4)] ; ST = autoc[10]+d*data[sample+10] d - fstp dword [edi + (10*4)] ; autoc[10]+=d*data[sample+10] ST = d - fld st0 ; ST = d d - fmul dword [esi + ( 9*4)] ; ST = d*data[sample+9] d - fadd dword [edi + ( 9*4)] ; ST = autoc[9]+d*data[sample+9] d - fstp dword [edi + ( 9*4)] ; autoc[9]+=d*data[sample+9] ST = d - fld st0 ; ST = d d - fmul dword [esi + ( 8*4)] ; ST = d*data[sample+8] d - fadd dword [edi + ( 8*4)] ; ST = autoc[8]+d*data[sample+8] d - fstp dword [edi + ( 8*4)] ; autoc[8]+=d*data[sample+8] ST = d - fld st0 ; ST = d d - fmul dword [esi + ( 7*4)] ; ST = d*data[sample+7] d - fadd dword [edi + ( 7*4)] ; ST = autoc[7]+d*data[sample+7] d - fstp dword [edi + ( 7*4)] ; autoc[7]+=d*data[sample+7] ST = d - fld st0 ; ST = d d - fmul dword [esi + ( 6*4)] ; ST = d*data[sample+6] d - fadd dword [edi + ( 6*4)] ; ST = autoc[6]+d*data[sample+6] d - fstp dword [edi + ( 6*4)] ; autoc[6]+=d*data[sample+6] ST = d - fld st0 ; ST = d d - fmul dword [esi + ( 5*4)] ; ST = d*data[sample+4] d - fadd dword [edi + ( 5*4)] ; ST = autoc[4]+d*data[sample+4] d - fstp dword [edi + ( 5*4)] ; autoc[4]+=d*data[sample+4] ST = d - fld st0 ; ST = d d - fmul dword [esi + ( 4*4)] ; ST = d*data[sample+4] d - fadd dword [edi + ( 4*4)] ; ST = autoc[4]+d*data[sample+4] d - fstp dword [edi + ( 4*4)] ; autoc[4]+=d*data[sample+4] ST = d - fld st0 ; ST = d d - fmul dword [esi + ( 3*4)] ; ST = d*data[sample+3] d - fadd dword [edi + ( 3*4)] ; ST = autoc[3]+d*data[sample+3] d - fstp dword [edi + ( 3*4)] ; autoc[3]+=d*data[sample+3] ST = d - fld st0 ; ST = d d - fmul dword [esi + ( 2*4)] ; ST = d*data[sample+2] d - fadd dword [edi + ( 2*4)] ; ST = autoc[2]+d*data[sample+2] d - fstp dword [edi + ( 2*4)] ; autoc[2]+=d*data[sample+2] ST = d - fld st0 ; ST = d d - fmul dword [esi + ( 1*4)] ; ST = d*data[sample+1] d - fadd dword [edi + ( 1*4)] ; ST = autoc[1]+d*data[sample+1] d - fstp dword [edi + ( 1*4)] ; autoc[1]+=d*data[sample+1] ST = d - fld st0 ; ST = d d - fmul dword [esi] ; ST = d*data[sample] d WATCHOUT: no displacement byte here! - fadd dword [edi] ; ST = autoc[0]+d*data[sample] d WATCHOUT: no displacement byte here! - fstp dword [edi] ; autoc[0]+=d*data[sample] ST = d WATCHOUT: no displacement byte here! -.jumper1_0: - - fstp st0 ; pop d, ST = empty - add esi, byte 4 ; sample++ - dec ecx - jz .loop1_end - fld dword [esi] ; ST = d <- data[sample] - jmp edx -.loop1_end: - - ; for(; sample < data_len; sample++) { - ; d = data[sample]; - ; for(coeff = 0; coeff < data_len - sample; coeff++) - ; autoc[coeff] += d * data[sample+coeff]; - ; } - mov ecx, [esp + 24] ; ecx <- lag - dec ecx ; ecx <- lag - 1 - jz near .end ; skip loop if 0 (i.e. lag == 1) - - fld dword [esi] ; ST = d <- data[sample] - mov eax, ecx ; eax <- lag - 1 == data_len - sample the first time through - ; each iteration is 11 bytes so we need (-eax)*11, so we do (-12*eax + eax) - lea edx, [eax + eax*2] - neg edx - lea edx, [eax + edx*4 + .jumper2_0 - .get_eip2] - call .get_eip2 -.get_eip2: - pop ebx - add edx, ebx - inc edx ; compensate for the shorter opcode on the last iteration - inc edx ; compensate for the shorter opcode on the last iteration - inc edx ; compensate for the shorter opcode on the last iteration - jmp edx - - fld st0 ; ST = d d - fmul dword [esi + (31*4)] ; ST = d*data[sample+31] d - fadd dword [edi + (31*4)] ; ST = autoc[31]+d*data[sample+31] d - fstp dword [edi + (31*4)] ; autoc[31]+=d*data[sample+31] ST = d - fld st0 ; ST = d d - fmul dword [esi + (30*4)] ; ST = d*data[sample+30] d - fadd dword [edi + (30*4)] ; ST = autoc[30]+d*data[sample+30] d - fstp dword [edi + (30*4)] ; autoc[30]+=d*data[sample+30] ST = d - fld st0 ; ST = d d - fmul dword [esi + (29*4)] ; ST = d*data[sample+29] d - fadd dword [edi + (29*4)] ; ST = autoc[29]+d*data[sample+29] d - fstp dword [edi + (29*4)] ; autoc[29]+=d*data[sample+29] ST = d - fld st0 ; ST = d d - fmul dword [esi + (28*4)] ; ST = d*data[sample+28] d - fadd dword [edi + (28*4)] ; ST = autoc[28]+d*data[sample+28] d - fstp dword [edi + (28*4)] ; autoc[28]+=d*data[sample+28] ST = d - fld st0 ; ST = d d - fmul dword [esi + (27*4)] ; ST = d*data[sample+27] d - fadd dword [edi + (27*4)] ; ST = autoc[27]+d*data[sample+27] d - fstp dword [edi + (27*4)] ; autoc[27]+=d*data[sample+27] ST = d - fld st0 ; ST = d d - fmul dword [esi + (26*4)] ; ST = d*data[sample+26] d - fadd dword [edi + (26*4)] ; ST = autoc[26]+d*data[sample+26] d - fstp dword [edi + (26*4)] ; autoc[26]+=d*data[sample+26] ST = d - fld st0 ; ST = d d - fmul dword [esi + (25*4)] ; ST = d*data[sample+25] d - fadd dword [edi + (25*4)] ; ST = autoc[25]+d*data[sample+25] d - fstp dword [edi + (25*4)] ; autoc[25]+=d*data[sample+25] ST = d - fld st0 ; ST = d d - fmul dword [esi + (24*4)] ; ST = d*data[sample+24] d - fadd dword [edi + (24*4)] ; ST = autoc[24]+d*data[sample+24] d - fstp dword [edi + (24*4)] ; autoc[24]+=d*data[sample+24] ST = d - fld st0 ; ST = d d - fmul dword [esi + (23*4)] ; ST = d*data[sample+23] d - fadd dword [edi + (23*4)] ; ST = autoc[23]+d*data[sample+23] d - fstp dword [edi + (23*4)] ; autoc[23]+=d*data[sample+23] ST = d - fld st0 ; ST = d d - fmul dword [esi + (22*4)] ; ST = d*data[sample+22] d - fadd dword [edi + (22*4)] ; ST = autoc[22]+d*data[sample+22] d - fstp dword [edi + (22*4)] ; autoc[22]+=d*data[sample+22] ST = d - fld st0 ; ST = d d - fmul dword [esi + (21*4)] ; ST = d*data[sample+21] d - fadd dword [edi + (21*4)] ; ST = autoc[21]+d*data[sample+21] d - fstp dword [edi + (21*4)] ; autoc[21]+=d*data[sample+21] ST = d - fld st0 ; ST = d d - fmul dword [esi + (20*4)] ; ST = d*data[sample+20] d - fadd dword [edi + (20*4)] ; ST = autoc[20]+d*data[sample+20] d - fstp dword [edi + (20*4)] ; autoc[20]+=d*data[sample+20] ST = d - fld st0 ; ST = d d - fmul dword [esi + (19*4)] ; ST = d*data[sample+19] d - fadd dword [edi + (19*4)] ; ST = autoc[19]+d*data[sample+19] d - fstp dword [edi + (19*4)] ; autoc[19]+=d*data[sample+19] ST = d - fld st0 ; ST = d d - fmul dword [esi + (18*4)] ; ST = d*data[sample+18] d - fadd dword [edi + (18*4)] ; ST = autoc[18]+d*data[sample+18] d - fstp dword [edi + (18*4)] ; autoc[18]+=d*data[sample+18] ST = d - fld st0 ; ST = d d - fmul dword [esi + (17*4)] ; ST = d*data[sample+17] d - fadd dword [edi + (17*4)] ; ST = autoc[17]+d*data[sample+17] d - fstp dword [edi + (17*4)] ; autoc[17]+=d*data[sample+17] ST = d - fld st0 ; ST = d d - fmul dword [esi + (16*4)] ; ST = d*data[sample+16] d - fadd dword [edi + (16*4)] ; ST = autoc[16]+d*data[sample+16] d - fstp dword [edi + (16*4)] ; autoc[16]+=d*data[sample+16] ST = d - fld st0 ; ST = d d - fmul dword [esi + (15*4)] ; ST = d*data[sample+15] d - fadd dword [edi + (15*4)] ; ST = autoc[15]+d*data[sample+15] d - fstp dword [edi + (15*4)] ; autoc[15]+=d*data[sample+15] ST = d - fld st0 ; ST = d d - fmul dword [esi + (14*4)] ; ST = d*data[sample+14] d - fadd dword [edi + (14*4)] ; ST = autoc[14]+d*data[sample+14] d - fstp dword [edi + (14*4)] ; autoc[14]+=d*data[sample+14] ST = d - fld st0 ; ST = d d - fmul dword [esi + (13*4)] ; ST = d*data[sample+13] d - fadd dword [edi + (13*4)] ; ST = autoc[13]+d*data[sample+13] d - fstp dword [edi + (13*4)] ; autoc[13]+=d*data[sample+13] ST = d - fld st0 ; ST = d d - fmul dword [esi + (12*4)] ; ST = d*data[sample+12] d - fadd dword [edi + (12*4)] ; ST = autoc[12]+d*data[sample+12] d - fstp dword [edi + (12*4)] ; autoc[12]+=d*data[sample+12] ST = d - fld st0 ; ST = d d - fmul dword [esi + (11*4)] ; ST = d*data[sample+11] d - fadd dword [edi + (11*4)] ; ST = autoc[11]+d*data[sample+11] d - fstp dword [edi + (11*4)] ; autoc[11]+=d*data[sample+11] ST = d - fld st0 ; ST = d d - fmul dword [esi + (10*4)] ; ST = d*data[sample+10] d - fadd dword [edi + (10*4)] ; ST = autoc[10]+d*data[sample+10] d - fstp dword [edi + (10*4)] ; autoc[10]+=d*data[sample+10] ST = d - fld st0 ; ST = d d - fmul dword [esi + ( 9*4)] ; ST = d*data[sample+9] d - fadd dword [edi + ( 9*4)] ; ST = autoc[9]+d*data[sample+9] d - fstp dword [edi + ( 9*4)] ; autoc[9]+=d*data[sample+9] ST = d - fld st0 ; ST = d d - fmul dword [esi + ( 8*4)] ; ST = d*data[sample+8] d - fadd dword [edi + ( 8*4)] ; ST = autoc[8]+d*data[sample+8] d - fstp dword [edi + ( 8*4)] ; autoc[8]+=d*data[sample+8] ST = d - fld st0 ; ST = d d - fmul dword [esi + ( 7*4)] ; ST = d*data[sample+7] d - fadd dword [edi + ( 7*4)] ; ST = autoc[7]+d*data[sample+7] d - fstp dword [edi + ( 7*4)] ; autoc[7]+=d*data[sample+7] ST = d - fld st0 ; ST = d d - fmul dword [esi + ( 6*4)] ; ST = d*data[sample+6] d - fadd dword [edi + ( 6*4)] ; ST = autoc[6]+d*data[sample+6] d - fstp dword [edi + ( 6*4)] ; autoc[6]+=d*data[sample+6] ST = d - fld st0 ; ST = d d - fmul dword [esi + ( 5*4)] ; ST = d*data[sample+4] d - fadd dword [edi + ( 5*4)] ; ST = autoc[4]+d*data[sample+4] d - fstp dword [edi + ( 5*4)] ; autoc[4]+=d*data[sample+4] ST = d - fld st0 ; ST = d d - fmul dword [esi + ( 4*4)] ; ST = d*data[sample+4] d - fadd dword [edi + ( 4*4)] ; ST = autoc[4]+d*data[sample+4] d - fstp dword [edi + ( 4*4)] ; autoc[4]+=d*data[sample+4] ST = d - fld st0 ; ST = d d - fmul dword [esi + ( 3*4)] ; ST = d*data[sample+3] d - fadd dword [edi + ( 3*4)] ; ST = autoc[3]+d*data[sample+3] d - fstp dword [edi + ( 3*4)] ; autoc[3]+=d*data[sample+3] ST = d - fld st0 ; ST = d d - fmul dword [esi + ( 2*4)] ; ST = d*data[sample+2] d - fadd dword [edi + ( 2*4)] ; ST = autoc[2]+d*data[sample+2] d - fstp dword [edi + ( 2*4)] ; autoc[2]+=d*data[sample+2] ST = d - fld st0 ; ST = d d - fmul dword [esi + ( 1*4)] ; ST = d*data[sample+1] d - fadd dword [edi + ( 1*4)] ; ST = autoc[1]+d*data[sample+1] d - fstp dword [edi + ( 1*4)] ; autoc[1]+=d*data[sample+1] ST = d - fld st0 ; ST = d d - fmul dword [esi] ; ST = d*data[sample] d WATCHOUT: no displacement byte here! - fadd dword [edi] ; ST = autoc[0]+d*data[sample] d WATCHOUT: no displacement byte here! - fstp dword [edi] ; autoc[0]+=d*data[sample] ST = d WATCHOUT: no displacement byte here! -.jumper2_0: - - fstp st0 ; pop d, ST = empty - add esi, byte 4 ; sample++ - dec ecx - jz .loop2_end - add edx, byte 11 ; adjust our inner loop counter by adjusting the jump target - fld dword [esi] ; ST = d <- data[sample] - jmp edx -.loop2_end: - -.end: - pop ebx - pop edi - pop esi - ret - - ALIGN 16 -cident FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_4 - ;[esp + 16] == autoc[] - ;[esp + 12] == lag - ;[esp + 8] == data_len - ;[esp + 4] == data[] - - ;ASSERT(lag > 0) - ;ASSERT(lag <= 4) - ;ASSERT(lag <= data_len) - - ; for(coeff = 0; coeff < lag; coeff++) - ; autoc[coeff] = 0.0; - xorps xmm5, xmm5 - - mov edx, [esp + 8] ; edx == data_len - mov eax, [esp + 4] ; eax == &data[sample] <- &data[0] - - movss xmm0, [eax] ; xmm0 = 0,0,0,data[0] - add eax, 4 - movaps xmm2, xmm0 ; xmm2 = 0,0,0,data[0] - shufps xmm0, xmm0, 0 ; xmm0 == data[sample],data[sample],data[sample],data[sample] = data[0],data[0],data[0],data[0] -.warmup: ; xmm2 == data[sample-3],data[sample-2],data[sample-1],data[sample] - mulps xmm0, xmm2 ; xmm0 = xmm0 * xmm2 - addps xmm5, xmm0 ; xmm5 += xmm0 * xmm2 - dec edx - jz .loop_end - ALIGN 16 -.loop_start: - ; start by reading the next sample - movss xmm0, [eax] ; xmm0 = 0,0,0,data[sample] - add eax, 4 - shufps xmm0, xmm0, 0 ; xmm0 = data[sample],data[sample],data[sample],data[sample] - shufps xmm2, xmm2, 93h ; 93h=2-1-0-3 => xmm2 gets rotated left by one float - movss xmm2, xmm0 - mulps xmm0, xmm2 ; xmm0 = xmm0 * xmm2 - addps xmm5, xmm0 ; xmm5 += xmm0 * xmm2 - dec edx - jnz .loop_start -.loop_end: - ; store autoc - mov edx, [esp + 16] ; edx == autoc - movups [edx], xmm5 - -.end: - ret - - ALIGN 16 -cident FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_8 - ;[esp + 16] == autoc[] - ;[esp + 12] == lag - ;[esp + 8] == data_len - ;[esp + 4] == data[] - - ;ASSERT(lag > 0) - ;ASSERT(lag <= 8) - ;ASSERT(lag <= data_len) - - ; for(coeff = 0; coeff < lag; coeff++) - ; autoc[coeff] = 0.0; - xorps xmm5, xmm5 - xorps xmm6, xmm6 - - mov edx, [esp + 8] ; edx == data_len - mov eax, [esp + 4] ; eax == &data[sample] <- &data[0] - - movss xmm0, [eax] ; xmm0 = 0,0,0,data[0] - add eax, 4 - movaps xmm2, xmm0 ; xmm2 = 0,0,0,data[0] - shufps xmm0, xmm0, 0 ; xmm0 == data[sample],data[sample],data[sample],data[sample] = data[0],data[0],data[0],data[0] - movaps xmm1, xmm0 ; xmm1 == data[sample],data[sample],data[sample],data[sample] = data[0],data[0],data[0],data[0] - xorps xmm3, xmm3 ; xmm3 = 0,0,0,0 -.warmup: ; xmm3:xmm2 == data[sample-7],data[sample-6],...,data[sample] - mulps xmm0, xmm2 - mulps xmm1, xmm3 ; xmm1:xmm0 = xmm1:xmm0 * xmm3:xmm2 - addps xmm5, xmm0 - addps xmm6, xmm1 ; xmm6:xmm5 += xmm1:xmm0 * xmm3:xmm2 - dec edx - jz .loop_end - ALIGN 16 -.loop_start: - ; start by reading the next sample - movss xmm0, [eax] ; xmm0 = 0,0,0,data[sample] - ; here we reorder the instructions; see the (#) indexes for a logical order - shufps xmm2, xmm2, 93h ; (3) 93h=2-1-0-3 => xmm2 gets rotated left by one float - add eax, 4 ; (0) - shufps xmm3, xmm3, 93h ; (4) 93h=2-1-0-3 => xmm3 gets rotated left by one float - shufps xmm0, xmm0, 0 ; (1) xmm0 = data[sample],data[sample],data[sample],data[sample] - movss xmm3, xmm2 ; (5) - movaps xmm1, xmm0 ; (2) xmm1 = data[sample],data[sample],data[sample],data[sample] - movss xmm2, xmm0 ; (6) - mulps xmm1, xmm3 ; (8) - mulps xmm0, xmm2 ; (7) xmm1:xmm0 = xmm1:xmm0 * xmm3:xmm2 - addps xmm6, xmm1 ; (10) - addps xmm5, xmm0 ; (9) xmm6:xmm5 += xmm1:xmm0 * xmm3:xmm2 - dec edx - jnz .loop_start -.loop_end: - ; store autoc - mov edx, [esp + 16] ; edx == autoc - movups [edx], xmm5 - movups [edx + 16], xmm6 - -.end: - ret - - ALIGN 16 -cident FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_12 - ;[esp + 16] == autoc[] - ;[esp + 12] == lag - ;[esp + 8] == data_len - ;[esp + 4] == data[] - - ;ASSERT(lag > 0) - ;ASSERT(lag <= 12) - ;ASSERT(lag <= data_len) - - ; for(coeff = 0; coeff < lag; coeff++) - ; autoc[coeff] = 0.0; - xorps xmm5, xmm5 - xorps xmm6, xmm6 - xorps xmm7, xmm7 - - mov edx, [esp + 8] ; edx == data_len - mov eax, [esp + 4] ; eax == &data[sample] <- &data[0] - - movss xmm0, [eax] ; xmm0 = 0,0,0,data[0] - add eax, 4 - movaps xmm2, xmm0 ; xmm2 = 0,0,0,data[0] - shufps xmm0, xmm0, 0 ; xmm0 == data[sample],data[sample],data[sample],data[sample] = data[0],data[0],data[0],data[0] - xorps xmm3, xmm3 ; xmm3 = 0,0,0,0 - xorps xmm4, xmm4 ; xmm4 = 0,0,0,0 -.warmup: ; xmm3:xmm2 == data[sample-7],data[sample-6],...,data[sample] - movaps xmm1, xmm0 - mulps xmm1, xmm2 - addps xmm5, xmm1 - movaps xmm1, xmm0 - mulps xmm1, xmm3 - addps xmm6, xmm1 - mulps xmm0, xmm4 - addps xmm7, xmm0 ; xmm7:xmm6:xmm5 += xmm0:xmm0:xmm0 * xmm4:xmm3:xmm2 - dec edx - jz .loop_end - ALIGN 16 -.loop_start: - ; start by reading the next sample - movss xmm0, [eax] ; xmm0 = 0,0,0,data[sample] - add eax, 4 - shufps xmm0, xmm0, 0 ; xmm0 = data[sample],data[sample],data[sample],data[sample] - - ; shift xmm4:xmm3:xmm2 left by one float - shufps xmm2, xmm2, 93h ; 93h=2-1-0-3 => xmm2 gets rotated left by one float - shufps xmm3, xmm3, 93h ; 93h=2-1-0-3 => xmm3 gets rotated left by one float - shufps xmm4, xmm4, 93h ; 93h=2-1-0-3 => xmm4 gets rotated left by one float - movss xmm4, xmm3 - movss xmm3, xmm2 - movss xmm2, xmm0 - - ; xmm7:xmm6:xmm5 += xmm0:xmm0:xmm0 * xmm3:xmm3:xmm2 - movaps xmm1, xmm0 - mulps xmm1, xmm2 - addps xmm5, xmm1 - movaps xmm1, xmm0 - mulps xmm1, xmm3 - addps xmm6, xmm1 - mulps xmm0, xmm4 - addps xmm7, xmm0 - - dec edx - jnz .loop_start -.loop_end: - ; store autoc - mov edx, [esp + 16] ; edx == autoc - movups [edx], xmm5 - movups [edx + 16], xmm6 - movups [edx + 32], xmm7 - -.end: - ret - - ALIGN 16 -cident FLAC__lpc_compute_autocorrelation_asm_ia32_3dnow - ;[ebp + 32] autoc - ;[ebp + 28] lag - ;[ebp + 24] data_len - ;[ebp + 20] data - - push ebp - push ebx - push esi - push edi - mov ebp, esp - - mov esi, [ebp + 20] - mov edi, [ebp + 24] - mov edx, [ebp + 28] - inc edx - and edx, byte -2 - mov eax, edx - neg eax - and esp, byte -8 - lea esp, [esp + 4 * eax] - mov ecx, edx - xor eax, eax -.loop0: - dec ecx - mov [esp + 4 * ecx], eax - jnz short .loop0 - - mov eax, edi - sub eax, edx - mov ebx, edx - and ebx, byte 1 - sub eax, ebx - lea ecx, [esi + 4 * eax - 12] - cmp esi, ecx - mov eax, esi - ja short .loop2_pre - ALIGN 16 ;4 nops -.loop1_i: - movd mm0, [eax] - movd mm2, [eax + 4] - movd mm4, [eax + 8] - movd mm6, [eax + 12] - mov ebx, edx - punpckldq mm0, mm0 - punpckldq mm2, mm2 - punpckldq mm4, mm4 - punpckldq mm6, mm6 - ALIGN 16 ;3 nops -.loop1_j: - sub ebx, byte 2 - movd mm1, [eax + 4 * ebx] - movd mm3, [eax + 4 * ebx + 4] - movd mm5, [eax + 4 * ebx + 8] - movd mm7, [eax + 4 * ebx + 12] - punpckldq mm1, mm3 - punpckldq mm3, mm5 - pfmul mm1, mm0 - punpckldq mm5, mm7 - pfmul mm3, mm2 - punpckldq mm7, [eax + 4 * ebx + 16] - pfmul mm5, mm4 - pfmul mm7, mm6 - pfadd mm1, mm3 - movq mm3, [esp + 4 * ebx] - pfadd mm5, mm7 - pfadd mm1, mm5 - pfadd mm3, mm1 - movq [esp + 4 * ebx], mm3 - jg short .loop1_j - - add eax, byte 16 - cmp eax, ecx - jb short .loop1_i - -.loop2_pre: - mov ebx, eax - sub eax, esi - shr eax, 2 - lea ecx, [esi + 4 * edi] - mov esi, ebx -.loop2_i: - movd mm0, [esi] - mov ebx, edi - sub ebx, eax - cmp ebx, edx - jbe short .loop2_j - mov ebx, edx -.loop2_j: - dec ebx - movd mm1, [esi + 4 * ebx] - pfmul mm1, mm0 - movd mm2, [esp + 4 * ebx] - pfadd mm1, mm2 - movd [esp + 4 * ebx], mm1 - - jnz short .loop2_j - - add esi, byte 4 - inc eax - cmp esi, ecx - jnz short .loop2_i - - mov edi, [ebp + 32] - mov edx, [ebp + 28] -.loop3: - dec edx - mov eax, [esp + 4 * edx] - mov [edi + 4 * edx], eax - jnz short .loop3 - - femms - - mov esp, ebp - pop edi - pop esi - pop ebx - pop ebp - ret - -;void FLAC__lpc_compute_residual_from_qlp_coefficients(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]) -; -; for(i = 0; i < data_len; i++) { -; sum = 0; -; for(j = 0; j < order; j++) -; sum += qlp_coeff[j] * data[i-j-1]; -; residual[i] = data[i] - (sum >> lp_quantization); -; } -; - ALIGN 16 -cident FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32 - ;[esp + 40] residual[] - ;[esp + 36] lp_quantization - ;[esp + 32] order - ;[esp + 28] qlp_coeff[] - ;[esp + 24] data_len - ;[esp + 20] data[] - - ;ASSERT(order > 0) - - push ebp - push ebx - push esi - push edi - - mov esi, [esp + 20] ; esi = data[] - mov edi, [esp + 40] ; edi = residual[] - mov eax, [esp + 32] ; eax = order - mov ebx, [esp + 24] ; ebx = data_len - - test ebx, ebx - jz near .end ; do nothing if data_len == 0 -.begin: - cmp eax, byte 1 - jg short .i_1more - - mov ecx, [esp + 28] - mov edx, [ecx] ; edx = qlp_coeff[0] - mov eax, [esi - 4] ; eax = data[-1] - mov cl, [esp + 36] ; cl = lp_quantization - ALIGN 16 -.i_1_loop_i: - imul eax, edx - sar eax, cl - neg eax - add eax, [esi] - mov [edi], eax - mov eax, [esi] - add edi, byte 4 - add esi, byte 4 - dec ebx - jnz .i_1_loop_i - - jmp .end - -.i_1more: - cmp eax, byte 32 ; for order <= 32 there is a faster routine - jbe short .i_32 - - ; This version is here just for completeness, since FLAC__MAX_LPC_ORDER == 32 - ALIGN 16 -.i_32more_loop_i: - xor ebp, ebp - mov ecx, [esp + 32] - mov edx, ecx - shl edx, 2 - add edx, [esp + 28] - neg ecx - ALIGN 16 -.i_32more_loop_j: - sub edx, byte 4 - mov eax, [edx] - imul eax, [esi + 4 * ecx] - add ebp, eax - inc ecx - jnz short .i_32more_loop_j - - mov cl, [esp + 36] - sar ebp, cl - neg ebp - add ebp, [esi] - mov [edi], ebp - add esi, byte 4 - add edi, byte 4 - - dec ebx - jnz .i_32more_loop_i - - jmp .end - -.i_32: - sub edi, esi - neg eax - lea edx, [eax + eax * 8 + .jumper_0 - .get_eip0] - call .get_eip0 -.get_eip0: - pop eax - add edx, eax - inc edx - mov eax, [esp + 28] ; eax = qlp_coeff[] - xor ebp, ebp - jmp edx - - mov ecx, [eax + 124] - imul ecx, [esi - 128] - add ebp, ecx - mov ecx, [eax + 120] - imul ecx, [esi - 124] - add ebp, ecx - mov ecx, [eax + 116] - imul ecx, [esi - 120] - add ebp, ecx - mov ecx, [eax + 112] - imul ecx, [esi - 116] - add ebp, ecx - mov ecx, [eax + 108] - imul ecx, [esi - 112] - add ebp, ecx - mov ecx, [eax + 104] - imul ecx, [esi - 108] - add ebp, ecx - mov ecx, [eax + 100] - imul ecx, [esi - 104] - add ebp, ecx - mov ecx, [eax + 96] - imul ecx, [esi - 100] - add ebp, ecx - mov ecx, [eax + 92] - imul ecx, [esi - 96] - add ebp, ecx - mov ecx, [eax + 88] - imul ecx, [esi - 92] - add ebp, ecx - mov ecx, [eax + 84] - imul ecx, [esi - 88] - add ebp, ecx - mov ecx, [eax + 80] - imul ecx, [esi - 84] - add ebp, ecx - mov ecx, [eax + 76] - imul ecx, [esi - 80] - add ebp, ecx - mov ecx, [eax + 72] - imul ecx, [esi - 76] - add ebp, ecx - mov ecx, [eax + 68] - imul ecx, [esi - 72] - add ebp, ecx - mov ecx, [eax + 64] - imul ecx, [esi - 68] - add ebp, ecx - mov ecx, [eax + 60] - imul ecx, [esi - 64] - add ebp, ecx - mov ecx, [eax + 56] - imul ecx, [esi - 60] - add ebp, ecx - mov ecx, [eax + 52] - imul ecx, [esi - 56] - add ebp, ecx - mov ecx, [eax + 48] - imul ecx, [esi - 52] - add ebp, ecx - mov ecx, [eax + 44] - imul ecx, [esi - 48] - add ebp, ecx - mov ecx, [eax + 40] - imul ecx, [esi - 44] - add ebp, ecx - mov ecx, [eax + 36] - imul ecx, [esi - 40] - add ebp, ecx - mov ecx, [eax + 32] - imul ecx, [esi - 36] - add ebp, ecx - mov ecx, [eax + 28] - imul ecx, [esi - 32] - add ebp, ecx - mov ecx, [eax + 24] - imul ecx, [esi - 28] - add ebp, ecx - mov ecx, [eax + 20] - imul ecx, [esi - 24] - add ebp, ecx - mov ecx, [eax + 16] - imul ecx, [esi - 20] - add ebp, ecx - mov ecx, [eax + 12] - imul ecx, [esi - 16] - add ebp, ecx - mov ecx, [eax + 8] - imul ecx, [esi - 12] - add ebp, ecx - mov ecx, [eax + 4] - imul ecx, [esi - 8] - add ebp, ecx - mov ecx, [eax] ; there is one byte missing - imul ecx, [esi - 4] - add ebp, ecx -.jumper_0: - - mov cl, [esp + 36] - sar ebp, cl - neg ebp - add ebp, [esi] - mov [edi + esi], ebp - add esi, byte 4 - - dec ebx - jz short .end - xor ebp, ebp - jmp edx - -.end: - pop edi - pop esi - pop ebx - pop ebp - ret - -; WATCHOUT: this routine works on 16 bit data which means bits-per-sample for -; the channel and qlp_coeffs must be <= 16. Especially note that this routine -; cannot be used for side-channel coded 16bps channels since the effective bps -; is 17. - ALIGN 16 -cident FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32_mmx - ;[esp + 40] residual[] - ;[esp + 36] lp_quantization - ;[esp + 32] order - ;[esp + 28] qlp_coeff[] - ;[esp + 24] data_len - ;[esp + 20] data[] - - ;ASSERT(order > 0) - - push ebp - push ebx - push esi - push edi - - mov esi, [esp + 20] ; esi = data[] - mov edi, [esp + 40] ; edi = residual[] - mov eax, [esp + 32] ; eax = order - mov ebx, [esp + 24] ; ebx = data_len - - test ebx, ebx - jz near .end ; do nothing if data_len == 0 - dec ebx - test ebx, ebx - jz near .last_one - - mov edx, [esp + 28] ; edx = qlp_coeff[] - movd mm6, [esp + 36] ; mm6 = 0:lp_quantization - mov ebp, esp - - and esp, 0xfffffff8 - - xor ecx, ecx -.copy_qlp_loop: - push word [edx + 4 * ecx] - inc ecx - cmp ecx, eax - jnz short .copy_qlp_loop - - and ecx, 0x3 - test ecx, ecx - je short .za_end - sub ecx, byte 4 -.za_loop: - push word 0 - inc eax - inc ecx - jnz short .za_loop -.za_end: - - movq mm5, [esp + 2 * eax - 8] - movd mm4, [esi - 16] - punpckldq mm4, [esi - 12] - movd mm0, [esi - 8] - punpckldq mm0, [esi - 4] - packssdw mm4, mm0 - - cmp eax, byte 4 - jnbe short .mmx_4more - - ALIGN 16 -.mmx_4_loop_i: - movd mm1, [esi] - movq mm3, mm4 - punpckldq mm1, [esi + 4] - psrlq mm4, 16 - movq mm0, mm1 - psllq mm0, 48 - por mm4, mm0 - movq mm2, mm4 - psrlq mm4, 16 - pxor mm0, mm0 - punpckhdq mm0, mm1 - pmaddwd mm3, mm5 - pmaddwd mm2, mm5 - psllq mm0, 16 - por mm4, mm0 - movq mm0, mm3 - punpckldq mm3, mm2 - punpckhdq mm0, mm2 - paddd mm3, mm0 - psrad mm3, mm6 - psubd mm1, mm3 - movd [edi], mm1 - punpckhdq mm1, mm1 - movd [edi + 4], mm1 - - add edi, byte 8 - add esi, byte 8 - - sub ebx, 2 - jg .mmx_4_loop_i - jmp .mmx_end - -.mmx_4more: - shl eax, 2 - neg eax - add eax, byte 16 - - ALIGN 16 -.mmx_4more_loop_i: - movd mm1, [esi] - punpckldq mm1, [esi + 4] - movq mm3, mm4 - psrlq mm4, 16 - movq mm0, mm1 - psllq mm0, 48 - por mm4, mm0 - movq mm2, mm4 - psrlq mm4, 16 - pxor mm0, mm0 - punpckhdq mm0, mm1 - pmaddwd mm3, mm5 - pmaddwd mm2, mm5 - psllq mm0, 16 - por mm4, mm0 - - mov ecx, esi - add ecx, eax - mov edx, esp - - ALIGN 16 -.mmx_4more_loop_j: - movd mm0, [ecx - 16] - movd mm7, [ecx - 8] - punpckldq mm0, [ecx - 12] - punpckldq mm7, [ecx - 4] - packssdw mm0, mm7 - pmaddwd mm0, [edx] - punpckhdq mm7, mm7 - paddd mm3, mm0 - movd mm0, [ecx - 12] - punpckldq mm0, [ecx - 8] - punpckldq mm7, [ecx] - packssdw mm0, mm7 - pmaddwd mm0, [edx] - paddd mm2, mm0 - - add edx, byte 8 - add ecx, byte 16 - cmp ecx, esi - jnz .mmx_4more_loop_j - - movq mm0, mm3 - punpckldq mm3, mm2 - punpckhdq mm0, mm2 - paddd mm3, mm0 - psrad mm3, mm6 - psubd mm1, mm3 - movd [edi], mm1 - punpckhdq mm1, mm1 - movd [edi + 4], mm1 - - add edi, byte 8 - add esi, byte 8 - - sub ebx, 2 - jg near .mmx_4more_loop_i - -.mmx_end: - emms - mov esp, ebp -.last_one: - mov eax, [esp + 32] - inc ebx - jnz near FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32.begin - -.end: - pop edi - pop esi - pop ebx - pop ebp - ret - -; ********************************************************************** -; -; void FLAC__lpc_restore_signal(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]) -; { -; unsigned i, j; -; FLAC__int32 sum; -; -; FLAC__ASSERT(order > 0); -; -; for(i = 0; i < data_len; i++) { -; sum = 0; -; for(j = 0; j < order; j++) -; sum += qlp_coeff[j] * data[i-j-1]; -; data[i] = residual[i] + (sum >> lp_quantization); -; } -; } - ALIGN 16 -cident FLAC__lpc_restore_signal_asm_ia32 - ;[esp + 40] data[] - ;[esp + 36] lp_quantization - ;[esp + 32] order - ;[esp + 28] qlp_coeff[] - ;[esp + 24] data_len - ;[esp + 20] residual[] - - ;ASSERT(order > 0) - - push ebp - push ebx - push esi - push edi - - mov esi, [esp + 20] ; esi = residual[] - mov edi, [esp + 40] ; edi = data[] - mov eax, [esp + 32] ; eax = order - mov ebx, [esp + 24] ; ebx = data_len - - test ebx, ebx - jz near .end ; do nothing if data_len == 0 - -.begin: - cmp eax, byte 1 - jg short .x87_1more - - mov ecx, [esp + 28] - mov edx, [ecx] - mov eax, [edi - 4] - mov cl, [esp + 36] - ALIGN 16 -.x87_1_loop_i: - imul eax, edx - sar eax, cl - add eax, [esi] - mov [edi], eax - add esi, byte 4 - add edi, byte 4 - dec ebx - jnz .x87_1_loop_i - - jmp .end - -.x87_1more: - cmp eax, byte 32 ; for order <= 32 there is a faster routine - jbe short .x87_32 - - ; This version is here just for completeness, since FLAC__MAX_LPC_ORDER == 32 - ALIGN 16 -.x87_32more_loop_i: - xor ebp, ebp - mov ecx, [esp + 32] - mov edx, ecx - shl edx, 2 - add edx, [esp + 28] - neg ecx - ALIGN 16 -.x87_32more_loop_j: - sub edx, byte 4 - mov eax, [edx] - imul eax, [edi + 4 * ecx] - add ebp, eax - inc ecx - jnz short .x87_32more_loop_j - - mov cl, [esp + 36] - sar ebp, cl - add ebp, [esi] - mov [edi], ebp - add edi, byte 4 - add esi, byte 4 - - dec ebx - jnz .x87_32more_loop_i - - jmp .end - -.x87_32: - sub esi, edi - neg eax - lea edx, [eax + eax * 8 + .jumper_0 - .get_eip0] - call .get_eip0 -.get_eip0: - pop eax - add edx, eax - inc edx ; compensate for the shorter opcode on the last iteration - mov eax, [esp + 28] ; eax = qlp_coeff[] - xor ebp, ebp - jmp edx - - mov ecx, [eax + 124] ; ecx = qlp_coeff[31] - imul ecx, [edi - 128] ; ecx = qlp_coeff[31] * data[i-32] - add ebp, ecx ; sum += qlp_coeff[31] * data[i-32] - mov ecx, [eax + 120] ; ecx = qlp_coeff[30] - imul ecx, [edi - 124] ; ecx = qlp_coeff[30] * data[i-31] - add ebp, ecx ; sum += qlp_coeff[30] * data[i-31] - mov ecx, [eax + 116] ; ecx = qlp_coeff[29] - imul ecx, [edi - 120] ; ecx = qlp_coeff[29] * data[i-30] - add ebp, ecx ; sum += qlp_coeff[29] * data[i-30] - mov ecx, [eax + 112] ; ecx = qlp_coeff[28] - imul ecx, [edi - 116] ; ecx = qlp_coeff[28] * data[i-29] - add ebp, ecx ; sum += qlp_coeff[28] * data[i-29] - mov ecx, [eax + 108] ; ecx = qlp_coeff[27] - imul ecx, [edi - 112] ; ecx = qlp_coeff[27] * data[i-28] - add ebp, ecx ; sum += qlp_coeff[27] * data[i-28] - mov ecx, [eax + 104] ; ecx = qlp_coeff[26] - imul ecx, [edi - 108] ; ecx = qlp_coeff[26] * data[i-27] - add ebp, ecx ; sum += qlp_coeff[26] * data[i-27] - mov ecx, [eax + 100] ; ecx = qlp_coeff[25] - imul ecx, [edi - 104] ; ecx = qlp_coeff[25] * data[i-26] - add ebp, ecx ; sum += qlp_coeff[25] * data[i-26] - mov ecx, [eax + 96] ; ecx = qlp_coeff[24] - imul ecx, [edi - 100] ; ecx = qlp_coeff[24] * data[i-25] - add ebp, ecx ; sum += qlp_coeff[24] * data[i-25] - mov ecx, [eax + 92] ; ecx = qlp_coeff[23] - imul ecx, [edi - 96] ; ecx = qlp_coeff[23] * data[i-24] - add ebp, ecx ; sum += qlp_coeff[23] * data[i-24] - mov ecx, [eax + 88] ; ecx = qlp_coeff[22] - imul ecx, [edi - 92] ; ecx = qlp_coeff[22] * data[i-23] - add ebp, ecx ; sum += qlp_coeff[22] * data[i-23] - mov ecx, [eax + 84] ; ecx = qlp_coeff[21] - imul ecx, [edi - 88] ; ecx = qlp_coeff[21] * data[i-22] - add ebp, ecx ; sum += qlp_coeff[21] * data[i-22] - mov ecx, [eax + 80] ; ecx = qlp_coeff[20] - imul ecx, [edi - 84] ; ecx = qlp_coeff[20] * data[i-21] - add ebp, ecx ; sum += qlp_coeff[20] * data[i-21] - mov ecx, [eax + 76] ; ecx = qlp_coeff[19] - imul ecx, [edi - 80] ; ecx = qlp_coeff[19] * data[i-20] - add ebp, ecx ; sum += qlp_coeff[19] * data[i-20] - mov ecx, [eax + 72] ; ecx = qlp_coeff[18] - imul ecx, [edi - 76] ; ecx = qlp_coeff[18] * data[i-19] - add ebp, ecx ; sum += qlp_coeff[18] * data[i-19] - mov ecx, [eax + 68] ; ecx = qlp_coeff[17] - imul ecx, [edi - 72] ; ecx = qlp_coeff[17] * data[i-18] - add ebp, ecx ; sum += qlp_coeff[17] * data[i-18] - mov ecx, [eax + 64] ; ecx = qlp_coeff[16] - imul ecx, [edi - 68] ; ecx = qlp_coeff[16] * data[i-17] - add ebp, ecx ; sum += qlp_coeff[16] * data[i-17] - mov ecx, [eax + 60] ; ecx = qlp_coeff[15] - imul ecx, [edi - 64] ; ecx = qlp_coeff[15] * data[i-16] - add ebp, ecx ; sum += qlp_coeff[15] * data[i-16] - mov ecx, [eax + 56] ; ecx = qlp_coeff[14] - imul ecx, [edi - 60] ; ecx = qlp_coeff[14] * data[i-15] - add ebp, ecx ; sum += qlp_coeff[14] * data[i-15] - mov ecx, [eax + 52] ; ecx = qlp_coeff[13] - imul ecx, [edi - 56] ; ecx = qlp_coeff[13] * data[i-14] - add ebp, ecx ; sum += qlp_coeff[13] * data[i-14] - mov ecx, [eax + 48] ; ecx = qlp_coeff[12] - imul ecx, [edi - 52] ; ecx = qlp_coeff[12] * data[i-13] - add ebp, ecx ; sum += qlp_coeff[12] * data[i-13] - mov ecx, [eax + 44] ; ecx = qlp_coeff[11] - imul ecx, [edi - 48] ; ecx = qlp_coeff[11] * data[i-12] - add ebp, ecx ; sum += qlp_coeff[11] * data[i-12] - mov ecx, [eax + 40] ; ecx = qlp_coeff[10] - imul ecx, [edi - 44] ; ecx = qlp_coeff[10] * data[i-11] - add ebp, ecx ; sum += qlp_coeff[10] * data[i-11] - mov ecx, [eax + 36] ; ecx = qlp_coeff[ 9] - imul ecx, [edi - 40] ; ecx = qlp_coeff[ 9] * data[i-10] - add ebp, ecx ; sum += qlp_coeff[ 9] * data[i-10] - mov ecx, [eax + 32] ; ecx = qlp_coeff[ 8] - imul ecx, [edi - 36] ; ecx = qlp_coeff[ 8] * data[i- 9] - add ebp, ecx ; sum += qlp_coeff[ 8] * data[i- 9] - mov ecx, [eax + 28] ; ecx = qlp_coeff[ 7] - imul ecx, [edi - 32] ; ecx = qlp_coeff[ 7] * data[i- 8] - add ebp, ecx ; sum += qlp_coeff[ 7] * data[i- 8] - mov ecx, [eax + 24] ; ecx = qlp_coeff[ 6] - imul ecx, [edi - 28] ; ecx = qlp_coeff[ 6] * data[i- 7] - add ebp, ecx ; sum += qlp_coeff[ 6] * data[i- 7] - mov ecx, [eax + 20] ; ecx = qlp_coeff[ 5] - imul ecx, [edi - 24] ; ecx = qlp_coeff[ 5] * data[i- 6] - add ebp, ecx ; sum += qlp_coeff[ 5] * data[i- 6] - mov ecx, [eax + 16] ; ecx = qlp_coeff[ 4] - imul ecx, [edi - 20] ; ecx = qlp_coeff[ 4] * data[i- 5] - add ebp, ecx ; sum += qlp_coeff[ 4] * data[i- 5] - mov ecx, [eax + 12] ; ecx = qlp_coeff[ 3] - imul ecx, [edi - 16] ; ecx = qlp_coeff[ 3] * data[i- 4] - add ebp, ecx ; sum += qlp_coeff[ 3] * data[i- 4] - mov ecx, [eax + 8] ; ecx = qlp_coeff[ 2] - imul ecx, [edi - 12] ; ecx = qlp_coeff[ 2] * data[i- 3] - add ebp, ecx ; sum += qlp_coeff[ 2] * data[i- 3] - mov ecx, [eax + 4] ; ecx = qlp_coeff[ 1] - imul ecx, [edi - 8] ; ecx = qlp_coeff[ 1] * data[i- 2] - add ebp, ecx ; sum += qlp_coeff[ 1] * data[i- 2] - mov ecx, [eax] ; ecx = qlp_coeff[ 0] (NOTE: one byte missing from instruction) - imul ecx, [edi - 4] ; ecx = qlp_coeff[ 0] * data[i- 1] - add ebp, ecx ; sum += qlp_coeff[ 0] * data[i- 1] -.jumper_0: - - mov cl, [esp + 36] - sar ebp, cl ; ebp = (sum >> lp_quantization) - add ebp, [esi + edi] ; ebp = residual[i] + (sum >> lp_quantization) - mov [edi], ebp ; data[i] = residual[i] + (sum >> lp_quantization) - add edi, byte 4 - - dec ebx - jz short .end - xor ebp, ebp - jmp edx - -.end: - pop edi - pop esi - pop ebx - pop ebp - ret - -; WATCHOUT: this routine works on 16 bit data which means bits-per-sample for -; the channel and qlp_coeffs must be <= 16. Especially note that this routine -; cannot be used for side-channel coded 16bps channels since the effective bps -; is 17. -; WATCHOUT: this routine requires that each data array have a buffer of up to -; 3 zeroes in front (at negative indices) for alignment purposes, i.e. for each -; channel n, data[n][-1] through data[n][-3] should be accessible and zero. - ALIGN 16 -cident FLAC__lpc_restore_signal_asm_ia32_mmx - ;[esp + 40] data[] - ;[esp + 36] lp_quantization - ;[esp + 32] order - ;[esp + 28] qlp_coeff[] - ;[esp + 24] data_len - ;[esp + 20] residual[] - - ;ASSERT(order > 0) - - push ebp - push ebx - push esi - push edi - - mov esi, [esp + 20] - mov edi, [esp + 40] - mov eax, [esp + 32] - mov ebx, [esp + 24] - - test ebx, ebx - jz near .end ; do nothing if data_len == 0 - cmp eax, byte 4 - jb near FLAC__lpc_restore_signal_asm_ia32.begin - - mov edx, [esp + 28] - movd mm6, [esp + 36] - mov ebp, esp - - and esp, 0xfffffff8 - - xor ecx, ecx -.copy_qlp_loop: - push word [edx + 4 * ecx] - inc ecx - cmp ecx, eax - jnz short .copy_qlp_loop - - and ecx, 0x3 - test ecx, ecx - je short .za_end - sub ecx, byte 4 -.za_loop: - push word 0 - inc eax - inc ecx - jnz short .za_loop -.za_end: - - movq mm5, [esp + 2 * eax - 8] - movd mm4, [edi - 16] - punpckldq mm4, [edi - 12] - movd mm0, [edi - 8] - punpckldq mm0, [edi - 4] - packssdw mm4, mm0 - - cmp eax, byte 4 - jnbe short .mmx_4more - - ALIGN 16 -.mmx_4_loop_i: - movq mm7, mm4 - pmaddwd mm7, mm5 - movq mm0, mm7 - punpckhdq mm7, mm7 - paddd mm7, mm0 - psrad mm7, mm6 - movd mm1, [esi] - paddd mm7, mm1 - movd [edi], mm7 - psllq mm7, 48 - psrlq mm4, 16 - por mm4, mm7 - - add esi, byte 4 - add edi, byte 4 - - dec ebx - jnz .mmx_4_loop_i - jmp .mmx_end -.mmx_4more: - shl eax, 2 - neg eax - add eax, byte 16 - ALIGN 16 -.mmx_4more_loop_i: - mov ecx, edi - add ecx, eax - mov edx, esp - - movq mm7, mm4 - pmaddwd mm7, mm5 - - ALIGN 16 -.mmx_4more_loop_j: - movd mm0, [ecx - 16] - punpckldq mm0, [ecx - 12] - movd mm1, [ecx - 8] - punpckldq mm1, [ecx - 4] - packssdw mm0, mm1 - pmaddwd mm0, [edx] - paddd mm7, mm0 - - add edx, byte 8 - add ecx, byte 16 - cmp ecx, edi - jnz .mmx_4more_loop_j - - movq mm0, mm7 - punpckhdq mm7, mm7 - paddd mm7, mm0 - psrad mm7, mm6 - movd mm1, [esi] - paddd mm7, mm1 - movd [edi], mm7 - psllq mm7, 48 - psrlq mm4, 16 - por mm4, mm7 - - add esi, byte 4 - add edi, byte 4 - - dec ebx - jnz short .mmx_4more_loop_i -.mmx_end: - emms - mov esp, ebp - -.end: - pop edi - pop esi - pop ebx - pop ebp - ret - -end - -%ifdef OBJ_FORMAT_elf - section .note.GNU-stack noalloc -%endif diff --git a/3rdparty/libflac/src/libFLAC/ia32/nasm.h b/3rdparty/libflac/src/libFLAC/ia32/nasm.h deleted file mode 100644 index 215498d811e..00000000000 --- a/3rdparty/libflac/src/libFLAC/ia32/nasm.h +++ /dev/null @@ -1,75 +0,0 @@ -; libFLAC - Free Lossless Audio Codec library -; Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions -; are met: -; -; - Redistributions of source code must retain the above copyright -; notice, this list of conditions and the following disclaimer. -; -; - Redistributions in binary form must reproduce the above copyright -; notice, this list of conditions and the following disclaimer in the -; documentation and/or other materials provided with the distribution. -; -; - Neither the name of the Xiph.org Foundation nor the names of its -; contributors may be used to endorse or promote products derived from -; this software without specific prior written permission. -; -; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -; ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - bits 32 - -%ifdef OBJ_FORMAT_win32 - %define FLAC__PUBLIC_NEEDS_UNDERSCORE - %idefine code_section section .text align=16 class=CODE use32 - %idefine data_section section .data align=32 class=DATA use32 - %idefine bss_section section .bss align=32 class=DATA use32 -%elifdef OBJ_FORMAT_aout - %define FLAC__PUBLIC_NEEDS_UNDERSCORE - %idefine code_section section .text - %idefine data_section section .data - %idefine bss_section section .bss -%elifdef OBJ_FORMAT_aoutb - %define FLAC__PUBLIC_NEEDS_UNDERSCORE - %idefine code_section section .text - %idefine data_section section .data - %idefine bss_section section .bss -%elifdef OBJ_FORMAT_elf - %idefine code_section section .text align=16 - %idefine data_section section .data align=32 - %idefine bss_section section .bss align=32 -%else - %error unsupported object format! -%endif - -%imacro cglobal 1 - %ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE - global _%1 - %else - global %1 - %endif -%endmacro - -%imacro cextern 1 - %ifdef FLAC__PUBLIC_NEEDS_UNDERSCORE - extern _%1 - %else - extern %1 - %endif -%endmacro - -%imacro cident 1 -_%1: -%1: -%endmacro diff --git a/3rdparty/libflac/src/libFLAC/ia32/stream_encoder_asm.nasm b/3rdparty/libflac/src/libFLAC/ia32/stream_encoder_asm.nasm deleted file mode 100644 index b7ecef8cd94..00000000000 --- a/3rdparty/libflac/src/libFLAC/ia32/stream_encoder_asm.nasm +++ /dev/null @@ -1,159 +0,0 @@ -; vim:filetype=nasm ts=8 - -; libFLAC - Free Lossless Audio Codec library -; Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions -; are met: -; -; - Redistributions of source code must retain the above copyright -; notice, this list of conditions and the following disclaimer. -; -; - Redistributions in binary form must reproduce the above copyright -; notice, this list of conditions and the following disclaimer in the -; documentation and/or other materials provided with the distribution. -; -; - Neither the name of the Xiph.org Foundation nor the names of its -; contributors may be used to endorse or promote products derived from -; this software without specific prior written permission. -; -; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -; ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -%include "nasm.h" - - data_section - -cglobal precompute_partition_info_sums_32bit_asm_ia32_ - - code_section - - -; ********************************************************************** -; -; void FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter) -; void precompute_partition_info_sums_32bit_( -; const FLAC__int32 residual[], -; FLAC__uint64 abs_residual_partition_sums[], -; unsigned blocksize, -; unsigned predictor_order, -; unsigned min_partition_order, -; unsigned max_partition_order -; ) -; - ALIGN 16 -cident precompute_partition_info_sums_32bit_asm_ia32_ - - ;; peppered throughout the code at major checkpoints are keys like this as to where things are at that point in time - ;; [esp + 4] const FLAC__int32 residual[] - ;; [esp + 8] FLAC__uint64 abs_residual_partition_sums[] - ;; [esp + 12] unsigned blocksize - ;; [esp + 16] unsigned predictor_order - ;; [esp + 20] unsigned min_partition_order - ;; [esp + 24] unsigned max_partition_order - push ebp - push ebx - push esi - push edi - sub esp, 8 - ;; [esp + 28] const FLAC__int32 residual[] - ;; [esp + 32] FLAC__uint64 abs_residual_partition_sums[] - ;; [esp + 36] unsigned blocksize - ;; [esp + 40] unsigned predictor_order - ;; [esp + 44] unsigned min_partition_order - ;; [esp + 48] unsigned max_partition_order - ;; [esp] partitions - ;; [esp + 4] default_partition_samples - - mov ecx, [esp + 48] - mov eax, 1 - shl eax, cl - mov [esp], eax ; [esp] <- partitions = 1u << max_partition_order; - mov eax, [esp + 36] - shr eax, cl - mov [esp + 4], eax ; [esp + 4] <- default_partition_samples = blocksize >> max_partition_order; - - ; - ; first do max_partition_order - ; - mov edi, [esp + 4] - sub edi, [esp + 40] ; edi <- end = (unsigned)(-(int)predictor_order) + default_partition_samples - xor esi, esi ; esi <- residual_sample = 0 - xor ecx, ecx ; ecx <- partition = 0 - mov ebp, [esp + 28] ; ebp <- residual[] - xor ebx, ebx ; ebx <- abs_residual_partition_sum = 0; - ; note we put the updates to 'end' and 'abs_residual_partition_sum' at the end of loop0 and in the initialization above so we could align loop0 and loop1 - ALIGN 16 -.loop0: ; for(partition = residual_sample = 0; partition < partitions; partition++) { -.loop1: ; for( ; residual_sample < end; residual_sample++) - mov eax, [ebp + esi * 4] - cdq - xor eax, edx - sub eax, edx - add ebx, eax ; abs_residual_partition_sum += abs(residual[residual_sample]); - ;@@@@@@ check overflow flag and abort here? - add esi, byte 1 - cmp esi, edi ; /* since the loop will always run at least once, we can put the loop check down here */ - jb .loop1 -.next1: - add edi, [esp + 4] ; end += default_partition_samples; - mov eax, [esp + 32] - mov [eax + ecx * 8], ebx ; abs_residual_partition_sums[partition] = abs_residual_partition_sum; - mov [eax + ecx * 8 + 4], dword 0 - xor ebx, ebx ; abs_residual_partition_sum = 0; - add ecx, byte 1 - cmp ecx, [esp] ; /* since the loop will always run at least once, we can put the loop check down here */ - jb .loop0 -.next0: ; } - ; - ; now merge partitions for lower orders - ; - mov esi, [esp + 32] ; esi <- abs_residual_partition_sums[from_partition==0]; - mov eax, [esp] - lea edi, [esi + eax * 8] ; edi <- abs_residual_partition_sums[to_partition==partitions]; - mov ecx, [esp + 48] - sub ecx, byte 1 ; ecx <- partition_order = (int)max_partition_order - 1; - ALIGN 16 -.loop2: ; for(; partition_order >= (int)min_partition_order; partition_order--) { - cmp ecx, [esp + 44] - jl .next2 - mov edx, 1 - shl edx, cl ; const unsigned partitions = 1u << partition_order; - ALIGN 16 -.loop3: ; for(i = 0; i < partitions; i++) { - mov eax, [esi] - mov ebx, [esi + 4] - add eax, [esi + 8] - adc ebx, [esi + 12] - mov [edi], eax - mov [edi + 4], ebx ; a_r_p_s[to_partition] = a_r_p_s[from_partition] + a_r_p_s[from_partition+1]; - add esi, byte 16 - add edi, byte 8 - sub edx, byte 1 - jnz .loop3 ; } - sub ecx, byte 1 - jmp .loop2 ; } -.next2: - - add esp, 8 - pop edi - pop esi - pop ebx - pop ebp - ret - -end - -%ifdef OBJ_FORMAT_elf - section .note.GNU-stack noalloc -%endif diff --git a/3rdparty/libflac/src/libFLAC/include/Makefile.am b/3rdparty/libflac/src/libFLAC/include/Makefile.am deleted file mode 100644 index 866a8948e30..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -# libFLAC - Free Lossless Audio Codec library -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -SUBDIRS = private protected diff --git a/3rdparty/libflac/src/libFLAC/include/Makefile.in b/3rdparty/libflac/src/libFLAC/include/Makefile.in deleted file mode 100644 index ae91c1e7f83..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/Makefile.in +++ /dev/null @@ -1,533 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# libFLAC - Free Lossless Audio Codec library -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -SUBDIRS = private protected -subdir = src/libFLAC/include -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = - -RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ - ps-recursive install-info-recursive uninstall-info-recursive \ - all-recursive install-data-recursive install-exec-recursive \ - installdirs-recursive install-recursive uninstall-recursive \ - check-recursive installcheck-recursive -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -DIST_SUBDIRS = $(SUBDIRS) -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/libFLAC/include/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if (etags --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - else \ - include_option=--include; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: - -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags - -dvi: dvi-recursive - -dvi-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ - clean-generic clean-libtool clean-recursive ctags \ - ctags-recursive distclean distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am \ - dvi-recursive info info-am info-recursive install install-am \ - install-data install-data-am install-data-recursive \ - install-exec install-exec-am install-exec-recursive \ - install-info install-info-am install-info-recursive install-man \ - install-recursive install-strip installcheck installcheck-am \ - installdirs installdirs-am installdirs-recursive \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-libtool mostlyclean-recursive pdf pdf-am \ - pdf-recursive ps ps-am ps-recursive tags tags-recursive \ - uninstall uninstall-am uninstall-info-am \ - uninstall-info-recursive uninstall-recursive - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/libFLAC/include/config.h b/3rdparty/libflac/src/libFLAC/include/config.h deleted file mode 100644 index d9f49ff504b..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/config.h +++ /dev/null @@ -1 +0,0 @@ -#define VERSION "1.2.1"
\ No newline at end of file diff --git a/3rdparty/libflac/src/libFLAC/include/private/Makefile.am b/3rdparty/libflac/src/libFLAC/include/private/Makefile.am deleted file mode 100644 index e8abc582fcf..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -# libFLAC - Free Lossless Audio Codec library -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -noinst_HEADERS = \ - all.h \ - bitmath.h \ - bitreader.h \ - bitwriter.h \ - cpu.h \ - crc.h \ - fixed.h \ - float.h \ - format.h \ - lpc.h \ - md5.h \ - memory.h \ - metadata.h \ - ogg_decoder_aspect.h \ - ogg_encoder_aspect.h \ - ogg_helper.h \ - ogg_mapping.h \ - stream_encoder_framing.h \ - window.h diff --git a/3rdparty/libflac/src/libFLAC/include/private/Makefile.in b/3rdparty/libflac/src/libFLAC/include/private/Makefile.in deleted file mode 100644 index 456024205a7..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/Makefile.in +++ /dev/null @@ -1,455 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# libFLAC - Free Lossless Audio Codec library -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -noinst_HEADERS = \ - all.h \ - bitmath.h \ - bitreader.h \ - bitwriter.h \ - cpu.h \ - crc.h \ - fixed.h \ - float.h \ - format.h \ - lpc.h \ - md5.h \ - memory.h \ - metadata.h \ - ogg_decoder_aspect.h \ - ogg_encoder_aspect.h \ - ogg_helper.h \ - ogg_mapping.h \ - stream_encoder_framing.h \ - window.h - -subdir = src/libFLAC/include/private -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = -HEADERS = $(noinst_HEADERS) - -DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in Makefile.am -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/libFLAC/include/private/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(HEADERS) - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool ctags distclean distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am info \ - info-am install install-am install-data install-data-am \ - install-exec install-exec-am install-info install-info-am \ - install-man install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags uninstall uninstall-am uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/libFLAC/include/private/all.h b/3rdparty/libflac/src/libFLAC/include/private/all.h deleted file mode 100644 index 304c471a52a..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/all.h +++ /dev/null @@ -1,49 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PRIVATE__ALL_H -#define FLAC__PRIVATE__ALL_H - -#include "bitmath.h" -#include "bitreader.h" -#include "bitwriter.h" -#include "cpu.h" -#include "crc.h" -#include "fixed.h" -#include "float.h" -#include "format.h" -#include "lpc.h" -#include "md5.h" -#include "memory.h" -#include "metadata.h" -#include "stream_encoder_framing.h" - -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/private/bitmath.h b/3rdparty/libflac/src/libFLAC/include/private/bitmath.h deleted file mode 100644 index 87fa0facd6b..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/bitmath.h +++ /dev/null @@ -1,42 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PRIVATE__BITMATH_H -#define FLAC__PRIVATE__BITMATH_H - -#include "FLAC/ordinals.h" - -unsigned FLAC__bitmath_ilog2(FLAC__uint32 v); -unsigned FLAC__bitmath_ilog2_wide(FLAC__uint64 v); -unsigned FLAC__bitmath_silog2(int v); -unsigned FLAC__bitmath_silog2_wide(FLAC__int64 v); - -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/private/bitreader.h b/3rdparty/libflac/src/libFLAC/include/private/bitreader.h deleted file mode 100644 index fd0f6aac6ce..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/bitreader.h +++ /dev/null @@ -1,99 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PRIVATE__BITREADER_H -#define FLAC__PRIVATE__BITREADER_H - -#include <stdio.h> /* for FILE */ -#include "FLAC/ordinals.h" -#include "cpu.h" - -/* - * opaque structure definition - */ -struct FLAC__BitReader; -typedef struct FLAC__BitReader FLAC__BitReader; - -typedef FLAC__bool (*FLAC__BitReaderReadCallback)(FLAC__byte buffer[], size_t *bytes, void *client_data); - -/* - * construction, deletion, initialization, etc functions - */ -FLAC__BitReader *FLAC__bitreader_new(void); -void FLAC__bitreader_delete(FLAC__BitReader *br); -FLAC__bool FLAC__bitreader_init(FLAC__BitReader *br, FLAC__CPUInfo cpu, FLAC__BitReaderReadCallback rcb, void *cd); -void FLAC__bitreader_free(FLAC__BitReader *br); /* does not 'free(br)' */ -FLAC__bool FLAC__bitreader_clear(FLAC__BitReader *br); -void FLAC__bitreader_dump(const FLAC__BitReader *br, FILE *out); - -/* - * CRC functions - */ -void FLAC__bitreader_reset_read_crc16(FLAC__BitReader *br, FLAC__uint16 seed); -FLAC__uint16 FLAC__bitreader_get_read_crc16(FLAC__BitReader *br); - -/* - * info functions - */ -FLAC__bool FLAC__bitreader_is_consumed_byte_aligned(const FLAC__BitReader *br); -unsigned FLAC__bitreader_bits_left_for_byte_alignment(const FLAC__BitReader *br); -unsigned FLAC__bitreader_get_input_bits_unconsumed(const FLAC__BitReader *br); - -/* - * read functions - */ - -FLAC__bool FLAC__bitreader_read_raw_uint32(FLAC__BitReader *br, FLAC__uint32 *val, unsigned bits); -FLAC__bool FLAC__bitreader_read_raw_int32(FLAC__BitReader *br, FLAC__int32 *val, unsigned bits); -FLAC__bool FLAC__bitreader_read_raw_uint64(FLAC__BitReader *br, FLAC__uint64 *val, unsigned bits); -FLAC__bool FLAC__bitreader_read_uint32_little_endian(FLAC__BitReader *br, FLAC__uint32 *val); /*only for bits=32*/ -FLAC__bool FLAC__bitreader_skip_bits_no_crc(FLAC__BitReader *br, unsigned bits); /* WATCHOUT: does not CRC the skipped data! */ /*@@@@ add to unit tests */ -FLAC__bool FLAC__bitreader_skip_byte_block_aligned_no_crc(FLAC__BitReader *br, unsigned nvals); /* WATCHOUT: does not CRC the read data! */ -FLAC__bool FLAC__bitreader_read_byte_block_aligned_no_crc(FLAC__BitReader *br, FLAC__byte *val, unsigned nvals); /* WATCHOUT: does not CRC the read data! */ -FLAC__bool FLAC__bitreader_read_unary_unsigned(FLAC__BitReader *br, unsigned *val); -FLAC__bool FLAC__bitreader_read_rice_signed(FLAC__BitReader *br, int *val, unsigned parameter); -FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter); -#ifndef FLAC__NO_ASM -# ifdef FLAC__CPU_IA32 -# ifdef FLAC__HAS_NASM -FLAC__bool FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter); -# endif -# endif -#endif -#if 0 /* UNUSED */ -FLAC__bool FLAC__bitreader_read_golomb_signed(FLAC__BitReader *br, int *val, unsigned parameter); -FLAC__bool FLAC__bitreader_read_golomb_unsigned(FLAC__BitReader *br, unsigned *val, unsigned parameter); -#endif -FLAC__bool FLAC__bitreader_read_utf8_uint32(FLAC__BitReader *br, FLAC__uint32 *val, FLAC__byte *raw, unsigned *rawlen); -FLAC__bool FLAC__bitreader_read_utf8_uint64(FLAC__BitReader *br, FLAC__uint64 *val, FLAC__byte *raw, unsigned *rawlen); - -FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br); -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/private/bitwriter.h b/3rdparty/libflac/src/libFLAC/include/private/bitwriter.h deleted file mode 100644 index aa5c4f74fcb..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/bitwriter.h +++ /dev/null @@ -1,103 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PRIVATE__BITWRITER_H -#define FLAC__PRIVATE__BITWRITER_H - -#include <stdio.h> /* for FILE */ -#include "FLAC/ordinals.h" - -/* - * opaque structure definition - */ -struct FLAC__BitWriter; -typedef struct FLAC__BitWriter FLAC__BitWriter; - -/* - * construction, deletion, initialization, etc functions - */ -FLAC__BitWriter *FLAC__bitwriter_new(void); -void FLAC__bitwriter_delete(FLAC__BitWriter *bw); -FLAC__bool FLAC__bitwriter_init(FLAC__BitWriter *bw); -void FLAC__bitwriter_free(FLAC__BitWriter *bw); /* does not 'free(buffer)' */ -void FLAC__bitwriter_clear(FLAC__BitWriter *bw); -void FLAC__bitwriter_dump(const FLAC__BitWriter *bw, FILE *out); - -/* - * CRC functions - * - * non-const *bw because they have to cal FLAC__bitwriter_get_buffer() - */ -FLAC__bool FLAC__bitwriter_get_write_crc16(FLAC__BitWriter *bw, FLAC__uint16 *crc); -FLAC__bool FLAC__bitwriter_get_write_crc8(FLAC__BitWriter *bw, FLAC__byte *crc); - -/* - * info functions - */ -FLAC__bool FLAC__bitwriter_is_byte_aligned(const FLAC__BitWriter *bw); -unsigned FLAC__bitwriter_get_input_bits_unconsumed(const FLAC__BitWriter *bw); /* can be called anytime, returns total # of bits unconsumed */ - -/* - * direct buffer access - * - * there may be no calls on the bitwriter between get and release. - * the bitwriter continues to own the returned buffer. - * before get, bitwriter MUST be byte aligned: check with FLAC__bitwriter_is_byte_aligned() - */ -FLAC__bool FLAC__bitwriter_get_buffer(FLAC__BitWriter *bw, const FLAC__byte **buffer, size_t *bytes); -void FLAC__bitwriter_release_buffer(FLAC__BitWriter *bw); - -/* - * write functions - */ -FLAC__bool FLAC__bitwriter_write_zeroes(FLAC__BitWriter *bw, unsigned bits); -FLAC__bool FLAC__bitwriter_write_raw_uint32(FLAC__BitWriter *bw, FLAC__uint32 val, unsigned bits); -FLAC__bool FLAC__bitwriter_write_raw_int32(FLAC__BitWriter *bw, FLAC__int32 val, unsigned bits); -FLAC__bool FLAC__bitwriter_write_raw_uint64(FLAC__BitWriter *bw, FLAC__uint64 val, unsigned bits); -FLAC__bool FLAC__bitwriter_write_raw_uint32_little_endian(FLAC__BitWriter *bw, FLAC__uint32 val); /*only for bits=32*/ -FLAC__bool FLAC__bitwriter_write_byte_block(FLAC__BitWriter *bw, const FLAC__byte vals[], unsigned nvals); -FLAC__bool FLAC__bitwriter_write_unary_unsigned(FLAC__BitWriter *bw, unsigned val); -unsigned FLAC__bitwriter_rice_bits(FLAC__int32 val, unsigned parameter); -#if 0 /* UNUSED */ -unsigned FLAC__bitwriter_golomb_bits_signed(int val, unsigned parameter); -unsigned FLAC__bitwriter_golomb_bits_unsigned(unsigned val, unsigned parameter); -#endif -FLAC__bool FLAC__bitwriter_write_rice_signed(FLAC__BitWriter *bw, FLAC__int32 val, unsigned parameter); -FLAC__bool FLAC__bitwriter_write_rice_signed_block(FLAC__BitWriter *bw, const FLAC__int32 *vals, unsigned nvals, unsigned parameter); -#if 0 /* UNUSED */ -FLAC__bool FLAC__bitwriter_write_golomb_signed(FLAC__BitWriter *bw, int val, unsigned parameter); -FLAC__bool FLAC__bitwriter_write_golomb_unsigned(FLAC__BitWriter *bw, unsigned val, unsigned parameter); -#endif -FLAC__bool FLAC__bitwriter_write_utf8_uint32(FLAC__BitWriter *bw, FLAC__uint32 val); -FLAC__bool FLAC__bitwriter_write_utf8_uint64(FLAC__BitWriter *bw, FLAC__uint64 val); -FLAC__bool FLAC__bitwriter_zero_pad_to_byte_boundary(FLAC__BitWriter *bw); - -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/private/cpu.h b/3rdparty/libflac/src/libFLAC/include/private/cpu.h deleted file mode 100644 index 651bb224f2a..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/cpu.h +++ /dev/null @@ -1,88 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PRIVATE__CPU_H -#define FLAC__PRIVATE__CPU_H - -#include "FLAC/ordinals.h" - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -typedef enum { - FLAC__CPUINFO_TYPE_IA32, - FLAC__CPUINFO_TYPE_PPC, - FLAC__CPUINFO_TYPE_UNKNOWN -} FLAC__CPUInfo_Type; - -typedef struct { - FLAC__bool cpuid; - FLAC__bool bswap; - FLAC__bool cmov; - FLAC__bool mmx; - FLAC__bool fxsr; - FLAC__bool sse; - FLAC__bool sse2; - FLAC__bool sse3; - FLAC__bool ssse3; - FLAC__bool _3dnow; - FLAC__bool ext3dnow; - FLAC__bool extmmx; -} FLAC__CPUInfo_IA32; - -typedef struct { - FLAC__bool altivec; - FLAC__bool ppc64; -} FLAC__CPUInfo_PPC; - -typedef struct { - FLAC__bool use_asm; - FLAC__CPUInfo_Type type; - union { - FLAC__CPUInfo_IA32 ia32; - FLAC__CPUInfo_PPC ppc; - } data; -} FLAC__CPUInfo; - -void FLAC__cpu_info(FLAC__CPUInfo *info); - -#ifndef FLAC__NO_ASM -#ifdef FLAC__CPU_IA32 -#ifdef FLAC__HAS_NASM -FLAC__uint32 FLAC__cpu_have_cpuid_asm_ia32(void); -void FLAC__cpu_info_asm_ia32(FLAC__uint32 *flags_edx, FLAC__uint32 *flags_ecx); -FLAC__uint32 FLAC__cpu_info_extended_amd_asm_ia32(void); -#endif -#endif -#endif - -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/private/crc.h b/3rdparty/libflac/src/libFLAC/include/private/crc.h deleted file mode 100644 index 0b67fb4be5d..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/crc.h +++ /dev/null @@ -1,61 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PRIVATE__CRC_H -#define FLAC__PRIVATE__CRC_H - -#include "FLAC/ordinals.h" - -/* 8 bit CRC generator, MSB shifted first -** polynomial = x^8 + x^2 + x^1 + x^0 -** init = 0 -*/ -extern FLAC__byte const FLAC__crc8_table[256]; -#define FLAC__CRC8_UPDATE(data, crc) (crc) = FLAC__crc8_table[(crc) ^ (data)]; -void FLAC__crc8_update(const FLAC__byte data, FLAC__uint8 *crc); -void FLAC__crc8_update_block(const FLAC__byte *data, unsigned len, FLAC__uint8 *crc); -FLAC__uint8 FLAC__crc8(const FLAC__byte *data, unsigned len); - -/* 16 bit CRC generator, MSB shifted first -** polynomial = x^16 + x^15 + x^2 + x^0 -** init = 0 -*/ -extern unsigned FLAC__crc16_table[256]; - -#define FLAC__CRC16_UPDATE(data, crc) (((((crc)<<8) & 0xffff) ^ FLAC__crc16_table[((crc)>>8) ^ (data)])) -/* this alternate may be faster on some systems/compilers */ -#if 0 -#define FLAC__CRC16_UPDATE(data, crc) ((((crc)<<8) ^ FLAC__crc16_table[((crc)>>8) ^ (data)]) & 0xffff) -#endif - -unsigned FLAC__crc16(const FLAC__byte *data, unsigned len); - -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/private/fixed.h b/3rdparty/libflac/src/libFLAC/include/private/fixed.h deleted file mode 100644 index 6656b796bec..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/fixed.h +++ /dev/null @@ -1,97 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PRIVATE__FIXED_H -#define FLAC__PRIVATE__FIXED_H - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "private/float.h" -#include "FLAC/format.h" - -/* - * FLAC__fixed_compute_best_predictor() - * -------------------------------------------------------------------- - * Compute the best fixed predictor and the expected bits-per-sample - * of the residual signal for each order. The _wide() version uses - * 64-bit integers which is statistically necessary when bits-per- - * sample + log2(blocksize) > 30 - * - * IN data[0,data_len-1] - * IN data_len - * OUT residual_bits_per_sample[0,FLAC__MAX_FIXED_ORDER] - */ -#ifndef FLAC__INTEGER_ONLY_LIBRARY -unsigned FLAC__fixed_compute_best_predictor(const FLAC__int32 data[], unsigned data_len, FLAC__float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]); -# ifndef FLAC__NO_ASM -# ifdef FLAC__CPU_IA32 -# ifdef FLAC__HAS_NASM -unsigned FLAC__fixed_compute_best_predictor_asm_ia32_mmx_cmov(const FLAC__int32 data[], unsigned data_len, FLAC__float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]); -# endif -# endif -# endif -unsigned FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], unsigned data_len, FLAC__float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]); -#else -unsigned FLAC__fixed_compute_best_predictor(const FLAC__int32 data[], unsigned data_len, FLAC__fixedpoint residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]); -unsigned FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], unsigned data_len, FLAC__fixedpoint residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]); -#endif - -/* - * FLAC__fixed_compute_residual() - * -------------------------------------------------------------------- - * Compute the residual signal obtained from sutracting the predicted - * signal from the original. - * - * IN data[-order,data_len-1] original signal (NOTE THE INDICES!) - * IN data_len length of original signal - * IN order <= FLAC__MAX_FIXED_ORDER fixed-predictor order - * OUT residual[0,data_len-1] residual signal - */ -void FLAC__fixed_compute_residual(const FLAC__int32 data[], unsigned data_len, unsigned order, FLAC__int32 residual[]); - -/* - * FLAC__fixed_restore_signal() - * -------------------------------------------------------------------- - * Restore the original signal by summing the residual and the - * predictor. - * - * IN residual[0,data_len-1] residual signal - * IN data_len length of original signal - * IN order <= FLAC__MAX_FIXED_ORDER fixed-predictor order - * *** IMPORTANT: the caller must pass in the historical samples: - * IN data[-order,-1] previously-reconstructed historical samples - * OUT data[0,data_len-1] original signal - */ -void FLAC__fixed_restore_signal(const FLAC__int32 residual[], unsigned data_len, unsigned order, FLAC__int32 data[]); - -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/private/float.h b/3rdparty/libflac/src/libFLAC/include/private/float.h deleted file mode 100644 index 73313f6dbf8..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/float.h +++ /dev/null @@ -1,97 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PRIVATE__FLOAT_H -#define FLAC__PRIVATE__FLOAT_H - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "FLAC/ordinals.h" - -/* - * These typedefs make it easier to ensure that integer versions of - * the library really only contain integer operations. All the code - * in libFLAC should use FLAC__float and FLAC__double in place of - * float and double, and be protected by checks of the macro - * FLAC__INTEGER_ONLY_LIBRARY. - * - * FLAC__real is the basic floating point type used in LPC analysis. - */ -#ifndef FLAC__INTEGER_ONLY_LIBRARY -typedef double FLAC__double; -typedef float FLAC__float; -/* - * WATCHOUT: changing FLAC__real will change the signatures of many - * functions that have assembly language equivalents and break them. - */ -typedef float FLAC__real; -#else -/* - * The convention for FLAC__fixedpoint is to use the upper 16 bits - * for the integer part and lower 16 bits for the fractional part. - */ -typedef FLAC__int32 FLAC__fixedpoint; -extern const FLAC__fixedpoint FLAC__FP_ZERO; -extern const FLAC__fixedpoint FLAC__FP_ONE_HALF; -extern const FLAC__fixedpoint FLAC__FP_ONE; -extern const FLAC__fixedpoint FLAC__FP_LN2; -extern const FLAC__fixedpoint FLAC__FP_E; - -#define FLAC__fixedpoint_trunc(x) ((x)>>16) - -#define FLAC__fixedpoint_mul(x, y) ( (FLAC__fixedpoint) ( ((FLAC__int64)(x)*(FLAC__int64)(y)) >> 16 ) ) - -#define FLAC__fixedpoint_div(x, y) ( (FLAC__fixedpoint) ( ( ((FLAC__int64)(x)<<32) / (FLAC__int64)(y) ) >> 16 ) ) - -/* - * FLAC__fixedpoint_log2() - * -------------------------------------------------------------------- - * Returns the base-2 logarithm of the fixed-point number 'x' using an - * algorithm by Knuth for x >= 1.0 - * - * 'fracbits' is the number of fractional bits of 'x'. 'fracbits' must - * be < 32 and evenly divisible by 4 (0 is OK but not very precise). - * - * 'precision' roughly limits the number of iterations that are done; - * use (unsigned)(-1) for maximum precision. - * - * If 'x' is less than one -- that is, x < (1<<fracbits) -- then this - * function will punt and return 0. - * - * The return value will also have 'fracbits' fractional bits. - */ -FLAC__uint32 FLAC__fixedpoint_log2(FLAC__uint32 x, unsigned fracbits, unsigned precision); - -#endif - -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/private/format.h b/3rdparty/libflac/src/libFLAC/include/private/format.h deleted file mode 100644 index 7f5cc9360dc..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/format.h +++ /dev/null @@ -1,44 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PRIVATE__FORMAT_H -#define FLAC__PRIVATE__FORMAT_H - -#include "FLAC/format.h" - -unsigned FLAC__format_get_max_rice_partition_order(unsigned blocksize, unsigned predictor_order); -unsigned FLAC__format_get_max_rice_partition_order_from_blocksize(unsigned blocksize); -unsigned FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order(unsigned limit, unsigned blocksize, unsigned predictor_order); -void FLAC__format_entropy_coding_method_partitioned_rice_contents_init(FLAC__EntropyCodingMethod_PartitionedRiceContents *object); -void FLAC__format_entropy_coding_method_partitioned_rice_contents_clear(FLAC__EntropyCodingMethod_PartitionedRiceContents *object); -FLAC__bool FLAC__format_entropy_coding_method_partitioned_rice_contents_ensure_size(FLAC__EntropyCodingMethod_PartitionedRiceContents *object, unsigned max_partition_order); - -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/private/lpc.h b/3rdparty/libflac/src/libFLAC/include/private/lpc.h deleted file mode 100644 index 2cb139b4bfd..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/lpc.h +++ /dev/null @@ -1,214 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PRIVATE__LPC_H -#define FLAC__PRIVATE__LPC_H - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "private/float.h" -#include "FLAC/format.h" - -#ifndef FLAC__INTEGER_ONLY_LIBRARY - -/* - * FLAC__lpc_window_data() - * -------------------------------------------------------------------- - * Applies the given window to the data. - * OPT: asm implementation - * - * IN in[0,data_len-1] - * IN window[0,data_len-1] - * OUT out[0,lag-1] - * IN data_len - */ -void FLAC__lpc_window_data(const FLAC__int32 in[], const FLAC__real window[], FLAC__real out[], unsigned data_len); - -/* - * FLAC__lpc_compute_autocorrelation() - * -------------------------------------------------------------------- - * Compute the autocorrelation for lags between 0 and lag-1. - * Assumes data[] outside of [0,data_len-1] == 0. - * Asserts that lag > 0. - * - * IN data[0,data_len-1] - * IN data_len - * IN 0 < lag <= data_len - * OUT autoc[0,lag-1] - */ -void FLAC__lpc_compute_autocorrelation(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); -#ifndef FLAC__NO_ASM -# ifdef FLAC__CPU_IA32 -# ifdef FLAC__HAS_NASM -void FLAC__lpc_compute_autocorrelation_asm_ia32(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); -void FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_4(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); -void FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_8(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); -void FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_12(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); -void FLAC__lpc_compute_autocorrelation_asm_ia32_3dnow(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); -# endif -# endif -#endif - -/* - * FLAC__lpc_compute_lp_coefficients() - * -------------------------------------------------------------------- - * Computes LP coefficients for orders 1..max_order. - * Do not call if autoc[0] == 0.0. This means the signal is zero - * and there is no point in calculating a predictor. - * - * IN autoc[0,max_order] autocorrelation values - * IN 0 < max_order <= FLAC__MAX_LPC_ORDER max LP order to compute - * OUT lp_coeff[0,max_order-1][0,max_order-1] LP coefficients for each order - * *** IMPORTANT: - * *** lp_coeff[0,max_order-1][max_order,FLAC__MAX_LPC_ORDER-1] are untouched - * OUT error[0,max_order-1] error for each order (more - * specifically, the variance of - * the error signal times # of - * samples in the signal) - * - * Example: if max_order is 9, the LP coefficients for order 9 will be - * in lp_coeff[8][0,8], the LP coefficients for order 8 will be - * in lp_coeff[7][0,7], etc. - */ -void FLAC__lpc_compute_lp_coefficients(const FLAC__real autoc[], unsigned *max_order, FLAC__real lp_coeff[][FLAC__MAX_LPC_ORDER], FLAC__double error[]); - -/* - * FLAC__lpc_quantize_coefficients() - * -------------------------------------------------------------------- - * Quantizes the LP coefficients. NOTE: precision + bits_per_sample - * must be less than 32 (sizeof(FLAC__int32)*8). - * - * IN lp_coeff[0,order-1] LP coefficients - * IN order LP order - * IN FLAC__MIN_QLP_COEFF_PRECISION < precision - * desired precision (in bits, including sign - * bit) of largest coefficient - * OUT qlp_coeff[0,order-1] quantized coefficients - * OUT shift # of bits to shift right to get approximated - * LP coefficients. NOTE: could be negative. - * RETURN 0 => quantization OK - * 1 => coefficients require too much shifting for *shift to - * fit in the LPC subframe header. 'shift' is unset. - * 2 => coefficients are all zero, which is bad. 'shift' is - * unset. - */ -int FLAC__lpc_quantize_coefficients(const FLAC__real lp_coeff[], unsigned order, unsigned precision, FLAC__int32 qlp_coeff[], int *shift); - -/* - * FLAC__lpc_compute_residual_from_qlp_coefficients() - * -------------------------------------------------------------------- - * Compute the residual signal obtained from sutracting the predicted - * signal from the original. - * - * IN data[-order,data_len-1] original signal (NOTE THE INDICES!) - * IN data_len length of original signal - * IN qlp_coeff[0,order-1] quantized LP coefficients - * IN order > 0 LP order - * IN lp_quantization quantization of LP coefficients in bits - * OUT residual[0,data_len-1] residual signal - */ -void FLAC__lpc_compute_residual_from_qlp_coefficients(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); -void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); -#ifndef FLAC__NO_ASM -# ifdef FLAC__CPU_IA32 -# ifdef FLAC__HAS_NASM -void FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); -void FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32_mmx(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); -# endif -# endif -#endif - -#endif /* !defined FLAC__INTEGER_ONLY_LIBRARY */ - -/* - * FLAC__lpc_restore_signal() - * -------------------------------------------------------------------- - * Restore the original signal by summing the residual and the - * predictor. - * - * IN residual[0,data_len-1] residual signal - * IN data_len length of original signal - * IN qlp_coeff[0,order-1] quantized LP coefficients - * IN order > 0 LP order - * IN lp_quantization quantization of LP coefficients in bits - * *** IMPORTANT: the caller must pass in the historical samples: - * IN data[-order,-1] previously-reconstructed historical samples - * OUT data[0,data_len-1] original signal - */ -void FLAC__lpc_restore_signal(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); -void FLAC__lpc_restore_signal_wide(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); -#ifndef FLAC__NO_ASM -# ifdef FLAC__CPU_IA32 -# ifdef FLAC__HAS_NASM -void FLAC__lpc_restore_signal_asm_ia32(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); -void FLAC__lpc_restore_signal_asm_ia32_mmx(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); -# endif /* FLAC__HAS_NASM */ -# elif defined FLAC__CPU_PPC -void FLAC__lpc_restore_signal_asm_ppc_altivec_16(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); -void FLAC__lpc_restore_signal_asm_ppc_altivec_16_order8(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); -# endif/* FLAC__CPU_IA32 || FLAC__CPU_PPC */ -#endif /* FLAC__NO_ASM */ - -#ifndef FLAC__INTEGER_ONLY_LIBRARY - -/* - * FLAC__lpc_compute_expected_bits_per_residual_sample() - * -------------------------------------------------------------------- - * Compute the expected number of bits per residual signal sample - * based on the LP error (which is related to the residual variance). - * - * IN lpc_error >= 0.0 error returned from calculating LP coefficients - * IN total_samples > 0 # of samples in residual signal - * RETURN expected bits per sample - */ -FLAC__double FLAC__lpc_compute_expected_bits_per_residual_sample(FLAC__double lpc_error, unsigned total_samples); -FLAC__double FLAC__lpc_compute_expected_bits_per_residual_sample_with_error_scale(FLAC__double lpc_error, FLAC__double error_scale); - -/* - * FLAC__lpc_compute_best_order() - * -------------------------------------------------------------------- - * Compute the best order from the array of signal errors returned - * during coefficient computation. - * - * IN lpc_error[0,max_order-1] >= 0.0 error returned from calculating LP coefficients - * IN max_order > 0 max LP order - * IN total_samples > 0 # of samples in residual signal - * IN overhead_bits_per_order # of bits overhead for each increased LP order - * (includes warmup sample size and quantized LP coefficient) - * RETURN [1,max_order] best order - */ -unsigned FLAC__lpc_compute_best_order(const FLAC__double lpc_error[], unsigned max_order, unsigned total_samples, unsigned overhead_bits_per_order); - -#endif /* !defined FLAC__INTEGER_ONLY_LIBRARY */ - -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/private/md5.h b/3rdparty/libflac/src/libFLAC/include/private/md5.h deleted file mode 100644 index e5f675a830a..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/md5.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef FLAC__PRIVATE__MD5_H -#define FLAC__PRIVATE__MD5_H - -/* - * This is the header file for the MD5 message-digest algorithm. - * The algorithm is due to Ron Rivest. This code was - * written by Colin Plumb in 1993, no copyright is claimed. - * This code is in the public domain; do with it what you wish. - * - * Equivalent code is available from RSA Data Security, Inc. - * This code has been tested against that, and is equivalent, - * except that you don't need to include two pages of legalese - * with every copy. - * - * To compute the message digest of a chunk of bytes, declare an - * MD5Context structure, pass it to MD5Init, call MD5Update as - * needed on buffers full of bytes, and then call MD5Final, which - * will fill a supplied 16-byte array with the digest. - * - * Changed so as no longer to depend on Colin Plumb's `usual.h' - * header definitions; now uses stuff from dpkg's config.h - * - Ian Jackson <ijackson@nyx.cs.du.edu>. - * Still in the public domain. - * - * Josh Coalson: made some changes to integrate with libFLAC. - * Still in the public domain, with no warranty. - */ - -#include "FLAC/ordinals.h" - -typedef struct { - FLAC__uint32 in[16]; - FLAC__uint32 buf[4]; - FLAC__uint32 bytes[2]; - FLAC__byte *internal_buf; - size_t capacity; -} FLAC__MD5Context; - -void FLAC__MD5Init(FLAC__MD5Context *context); -void FLAC__MD5Final(FLAC__byte digest[16], FLAC__MD5Context *context); - -FLAC__bool FLAC__MD5Accumulate(FLAC__MD5Context *ctx, const FLAC__int32 * const signal[], unsigned channels, unsigned samples, unsigned bytes_per_sample); - -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/private/memory.h b/3rdparty/libflac/src/libFLAC/include/private/memory.h deleted file mode 100644 index 38a9ffe0711..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/memory.h +++ /dev/null @@ -1,56 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PRIVATE__MEMORY_H -#define FLAC__PRIVATE__MEMORY_H - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <stdlib.h> /* for size_t */ - -#include "private/float.h" -#include "FLAC/ordinals.h" /* for FLAC__bool */ - -/* Returns the unaligned address returned by malloc. - * Use free() on this address to deallocate. - */ -void *FLAC__memory_alloc_aligned(size_t bytes, void **aligned_address); -FLAC__bool FLAC__memory_alloc_aligned_int32_array(size_t elements, FLAC__int32 **unaligned_pointer, FLAC__int32 **aligned_pointer); -FLAC__bool FLAC__memory_alloc_aligned_uint32_array(size_t elements, FLAC__uint32 **unaligned_pointer, FLAC__uint32 **aligned_pointer); -FLAC__bool FLAC__memory_alloc_aligned_uint64_array(size_t elements, FLAC__uint64 **unaligned_pointer, FLAC__uint64 **aligned_pointer); -FLAC__bool FLAC__memory_alloc_aligned_unsigned_array(size_t elements, unsigned **unaligned_pointer, unsigned **aligned_pointer); -#ifndef FLAC__INTEGER_ONLY_LIBRARY -FLAC__bool FLAC__memory_alloc_aligned_real_array(size_t elements, FLAC__real **unaligned_pointer, FLAC__real **aligned_pointer); -#endif - -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/private/metadata.h b/3rdparty/libflac/src/libFLAC/include/private/metadata.h deleted file mode 100644 index b5268c9552e..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/metadata.h +++ /dev/null @@ -1,45 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PRIVATE__METADATA_H -#define FLAC__PRIVATE__METADATA_H - -#include "FLAC/metadata.h" - -/* WATCHOUT: all malloc()ed data in the block is free()ed; this may not - * be a consistent state (e.g. PICTURE) or equivalent to the initial - * state after FLAC__metadata_object_new() - */ -void FLAC__metadata_object_delete_data(FLAC__StreamMetadata *object); - -void FLAC__metadata_object_cuesheet_track_delete_data(FLAC__StreamMetadata_CueSheet_Track *object); - -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/private/ogg_decoder_aspect.h b/3rdparty/libflac/src/libFLAC/include/private/ogg_decoder_aspect.h deleted file mode 100644 index df2b6b55bdf..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/ogg_decoder_aspect.h +++ /dev/null @@ -1,79 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PRIVATE__OGG_DECODER_ASPECT_H -#define FLAC__PRIVATE__OGG_DECODER_ASPECT_H - -#include <ogg/ogg.h> - -#include "FLAC/ordinals.h" -#include "FLAC/stream_decoder.h" /* for FLAC__StreamDecoderReadStatus */ - -typedef struct FLAC__OggDecoderAspect { - /* these are storage for values that can be set through the API */ - FLAC__bool use_first_serial_number; - long serial_number; - - /* these are for internal state related to Ogg decoding */ - ogg_stream_state stream_state; - ogg_sync_state sync_state; - unsigned version_major, version_minor; - FLAC__bool need_serial_number; - FLAC__bool end_of_stream; - FLAC__bool have_working_page; /* only if true will the following vars be valid */ - ogg_page working_page; - FLAC__bool have_working_packet; /* only if true will the following vars be valid */ - ogg_packet working_packet; /* as we work through the packet we will move working_packet.packet forward and working_packet.bytes down */ -} FLAC__OggDecoderAspect; - -void FLAC__ogg_decoder_aspect_set_serial_number(FLAC__OggDecoderAspect *aspect, long value); -void FLAC__ogg_decoder_aspect_set_defaults(FLAC__OggDecoderAspect *aspect); -FLAC__bool FLAC__ogg_decoder_aspect_init(FLAC__OggDecoderAspect *aspect); -void FLAC__ogg_decoder_aspect_finish(FLAC__OggDecoderAspect *aspect); -void FLAC__ogg_decoder_aspect_flush(FLAC__OggDecoderAspect *aspect); -void FLAC__ogg_decoder_aspect_reset(FLAC__OggDecoderAspect *aspect); - -typedef enum { - FLAC__OGG_DECODER_ASPECT_READ_STATUS_OK = 0, - FLAC__OGG_DECODER_ASPECT_READ_STATUS_END_OF_STREAM, - FLAC__OGG_DECODER_ASPECT_READ_STATUS_LOST_SYNC, - FLAC__OGG_DECODER_ASPECT_READ_STATUS_NOT_FLAC, - FLAC__OGG_DECODER_ASPECT_READ_STATUS_UNSUPPORTED_MAPPING_VERSION, - FLAC__OGG_DECODER_ASPECT_READ_STATUS_ABORT, - FLAC__OGG_DECODER_ASPECT_READ_STATUS_ERROR, - FLAC__OGG_DECODER_ASPECT_READ_STATUS_MEMORY_ALLOCATION_ERROR -} FLAC__OggDecoderAspectReadStatus; - -typedef FLAC__OggDecoderAspectReadStatus (*FLAC__OggDecoderAspectReadCallbackProxy)(const void *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data); - -FLAC__OggDecoderAspectReadStatus FLAC__ogg_decoder_aspect_read_callback_wrapper(FLAC__OggDecoderAspect *aspect, FLAC__byte buffer[], size_t *bytes, FLAC__OggDecoderAspectReadCallbackProxy read_callback, const FLAC__StreamDecoder *decoder, void *client_data); - -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/private/ogg_encoder_aspect.h b/3rdparty/libflac/src/libFLAC/include/private/ogg_encoder_aspect.h deleted file mode 100644 index 290da071c6b..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/ogg_encoder_aspect.h +++ /dev/null @@ -1,62 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PRIVATE__OGG_ENCODER_ASPECT_H -#define FLAC__PRIVATE__OGG_ENCODER_ASPECT_H - -#include <ogg/ogg.h> - -#include "FLAC/ordinals.h" -#include "FLAC/stream_encoder.h" /* for FLAC__StreamEncoderWriteStatus */ - -typedef struct FLAC__OggEncoderAspect { - /* these are storage for values that can be set through the API */ - long serial_number; - unsigned num_metadata; - - /* these are for internal state related to Ogg encoding */ - ogg_stream_state stream_state; - ogg_page page; - FLAC__bool seen_magic; /* true if we've seen the fLaC magic in the write callback yet */ - FLAC__bool is_first_packet; - FLAC__uint64 samples_written; -} FLAC__OggEncoderAspect; - -void FLAC__ogg_encoder_aspect_set_serial_number(FLAC__OggEncoderAspect *aspect, long value); -FLAC__bool FLAC__ogg_encoder_aspect_set_num_metadata(FLAC__OggEncoderAspect *aspect, unsigned value); -void FLAC__ogg_encoder_aspect_set_defaults(FLAC__OggEncoderAspect *aspect); -FLAC__bool FLAC__ogg_encoder_aspect_init(FLAC__OggEncoderAspect *aspect); -void FLAC__ogg_encoder_aspect_finish(FLAC__OggEncoderAspect *aspect); - -typedef FLAC__StreamEncoderWriteStatus (*FLAC__OggEncoderAspectWriteCallbackProxy)(const void *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data); - -FLAC__StreamEncoderWriteStatus FLAC__ogg_encoder_aspect_write_callback_wrapper(FLAC__OggEncoderAspect *aspect, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, FLAC__bool is_last_block, FLAC__OggEncoderAspectWriteCallbackProxy write_callback, void *encoder, void *client_data); -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/private/ogg_helper.h b/3rdparty/libflac/src/libFLAC/include/private/ogg_helper.h deleted file mode 100644 index 389be18aba1..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/ogg_helper.h +++ /dev/null @@ -1,43 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec - * Copyright (C) 2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PRIVATE__OGG_HELPER_H -#define FLAC__PRIVATE__OGG_HELPER_H - -#include <ogg/ogg.h> -#include "FLAC/stream_encoder.h" /* for FLAC__StreamEncoder */ - -void simple_ogg_page__init(ogg_page *page); -void simple_ogg_page__clear(ogg_page *page); -FLAC__bool simple_ogg_page__get_at(FLAC__StreamEncoder *encoder, FLAC__uint64 position, ogg_page *page, FLAC__StreamEncoderSeekCallback seek_callback, FLAC__StreamEncoderReadCallback read_callback, void *client_data); -FLAC__bool simple_ogg_page__set_at(FLAC__StreamEncoder *encoder, FLAC__uint64 position, ogg_page *page, FLAC__StreamEncoderSeekCallback seek_callback, FLAC__StreamEncoderWriteCallback write_callback, void *client_data); - -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/private/ogg_mapping.h b/3rdparty/libflac/src/libFLAC/include/private/ogg_mapping.h deleted file mode 100644 index 07dd8b273fb..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/ogg_mapping.h +++ /dev/null @@ -1,63 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec - * Copyright (C) 2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PRIVATE__OGG_MAPPING_H -#define FLAC__PRIVATE__OGG_MAPPING_H - -#include "FLAC/ordinals.h" - -/** The length of the 'FLAC' magic in bytes. */ -#define FLAC__OGG_MAPPING_PACKET_TYPE_LENGTH (1u) - -extern const unsigned FLAC__OGG_MAPPING_PACKET_TYPE_LEN; /* = 8 bits */ - -extern const FLAC__byte FLAC__OGG_MAPPING_FIRST_HEADER_PACKET_TYPE; /* = 0x7f */ - -/** The length of the 'FLAC' magic in bytes. */ -#define FLAC__OGG_MAPPING_MAGIC_LENGTH (4u) - -extern const FLAC__byte * const FLAC__OGG_MAPPING_MAGIC; /* = "FLAC" */ - -extern const unsigned FLAC__OGG_MAPPING_VERSION_MAJOR_LEN; /* = 8 bits */ -extern const unsigned FLAC__OGG_MAPPING_VERSION_MINOR_LEN; /* = 8 bits */ - -/** The length of the Ogg FLAC mapping major version number in bytes. */ -#define FLAC__OGG_MAPPING_VERSION_MAJOR_LENGTH (1u) - -/** The length of the Ogg FLAC mapping minor version number in bytes. */ -#define FLAC__OGG_MAPPING_VERSION_MINOR_LENGTH (1u) - -extern const unsigned FLAC__OGG_MAPPING_NUM_HEADERS_LEN; /* = 16 bits */ - -/** The length of the #-of-header-packets number bytes. */ -#define FLAC__OGG_MAPPING_NUM_HEADERS_LENGTH (2u) - -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/private/stream_encoder_framing.h b/3rdparty/libflac/src/libFLAC/include/private/stream_encoder_framing.h deleted file mode 100644 index 4865c16c8a9..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/stream_encoder_framing.h +++ /dev/null @@ -1,45 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PRIVATE__STREAM_ENCODER_FRAMING_H -#define FLAC__PRIVATE__STREAM_ENCODER_FRAMING_H - -#include "FLAC/format.h" -#include "bitwriter.h" - -FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__BitWriter *bw); -FLAC__bool FLAC__frame_add_header(const FLAC__FrameHeader *header, FLAC__BitWriter *bw); -FLAC__bool FLAC__subframe_add_constant(const FLAC__Subframe_Constant *subframe, unsigned subframe_bps, unsigned wasted_bits, FLAC__BitWriter *bw); -FLAC__bool FLAC__subframe_add_fixed(const FLAC__Subframe_Fixed *subframe, unsigned residual_samples, unsigned subframe_bps, unsigned wasted_bits, FLAC__BitWriter *bw); -FLAC__bool FLAC__subframe_add_lpc(const FLAC__Subframe_LPC *subframe, unsigned residual_samples, unsigned subframe_bps, unsigned wasted_bits, FLAC__BitWriter *bw); -FLAC__bool FLAC__subframe_add_verbatim(const FLAC__Subframe_Verbatim *subframe, unsigned samples, unsigned subframe_bps, unsigned wasted_bits, FLAC__BitWriter *bw); - -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/private/window.h b/3rdparty/libflac/src/libFLAC/include/private/window.h deleted file mode 100644 index 01e0fc46c94..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/private/window.h +++ /dev/null @@ -1,71 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PRIVATE__WINDOW_H -#define FLAC__PRIVATE__WINDOW_H - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "private/float.h" -#include "FLAC/format.h" - -#ifndef FLAC__INTEGER_ONLY_LIBRARY - -/* - * FLAC__window_*() - * -------------------------------------------------------------------- - * Calculates window coefficients according to different apodization - * functions. - * - * OUT window[0,L-1] - * IN L (number of points in window) - */ -void FLAC__window_bartlett(FLAC__real *window, const FLAC__int32 L); -void FLAC__window_bartlett_hann(FLAC__real *window, const FLAC__int32 L); -void FLAC__window_blackman(FLAC__real *window, const FLAC__int32 L); -void FLAC__window_blackman_harris_4term_92db_sidelobe(FLAC__real *window, const FLAC__int32 L); -void FLAC__window_connes(FLAC__real *window, const FLAC__int32 L); -void FLAC__window_flattop(FLAC__real *window, const FLAC__int32 L); -void FLAC__window_gauss(FLAC__real *window, const FLAC__int32 L, const FLAC__real stddev); /* 0.0 < stddev <= 0.5 */ -void FLAC__window_hamming(FLAC__real *window, const FLAC__int32 L); -void FLAC__window_hann(FLAC__real *window, const FLAC__int32 L); -void FLAC__window_kaiser_bessel(FLAC__real *window, const FLAC__int32 L); -void FLAC__window_nuttall(FLAC__real *window, const FLAC__int32 L); -void FLAC__window_rectangle(FLAC__real *window, const FLAC__int32 L); -void FLAC__window_triangle(FLAC__real *window, const FLAC__int32 L); -void FLAC__window_tukey(FLAC__real *window, const FLAC__int32 L, const FLAC__real p); -void FLAC__window_welch(FLAC__real *window, const FLAC__int32 L); - -#endif /* !defined FLAC__INTEGER_ONLY_LIBRARY */ - -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/protected/Makefile.am b/3rdparty/libflac/src/libFLAC/include/protected/Makefile.am deleted file mode 100644 index 66c697c8277..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/protected/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# libFLAC - Free Lossless Audio Codec library -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -noinst_HEADERS = \ - all.h \ - stream_decoder.h \ - stream_encoder.h diff --git a/3rdparty/libflac/src/libFLAC/include/protected/Makefile.in b/3rdparty/libflac/src/libFLAC/include/protected/Makefile.in deleted file mode 100644 index 96133a6ad98..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/protected/Makefile.in +++ /dev/null @@ -1,439 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# libFLAC - Free Lossless Audio Codec library -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -noinst_HEADERS = \ - all.h \ - stream_decoder.h \ - stream_encoder.h - -subdir = src/libFLAC/include/protected -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = -HEADERS = $(noinst_HEADERS) - -DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in Makefile.am -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/libFLAC/include/protected/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(HEADERS) - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool ctags distclean distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am info \ - info-am install install-am install-data install-data-am \ - install-exec install-exec-am install-info install-info-am \ - install-man install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags uninstall uninstall-am uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/libFLAC/include/protected/all.h b/3rdparty/libflac/src/libFLAC/include/protected/all.h deleted file mode 100644 index 2921092b380..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/protected/all.h +++ /dev/null @@ -1,38 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PROTECTED__ALL_H -#define FLAC__PROTECTED__ALL_H - -#include "stream_decoder.h" -#include "stream_encoder.h" - -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/protected/stream_decoder.h b/3rdparty/libflac/src/libFLAC/include/protected/stream_decoder.h deleted file mode 100644 index 9108ca78f22..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/protected/stream_decoder.h +++ /dev/null @@ -1,58 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PROTECTED__STREAM_DECODER_H -#define FLAC__PROTECTED__STREAM_DECODER_H - -#include "FLAC/stream_decoder.h" -#if FLAC__HAS_OGG -#include "private/ogg_decoder_aspect.h" -#endif - -typedef struct FLAC__StreamDecoderProtected { - FLAC__StreamDecoderState state; - unsigned channels; - FLAC__ChannelAssignment channel_assignment; - unsigned bits_per_sample; - unsigned sample_rate; /* in Hz */ - unsigned blocksize; /* in samples (per channel) */ - FLAC__bool md5_checking; /* if true, generate MD5 signature of decoded data and compare against signature in the STREAMINFO metadata block */ -#if FLAC__HAS_OGG - FLAC__OggDecoderAspect ogg_decoder_aspect; -#endif -} FLAC__StreamDecoderProtected; - -/* - * return the number of input bytes consumed - */ -unsigned FLAC__stream_decoder_get_input_bytes_unconsumed(const FLAC__StreamDecoder *decoder); - -#endif diff --git a/3rdparty/libflac/src/libFLAC/include/protected/stream_encoder.h b/3rdparty/libflac/src/libFLAC/include/protected/stream_encoder.h deleted file mode 100644 index 4101ee55288..00000000000 --- a/3rdparty/libflac/src/libFLAC/include/protected/stream_encoder.h +++ /dev/null @@ -1,110 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef FLAC__PROTECTED__STREAM_ENCODER_H -#define FLAC__PROTECTED__STREAM_ENCODER_H - -#include "FLAC/stream_encoder.h" -#if FLAC__HAS_OGG -#include "private/ogg_encoder_aspect.h" -#endif - -#ifndef FLAC__INTEGER_ONLY_LIBRARY - -#include "private/float.h" - -#define FLAC__MAX_APODIZATION_FUNCTIONS 32 - -typedef enum { - FLAC__APODIZATION_BARTLETT, - FLAC__APODIZATION_BARTLETT_HANN, - FLAC__APODIZATION_BLACKMAN, - FLAC__APODIZATION_BLACKMAN_HARRIS_4TERM_92DB_SIDELOBE, - FLAC__APODIZATION_CONNES, - FLAC__APODIZATION_FLATTOP, - FLAC__APODIZATION_GAUSS, - FLAC__APODIZATION_HAMMING, - FLAC__APODIZATION_HANN, - FLAC__APODIZATION_KAISER_BESSEL, - FLAC__APODIZATION_NUTTALL, - FLAC__APODIZATION_RECTANGLE, - FLAC__APODIZATION_TRIANGLE, - FLAC__APODIZATION_TUKEY, - FLAC__APODIZATION_WELCH -} FLAC__ApodizationFunction; - -typedef struct { - FLAC__ApodizationFunction type; - union { - struct { - FLAC__real stddev; - } gauss; - struct { - FLAC__real p; - } tukey; - } parameters; -} FLAC__ApodizationSpecification; - -#endif // #ifndef FLAC__INTEGER_ONLY_LIBRARY - -typedef struct FLAC__StreamEncoderProtected { - FLAC__StreamEncoderState state; - FLAC__bool verify; - FLAC__bool streamable_subset; - FLAC__bool do_md5; - FLAC__bool do_mid_side_stereo; - FLAC__bool loose_mid_side_stereo; - unsigned channels; - unsigned bits_per_sample; - unsigned sample_rate; - unsigned blocksize; -#ifndef FLAC__INTEGER_ONLY_LIBRARY - unsigned num_apodizations; - FLAC__ApodizationSpecification apodizations[FLAC__MAX_APODIZATION_FUNCTIONS]; -#endif - unsigned max_lpc_order; - unsigned qlp_coeff_precision; - FLAC__bool do_qlp_coeff_prec_search; - FLAC__bool do_exhaustive_model_search; - FLAC__bool do_escape_coding; - unsigned min_residual_partition_order; - unsigned max_residual_partition_order; - unsigned rice_parameter_search_dist; - FLAC__uint64 total_samples_estimate; - FLAC__StreamMetadata **metadata; - unsigned num_metadata_blocks; - FLAC__uint64 streaminfo_offset, seektable_offset, audio_offset; -#if FLAC__HAS_OGG - FLAC__OggEncoderAspect ogg_encoder_aspect; -#endif -} FLAC__StreamEncoderProtected; - -#endif diff --git a/3rdparty/libflac/src/libFLAC/libFLAC.m4 b/3rdparty/libflac/src/libFLAC/libFLAC.m4 deleted file mode 100644 index 24eb0c5432a..00000000000 --- a/3rdparty/libflac/src/libFLAC/libFLAC.m4 +++ /dev/null @@ -1,114 +0,0 @@ -# Configure paths for libFLAC -# "Inspired" by ogg.m4 - -dnl AM_PATH_LIBFLAC([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) -dnl Test for libFLAC, and define LIBFLAC_CFLAGS, LIBFLAC_LIBS, LIBFLAC_LIBDIR -dnl -AC_DEFUN([AM_PATH_LIBFLAC], -[dnl -dnl Get the cflags and libraries -dnl -AC_ARG_WITH(libFLAC,[ --with-libFLAC=PFX Prefix where libFLAC is installed (optional)], libFLAC_prefix="$withval", libFLAC_prefix="") -AC_ARG_WITH(libFLAC-libraries,[ --with-libFLAC-libraries=DIR Directory where libFLAC library is installed (optional)], libFLAC_libraries="$withval", libFLAC_libraries="") -AC_ARG_WITH(libFLAC-includes,[ --with-libFLAC-includes=DIR Directory where libFLAC header files are installed (optional)], libFLAC_includes="$withval", libFLAC_includes="") -AC_ARG_ENABLE(libFLACtest, [ --disable-libFLACtest Do not try to compile and run a test libFLAC program],, enable_libFLACtest=yes) - - if test "x$libFLAC_libraries" != "x" ; then - LIBFLAC_LIBDIR="$libFLAC_libraries" - elif test "x$libFLAC_prefix" != "x" ; then - LIBFLAC_LIBDIR="$libFLAC_prefix/lib" - elif test "x$prefix" != "xNONE" ; then - LIBFLAC_LIBDIR="$libdir" - fi - - LIBFLAC_LIBS="-L$LIBFLAC_LIBDIR -lFLAC $OGG_LIBS -lm" - - if test "x$libFLAC_includes" != "x" ; then - LIBFLAC_CFLAGS="-I$libFLAC_includes" - elif test "x$libFLAC_prefix" != "x" ; then - LIBFLAC_CFLAGS="-I$libFLAC_prefix/include" - elif test "$prefix" != "xNONE"; then - LIBFLAC_CFLAGS="" - fi - - AC_MSG_CHECKING(for libFLAC) - no_libFLAC="" - - - if test "x$enable_libFLACtest" = "xyes" ; then - ac_save_CFLAGS="$CFLAGS" - ac_save_CXXFLAGS="$CXXFLAGS" - ac_save_LIBS="$LIBS" - ac_save_LD_LIBRARY_PATH="$LD_LIBRARY_PATH" - CFLAGS="$CFLAGS $LIBFLAC_CFLAGS" - CXXFLAGS="$CXXFLAGS $LIBFLAC_CFLAGS" - LIBS="$LIBS $LIBFLAC_LIBS" - LD_LIBRARY_PATH="$LIBFLAC_LIBDIR:$LD_LIBRARY_PATH" -dnl -dnl Now check if the installed libFLAC is sufficiently new. -dnl - rm -f conf.libFLACtest - AC_TRY_RUN([ -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <FLAC/format.h> - -int main () -{ - system("touch conf.libFLACtest"); - return 0; -} - -],, no_libFLAC=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - CXXFLAGS="$ac_save_CXXFLAGS" - LIBS="$ac_save_LIBS" - LD_LIBRARY_PATH="$ac_save_LD_LIBRARY_PATH" - fi - - if test "x$no_libFLAC" = "x" ; then - AC_MSG_RESULT(yes) - ifelse([$1], , :, [$1]) - else - AC_MSG_RESULT(no) - if test -f conf.libFLACtest ; then - : - else - echo "*** Could not run libFLAC test program, checking why..." - CFLAGS="$CFLAGS $LIBFLAC_CFLAGS" - CXXFLAGS="$CXXFLAGS $LIBFLAC_CFLAGS" - LIBS="$LIBS $LIBFLAC_LIBS" - LD_LIBRARY_PATH="$LIBFLAC_LIBDIR:$LD_LIBRARY_PATH" - AC_TRY_LINK([ -#include <stdio.h> -#include <FLAC/format.h> -], [ return 0; ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding libFLAC or finding the wrong" - echo "*** version of libFLAC. If it is not finding libFLAC, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means libFLAC was incorrectly installed" - echo "*** or that you have moved libFLAC since it was installed. In the latter case, you" - echo "*** may want to edit the libFLAC-config script: $LIBFLAC_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - CXXFLAGS="$ac_save_CXXFLAGS" - LIBS="$ac_save_LIBS" - LD_LIBRARY_PATH="$ac_save_LD_LIBRARY_PATH" - fi - LIBFLAC_CFLAGS="" - LIBFLAC_LIBDIR="" - LIBFLAC_LIBS="" - ifelse([$2], , :, [$2]) - fi - AC_SUBST(LIBFLAC_CFLAGS) - AC_SUBST(LIBFLAC_LIBDIR) - AC_SUBST(LIBFLAC_LIBS) - rm -f conf.libFLACtest -]) diff --git a/3rdparty/libflac/src/libFLAC/libFLAC_dynamic.dsp b/3rdparty/libflac/src/libFLAC/libFLAC_dynamic.dsp deleted file mode 100644 index 73169ecfc22..00000000000 --- a/3rdparty/libflac/src/libFLAC/libFLAC_dynamic.dsp +++ /dev/null @@ -1,464 +0,0 @@ -# Microsoft Developer Studio Project File - Name="libFLAC_dynamic" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=libFLAC_dynamic - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libFLAC_dynamic.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libFLAC_dynamic.mak" CFG="libFLAC_dynamic - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libFLAC_dynamic - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "libFLAC_dynamic - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "libFLAC" -# PROP Scc_LocalPath "..\.." -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libFLAC_dynamic - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\obj\release\lib" -# PROP Intermediate_Dir "Release_dynamic" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I ".\include" /I "..\..\include" /D "NDEBUG" /D "FLAC_API_EXPORTS" /D "FLAC__HAS_OGG" /D VERSION=\"1.2.1\" /D "FLAC__CPU_IA32" /D "FLAC__HAS_NASM" /D "FLAC__USE_3DNOW" /D "_WINDOWS" /D "_WINDLL" /D "WIN32" /D "_USRDLL" /FR /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" /d "_USRDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:windows /dll /machine:I386 /out:"..\..\obj\release\bin/libFLAC.dll" - -!ELSEIF "$(CFG)" == "libFLAC_dynamic - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\obj\debug\lib" -# PROP Intermediate_Dir "Debug_dynamic" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I ".\include" /I "..\..\include" /D "_DEBUG" /D "DEBUG" /D "FLAC__OVERFLOW_DETECT" /D "FLAC_API_EXPORTS" /D "FLAC__HAS_OGG" /D VERSION=\"1.2.1\" /D "FLAC__CPU_IA32" /D "FLAC__HAS_NASM" /D "FLAC__USE_3DNOW" /D "_WINDOWS" /D "_WINDLL" /D "WIN32" /D "_USRDLL" /FR /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" /d "_USRDLL" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"..\..\obj\debug\bin/libFLAC.dll" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "libFLAC_dynamic - Win32 Release" -# Name "libFLAC_dynamic - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "c" -# Begin Group "Assembly Files (ia32)" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\ia32\bitreader_asm.nasm - -!IF "$(CFG)" == "libFLAC_dynamic - Win32 Release" - -USERDEP__CPU_A="ia32/bitreader_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\bitreader_asm.nasm - -"ia32/bitreader_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/bitreader_asm.nasm -o ia32/bitreader_asm.obj - -# End Custom Build - -!ELSEIF "$(CFG)" == "libFLAC_dynamic - Win32 Debug" - -USERDEP__CPU_A="ia32/bitreader_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\bitreader_asm.nasm - -"ia32/bitreader_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/bitreader_asm.nasm -o ia32/bitreader_asm.obj - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ia32\cpu_asm.nasm - -!IF "$(CFG)" == "libFLAC_dynamic - Win32 Release" - -USERDEP__CPU_A="ia32/cpu_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\cpu_asm.nasm - -"ia32/cpu_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/cpu_asm.nasm -o ia32/cpu_asm.obj - -# End Custom Build - -!ELSEIF "$(CFG)" == "libFLAC_dynamic - Win32 Debug" - -USERDEP__CPU_A="ia32/cpu_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\cpu_asm.nasm - -"ia32/cpu_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/cpu_asm.nasm -o ia32/cpu_asm.obj - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ia32\fixed_asm.nasm - -!IF "$(CFG)" == "libFLAC_dynamic - Win32 Release" - -USERDEP__FIXED="ia32/fixed_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\fixed_asm.nasm - -"ia32/fixed_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/fixed_asm.nasm -o ia32/fixed_asm.obj - -# End Custom Build - -!ELSEIF "$(CFG)" == "libFLAC_dynamic - Win32 Debug" - -USERDEP__FIXED="ia32/fixed_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\fixed_asm.nasm - -"ia32/fixed_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/fixed_asm.nasm -o ia32/fixed_asm.obj - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ia32\lpc_asm.nasm - -!IF "$(CFG)" == "libFLAC_dynamic - Win32 Release" - -USERDEP__LPC_A="ia32/lpc_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\lpc_asm.nasm - -"ia32/lpc_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/lpc_asm.nasm -o ia32/lpc_asm.obj - -# End Custom Build - -!ELSEIF "$(CFG)" == "libFLAC_dynamic - Win32 Debug" - -USERDEP__LPC_A="ia32/lpc_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\lpc_asm.nasm - -"ia32/lpc_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/lpc_asm.nasm -o ia32/lpc_asm.obj - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ia32\stream_encoder_asm.nasm - -!IF "$(CFG)" == "libFLAC_dynamic - Win32 Release" - -USERDEP__CPU_A="ia32/stream_encoder_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\stream_encoder_asm.nasm - -"ia32/stream_encoder_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/stream_encoder_asm.nasm -o ia32/stream_encoder_asm.obj - -# End Custom Build - -!ELSEIF "$(CFG)" == "libFLAC_dynamic - Win32 Debug" - -USERDEP__CPU_A="ia32/stream_encoder_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\stream_encoder_asm.nasm - -"ia32/stream_encoder_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/stream_encoder_asm.nasm -o ia32/stream_encoder_asm.obj - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ia32\nasm.h -# End Source File -# End Group -# Begin Source File - -SOURCE=.\bitmath.c -# End Source File -# Begin Source File - -SOURCE=.\bitreader.c -# End Source File -# Begin Source File - -SOURCE=.\bitwriter.c -# End Source File -# Begin Source File - -SOURCE=.\cpu.c -# End Source File -# Begin Source File - -SOURCE=.\crc.c -# End Source File -# Begin Source File - -SOURCE=.\fixed.c -# End Source File -# Begin Source File - -SOURCE=.\float.c -# End Source File -# Begin Source File - -SOURCE=.\format.c -# End Source File -# Begin Source File - -SOURCE=.\lpc.c -# End Source File -# Begin Source File - -SOURCE=.\md5.c -# End Source File -# Begin Source File - -SOURCE=.\memory.c -# End Source File -# Begin Source File - -SOURCE=.\metadata_iterators.c -# End Source File -# Begin Source File - -SOURCE=.\metadata_object.c -# End Source File -# Begin Source File - -SOURCE=.\ogg_decoder_aspect.c -# End Source File -# Begin Source File - -SOURCE=.\ogg_encoder_aspect.c -# End Source File -# Begin Source File - -SOURCE=.\ogg_helper.c -# End Source File -# Begin Source File - -SOURCE=.\ogg_mapping.c -# End Source File -# Begin Source File - -SOURCE=.\stream_decoder.c -# End Source File -# Begin Source File - -SOURCE=.\stream_encoder.c -# End Source File -# Begin Source File - -SOURCE=.\stream_encoder_framing.c -# End Source File -# Begin Source File - -SOURCE=.\window.c -# End Source File -# End Group -# Begin Group "Private Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\private\all.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\bitmath.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\bitreader.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\bitwriter.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\cpu.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\crc.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\fixed.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\float.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\format.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\lpc.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\md5.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\memory.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\metadata.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\ogg_decoder_aspect.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\ogg_encoder_aspect.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\ogg_helper.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\ogg_mapping.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\stream_encoder_framing.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\window.h -# End Source File -# End Group -# Begin Group "Protected Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\protected\all.h -# End Source File -# Begin Source File - -SOURCE=.\include\protected\stream_decoder.h -# End Source File -# Begin Source File - -SOURCE=.\include\protected\stream_encoder.h -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\include\FLAC\all.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\FLAC\assert.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\FLAC\export.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\FLAC\format.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\FLAC\metadata.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\FLAC\ordinals.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\FLAC\stream_decoder.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\FLAC\stream_encoder.h -# End Source File -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/libFLAC/libFLAC_dynamic.vcproj b/3rdparty/libflac/src/libFLAC/libFLAC_dynamic.vcproj deleted file mode 100644 index f8163ab7b9d..00000000000 --- a/3rdparty/libflac/src/libFLAC/libFLAC_dynamic.vcproj +++ /dev/null @@ -1,540 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="libFLAC_dynamic" - ProjectGUID="{4cefbc83-c215-11db-8314-0800200c9a66}" - RootNamespace="libFLAC_dynamic" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\obj\debug\lib" - IntermediateDirectory="Debug_dynamic" - ConfigurationType="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".\include;..\..\include" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;FLAC_API_EXPORTS;FLAC__HAS_OGG;FLAC__CPU_IA32;FLAC__HAS_NASM;FLAC__USE_3DNOW;VERSION=\"1.2.0\";DEBUG;FLAC__OVERFLOW_DETECT" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="..\..\obj\release\lib\ogg_static.lib" - LinkIncremental="2" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="2" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\obj\release\lib" - IntermediateDirectory="Release_dynamic" - ConfigurationType="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".\include;..\..\include" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;FLAC_API_EXPORTS;FLAC__HAS_OGG;FLAC__CPU_IA32;FLAC__HAS_NASM;FLAC__USE_3DNOW;VERSION=\"1.2.0\"" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="..\..\obj\release\lib\ogg_static.lib" - LinkIncremental="1" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="2" - OptimizeReferences="2" - EnableCOMDATFolding="2" - LinkTimeCodeGeneration="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath=".\include\private\all.h" - > - </File> - <File - RelativePath=".\include\protected\all.h" - > - </File> - <File - RelativePath=".\include\private\bitmath.h" - > - </File> - <File - RelativePath=".\include\private\bitreader.h" - > - </File> - <File - RelativePath=".\include\private\bitwriter.h" - > - </File> - <File - RelativePath=".\include\private\cpu.h" - > - </File> - <File - RelativePath=".\include\private\crc.h" - > - </File> - <File - RelativePath=".\include\private\fixed.h" - > - </File> - <File - RelativePath=".\include\private\float.h" - > - </File> - <File - RelativePath=".\include\private\format.h" - > - </File> - <File - RelativePath=".\include\private\lpc.h" - > - </File> - <File - RelativePath=".\include\private\md5.h" - > - </File> - <File - RelativePath=".\include\private\memory.h" - > - </File> - <File - RelativePath=".\include\private\metadata.h" - > - </File> - <File - RelativePath=".\ia32\nasm.h" - > - </File> - <File - RelativePath=".\include\private\ogg_decoder_aspect.h" - > - </File> - <File - RelativePath=".\include\private\ogg_encoder_aspect.h" - > - </File> - <File - RelativePath=".\include\private\ogg_helper.h" - > - </File> - <File - RelativePath=".\include\private\ogg_mapping.h" - > - </File> - <File - RelativePath=".\include\protected\stream_decoder.h" - > - </File> - <File - RelativePath=".\include\protected\stream_encoder.h" - > - </File> - <File - RelativePath=".\include\private\stream_encoder_framing.h" - > - </File> - <File - RelativePath=".\include\private\window.h" - > - </File> - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\bitmath.c" - > - </File> - <File - RelativePath=".\bitreader.c" - > - </File> - <File - RelativePath=".\bitwriter.c" - > - </File> - <File - RelativePath=".\cpu.c" - > - </File> - <File - RelativePath=".\crc.c" - > - </File> - <File - RelativePath=".\fixed.c" - > - </File> - <File - RelativePath=".\float.c" - > - </File> - <File - RelativePath=".\format.c" - > - </File> - <File - RelativePath=".\lpc.c" - > - </File> - <File - RelativePath=".\md5.c" - > - </File> - <File - RelativePath=".\memory.c" - > - </File> - <File - RelativePath=".\metadata_iterators.c" - > - </File> - <File - RelativePath=".\metadata_object.c" - > - </File> - <File - RelativePath=".\ogg_decoder_aspect.c" - > - </File> - <File - RelativePath=".\ogg_encoder_aspect.c" - > - </File> - <File - RelativePath=".\ogg_helper.c" - > - </File> - <File - RelativePath=".\ogg_mapping.c" - > - </File> - <File - RelativePath=".\stream_decoder.c" - > - </File> - <File - RelativePath=".\stream_encoder.c" - > - </File> - <File - RelativePath=".\stream_encoder_framing.c" - > - </File> - <File - RelativePath=".\window.c" - > - </File> - </Filter> - <Filter - Name="Public Header Files" - > - <File - RelativePath="..\..\include\FLAC\all.h" - > - </File> - <File - RelativePath="..\..\include\FLAC\assert.h" - > - </File> - <File - RelativePath="..\..\include\FLAC\callback.h" - > - </File> - <File - RelativePath="..\..\include\FLAC\export.h" - > - </File> - <File - RelativePath="..\..\include\FLAC\format.h" - > - </File> - <File - RelativePath="..\..\include\FLAC\metadata.h" - > - </File> - <File - RelativePath="..\..\include\FLAC\ordinals.h" - > - </File> - <File - RelativePath="..\..\include\FLAC\stream_decoder.h" - > - </File> - <File - RelativePath="..\..\include\FLAC\stream_encoder.h" - > - </File> - </Filter> - <File - RelativePath=".\ia32\bitreader_asm.nasm" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/bitreader_asm.nasm -o ia32/bitreader_asm.obj
" - AdditionalDependencies="ia32/bitreader_asm.nasm;ia32/nasm.h" - Outputs="ia32/bitreader_asm.obj" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/bitreader_asm.nasm -o ia32/bitreader_asm.obj
" - AdditionalDependencies="ia32/bitreader_asm.nasm;ia32/nasm.h" - Outputs="ia32/bitreader_asm.obj" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\release_static\BuildLog.htm" - > - </File> - <File - RelativePath=".\ia32\cpu_asm.nasm" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/cpu_asm.nasm -o ia32/cpu_asm.obj
" - AdditionalDependencies="ia32/cpu_asm.nasm;ia32/nasm.h" - Outputs="ia32/cpu_asm.obj" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/cpu_asm.nasm -o ia32/cpu_asm.obj
" - AdditionalDependencies="ia32/cpu_asm.nasm;ia32/nasm.h" - Outputs="ia32/cpu_asm.obj" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ia32\fixed_asm.nasm" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/fixed_asm.nasm -o ia32/fixed_asm.obj
" - AdditionalDependencies="ia32/fixed_asm.nasm;ia32/nasm.h" - Outputs="ia32/fixed_asm.obj" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/fixed_asm.nasm -o ia32/fixed_asm.obj
" - AdditionalDependencies="ia32/fixed_asm.nasm;ia32/nasm.h" - Outputs="ia32/fixed_asm.obj" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ia32\lpc_asm.nasm" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/lpc_asm.nasm -o ia32/lpc_asm.obj
" - AdditionalDependencies="ia32/lpc_asm.nasm;ia32/nasm.h" - Outputs="ia32/lpc_asm.obj" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/lpc_asm.nasm -o ia32/lpc_asm.obj
" - AdditionalDependencies="ia32/lpc_asm.nasm;ia32/nasm.h" - Outputs="ia32/lpc_asm.obj" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ia32\stream_encoder_asm.nasm" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/stream_encoder_asm.nasm -o ia32/stream_encoder_asm.obj
" - AdditionalDependencies="ia32/stream_encoder_asm.nasm;ia32/nasm.h" - Outputs="ia32/stream_encoder_asm.obj" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/stream_encoder_asm.nasm -o ia32/stream_encoder_asm.obj
" - AdditionalDependencies="ia32/stream_encoder_asm.nasm;ia32/nasm.h" - Outputs="ia32/stream_encoder_asm.obj" - /> - </FileConfiguration> - </File> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/libFLAC/libFLAC_static.dsp b/3rdparty/libflac/src/libFLAC/libFLAC_static.dsp deleted file mode 100644 index 1a11d8b2120..00000000000 --- a/3rdparty/libflac/src/libFLAC/libFLAC_static.dsp +++ /dev/null @@ -1,457 +0,0 @@ -# Microsoft Developer Studio Project File - Name="libFLAC_static" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=libFLAC_static - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libFLAC_static.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libFLAC_static.mak" CFG="libFLAC_static - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libFLAC_static - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "libFLAC_static - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "libFLAC" -# PROP Scc_LocalPath "..\.." -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libFLAC_static - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\obj\release\lib" -# PROP Intermediate_Dir "Release_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /Op /I ".\include" /I "..\..\include" /D VERSION=\"1.2.1\" /D "FLAC__NO_DLL" /D "FLAC__HAS_OGG" /D "FLAC__CPU_IA32" /D "FLAC__HAS_NASM" /D "FLAC__USE_3DNOW" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /nodefaultlib - -!ELSEIF "$(CFG)" == "libFLAC_static - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\obj\debug\lib" -# PROP Intermediate_Dir "Debug_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\include" /I "..\..\include" /D VERSION=\"1.2.1\" /D "FLAC__NO_DLL" /D "FLAC__HAS_OGG" /D "FLAC__CPU_IA32" /D "FLAC__HAS_NASM" /D "FLAC__USE_3DNOW" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D "FLAC__OVERFLOW_DETECT" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /nodefaultlib - -!ENDIF - -# Begin Target - -# Name "libFLAC_static - Win32 Release" -# Name "libFLAC_static - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "c" -# Begin Group "Assembly Files (ia32)" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\ia32\bitreader_asm.nasm - -!IF "$(CFG)" == "libFLAC_static - Win32 Release" - -USERDEP__CPU_A="ia32/bitreader_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\bitreader_asm.nasm - -"ia32/bitreader_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/bitreader_asm.nasm -o ia32/bitreader_asm.obj - -# End Custom Build - -!ELSEIF "$(CFG)" == "libFLAC_static - Win32 Debug" - -USERDEP__CPU_A="ia32/bitreader_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\bitreader_asm.nasm - -"ia32/bitreader_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/bitreader_asm.nasm -o ia32/bitreader_asm.obj - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ia32\cpu_asm.nasm - -!IF "$(CFG)" == "libFLAC_static - Win32 Release" - -USERDEP__CPU_A="ia32/cpu_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\cpu_asm.nasm - -"ia32/cpu_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/cpu_asm.nasm -o ia32/cpu_asm.obj - -# End Custom Build - -!ELSEIF "$(CFG)" == "libFLAC_static - Win32 Debug" - -USERDEP__CPU_A="ia32/cpu_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\cpu_asm.nasm - -"ia32/cpu_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/cpu_asm.nasm -o ia32/cpu_asm.obj - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ia32\fixed_asm.nasm - -!IF "$(CFG)" == "libFLAC_static - Win32 Release" - -USERDEP__FIXED="ia32/fixed_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\fixed_asm.nasm - -"ia32/fixed_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/fixed_asm.nasm -o ia32/fixed_asm.obj - -# End Custom Build - -!ELSEIF "$(CFG)" == "libFLAC_static - Win32 Debug" - -USERDEP__FIXED="ia32/fixed_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\fixed_asm.nasm - -"ia32/fixed_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/fixed_asm.nasm -o ia32/fixed_asm.obj - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ia32\lpc_asm.nasm - -!IF "$(CFG)" == "libFLAC_static - Win32 Release" - -USERDEP__LPC_A="ia32/lpc_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\lpc_asm.nasm - -"ia32/lpc_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/lpc_asm.nasm -o ia32/lpc_asm.obj - -# End Custom Build - -!ELSEIF "$(CFG)" == "libFLAC_static - Win32 Debug" - -USERDEP__LPC_A="ia32/lpc_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\lpc_asm.nasm - -"ia32/lpc_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/lpc_asm.nasm -o ia32/lpc_asm.obj - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ia32\stream_encoder_asm.nasm - -!IF "$(CFG)" == "libFLAC_static - Win32 Release" - -USERDEP__CPU_A="ia32/stream_encoder_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\stream_encoder_asm.nasm - -"ia32/stream_encoder_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/stream_encoder_asm.nasm -o ia32/stream_encoder_asm.obj - -# End Custom Build - -!ELSEIF "$(CFG)" == "libFLAC_static - Win32 Debug" - -USERDEP__CPU_A="ia32/stream_encoder_asm.nasm" -# Begin Custom Build -InputPath=.\ia32\stream_encoder_asm.nasm - -"ia32/stream_encoder_asm.obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/stream_encoder_asm.nasm -o ia32/stream_encoder_asm.obj - -# End Custom Build - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\ia32\nasm.h -# End Source File -# End Group -# Begin Source File - -SOURCE=.\bitmath.c -# End Source File -# Begin Source File - -SOURCE=.\bitreader.c -# End Source File -# Begin Source File - -SOURCE=.\bitwriter.c -# End Source File -# Begin Source File - -SOURCE=.\cpu.c -# End Source File -# Begin Source File - -SOURCE=.\crc.c -# End Source File -# Begin Source File - -SOURCE=.\fixed.c -# End Source File -# Begin Source File - -SOURCE=.\float.c -# End Source File -# Begin Source File - -SOURCE=.\format.c -# End Source File -# Begin Source File - -SOURCE=.\lpc.c -# End Source File -# Begin Source File - -SOURCE=.\md5.c -# End Source File -# Begin Source File - -SOURCE=.\memory.c -# End Source File -# Begin Source File - -SOURCE=.\metadata_iterators.c -# End Source File -# Begin Source File - -SOURCE=.\metadata_object.c -# End Source File -# Begin Source File - -SOURCE=.\ogg_decoder_aspect.c -# End Source File -# Begin Source File - -SOURCE=.\ogg_encoder_aspect.c -# End Source File -# Begin Source File - -SOURCE=.\ogg_helper.c -# End Source File -# Begin Source File - -SOURCE=.\ogg_mapping.c -# End Source File -# Begin Source File - -SOURCE=.\stream_decoder.c -# End Source File -# Begin Source File - -SOURCE=.\stream_encoder.c -# End Source File -# Begin Source File - -SOURCE=.\stream_encoder_framing.c -# End Source File -# Begin Source File - -SOURCE=.\window.c -# End Source File -# End Group -# Begin Group "Private Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\private\all.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\bitmath.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\bitreader.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\bitwriter.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\cpu.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\crc.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\fixed.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\float.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\format.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\lpc.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\md5.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\memory.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\metadata.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\ogg_decoder_aspect.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\ogg_encoder_aspect.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\ogg_helper.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\ogg_mapping.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\stream_encoder_framing.h -# End Source File -# Begin Source File - -SOURCE=.\include\private\window.h -# End Source File -# End Group -# Begin Group "Protected Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\protected\all.h -# End Source File -# Begin Source File - -SOURCE=.\include\protected\stream_decoder.h -# End Source File -# Begin Source File - -SOURCE=.\include\protected\stream_encoder.h -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\include\FLAC\all.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\FLAC\assert.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\FLAC\export.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\FLAC\format.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\FLAC\metadata.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\FLAC\ordinals.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\FLAC\stream_decoder.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\FLAC\stream_encoder.h -# End Source File -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/libFLAC/libFLAC_static.vcproj b/3rdparty/libflac/src/libFLAC/libFLAC_static.vcproj deleted file mode 100644 index cdc1531c92c..00000000000 --- a/3rdparty/libflac/src/libFLAC/libFLAC_static.vcproj +++ /dev/null @@ -1,505 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="libFLAC_static" - ProjectGUID="{4cefbc84-c215-11db-8314-0800200c9a66}" - RootNamespace="libFLAC_static" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\obj\debug\lib" - IntermediateDirectory="Debug_static" - ConfigurationType="4" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".\include;..\..\include" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;FLAC__HAS_OGG;FLAC__CPU_IA32;FLAC__HAS_NASM;FLAC__USE_3DNOW;VERSION=\"1.2.0\";FLAC__NO_DLL;DEBUG;FLAC__OVERFLOW_DETECT" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\..\obj\debug\lib\$(ProjectName).lib" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\obj\release\lib" - IntermediateDirectory="Release_static" - ConfigurationType="4" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".\include;..\..\include" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__HAS_OGG;FLAC__CPU_IA32;FLAC__HAS_NASM;FLAC__USE_3DNOW;VERSION=\"1.2.0\";FLAC__NO_DLL" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\..\obj\release\lib\$(ProjectName).lib" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath=".\include\protected\all.h" - > - </File> - <File - RelativePath=".\include\private\all.h" - > - </File> - <File - RelativePath=".\include\private\bitmath.h" - > - </File> - <File - RelativePath=".\include\private\bitreader.h" - > - </File> - <File - RelativePath=".\include\private\bitwriter.h" - > - </File> - <File - RelativePath=".\include\private\cpu.h" - > - </File> - <File - RelativePath=".\include\private\crc.h" - > - </File> - <File - RelativePath=".\include\private\fixed.h" - > - </File> - <File - RelativePath=".\include\private\float.h" - > - </File> - <File - RelativePath=".\include\private\format.h" - > - </File> - <File - RelativePath=".\include\private\lpc.h" - > - </File> - <File - RelativePath=".\include\private\md5.h" - > - </File> - <File - RelativePath=".\include\private\memory.h" - > - </File> - <File - RelativePath=".\include\private\metadata.h" - > - </File> - <File - RelativePath=".\ia32\nasm.h" - > - </File> - <File - RelativePath=".\include\private\ogg_decoder_aspect.h" - > - </File> - <File - RelativePath=".\include\private\ogg_encoder_aspect.h" - > - </File> - <File - RelativePath=".\include\private\ogg_helper.h" - > - </File> - <File - RelativePath=".\include\private\ogg_mapping.h" - > - </File> - <File - RelativePath=".\include\protected\stream_decoder.h" - > - </File> - <File - RelativePath=".\include\protected\stream_encoder.h" - > - </File> - <File - RelativePath=".\include\private\stream_encoder_framing.h" - > - </File> - <File - RelativePath=".\include\private\window.h" - > - </File> - </Filter> - <Filter - Name="Public Header Files" - > - <File - RelativePath="..\..\include\FLAC\all.h" - > - </File> - <File - RelativePath="..\..\include\FLAC\assert.h" - > - </File> - <File - RelativePath="..\..\include\FLAC\callback.h" - > - </File> - <File - RelativePath="..\..\include\FLAC\export.h" - > - </File> - <File - RelativePath="..\..\include\FLAC\format.h" - > - </File> - <File - RelativePath="..\..\include\FLAC\metadata.h" - > - </File> - <File - RelativePath="..\..\include\FLAC\ordinals.h" - > - </File> - <File - RelativePath="..\..\include\FLAC\stream_decoder.h" - > - </File> - <File - RelativePath="..\..\include\FLAC\stream_encoder.h" - > - </File> - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\bitmath.c" - > - </File> - <File - RelativePath=".\bitreader.c" - > - </File> - <File - RelativePath=".\bitwriter.c" - > - </File> - <File - RelativePath=".\cpu.c" - > - </File> - <File - RelativePath=".\crc.c" - > - </File> - <File - RelativePath=".\fixed.c" - > - </File> - <File - RelativePath=".\float.c" - > - </File> - <File - RelativePath=".\format.c" - > - </File> - <File - RelativePath=".\lpc.c" - > - </File> - <File - RelativePath=".\md5.c" - > - </File> - <File - RelativePath=".\memory.c" - > - </File> - <File - RelativePath=".\metadata_iterators.c" - > - </File> - <File - RelativePath=".\metadata_object.c" - > - </File> - <File - RelativePath=".\ogg_decoder_aspect.c" - > - </File> - <File - RelativePath=".\ogg_encoder_aspect.c" - > - </File> - <File - RelativePath=".\ogg_helper.c" - > - </File> - <File - RelativePath=".\ogg_mapping.c" - > - </File> - <File - RelativePath=".\stream_decoder.c" - > - </File> - <File - RelativePath=".\stream_encoder.c" - > - </File> - <File - RelativePath=".\stream_encoder_framing.c" - > - </File> - <File - RelativePath=".\window.c" - > - </File> - </Filter> - <File - RelativePath=".\ia32\bitreader_asm.nasm" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/bitreader_asm.nasm -o ia32/bitreader_asm.obj
" - AdditionalDependencies="ia32/bitreader_asm.nasm;ia32/nasm.h" - Outputs="ia32/bitreader_asm.obj" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/bitreader_asm.nasm -o ia32/bitreader_asm.obj
" - AdditionalDependencies="ia32/bitreader_asm.nasm;ia32/nasm.h" - Outputs="ia32/bitreader_asm.obj" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ia32\cpu_asm.nasm" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/cpu_asm.nasm -o ia32/cpu_asm.obj
" - AdditionalDependencies="ia32/cpu_asm.nasm;ia32/nasm.h" - Outputs="ia32/cpu_asm.obj" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/cpu_asm.nasm -o ia32/cpu_asm.obj
" - AdditionalDependencies="ia32/cpu_asm.nasm;ia32/nasm.h" - Outputs="ia32/cpu_asm.obj" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ia32\fixed_asm.nasm" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/fixed_asm.nasm -o ia32/fixed_asm.obj
" - AdditionalDependencies="ia32/fixed_asm.nasm;ia32/nasm.h" - Outputs="ia32/fixed_asm.obj" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/fixed_asm.nasm -o ia32/fixed_asm.obj
" - AdditionalDependencies="ia32/fixed_asm.nasm;ia32/nasm.h" - Outputs="ia32/fixed_asm.obj" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ia32\lpc_asm.nasm" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/lpc_asm.nasm -o ia32/lpc_asm.obj
" - AdditionalDependencies="ia32/lpc_asm.nasm;ia32/nasm.h" - Outputs="ia32/lpc_asm.obj" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/lpc_asm.nasm -o ia32/lpc_asm.obj
" - AdditionalDependencies="ia32/lpc_asm.nasm;ia32/nasm.h" - Outputs="ia32/lpc_asm.obj" - /> - </FileConfiguration> - </File> - <File - RelativePath=".\ia32\stream_encoder_asm.nasm" - > - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/stream_encoder_asm.nasm -o ia32/stream_encoder_asm.obj
" - AdditionalDependencies="ia32/stream_encoder_asm.nasm;ia32/nasm.h" - Outputs="ia32/stream_encoder_asm.obj" - /> - </FileConfiguration> - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - CommandLine="nasmw.exe -f win32 -d OBJ_FORMAT_win32 -i ia32/ ia32/stream_encoder_asm.nasm -o ia32/stream_encoder_asm.obj
" - AdditionalDependencies="ia32/stream_encoder_asm.nasm;ia32/nasm.h" - Outputs="ia32/stream_encoder_asm.obj" - /> - </FileConfiguration> - </File> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/libFLAC/lpc.c b/3rdparty/libflac/src/libFLAC/lpc.c deleted file mode 100644 index 00bbab44c1c..00000000000 --- a/3rdparty/libflac/src/libFLAC/lpc.c +++ /dev/null @@ -1,1384 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <math.h> -#include "FLAC/assert.h" -#include "FLAC/format.h" -#include "private/bitmath.h" -#include "private/lpc.h" -#if defined DEBUG || defined FLAC__OVERFLOW_DETECT || defined FLAC__OVERFLOW_DETECT_VERBOSE -#include <stdio.h> -#endif - -#ifndef FLAC__INTEGER_ONLY_LIBRARY - -#ifndef M_LN2 -/* math.h in VC++ doesn't seem to have this (how Microsoft is that?) */ -#define M_LN2 0.69314718055994530942 -#endif - -/* OPT: #undef'ing this may improve the speed on some architectures */ -#define FLAC__LPC_UNROLLED_FILTER_LOOPS - - -void FLAC__lpc_window_data(const FLAC__int32 in[], const FLAC__real window[], FLAC__real out[], unsigned data_len) -{ - unsigned i; - for(i = 0; i < data_len; i++) - out[i] = in[i] * window[i]; -} - -#if defined(__GNUC__) && defined(__i386__) && (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) -__attribute__((optimize("O0"))) -#endif -void FLAC__lpc_compute_autocorrelation(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]) -{ - /* a readable, but slower, version */ -#if 0 - FLAC__real d; - unsigned i; - - FLAC__ASSERT(lag > 0); - FLAC__ASSERT(lag <= data_len); - - /* - * Technically we should subtract the mean first like so: - * for(i = 0; i < data_len; i++) - * data[i] -= mean; - * but it appears not to make enough of a difference to matter, and - * most signals are already closely centered around zero - */ - while(lag--) { - for(i = lag, d = 0.0; i < data_len; i++) - d += data[i] * data[i - lag]; - autoc[lag] = d; - } -#endif - - /* - * this version tends to run faster because of better data locality - * ('data_len' is usually much larger than 'lag') - */ - FLAC__real d, tmp; - unsigned sample, coeff; - const unsigned limit = data_len - lag; - - FLAC__ASSERT(lag > 0); - FLAC__ASSERT(lag <= data_len); - - for(coeff = 0; coeff < lag; coeff++) - autoc[coeff] = 0.0; - for(sample = 0; sample <= limit; sample++) { - d = data[sample]; - for(coeff = 0; coeff < lag; coeff++) { - tmp = d * data[sample+coeff]; - autoc[coeff] += tmp; - } - } - for(; sample < data_len; sample++) { - d = data[sample]; - for(coeff = 0; coeff < data_len - sample; coeff++) { - tmp = d * data[sample+coeff]; - autoc[coeff] += tmp; - } - } -} - -void FLAC__lpc_compute_lp_coefficients(const FLAC__real autoc[], unsigned *max_order, FLAC__real lp_coeff[][FLAC__MAX_LPC_ORDER], FLAC__double error[]) -{ - unsigned i, j; - FLAC__double r, err, lpc[FLAC__MAX_LPC_ORDER]; - - FLAC__ASSERT(0 != max_order); - FLAC__ASSERT(0 < *max_order); - FLAC__ASSERT(*max_order <= FLAC__MAX_LPC_ORDER); - FLAC__ASSERT(autoc[0] != 0.0); - - err = autoc[0]; - - for(i = 0; i < *max_order; i++) { - /* Sum up this iteration's reflection coefficient. */ - r = -autoc[i+1]; - for(j = 0; j < i; j++) - r -= lpc[j] * autoc[i-j]; - r/=err; - - /* Update LPC coefficients and total error. */ - lpc[i]=r; - for(j = 0; j < (i>>1); j++) { - FLAC__double tmp = lpc[j]; - lpc[j] += r * lpc[i-1-j]; - lpc[i-1-j] += r * tmp; - } - if(i & 1) - lpc[j] += lpc[j] * r; - - err *= (1.0 - r * r); - - /* save this order */ - for(j = 0; j <= i; j++) - lp_coeff[i][j] = (FLAC__real)(-lpc[j]); /* negate FIR filter coeff to get predictor coeff */ - error[i] = err; - - /* see SF bug #1601812 http://sourceforge.net/tracker/index.php?func=detail&aid=1601812&group_id=13478&atid=113478 */ - if(err == 0.0) { - *max_order = i+1; - return; - } - } -} - -int FLAC__lpc_quantize_coefficients(const FLAC__real lp_coeff[], unsigned order, unsigned precision, FLAC__int32 qlp_coeff[], int *shift) -{ - unsigned i; - FLAC__double cmax; - FLAC__int32 qmax, qmin; - - FLAC__ASSERT(precision > 0); - FLAC__ASSERT(precision >= FLAC__MIN_QLP_COEFF_PRECISION); - - /* drop one bit for the sign; from here on out we consider only |lp_coeff[i]| */ - precision--; - qmax = 1 << precision; - qmin = -qmax; - qmax--; - - /* calc cmax = max( |lp_coeff[i]| ) */ - cmax = 0.0; - for(i = 0; i < order; i++) { - const FLAC__double d = fabs(lp_coeff[i]); - if(d > cmax) - cmax = d; - } - - if(cmax <= 0.0) { - /* => coefficients are all 0, which means our constant-detect didn't work */ - return 2; - } - else { - const int max_shiftlimit = (1 << (FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN-1)) - 1; - const int min_shiftlimit = -max_shiftlimit - 1; - int log2cmax; - - (void)frexp(cmax, &log2cmax); - log2cmax--; - *shift = (int)precision - log2cmax - 1; - - if(*shift > max_shiftlimit) - *shift = max_shiftlimit; - else if(*shift < min_shiftlimit) - return 1; - } - - if(*shift >= 0) { - FLAC__double error = 0.0; - FLAC__int32 q; - for(i = 0; i < order; i++) { - error += lp_coeff[i] * (1 << *shift); -#if 1 /* unfortunately lround() is C99 */ - if(error >= 0.0) - q = (FLAC__int32)(error + 0.5); - else - q = (FLAC__int32)(error - 0.5); -#else - q = lround(error); -#endif -#ifdef FLAC__OVERFLOW_DETECT - if(q > qmax+1) /* we expect q==qmax+1 occasionally due to rounding */ - fprintf(stderr,"FLAC__lpc_quantize_coefficients: quantizer overflow: q>qmax %d>%d shift=%d cmax=%f precision=%u lpc[%u]=%f\n",q,qmax,*shift,cmax,precision+1,i,lp_coeff[i]); - else if(q < qmin) - fprintf(stderr,"FLAC__lpc_quantize_coefficients: quantizer overflow: q<qmin %d<%d shift=%d cmax=%f precision=%u lpc[%u]=%f\n",q,qmin,*shift,cmax,precision+1,i,lp_coeff[i]); -#endif - if(q > qmax) - q = qmax; - else if(q < qmin) - q = qmin; - error -= q; - qlp_coeff[i] = q; - } - } - /* negative shift is very rare but due to design flaw, negative shift is - * a NOP in the decoder, so it must be handled specially by scaling down - * coeffs - */ - else { - const int nshift = -(*shift); - FLAC__double error = 0.0; - FLAC__int32 q; -#ifdef DEBUG - fprintf(stderr,"FLAC__lpc_quantize_coefficients: negative shift=%d order=%u cmax=%f\n", *shift, order, cmax); -#endif - for(i = 0; i < order; i++) { - error += lp_coeff[i] / (1 << nshift); -#if 1 /* unfortunately lround() is C99 */ - if(error >= 0.0) - q = (FLAC__int32)(error + 0.5); - else - q = (FLAC__int32)(error - 0.5); -#else - q = lround(error); -#endif -#ifdef FLAC__OVERFLOW_DETECT - if(q > qmax+1) /* we expect q==qmax+1 occasionally due to rounding */ - fprintf(stderr,"FLAC__lpc_quantize_coefficients: quantizer overflow: q>qmax %d>%d shift=%d cmax=%f precision=%u lpc[%u]=%f\n",q,qmax,*shift,cmax,precision+1,i,lp_coeff[i]); - else if(q < qmin) - fprintf(stderr,"FLAC__lpc_quantize_coefficients: quantizer overflow: q<qmin %d<%d shift=%d cmax=%f precision=%u lpc[%u]=%f\n",q,qmin,*shift,cmax,precision+1,i,lp_coeff[i]); -#endif - if(q > qmax) - q = qmax; - else if(q < qmin) - q = qmin; - error -= q; - qlp_coeff[i] = q; - } - *shift = 0; - } - - return 0; -} - -void FLAC__lpc_compute_residual_from_qlp_coefficients(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]) -#if defined(FLAC__OVERFLOW_DETECT) || !defined(FLAC__LPC_UNROLLED_FILTER_LOOPS) -{ - FLAC__int64 sumo; - unsigned i, j; - FLAC__int32 sum; - const FLAC__int32 *history; - -#ifdef FLAC__OVERFLOW_DETECT_VERBOSE - fprintf(stderr,"FLAC__lpc_compute_residual_from_qlp_coefficients: data_len=%d, order=%u, lpq=%d",data_len,order,lp_quantization); - for(i=0;i<order;i++) - fprintf(stderr,", q[%u]=%d",i,qlp_coeff[i]); - fprintf(stderr,"\n"); -#endif - FLAC__ASSERT(order > 0); - - for(i = 0; i < data_len; i++) { - sumo = 0; - sum = 0; - history = data; - for(j = 0; j < order; j++) { - sum += qlp_coeff[j] * (*(--history)); - sumo += (FLAC__int64)qlp_coeff[j] * (FLAC__int64)(*history); -#if defined _MSC_VER - if(sumo > 2147483647I64 || sumo < -2147483648I64) - fprintf(stderr,"FLAC__lpc_compute_residual_from_qlp_coefficients: OVERFLOW, i=%u, j=%u, c=%d, d=%d, sumo=%I64d\n",i,j,qlp_coeff[j],*history,sumo); -#else - if(sumo > 2147483647ll || sumo < -2147483648ll) - fprintf(stderr,"FLAC__lpc_compute_residual_from_qlp_coefficients: OVERFLOW, i=%u, j=%u, c=%d, d=%d, sumo=%lld\n",i,j,qlp_coeff[j],*history,(long long)sumo); -#endif - } - *(residual++) = *(data++) - (sum >> lp_quantization); - } - - /* Here's a slower but clearer version: - for(i = 0; i < data_len; i++) { - sum = 0; - for(j = 0; j < order; j++) - sum += qlp_coeff[j] * data[i-j-1]; - residual[i] = data[i] - (sum >> lp_quantization); - } - */ -} -#else /* fully unrolled version for normal use */ -{ - int i; - FLAC__int32 sum; - - FLAC__ASSERT(order > 0); - FLAC__ASSERT(order <= 32); - - /* - * We do unique versions up to 12th order since that's the subset limit. - * Also they are roughly ordered to match frequency of occurrence to - * minimize branching. - */ - if(order <= 12) { - if(order > 8) { - if(order > 10) { - if(order == 12) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[11] * data[i-12]; - sum += qlp_coeff[10] * data[i-11]; - sum += qlp_coeff[9] * data[i-10]; - sum += qlp_coeff[8] * data[i-9]; - sum += qlp_coeff[7] * data[i-8]; - sum += qlp_coeff[6] * data[i-7]; - sum += qlp_coeff[5] * data[i-6]; - sum += qlp_coeff[4] * data[i-5]; - sum += qlp_coeff[3] * data[i-4]; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - residual[i] = data[i] - (sum >> lp_quantization); - } - } - else { /* order == 11 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[10] * data[i-11]; - sum += qlp_coeff[9] * data[i-10]; - sum += qlp_coeff[8] * data[i-9]; - sum += qlp_coeff[7] * data[i-8]; - sum += qlp_coeff[6] * data[i-7]; - sum += qlp_coeff[5] * data[i-6]; - sum += qlp_coeff[4] * data[i-5]; - sum += qlp_coeff[3] * data[i-4]; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - residual[i] = data[i] - (sum >> lp_quantization); - } - } - } - else { - if(order == 10) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[9] * data[i-10]; - sum += qlp_coeff[8] * data[i-9]; - sum += qlp_coeff[7] * data[i-8]; - sum += qlp_coeff[6] * data[i-7]; - sum += qlp_coeff[5] * data[i-6]; - sum += qlp_coeff[4] * data[i-5]; - sum += qlp_coeff[3] * data[i-4]; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - residual[i] = data[i] - (sum >> lp_quantization); - } - } - else { /* order == 9 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[8] * data[i-9]; - sum += qlp_coeff[7] * data[i-8]; - sum += qlp_coeff[6] * data[i-7]; - sum += qlp_coeff[5] * data[i-6]; - sum += qlp_coeff[4] * data[i-5]; - sum += qlp_coeff[3] * data[i-4]; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - residual[i] = data[i] - (sum >> lp_quantization); - } - } - } - } - else if(order > 4) { - if(order > 6) { - if(order == 8) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[7] * data[i-8]; - sum += qlp_coeff[6] * data[i-7]; - sum += qlp_coeff[5] * data[i-6]; - sum += qlp_coeff[4] * data[i-5]; - sum += qlp_coeff[3] * data[i-4]; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - residual[i] = data[i] - (sum >> lp_quantization); - } - } - else { /* order == 7 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[6] * data[i-7]; - sum += qlp_coeff[5] * data[i-6]; - sum += qlp_coeff[4] * data[i-5]; - sum += qlp_coeff[3] * data[i-4]; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - residual[i] = data[i] - (sum >> lp_quantization); - } - } - } - else { - if(order == 6) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[5] * data[i-6]; - sum += qlp_coeff[4] * data[i-5]; - sum += qlp_coeff[3] * data[i-4]; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - residual[i] = data[i] - (sum >> lp_quantization); - } - } - else { /* order == 5 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[4] * data[i-5]; - sum += qlp_coeff[3] * data[i-4]; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - residual[i] = data[i] - (sum >> lp_quantization); - } - } - } - } - else { - if(order > 2) { - if(order == 4) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[3] * data[i-4]; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - residual[i] = data[i] - (sum >> lp_quantization); - } - } - else { /* order == 3 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - residual[i] = data[i] - (sum >> lp_quantization); - } - } - } - else { - if(order == 2) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - residual[i] = data[i] - (sum >> lp_quantization); - } - } - else { /* order == 1 */ - for(i = 0; i < (int)data_len; i++) - residual[i] = data[i] - ((qlp_coeff[0] * data[i-1]) >> lp_quantization); - } - } - } - } - else { /* order > 12 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - switch(order) { - case 32: sum += qlp_coeff[31] * data[i-32]; - case 31: sum += qlp_coeff[30] * data[i-31]; - case 30: sum += qlp_coeff[29] * data[i-30]; - case 29: sum += qlp_coeff[28] * data[i-29]; - case 28: sum += qlp_coeff[27] * data[i-28]; - case 27: sum += qlp_coeff[26] * data[i-27]; - case 26: sum += qlp_coeff[25] * data[i-26]; - case 25: sum += qlp_coeff[24] * data[i-25]; - case 24: sum += qlp_coeff[23] * data[i-24]; - case 23: sum += qlp_coeff[22] * data[i-23]; - case 22: sum += qlp_coeff[21] * data[i-22]; - case 21: sum += qlp_coeff[20] * data[i-21]; - case 20: sum += qlp_coeff[19] * data[i-20]; - case 19: sum += qlp_coeff[18] * data[i-19]; - case 18: sum += qlp_coeff[17] * data[i-18]; - case 17: sum += qlp_coeff[16] * data[i-17]; - case 16: sum += qlp_coeff[15] * data[i-16]; - case 15: sum += qlp_coeff[14] * data[i-15]; - case 14: sum += qlp_coeff[13] * data[i-14]; - case 13: sum += qlp_coeff[12] * data[i-13]; - sum += qlp_coeff[11] * data[i-12]; - sum += qlp_coeff[10] * data[i-11]; - sum += qlp_coeff[ 9] * data[i-10]; - sum += qlp_coeff[ 8] * data[i- 9]; - sum += qlp_coeff[ 7] * data[i- 8]; - sum += qlp_coeff[ 6] * data[i- 7]; - sum += qlp_coeff[ 5] * data[i- 6]; - sum += qlp_coeff[ 4] * data[i- 5]; - sum += qlp_coeff[ 3] * data[i- 4]; - sum += qlp_coeff[ 2] * data[i- 3]; - sum += qlp_coeff[ 1] * data[i- 2]; - sum += qlp_coeff[ 0] * data[i- 1]; - } - residual[i] = data[i] - (sum >> lp_quantization); - } - } -} -#endif - -void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]) -#if defined(FLAC__OVERFLOW_DETECT) || !defined(FLAC__LPC_UNROLLED_FILTER_LOOPS) -{ - unsigned i, j; - FLAC__int64 sum; - const FLAC__int32 *history; - -#ifdef FLAC__OVERFLOW_DETECT_VERBOSE - fprintf(stderr,"FLAC__lpc_compute_residual_from_qlp_coefficients_wide: data_len=%d, order=%u, lpq=%d",data_len,order,lp_quantization); - for(i=0;i<order;i++) - fprintf(stderr,", q[%u]=%d",i,qlp_coeff[i]); - fprintf(stderr,"\n"); -#endif - FLAC__ASSERT(order > 0); - - for(i = 0; i < data_len; i++) { - sum = 0; - history = data; - for(j = 0; j < order; j++) - sum += (FLAC__int64)qlp_coeff[j] * (FLAC__int64)(*(--history)); - if(FLAC__bitmath_silog2_wide(sum >> lp_quantization) > 32) { -#if defined _MSC_VER - fprintf(stderr,"FLAC__lpc_compute_residual_from_qlp_coefficients_wide: OVERFLOW, i=%u, sum=%I64d\n", i, sum >> lp_quantization); -#else - fprintf(stderr,"FLAC__lpc_compute_residual_from_qlp_coefficients_wide: OVERFLOW, i=%u, sum=%lld\n", i, (long long)(sum >> lp_quantization)); -#endif - break; - } - if(FLAC__bitmath_silog2_wide((FLAC__int64)(*data) - (sum >> lp_quantization)) > 32) { -#if defined _MSC_VER - fprintf(stderr,"FLAC__lpc_compute_residual_from_qlp_coefficients_wide: OVERFLOW, i=%u, data=%d, sum=%I64d, residual=%I64d\n", i, *data, sum >> lp_quantization, (FLAC__int64)(*data) - (sum >> lp_quantization)); -#else - fprintf(stderr,"FLAC__lpc_compute_residual_from_qlp_coefficients_wide: OVERFLOW, i=%u, data=%d, sum=%lld, residual=%lld\n", i, *data, (long long)(sum >> lp_quantization), (long long)((FLAC__int64)(*data) - (sum >> lp_quantization))); -#endif - break; - } - *(residual++) = *(data++) - (FLAC__int32)(sum >> lp_quantization); - } -} -#else /* fully unrolled version for normal use */ -{ - int i; - FLAC__int64 sum; - - FLAC__ASSERT(order > 0); - FLAC__ASSERT(order <= 32); - - /* - * We do unique versions up to 12th order since that's the subset limit. - * Also they are roughly ordered to match frequency of occurrence to - * minimize branching. - */ - if(order <= 12) { - if(order > 8) { - if(order > 10) { - if(order == 12) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[11] * (FLAC__int64)data[i-12]; - sum += qlp_coeff[10] * (FLAC__int64)data[i-11]; - sum += qlp_coeff[9] * (FLAC__int64)data[i-10]; - sum += qlp_coeff[8] * (FLAC__int64)data[i-9]; - sum += qlp_coeff[7] * (FLAC__int64)data[i-8]; - sum += qlp_coeff[6] * (FLAC__int64)data[i-7]; - sum += qlp_coeff[5] * (FLAC__int64)data[i-6]; - sum += qlp_coeff[4] * (FLAC__int64)data[i-5]; - sum += qlp_coeff[3] * (FLAC__int64)data[i-4]; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization); - } - } - else { /* order == 11 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[10] * (FLAC__int64)data[i-11]; - sum += qlp_coeff[9] * (FLAC__int64)data[i-10]; - sum += qlp_coeff[8] * (FLAC__int64)data[i-9]; - sum += qlp_coeff[7] * (FLAC__int64)data[i-8]; - sum += qlp_coeff[6] * (FLAC__int64)data[i-7]; - sum += qlp_coeff[5] * (FLAC__int64)data[i-6]; - sum += qlp_coeff[4] * (FLAC__int64)data[i-5]; - sum += qlp_coeff[3] * (FLAC__int64)data[i-4]; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization); - } - } - } - else { - if(order == 10) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[9] * (FLAC__int64)data[i-10]; - sum += qlp_coeff[8] * (FLAC__int64)data[i-9]; - sum += qlp_coeff[7] * (FLAC__int64)data[i-8]; - sum += qlp_coeff[6] * (FLAC__int64)data[i-7]; - sum += qlp_coeff[5] * (FLAC__int64)data[i-6]; - sum += qlp_coeff[4] * (FLAC__int64)data[i-5]; - sum += qlp_coeff[3] * (FLAC__int64)data[i-4]; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization); - } - } - else { /* order == 9 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[8] * (FLAC__int64)data[i-9]; - sum += qlp_coeff[7] * (FLAC__int64)data[i-8]; - sum += qlp_coeff[6] * (FLAC__int64)data[i-7]; - sum += qlp_coeff[5] * (FLAC__int64)data[i-6]; - sum += qlp_coeff[4] * (FLAC__int64)data[i-5]; - sum += qlp_coeff[3] * (FLAC__int64)data[i-4]; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization); - } - } - } - } - else if(order > 4) { - if(order > 6) { - if(order == 8) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[7] * (FLAC__int64)data[i-8]; - sum += qlp_coeff[6] * (FLAC__int64)data[i-7]; - sum += qlp_coeff[5] * (FLAC__int64)data[i-6]; - sum += qlp_coeff[4] * (FLAC__int64)data[i-5]; - sum += qlp_coeff[3] * (FLAC__int64)data[i-4]; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization); - } - } - else { /* order == 7 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[6] * (FLAC__int64)data[i-7]; - sum += qlp_coeff[5] * (FLAC__int64)data[i-6]; - sum += qlp_coeff[4] * (FLAC__int64)data[i-5]; - sum += qlp_coeff[3] * (FLAC__int64)data[i-4]; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization); - } - } - } - else { - if(order == 6) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[5] * (FLAC__int64)data[i-6]; - sum += qlp_coeff[4] * (FLAC__int64)data[i-5]; - sum += qlp_coeff[3] * (FLAC__int64)data[i-4]; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization); - } - } - else { /* order == 5 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[4] * (FLAC__int64)data[i-5]; - sum += qlp_coeff[3] * (FLAC__int64)data[i-4]; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization); - } - } - } - } - else { - if(order > 2) { - if(order == 4) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[3] * (FLAC__int64)data[i-4]; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization); - } - } - else { /* order == 3 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization); - } - } - } - else { - if(order == 2) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization); - } - } - else { /* order == 1 */ - for(i = 0; i < (int)data_len; i++) - residual[i] = data[i] - (FLAC__int32)((qlp_coeff[0] * (FLAC__int64)data[i-1]) >> lp_quantization); - } - } - } - } - else { /* order > 12 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - switch(order) { - case 32: sum += qlp_coeff[31] * (FLAC__int64)data[i-32]; - case 31: sum += qlp_coeff[30] * (FLAC__int64)data[i-31]; - case 30: sum += qlp_coeff[29] * (FLAC__int64)data[i-30]; - case 29: sum += qlp_coeff[28] * (FLAC__int64)data[i-29]; - case 28: sum += qlp_coeff[27] * (FLAC__int64)data[i-28]; - case 27: sum += qlp_coeff[26] * (FLAC__int64)data[i-27]; - case 26: sum += qlp_coeff[25] * (FLAC__int64)data[i-26]; - case 25: sum += qlp_coeff[24] * (FLAC__int64)data[i-25]; - case 24: sum += qlp_coeff[23] * (FLAC__int64)data[i-24]; - case 23: sum += qlp_coeff[22] * (FLAC__int64)data[i-23]; - case 22: sum += qlp_coeff[21] * (FLAC__int64)data[i-22]; - case 21: sum += qlp_coeff[20] * (FLAC__int64)data[i-21]; - case 20: sum += qlp_coeff[19] * (FLAC__int64)data[i-20]; - case 19: sum += qlp_coeff[18] * (FLAC__int64)data[i-19]; - case 18: sum += qlp_coeff[17] * (FLAC__int64)data[i-18]; - case 17: sum += qlp_coeff[16] * (FLAC__int64)data[i-17]; - case 16: sum += qlp_coeff[15] * (FLAC__int64)data[i-16]; - case 15: sum += qlp_coeff[14] * (FLAC__int64)data[i-15]; - case 14: sum += qlp_coeff[13] * (FLAC__int64)data[i-14]; - case 13: sum += qlp_coeff[12] * (FLAC__int64)data[i-13]; - sum += qlp_coeff[11] * (FLAC__int64)data[i-12]; - sum += qlp_coeff[10] * (FLAC__int64)data[i-11]; - sum += qlp_coeff[ 9] * (FLAC__int64)data[i-10]; - sum += qlp_coeff[ 8] * (FLAC__int64)data[i- 9]; - sum += qlp_coeff[ 7] * (FLAC__int64)data[i- 8]; - sum += qlp_coeff[ 6] * (FLAC__int64)data[i- 7]; - sum += qlp_coeff[ 5] * (FLAC__int64)data[i- 6]; - sum += qlp_coeff[ 4] * (FLAC__int64)data[i- 5]; - sum += qlp_coeff[ 3] * (FLAC__int64)data[i- 4]; - sum += qlp_coeff[ 2] * (FLAC__int64)data[i- 3]; - sum += qlp_coeff[ 1] * (FLAC__int64)data[i- 2]; - sum += qlp_coeff[ 0] * (FLAC__int64)data[i- 1]; - } - residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization); - } - } -} -#endif - -#endif /* !defined FLAC__INTEGER_ONLY_LIBRARY */ - -void FLAC__lpc_restore_signal(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]) -#if defined(FLAC__OVERFLOW_DETECT) || !defined(FLAC__LPC_UNROLLED_FILTER_LOOPS) -{ - FLAC__int64 sumo; - unsigned i, j; - FLAC__int32 sum; - const FLAC__int32 *r = residual, *history; - -#ifdef FLAC__OVERFLOW_DETECT_VERBOSE - fprintf(stderr,"FLAC__lpc_restore_signal: data_len=%d, order=%u, lpq=%d",data_len,order,lp_quantization); - for(i=0;i<order;i++) - fprintf(stderr,", q[%u]=%d",i,qlp_coeff[i]); - fprintf(stderr,"\n"); -#endif - FLAC__ASSERT(order > 0); - - for(i = 0; i < data_len; i++) { - sumo = 0; - sum = 0; - history = data; - for(j = 0; j < order; j++) { - sum += qlp_coeff[j] * (*(--history)); - sumo += (FLAC__int64)qlp_coeff[j] * (FLAC__int64)(*history); -#if defined _MSC_VER - if(sumo > 2147483647I64 || sumo < -2147483648I64) - fprintf(stderr,"FLAC__lpc_restore_signal: OVERFLOW, i=%u, j=%u, c=%d, d=%d, sumo=%I64d\n",i,j,qlp_coeff[j],*history,sumo); -#else - if(sumo > 2147483647ll || sumo < -2147483648ll) - fprintf(stderr,"FLAC__lpc_restore_signal: OVERFLOW, i=%u, j=%u, c=%d, d=%d, sumo=%lld\n",i,j,qlp_coeff[j],*history,(long long)sumo); -#endif - } - *(data++) = *(r++) + (sum >> lp_quantization); - } - - /* Here's a slower but clearer version: - for(i = 0; i < data_len; i++) { - sum = 0; - for(j = 0; j < order; j++) - sum += qlp_coeff[j] * data[i-j-1]; - data[i] = residual[i] + (sum >> lp_quantization); - } - */ -} -#else /* fully unrolled version for normal use */ -{ - int i; - FLAC__int32 sum; - - FLAC__ASSERT(order > 0); - FLAC__ASSERT(order <= 32); - - /* - * We do unique versions up to 12th order since that's the subset limit. - * Also they are roughly ordered to match frequency of occurrence to - * minimize branching. - */ - if(order <= 12) { - if(order > 8) { - if(order > 10) { - if(order == 12) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[11] * data[i-12]; - sum += qlp_coeff[10] * data[i-11]; - sum += qlp_coeff[9] * data[i-10]; - sum += qlp_coeff[8] * data[i-9]; - sum += qlp_coeff[7] * data[i-8]; - sum += qlp_coeff[6] * data[i-7]; - sum += qlp_coeff[5] * data[i-6]; - sum += qlp_coeff[4] * data[i-5]; - sum += qlp_coeff[3] * data[i-4]; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - data[i] = residual[i] + (sum >> lp_quantization); - } - } - else { /* order == 11 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[10] * data[i-11]; - sum += qlp_coeff[9] * data[i-10]; - sum += qlp_coeff[8] * data[i-9]; - sum += qlp_coeff[7] * data[i-8]; - sum += qlp_coeff[6] * data[i-7]; - sum += qlp_coeff[5] * data[i-6]; - sum += qlp_coeff[4] * data[i-5]; - sum += qlp_coeff[3] * data[i-4]; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - data[i] = residual[i] + (sum >> lp_quantization); - } - } - } - else { - if(order == 10) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[9] * data[i-10]; - sum += qlp_coeff[8] * data[i-9]; - sum += qlp_coeff[7] * data[i-8]; - sum += qlp_coeff[6] * data[i-7]; - sum += qlp_coeff[5] * data[i-6]; - sum += qlp_coeff[4] * data[i-5]; - sum += qlp_coeff[3] * data[i-4]; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - data[i] = residual[i] + (sum >> lp_quantization); - } - } - else { /* order == 9 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[8] * data[i-9]; - sum += qlp_coeff[7] * data[i-8]; - sum += qlp_coeff[6] * data[i-7]; - sum += qlp_coeff[5] * data[i-6]; - sum += qlp_coeff[4] * data[i-5]; - sum += qlp_coeff[3] * data[i-4]; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - data[i] = residual[i] + (sum >> lp_quantization); - } - } - } - } - else if(order > 4) { - if(order > 6) { - if(order == 8) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[7] * data[i-8]; - sum += qlp_coeff[6] * data[i-7]; - sum += qlp_coeff[5] * data[i-6]; - sum += qlp_coeff[4] * data[i-5]; - sum += qlp_coeff[3] * data[i-4]; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - data[i] = residual[i] + (sum >> lp_quantization); - } - } - else { /* order == 7 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[6] * data[i-7]; - sum += qlp_coeff[5] * data[i-6]; - sum += qlp_coeff[4] * data[i-5]; - sum += qlp_coeff[3] * data[i-4]; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - data[i] = residual[i] + (sum >> lp_quantization); - } - } - } - else { - if(order == 6) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[5] * data[i-6]; - sum += qlp_coeff[4] * data[i-5]; - sum += qlp_coeff[3] * data[i-4]; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - data[i] = residual[i] + (sum >> lp_quantization); - } - } - else { /* order == 5 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[4] * data[i-5]; - sum += qlp_coeff[3] * data[i-4]; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - data[i] = residual[i] + (sum >> lp_quantization); - } - } - } - } - else { - if(order > 2) { - if(order == 4) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[3] * data[i-4]; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - data[i] = residual[i] + (sum >> lp_quantization); - } - } - else { /* order == 3 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[2] * data[i-3]; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - data[i] = residual[i] + (sum >> lp_quantization); - } - } - } - else { - if(order == 2) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[1] * data[i-2]; - sum += qlp_coeff[0] * data[i-1]; - data[i] = residual[i] + (sum >> lp_quantization); - } - } - else { /* order == 1 */ - for(i = 0; i < (int)data_len; i++) - data[i] = residual[i] + ((qlp_coeff[0] * data[i-1]) >> lp_quantization); - } - } - } - } - else { /* order > 12 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - switch(order) { - case 32: sum += qlp_coeff[31] * data[i-32]; - case 31: sum += qlp_coeff[30] * data[i-31]; - case 30: sum += qlp_coeff[29] * data[i-30]; - case 29: sum += qlp_coeff[28] * data[i-29]; - case 28: sum += qlp_coeff[27] * data[i-28]; - case 27: sum += qlp_coeff[26] * data[i-27]; - case 26: sum += qlp_coeff[25] * data[i-26]; - case 25: sum += qlp_coeff[24] * data[i-25]; - case 24: sum += qlp_coeff[23] * data[i-24]; - case 23: sum += qlp_coeff[22] * data[i-23]; - case 22: sum += qlp_coeff[21] * data[i-22]; - case 21: sum += qlp_coeff[20] * data[i-21]; - case 20: sum += qlp_coeff[19] * data[i-20]; - case 19: sum += qlp_coeff[18] * data[i-19]; - case 18: sum += qlp_coeff[17] * data[i-18]; - case 17: sum += qlp_coeff[16] * data[i-17]; - case 16: sum += qlp_coeff[15] * data[i-16]; - case 15: sum += qlp_coeff[14] * data[i-15]; - case 14: sum += qlp_coeff[13] * data[i-14]; - case 13: sum += qlp_coeff[12] * data[i-13]; - sum += qlp_coeff[11] * data[i-12]; - sum += qlp_coeff[10] * data[i-11]; - sum += qlp_coeff[ 9] * data[i-10]; - sum += qlp_coeff[ 8] * data[i- 9]; - sum += qlp_coeff[ 7] * data[i- 8]; - sum += qlp_coeff[ 6] * data[i- 7]; - sum += qlp_coeff[ 5] * data[i- 6]; - sum += qlp_coeff[ 4] * data[i- 5]; - sum += qlp_coeff[ 3] * data[i- 4]; - sum += qlp_coeff[ 2] * data[i- 3]; - sum += qlp_coeff[ 1] * data[i- 2]; - sum += qlp_coeff[ 0] * data[i- 1]; - } - data[i] = residual[i] + (sum >> lp_quantization); - } - } -} -#endif - -void FLAC__lpc_restore_signal_wide(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]) -#if defined(FLAC__OVERFLOW_DETECT) || !defined(FLAC__LPC_UNROLLED_FILTER_LOOPS) -{ - unsigned i, j; - FLAC__int64 sum; - const FLAC__int32 *r = residual, *history; - -#ifdef FLAC__OVERFLOW_DETECT_VERBOSE - fprintf(stderr,"FLAC__lpc_restore_signal_wide: data_len=%d, order=%u, lpq=%d",data_len,order,lp_quantization); - for(i=0;i<order;i++) - fprintf(stderr,", q[%u]=%d",i,qlp_coeff[i]); - fprintf(stderr,"\n"); -#endif - FLAC__ASSERT(order > 0); - - for(i = 0; i < data_len; i++) { - sum = 0; - history = data; - for(j = 0; j < order; j++) - sum += (FLAC__int64)qlp_coeff[j] * (FLAC__int64)(*(--history)); - if(FLAC__bitmath_silog2_wide(sum >> lp_quantization) > 32) { -#ifdef _MSC_VER - fprintf(stderr,"FLAC__lpc_restore_signal_wide: OVERFLOW, i=%u, sum=%I64d\n", i, sum >> lp_quantization); -#else - fprintf(stderr,"FLAC__lpc_restore_signal_wide: OVERFLOW, i=%u, sum=%lld\n", i, (long long)(sum >> lp_quantization)); -#endif - break; - } - if(FLAC__bitmath_silog2_wide((FLAC__int64)(*r) + (sum >> lp_quantization)) > 32) { -#ifdef _MSC_VER - fprintf(stderr,"FLAC__lpc_restore_signal_wide: OVERFLOW, i=%u, residual=%d, sum=%I64d, data=%I64d\n", i, *r, sum >> lp_quantization, (FLAC__int64)(*r) + (sum >> lp_quantization)); -#else - fprintf(stderr,"FLAC__lpc_restore_signal_wide: OVERFLOW, i=%u, residual=%d, sum=%lld, data=%lld\n", i, *r, (long long)(sum >> lp_quantization), (long long)((FLAC__int64)(*r) + (sum >> lp_quantization))); -#endif - break; - } - *(data++) = *(r++) + (FLAC__int32)(sum >> lp_quantization); - } -} -#else /* fully unrolled version for normal use */ -{ - int i; - FLAC__int64 sum; - - FLAC__ASSERT(order > 0); - FLAC__ASSERT(order <= 32); - - /* - * We do unique versions up to 12th order since that's the subset limit. - * Also they are roughly ordered to match frequency of occurrence to - * minimize branching. - */ - if(order <= 12) { - if(order > 8) { - if(order > 10) { - if(order == 12) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[11] * (FLAC__int64)data[i-12]; - sum += qlp_coeff[10] * (FLAC__int64)data[i-11]; - sum += qlp_coeff[9] * (FLAC__int64)data[i-10]; - sum += qlp_coeff[8] * (FLAC__int64)data[i-9]; - sum += qlp_coeff[7] * (FLAC__int64)data[i-8]; - sum += qlp_coeff[6] * (FLAC__int64)data[i-7]; - sum += qlp_coeff[5] * (FLAC__int64)data[i-6]; - sum += qlp_coeff[4] * (FLAC__int64)data[i-5]; - sum += qlp_coeff[3] * (FLAC__int64)data[i-4]; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization); - } - } - else { /* order == 11 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[10] * (FLAC__int64)data[i-11]; - sum += qlp_coeff[9] * (FLAC__int64)data[i-10]; - sum += qlp_coeff[8] * (FLAC__int64)data[i-9]; - sum += qlp_coeff[7] * (FLAC__int64)data[i-8]; - sum += qlp_coeff[6] * (FLAC__int64)data[i-7]; - sum += qlp_coeff[5] * (FLAC__int64)data[i-6]; - sum += qlp_coeff[4] * (FLAC__int64)data[i-5]; - sum += qlp_coeff[3] * (FLAC__int64)data[i-4]; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization); - } - } - } - else { - if(order == 10) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[9] * (FLAC__int64)data[i-10]; - sum += qlp_coeff[8] * (FLAC__int64)data[i-9]; - sum += qlp_coeff[7] * (FLAC__int64)data[i-8]; - sum += qlp_coeff[6] * (FLAC__int64)data[i-7]; - sum += qlp_coeff[5] * (FLAC__int64)data[i-6]; - sum += qlp_coeff[4] * (FLAC__int64)data[i-5]; - sum += qlp_coeff[3] * (FLAC__int64)data[i-4]; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization); - } - } - else { /* order == 9 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[8] * (FLAC__int64)data[i-9]; - sum += qlp_coeff[7] * (FLAC__int64)data[i-8]; - sum += qlp_coeff[6] * (FLAC__int64)data[i-7]; - sum += qlp_coeff[5] * (FLAC__int64)data[i-6]; - sum += qlp_coeff[4] * (FLAC__int64)data[i-5]; - sum += qlp_coeff[3] * (FLAC__int64)data[i-4]; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization); - } - } - } - } - else if(order > 4) { - if(order > 6) { - if(order == 8) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[7] * (FLAC__int64)data[i-8]; - sum += qlp_coeff[6] * (FLAC__int64)data[i-7]; - sum += qlp_coeff[5] * (FLAC__int64)data[i-6]; - sum += qlp_coeff[4] * (FLAC__int64)data[i-5]; - sum += qlp_coeff[3] * (FLAC__int64)data[i-4]; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization); - } - } - else { /* order == 7 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[6] * (FLAC__int64)data[i-7]; - sum += qlp_coeff[5] * (FLAC__int64)data[i-6]; - sum += qlp_coeff[4] * (FLAC__int64)data[i-5]; - sum += qlp_coeff[3] * (FLAC__int64)data[i-4]; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization); - } - } - } - else { - if(order == 6) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[5] * (FLAC__int64)data[i-6]; - sum += qlp_coeff[4] * (FLAC__int64)data[i-5]; - sum += qlp_coeff[3] * (FLAC__int64)data[i-4]; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization); - } - } - else { /* order == 5 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[4] * (FLAC__int64)data[i-5]; - sum += qlp_coeff[3] * (FLAC__int64)data[i-4]; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization); - } - } - } - } - else { - if(order > 2) { - if(order == 4) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[3] * (FLAC__int64)data[i-4]; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization); - } - } - else { /* order == 3 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[2] * (FLAC__int64)data[i-3]; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization); - } - } - } - else { - if(order == 2) { - for(i = 0; i < (int)data_len; i++) { - sum = 0; - sum += qlp_coeff[1] * (FLAC__int64)data[i-2]; - sum += qlp_coeff[0] * (FLAC__int64)data[i-1]; - data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization); - } - } - else { /* order == 1 */ - for(i = 0; i < (int)data_len; i++) - data[i] = residual[i] + (FLAC__int32)((qlp_coeff[0] * (FLAC__int64)data[i-1]) >> lp_quantization); - } - } - } - } - else { /* order > 12 */ - for(i = 0; i < (int)data_len; i++) { - sum = 0; - switch(order) { - case 32: sum += qlp_coeff[31] * (FLAC__int64)data[i-32]; - case 31: sum += qlp_coeff[30] * (FLAC__int64)data[i-31]; - case 30: sum += qlp_coeff[29] * (FLAC__int64)data[i-30]; - case 29: sum += qlp_coeff[28] * (FLAC__int64)data[i-29]; - case 28: sum += qlp_coeff[27] * (FLAC__int64)data[i-28]; - case 27: sum += qlp_coeff[26] * (FLAC__int64)data[i-27]; - case 26: sum += qlp_coeff[25] * (FLAC__int64)data[i-26]; - case 25: sum += qlp_coeff[24] * (FLAC__int64)data[i-25]; - case 24: sum += qlp_coeff[23] * (FLAC__int64)data[i-24]; - case 23: sum += qlp_coeff[22] * (FLAC__int64)data[i-23]; - case 22: sum += qlp_coeff[21] * (FLAC__int64)data[i-22]; - case 21: sum += qlp_coeff[20] * (FLAC__int64)data[i-21]; - case 20: sum += qlp_coeff[19] * (FLAC__int64)data[i-20]; - case 19: sum += qlp_coeff[18] * (FLAC__int64)data[i-19]; - case 18: sum += qlp_coeff[17] * (FLAC__int64)data[i-18]; - case 17: sum += qlp_coeff[16] * (FLAC__int64)data[i-17]; - case 16: sum += qlp_coeff[15] * (FLAC__int64)data[i-16]; - case 15: sum += qlp_coeff[14] * (FLAC__int64)data[i-15]; - case 14: sum += qlp_coeff[13] * (FLAC__int64)data[i-14]; - case 13: sum += qlp_coeff[12] * (FLAC__int64)data[i-13]; - sum += qlp_coeff[11] * (FLAC__int64)data[i-12]; - sum += qlp_coeff[10] * (FLAC__int64)data[i-11]; - sum += qlp_coeff[ 9] * (FLAC__int64)data[i-10]; - sum += qlp_coeff[ 8] * (FLAC__int64)data[i- 9]; - sum += qlp_coeff[ 7] * (FLAC__int64)data[i- 8]; - sum += qlp_coeff[ 6] * (FLAC__int64)data[i- 7]; - sum += qlp_coeff[ 5] * (FLAC__int64)data[i- 6]; - sum += qlp_coeff[ 4] * (FLAC__int64)data[i- 5]; - sum += qlp_coeff[ 3] * (FLAC__int64)data[i- 4]; - sum += qlp_coeff[ 2] * (FLAC__int64)data[i- 3]; - sum += qlp_coeff[ 1] * (FLAC__int64)data[i- 2]; - sum += qlp_coeff[ 0] * (FLAC__int64)data[i- 1]; - } - data[i] = residual[i] + (FLAC__int32)(sum >> lp_quantization); - } - } -} -#endif - -#ifndef FLAC__INTEGER_ONLY_LIBRARY - -FLAC__double FLAC__lpc_compute_expected_bits_per_residual_sample(FLAC__double lpc_error, unsigned total_samples) -{ - FLAC__double error_scale; - - FLAC__ASSERT(total_samples > 0); - - error_scale = 0.5 * M_LN2 * M_LN2 / (FLAC__double)total_samples; - - return FLAC__lpc_compute_expected_bits_per_residual_sample_with_error_scale(lpc_error, error_scale); -} - -FLAC__double FLAC__lpc_compute_expected_bits_per_residual_sample_with_error_scale(FLAC__double lpc_error, FLAC__double error_scale) -{ - if(lpc_error > 0.0) { - FLAC__double bps = (FLAC__double)0.5 * log(error_scale * lpc_error) / M_LN2; - if(bps >= 0.0) - return bps; - else - return 0.0; - } - else if(lpc_error < 0.0) { /* error should not be negative but can happen due to inadequate floating-point resolution */ - return 1e32; - } - else { - return 0.0; - } -} - -unsigned FLAC__lpc_compute_best_order(const FLAC__double lpc_error[], unsigned max_order, unsigned total_samples, unsigned overhead_bits_per_order) -{ - unsigned order, index, best_index; /* 'index' the index into lpc_error; index==order-1 since lpc_error[0] is for order==1, lpc_error[1] is for order==2, etc */ - FLAC__double bits, best_bits, error_scale; - - FLAC__ASSERT(max_order > 0); - FLAC__ASSERT(total_samples > 0); - - error_scale = 0.5 * M_LN2 * M_LN2 / (FLAC__double)total_samples; - - best_index = 0; - best_bits = (unsigned)(-1); - - for(index = 0, order = 1; index < max_order; index++, order++) { - bits = FLAC__lpc_compute_expected_bits_per_residual_sample_with_error_scale(lpc_error[index], error_scale) * (FLAC__double)(total_samples - order) + (FLAC__double)(order * overhead_bits_per_order); - if(bits < best_bits) { - best_index = index; - best_bits = bits; - } - } - - return best_index+1; /* +1 since index of lpc_error[] is order-1 */ -} - -#endif /* !defined FLAC__INTEGER_ONLY_LIBRARY */ diff --git a/3rdparty/libflac/src/libFLAC/md5.c b/3rdparty/libflac/src/libFLAC/md5.c deleted file mode 100644 index af350e01d16..00000000000 --- a/3rdparty/libflac/src/libFLAC/md5.c +++ /dev/null @@ -1,424 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdlib.h> /* for malloc() */ -#include <string.h> /* for memcpy() */ - -#include "private/md5.h" -#include "share/alloc.h" - -#ifndef FLaC__INLINE -#define FLaC__INLINE -#endif - -/* - * This code implements the MD5 message-digest algorithm. - * The algorithm is due to Ron Rivest. This code was - * written by Colin Plumb in 1993, no copyright is claimed. - * This code is in the public domain; do with it what you wish. - * - * Equivalent code is available from RSA Data Security, Inc. - * This code has been tested against that, and is equivalent, - * except that you don't need to include two pages of legalese - * with every copy. - * - * To compute the message digest of a chunk of bytes, declare an - * MD5Context structure, pass it to MD5Init, call MD5Update as - * needed on buffers full of bytes, and then call MD5Final, which - * will fill a supplied 16-byte array with the digest. - * - * Changed so as no longer to depend on Colin Plumb's `usual.h' header - * definitions; now uses stuff from dpkg's config.h. - * - Ian Jackson <ijackson@nyx.cs.du.edu>. - * Still in the public domain. - * - * Josh Coalson: made some changes to integrate with libFLAC. - * Still in the public domain. - */ - -/* The four core functions - F1 is optimized somewhat */ - -/* #define F1(x, y, z) (x & y | ~x & z) */ -#define F1(x, y, z) (z ^ (x & (y ^ z))) -#define F2(x, y, z) F1(z, x, y) -#define F3(x, y, z) (x ^ y ^ z) -#define F4(x, y, z) (y ^ (x | ~z)) - -/* This is the central step in the MD5 algorithm. */ -#define MD5STEP(f,w,x,y,z,in,s) \ - (w += f(x,y,z) + in, w = (w<<s | w>>(32-s)) + x) - -/* - * The core of the MD5 algorithm, this alters an existing MD5 hash to - * reflect the addition of 16 longwords of new data. MD5Update blocks - * the data and converts bytes into longwords for this routine. - */ -static void FLAC__MD5Transform(FLAC__uint32 buf[4], FLAC__uint32 const in[16]) -{ - register FLAC__uint32 a, b, c, d; - - a = buf[0]; - b = buf[1]; - c = buf[2]; - d = buf[3]; - - MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); - MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); - MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); - MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); - MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); - MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); - MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); - MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); - MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); - MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); - MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); - MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); - MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); - MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); - MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); - MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); - - MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); - MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); - MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); - MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); - MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); - MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); - MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); - MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); - MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); - MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); - MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); - MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); - MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); - MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); - MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); - MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); - - MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); - MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); - MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); - MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); - MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); - MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); - MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); - MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); - MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); - MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); - MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); - MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); - MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); - MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); - MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); - MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); - - MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); - MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); - MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); - MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); - MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); - MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); - MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); - MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); - MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); - MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); - MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); - MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); - MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); - MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); - MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); - MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); - - buf[0] += a; - buf[1] += b; - buf[2] += c; - buf[3] += d; -} - -#if WORDS_BIGENDIAN -//@@@@@@ OPT: use bswap/intrinsics -static void byteSwap(FLAC__uint32 *buf, unsigned words) -{ - register FLAC__uint32 x; - do { - x = *buf; - x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); - *buf++ = (x >> 16) | (x << 16); - } while (--words); -} -static void byteSwapX16(FLAC__uint32 *buf) -{ - register FLAC__uint32 x; - - x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16); - x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16); - x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16); - x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16); - x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16); - x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16); - x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16); - x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16); - x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16); - x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16); - x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16); - x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16); - x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16); - x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16); - x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16); - x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf = (x >> 16) | (x << 16); -} -#else -#define byteSwap(buf, words) -#define byteSwapX16(buf) -#endif - -/* - * Update context to reflect the concatenation of another buffer full - * of bytes. - */ -static void FLAC__MD5Update(FLAC__MD5Context *ctx, FLAC__byte const *buf, unsigned len) -{ - FLAC__uint32 t; - - /* Update byte count */ - - t = ctx->bytes[0]; - if ((ctx->bytes[0] = t + len) < t) - ctx->bytes[1]++; /* Carry from low to high */ - - t = 64 - (t & 0x3f); /* Space available in ctx->in (at least 1) */ - if (t > len) { - memcpy((FLAC__byte *)ctx->in + 64 - t, buf, len); - return; - } - /* First chunk is an odd size */ - memcpy((FLAC__byte *)ctx->in + 64 - t, buf, t); - byteSwapX16(ctx->in); - FLAC__MD5Transform(ctx->buf, ctx->in); - buf += t; - len -= t; - - /* Process data in 64-byte chunks */ - while (len >= 64) { - memcpy(ctx->in, buf, 64); - byteSwapX16(ctx->in); - FLAC__MD5Transform(ctx->buf, ctx->in); - buf += 64; - len -= 64; - } - - /* Handle any remaining bytes of data. */ - memcpy(ctx->in, buf, len); -} - -/* - * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious - * initialization constants. - */ -void FLAC__MD5Init(FLAC__MD5Context *ctx) -{ - ctx->buf[0] = 0x67452301; - ctx->buf[1] = 0xefcdab89; - ctx->buf[2] = 0x98badcfe; - ctx->buf[3] = 0x10325476; - - ctx->bytes[0] = 0; - ctx->bytes[1] = 0; - - ctx->internal_buf = 0; - ctx->capacity = 0; -} - -/* - * Final wrapup - pad to 64-byte boundary with the bit pattern - * 1 0* (64-bit count of bits processed, MSB-first) - */ -void FLAC__MD5Final(FLAC__byte digest[16], FLAC__MD5Context *ctx) -{ - int count = ctx->bytes[0] & 0x3f; /* Number of bytes in ctx->in */ - FLAC__byte *p = (FLAC__byte *)ctx->in + count; - - /* Set the first char of padding to 0x80. There is always room. */ - *p++ = 0x80; - - /* Bytes of padding needed to make 56 bytes (-8..55) */ - count = 56 - 1 - count; - - if (count < 0) { /* Padding forces an extra block */ - memset(p, 0, count + 8); - byteSwapX16(ctx->in); - FLAC__MD5Transform(ctx->buf, ctx->in); - p = (FLAC__byte *)ctx->in; - count = 56; - } - memset(p, 0, count); - byteSwap(ctx->in, 14); - - /* Append length in bits and transform */ - ctx->in[14] = ctx->bytes[0] << 3; - ctx->in[15] = ctx->bytes[1] << 3 | ctx->bytes[0] >> 29; - FLAC__MD5Transform(ctx->buf, ctx->in); - - byteSwap(ctx->buf, 4); - memcpy(digest, ctx->buf, 16); - if(0 != ctx->internal_buf) { - free(ctx->internal_buf); - ctx->internal_buf = 0; - ctx->capacity = 0; - } - memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ -} - -/* - * Convert the incoming audio signal to a byte stream - */ -static void format_input_(FLAC__byte *buf, const FLAC__int32 * const signal[], unsigned channels, unsigned samples, unsigned bytes_per_sample) -{ - unsigned channel, sample; - register FLAC__int32 a_word; - register FLAC__byte *buf_ = buf; - -#if WORDS_BIGENDIAN -#else - if(channels == 2 && bytes_per_sample == 2) { - FLAC__int16 *buf1_ = ((FLAC__int16*)buf_) + 1; - memcpy(buf_, signal[0], sizeof(FLAC__int32) * samples); - for(sample = 0; sample < samples; sample++, buf1_+=2) - *buf1_ = (FLAC__int16)signal[1][sample]; - } - else if(channels == 1 && bytes_per_sample == 2) { - FLAC__int16 *buf1_ = (FLAC__int16*)buf_; - for(sample = 0; sample < samples; sample++) - *buf1_++ = (FLAC__int16)signal[0][sample]; - } - else -#endif - if(bytes_per_sample == 2) { - if(channels == 2) { - for(sample = 0; sample < samples; sample++) { - a_word = signal[0][sample]; - *buf_++ = (FLAC__byte)a_word; a_word >>= 8; - *buf_++ = (FLAC__byte)a_word; - a_word = signal[1][sample]; - *buf_++ = (FLAC__byte)a_word; a_word >>= 8; - *buf_++ = (FLAC__byte)a_word; - } - } - else if(channels == 1) { - for(sample = 0; sample < samples; sample++) { - a_word = signal[0][sample]; - *buf_++ = (FLAC__byte)a_word; a_word >>= 8; - *buf_++ = (FLAC__byte)a_word; - } - } - else { - for(sample = 0; sample < samples; sample++) { - for(channel = 0; channel < channels; channel++) { - a_word = signal[channel][sample]; - *buf_++ = (FLAC__byte)a_word; a_word >>= 8; - *buf_++ = (FLAC__byte)a_word; - } - } - } - } - else if(bytes_per_sample == 3) { - if(channels == 2) { - for(sample = 0; sample < samples; sample++) { - a_word = signal[0][sample]; - *buf_++ = (FLAC__byte)a_word; a_word >>= 8; - *buf_++ = (FLAC__byte)a_word; a_word >>= 8; - *buf_++ = (FLAC__byte)a_word; - a_word = signal[1][sample]; - *buf_++ = (FLAC__byte)a_word; a_word >>= 8; - *buf_++ = (FLAC__byte)a_word; a_word >>= 8; - *buf_++ = (FLAC__byte)a_word; - } - } - else if(channels == 1) { - for(sample = 0; sample < samples; sample++) { - a_word = signal[0][sample]; - *buf_++ = (FLAC__byte)a_word; a_word >>= 8; - *buf_++ = (FLAC__byte)a_word; a_word >>= 8; - *buf_++ = (FLAC__byte)a_word; - } - } - else { - for(sample = 0; sample < samples; sample++) { - for(channel = 0; channel < channels; channel++) { - a_word = signal[channel][sample]; - *buf_++ = (FLAC__byte)a_word; a_word >>= 8; - *buf_++ = (FLAC__byte)a_word; a_word >>= 8; - *buf_++ = (FLAC__byte)a_word; - } - } - } - } - else if(bytes_per_sample == 1) { - if(channels == 2) { - for(sample = 0; sample < samples; sample++) { - a_word = signal[0][sample]; - *buf_++ = (FLAC__byte)a_word; - a_word = signal[1][sample]; - *buf_++ = (FLAC__byte)a_word; - } - } - else if(channels == 1) { - for(sample = 0; sample < samples; sample++) { - a_word = signal[0][sample]; - *buf_++ = (FLAC__byte)a_word; - } - } - else { - for(sample = 0; sample < samples; sample++) { - for(channel = 0; channel < channels; channel++) { - a_word = signal[channel][sample]; - *buf_++ = (FLAC__byte)a_word; - } - } - } - } - else { /* bytes_per_sample == 4, maybe optimize more later */ - for(sample = 0; sample < samples; sample++) { - for(channel = 0; channel < channels; channel++) { - a_word = signal[channel][sample]; - *buf_++ = (FLAC__byte)a_word; a_word >>= 8; - *buf_++ = (FLAC__byte)a_word; a_word >>= 8; - *buf_++ = (FLAC__byte)a_word; a_word >>= 8; - *buf_++ = (FLAC__byte)a_word; - } - } - } -} - -/* - * Convert the incoming audio signal to a byte stream and FLAC__MD5Update it. - */ -FLAC__bool FLAC__MD5Accumulate(FLAC__MD5Context *ctx, const FLAC__int32 * const signal[], unsigned channels, unsigned samples, unsigned bytes_per_sample) -{ - const size_t bytes_needed = (size_t)channels * (size_t)samples * (size_t)bytes_per_sample; - - /* overflow check */ - if((size_t)channels > SIZE_MAX / (size_t)bytes_per_sample) - return false; - if((size_t)channels * (size_t)bytes_per_sample > SIZE_MAX / (size_t)samples) - return false; - - if(ctx->capacity < bytes_needed) { - FLAC__byte *tmp = (FLAC__byte*)realloc(ctx->internal_buf, bytes_needed); - if(0 == tmp) { - free(ctx->internal_buf); - if(0 == (ctx->internal_buf = (FLAC__byte*)safe_malloc_(bytes_needed))) - return false; - } - ctx->internal_buf = tmp; - ctx->capacity = bytes_needed; - } - - format_input_(ctx->internal_buf, signal, channels, samples, bytes_per_sample); - - FLAC__MD5Update(ctx, ctx->internal_buf, bytes_needed); - - return true; -} diff --git a/3rdparty/libflac/src/libFLAC/memory.c b/3rdparty/libflac/src/libFLAC/memory.c deleted file mode 100644 index 48f381b7e8c..00000000000 --- a/3rdparty/libflac/src/libFLAC/memory.c +++ /dev/null @@ -1,222 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include "private/memory.h" -#include "FLAC/assert.h" -#include "share/alloc.h" - -void *FLAC__memory_alloc_aligned(size_t bytes, void **aligned_address) -{ - void *x; - - FLAC__ASSERT(0 != aligned_address); - -#ifdef FLAC__ALIGN_MALLOC_DATA - /* align on 32-byte (256-bit) boundary */ - x = safe_malloc_add_2op_(bytes, /*+*/31); -#ifdef SIZEOF_VOIDP -#if SIZEOF_VOIDP == 4 - /* could do *aligned_address = x + ((unsigned) (32 - (((unsigned)x) & 31))) & 31; */ - *aligned_address = (void*)(((unsigned)x + 31) & -32); -#elif SIZEOF_VOIDP == 8 - *aligned_address = (void*)(((FLAC__uint64)x + 31) & (FLAC__uint64)(-((FLAC__int64)32))); -#else -# error Unsupported sizeof(void*) -#endif -#else - /* there's got to be a better way to do this right for all archs */ - if(sizeof(void*) == sizeof(unsigned)) - *aligned_address = (void*)(((unsigned)x + 31) & -32); - else if(sizeof(void*) == sizeof(FLAC__uint64)) - *aligned_address = (void*)(((FLAC__uint64)x + 31) & (FLAC__uint64)(-((FLAC__int64)32))); - else - return 0; -#endif -#else - x = safe_malloc_(bytes); - *aligned_address = x; -#endif - return x; -} - -FLAC__bool FLAC__memory_alloc_aligned_int32_array(size_t elements, FLAC__int32 **unaligned_pointer, FLAC__int32 **aligned_pointer) -{ - FLAC__int32 *pu; /* unaligned pointer */ - union { /* union needed to comply with C99 pointer aliasing rules */ - FLAC__int32 *pa; /* aligned pointer */ - void *pv; /* aligned pointer alias */ - } u; - - FLAC__ASSERT(elements > 0); - FLAC__ASSERT(0 != unaligned_pointer); - FLAC__ASSERT(0 != aligned_pointer); - FLAC__ASSERT(unaligned_pointer != aligned_pointer); - - if(elements > SIZE_MAX / sizeof(*pu)) /* overflow check */ - return false; - - pu = (FLAC__int32*)FLAC__memory_alloc_aligned(sizeof(*pu) * elements, &u.pv); - if(0 == pu) { - return false; - } - else { - if(*unaligned_pointer != 0) - free(*unaligned_pointer); - *unaligned_pointer = pu; - *aligned_pointer = u.pa; - return true; - } -} - - -FLAC__bool FLAC__memory_alloc_aligned_uint32_array(size_t elements, FLAC__uint32 **unaligned_pointer, FLAC__uint32 **aligned_pointer) -{ - FLAC__uint32 *pu; /* unaligned pointer */ - union { /* union needed to comply with C99 pointer aliasing rules */ - FLAC__uint32 *pa; /* aligned pointer */ - void *pv; /* aligned pointer alias */ - } u; - - FLAC__ASSERT(elements > 0); - FLAC__ASSERT(0 != unaligned_pointer); - FLAC__ASSERT(0 != aligned_pointer); - FLAC__ASSERT(unaligned_pointer != aligned_pointer); - - if(elements > SIZE_MAX / sizeof(*pu)) /* overflow check */ - return false; - - pu = (FLAC__uint32*)FLAC__memory_alloc_aligned(sizeof(*pu) * elements, &u.pv); - if(0 == pu) { - return false; - } - else { - if(*unaligned_pointer != 0) - free(*unaligned_pointer); - *unaligned_pointer = pu; - *aligned_pointer = u.pa; - return true; - } -} - -FLAC__bool FLAC__memory_alloc_aligned_uint64_array(size_t elements, FLAC__uint64 **unaligned_pointer, FLAC__uint64 **aligned_pointer) -{ - FLAC__uint64 *pu; /* unaligned pointer */ - union { /* union needed to comply with C99 pointer aliasing rules */ - FLAC__uint64 *pa; /* aligned pointer */ - void *pv; /* aligned pointer alias */ - } u; - - FLAC__ASSERT(elements > 0); - FLAC__ASSERT(0 != unaligned_pointer); - FLAC__ASSERT(0 != aligned_pointer); - FLAC__ASSERT(unaligned_pointer != aligned_pointer); - - if(elements > SIZE_MAX / sizeof(*pu)) /* overflow check */ - return false; - - pu = (FLAC__uint64*)FLAC__memory_alloc_aligned(sizeof(*pu) * elements, &u.pv); - if(0 == pu) { - return false; - } - else { - if(*unaligned_pointer != 0) - free(*unaligned_pointer); - *unaligned_pointer = pu; - *aligned_pointer = u.pa; - return true; - } -} - -FLAC__bool FLAC__memory_alloc_aligned_unsigned_array(size_t elements, unsigned **unaligned_pointer, unsigned **aligned_pointer) -{ - unsigned *pu; /* unaligned pointer */ - union { /* union needed to comply with C99 pointer aliasing rules */ - unsigned *pa; /* aligned pointer */ - void *pv; /* aligned pointer alias */ - } u; - - FLAC__ASSERT(elements > 0); - FLAC__ASSERT(0 != unaligned_pointer); - FLAC__ASSERT(0 != aligned_pointer); - FLAC__ASSERT(unaligned_pointer != aligned_pointer); - - if(elements > SIZE_MAX / sizeof(*pu)) /* overflow check */ - return false; - - pu = (unsigned*)FLAC__memory_alloc_aligned(sizeof(*pu) * elements, &u.pv); - if(0 == pu) { - return false; - } - else { - if(*unaligned_pointer != 0) - free(*unaligned_pointer); - *unaligned_pointer = pu; - *aligned_pointer = u.pa; - return true; - } -} - -#ifndef FLAC__INTEGER_ONLY_LIBRARY - -FLAC__bool FLAC__memory_alloc_aligned_real_array(size_t elements, FLAC__real **unaligned_pointer, FLAC__real **aligned_pointer) -{ - FLAC__real *pu; /* unaligned pointer */ - union { /* union needed to comply with C99 pointer aliasing rules */ - FLAC__real *pa; /* aligned pointer */ - void *pv; /* aligned pointer alias */ - } u; - - FLAC__ASSERT(elements > 0); - FLAC__ASSERT(0 != unaligned_pointer); - FLAC__ASSERT(0 != aligned_pointer); - FLAC__ASSERT(unaligned_pointer != aligned_pointer); - - if(elements > SIZE_MAX / sizeof(*pu)) /* overflow check */ - return false; - - pu = (FLAC__real*)FLAC__memory_alloc_aligned(sizeof(*pu) * elements, &u.pv); - if(0 == pu) { - return false; - } - else { - if(*unaligned_pointer != 0) - free(*unaligned_pointer); - *unaligned_pointer = pu; - *aligned_pointer = u.pa; - return true; - } -} - -#endif diff --git a/3rdparty/libflac/src/libFLAC/metadata_iterators.c b/3rdparty/libflac/src/libFLAC/metadata_iterators.c deleted file mode 100644 index f88795bcf82..00000000000 --- a/3rdparty/libflac/src/libFLAC/metadata_iterators.c +++ /dev/null @@ -1,3363 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <errno.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__ -#if defined __BORLANDC__ -#include <utime.h> /* for utime() */ -#else -#include <sys/utime.h> /* for utime() */ -#endif -#include <io.h> /* for chmod() */ -#include <sys/types.h> /* for off_t */ -#if _MSC_VER <= 1600 || defined __BORLANDC__ /* @@@ [2G limit] */ -#define fseeko fseek -#define ftello ftell -#endif -#else -#include <sys/types.h> /* some flavors of BSD (like OS X) require this to get time_t */ -#include <utime.h> /* for utime() */ -#include <unistd.h> /* for chown(), unlink() */ -#endif -#include <sys/stat.h> /* for stat(), maybe chmod() */ - -#include "private/metadata.h" - -#include "FLAC/assert.h" -#include "FLAC/stream_decoder.h" -#include "share/alloc.h" - -#ifdef max -#undef max -#endif -#define max(a,b) ((a)>(b)?(a):(b)) -#ifdef min -#undef min -#endif -#define min(a,b) ((a)<(b)?(a):(b)) - - -/**************************************************************************** - * - * Local function declarations - * - ***************************************************************************/ - -static void pack_uint32_(FLAC__uint32 val, FLAC__byte *b, unsigned bytes); -static void pack_uint32_little_endian_(FLAC__uint32 val, FLAC__byte *b, unsigned bytes); -static void pack_uint64_(FLAC__uint64 val, FLAC__byte *b, unsigned bytes); -static FLAC__uint32 unpack_uint32_(FLAC__byte *b, unsigned bytes); -static FLAC__uint32 unpack_uint32_little_endian_(FLAC__byte *b, unsigned bytes); -static FLAC__uint64 unpack_uint64_(FLAC__byte *b, unsigned bytes); - -static FLAC__bool read_metadata_block_header_(FLAC__Metadata_SimpleIterator *iterator); -static FLAC__bool read_metadata_block_data_(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block); -static FLAC__bool read_metadata_block_header_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__bool *is_last, FLAC__MetadataType *type, unsigned *length); -static FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__IOCallback_Seek seek_cb, FLAC__StreamMetadata *block); -static FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_streaminfo_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_StreamInfo *block); -static FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_padding_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Seek seek_cb, FLAC__StreamMetadata_Padding *block, unsigned block_length); -static FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_application_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_Application *block, unsigned block_length); -static FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_seektable_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_SeekTable *block, unsigned block_length); -static FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_vorbis_comment_entry_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_VorbisComment_Entry *entry); -static FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_vorbis_comment_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_VorbisComment *block); -static FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_cuesheet_track_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_CueSheet_Track *track); -static FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_cuesheet_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_CueSheet *block); -static FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_picture_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_Picture *block); -static FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_unknown_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_Unknown *block, unsigned block_length); - -static FLAC__bool write_metadata_block_header_(FILE *file, FLAC__Metadata_SimpleIteratorStatus *status, const FLAC__StreamMetadata *block); -static FLAC__bool write_metadata_block_data_(FILE *file, FLAC__Metadata_SimpleIteratorStatus *status, const FLAC__StreamMetadata *block); -static FLAC__bool write_metadata_block_header_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata *block); -static FLAC__bool write_metadata_block_data_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata *block); -static FLAC__bool write_metadata_block_data_streaminfo_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata_StreamInfo *block); -static FLAC__bool write_metadata_block_data_padding_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata_Padding *block, unsigned block_length); -static FLAC__bool write_metadata_block_data_application_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata_Application *block, unsigned block_length); -static FLAC__bool write_metadata_block_data_seektable_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata_SeekTable *block); -static FLAC__bool write_metadata_block_data_vorbis_comment_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata_VorbisComment *block); -static FLAC__bool write_metadata_block_data_cuesheet_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata_CueSheet *block); -static FLAC__bool write_metadata_block_data_picture_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata_Picture *block); -static FLAC__bool write_metadata_block_data_unknown_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata_Unknown *block, unsigned block_length); - -static FLAC__bool write_metadata_block_stationary_(FLAC__Metadata_SimpleIterator *iterator, const FLAC__StreamMetadata *block); -static FLAC__bool write_metadata_block_stationary_with_padding_(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block, unsigned padding_length, FLAC__bool padding_is_last); -static FLAC__bool rewrite_whole_file_(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block, FLAC__bool append); - -static void simple_iterator_push_(FLAC__Metadata_SimpleIterator *iterator); -static FLAC__bool simple_iterator_pop_(FLAC__Metadata_SimpleIterator *iterator); - -static unsigned seek_to_first_metadata_block_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__IOCallback_Seek seek_cb); -static unsigned seek_to_first_metadata_block_(FILE *f); - -static FLAC__bool simple_iterator_copy_file_prefix_(FLAC__Metadata_SimpleIterator *iterator, FILE **tempfile, char **tempfilename, FLAC__bool append); -static FLAC__bool simple_iterator_copy_file_postfix_(FLAC__Metadata_SimpleIterator *iterator, FILE **tempfile, char **tempfilename, int fixup_is_last_code, off_t fixup_is_last_flag_offset, FLAC__bool backup); - -static FLAC__bool copy_n_bytes_from_file_(FILE *file, FILE *tempfile, off_t bytes, FLAC__Metadata_SimpleIteratorStatus *status); -static FLAC__bool copy_n_bytes_from_file_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__IOHandle temp_handle, FLAC__IOCallback_Write temp_write_cb, off_t bytes, FLAC__Metadata_SimpleIteratorStatus *status); -static FLAC__bool copy_remaining_bytes_from_file_(FILE *file, FILE *tempfile, FLAC__Metadata_SimpleIteratorStatus *status); -static FLAC__bool copy_remaining_bytes_from_file_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__IOCallback_Eof eof_cb, FLAC__IOHandle temp_handle, FLAC__IOCallback_Write temp_write_cb, FLAC__Metadata_SimpleIteratorStatus *status); - -static FLAC__bool open_tempfile_(const char *filename, const char *tempfile_path_prefix, FILE **tempfile, char **tempfilename, FLAC__Metadata_SimpleIteratorStatus *status); -static FLAC__bool transport_tempfile_(const char *filename, FILE **tempfile, char **tempfilename, FLAC__Metadata_SimpleIteratorStatus *status); -static void cleanup_tempfile_(FILE **tempfile, char **tempfilename); - -static FLAC__bool get_file_stats_(const char *filename, struct stat *stats); -static void set_file_stats_(const char *filename, struct stat *stats); - -static int fseek_wrapper_(FLAC__IOHandle handle, FLAC__int64 offset, int whence); -static FLAC__int64 ftell_wrapper_(FLAC__IOHandle handle); - -static FLAC__Metadata_ChainStatus get_equivalent_status_(FLAC__Metadata_SimpleIteratorStatus status); - - -#ifdef FLAC__VALGRIND_TESTING -static size_t local__fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) -{ - size_t ret = fwrite(ptr, size, nmemb, stream); - if(!ferror(stream)) - fflush(stream); - return ret; -} -#else -#define local__fwrite fwrite -#endif - -/**************************************************************************** - * - * Level 0 implementation - * - ***************************************************************************/ - -static FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data); -static void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data); -static void error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data); - -typedef struct { - FLAC__bool got_error; - FLAC__StreamMetadata *object; -} level0_client_data; - -static FLAC__StreamMetadata *get_one_metadata_block_(const char *filename, FLAC__MetadataType type) -{ - level0_client_data cd; - FLAC__StreamDecoder *decoder; - - FLAC__ASSERT(0 != filename); - - cd.got_error = false; - cd.object = 0; - - decoder = FLAC__stream_decoder_new(); - - if(0 == decoder) - return 0; - - FLAC__stream_decoder_set_md5_checking(decoder, false); - FLAC__stream_decoder_set_metadata_ignore_all(decoder); - FLAC__stream_decoder_set_metadata_respond(decoder, type); - - if(FLAC__stream_decoder_init_file(decoder, filename, write_callback_, metadata_callback_, error_callback_, &cd) != FLAC__STREAM_DECODER_INIT_STATUS_OK || cd.got_error) { - (void)FLAC__stream_decoder_finish(decoder); - FLAC__stream_decoder_delete(decoder); - return 0; - } - - if(!FLAC__stream_decoder_process_until_end_of_metadata(decoder) || cd.got_error) { - (void)FLAC__stream_decoder_finish(decoder); - FLAC__stream_decoder_delete(decoder); - if(0 != cd.object) - FLAC__metadata_object_delete(cd.object); - return 0; - } - - (void)FLAC__stream_decoder_finish(decoder); - FLAC__stream_decoder_delete(decoder); - - return cd.object; -} - -FLAC_API FLAC__bool FLAC__metadata_get_streaminfo(const char *filename, FLAC__StreamMetadata *streaminfo) -{ - FLAC__StreamMetadata *object; - - FLAC__ASSERT(0 != filename); - FLAC__ASSERT(0 != streaminfo); - - object = get_one_metadata_block_(filename, FLAC__METADATA_TYPE_STREAMINFO); - - if (object) { - /* can just copy the contents since STREAMINFO has no internal structure */ - *streaminfo = *object; - FLAC__metadata_object_delete(object); - return true; - } - else { - return false; - } -} - -FLAC_API FLAC__bool FLAC__metadata_get_tags(const char *filename, FLAC__StreamMetadata **tags) -{ - FLAC__ASSERT(0 != filename); - FLAC__ASSERT(0 != tags); - - *tags = get_one_metadata_block_(filename, FLAC__METADATA_TYPE_VORBIS_COMMENT); - - return 0 != *tags; -} - -FLAC_API FLAC__bool FLAC__metadata_get_cuesheet(const char *filename, FLAC__StreamMetadata **cuesheet) -{ - FLAC__ASSERT(0 != filename); - FLAC__ASSERT(0 != cuesheet); - - *cuesheet = get_one_metadata_block_(filename, FLAC__METADATA_TYPE_CUESHEET); - - return 0 != *cuesheet; -} - -FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data) -{ - (void)decoder, (void)frame, (void)buffer, (void)client_data; - - return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; -} - -void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) -{ - level0_client_data *cd = (level0_client_data *)client_data; - (void)decoder; - - /* - * we assume we only get here when the one metadata block we were - * looking for was passed to us - */ - if(!cd->got_error && 0 == cd->object) { - if(0 == (cd->object = FLAC__metadata_object_clone(metadata))) - cd->got_error = true; - } -} - -void error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) -{ - level0_client_data *cd = (level0_client_data *)client_data; - (void)decoder; - - if(status != FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC) - cd->got_error = true; -} - -FLAC_API FLAC__bool FLAC__metadata_get_picture(const char *filename, FLAC__StreamMetadata **picture, FLAC__StreamMetadata_Picture_Type type, const char *mime_type, const FLAC__byte *description, unsigned max_width, unsigned max_height, unsigned max_depth, unsigned max_colors) -{ - FLAC__Metadata_SimpleIterator *it; - FLAC__uint64 max_area_seen = 0; - FLAC__uint64 max_depth_seen = 0; - - FLAC__ASSERT(0 != filename); - FLAC__ASSERT(0 != picture); - - *picture = 0; - - it = FLAC__metadata_simple_iterator_new(); - if(0 == it) - return false; - if(!FLAC__metadata_simple_iterator_init(it, filename, /*read_only=*/true, /*preserve_file_stats=*/true)) { - FLAC__metadata_simple_iterator_delete(it); - return false; - } - do { - if(FLAC__metadata_simple_iterator_get_block_type(it) == FLAC__METADATA_TYPE_PICTURE) { - FLAC__StreamMetadata *obj = FLAC__metadata_simple_iterator_get_block(it); - FLAC__uint64 area = (FLAC__uint64)obj->data.picture.width * (FLAC__uint64)obj->data.picture.height; - /* check constraints */ - if( - (type == (FLAC__StreamMetadata_Picture_Type)(-1) || type == obj->data.picture.type) && - (mime_type == 0 || !strcmp(mime_type, obj->data.picture.mime_type)) && - (description == 0 || !strcmp((const char *)description, (const char *)obj->data.picture.description)) && - obj->data.picture.width <= max_width && - obj->data.picture.height <= max_height && - obj->data.picture.depth <= max_depth && - obj->data.picture.colors <= max_colors && - (area > max_area_seen || (area == max_area_seen && obj->data.picture.depth > max_depth_seen)) - ) { - if(*picture) - FLAC__metadata_object_delete(*picture); - *picture = obj; - max_area_seen = area; - max_depth_seen = obj->data.picture.depth; - } - else { - FLAC__metadata_object_delete(obj); - } - } - } while(FLAC__metadata_simple_iterator_next(it)); - - FLAC__metadata_simple_iterator_delete(it); - - return (0 != *picture); -} - - -/**************************************************************************** - * - * Level 1 implementation - * - ***************************************************************************/ - -#define SIMPLE_ITERATOR_MAX_PUSH_DEPTH (1+4) -/* 1 for initial offset, +4 for our own personal use */ - -struct FLAC__Metadata_SimpleIterator { - FILE *file; - char *filename, *tempfile_path_prefix; - struct stat stats; - FLAC__bool has_stats; - FLAC__bool is_writable; - FLAC__Metadata_SimpleIteratorStatus status; - off_t offset[SIMPLE_ITERATOR_MAX_PUSH_DEPTH]; - off_t first_offset; /* this is the offset to the STREAMINFO block */ - unsigned depth; - /* this is the metadata block header of the current block we are pointing to: */ - FLAC__bool is_last; - FLAC__MetadataType type; - unsigned length; -}; - -FLAC_API const char * const FLAC__Metadata_SimpleIteratorStatusString[] = { - "FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK", - "FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT", - "FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ERROR_OPENING_FILE", - "FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_A_FLAC_FILE", - "FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_WRITABLE", - "FLAC__METADATA_SIMPLE_ITERATOR_STATUS_BAD_METADATA", - "FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR", - "FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR", - "FLAC__METADATA_SIMPLE_ITERATOR_STATUS_WRITE_ERROR", - "FLAC__METADATA_SIMPLE_ITERATOR_STATUS_RENAME_ERROR", - "FLAC__METADATA_SIMPLE_ITERATOR_STATUS_UNLINK_ERROR", - "FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR", - "FLAC__METADATA_SIMPLE_ITERATOR_STATUS_INTERNAL_ERROR" -}; - - -FLAC_API FLAC__Metadata_SimpleIterator *FLAC__metadata_simple_iterator_new(void) -{ - FLAC__Metadata_SimpleIterator *iterator = (FLAC__Metadata_SimpleIterator*)calloc(1, sizeof(FLAC__Metadata_SimpleIterator)); - - if(0 != iterator) { - iterator->file = 0; - iterator->filename = 0; - iterator->tempfile_path_prefix = 0; - iterator->has_stats = false; - iterator->is_writable = false; - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK; - iterator->first_offset = iterator->offset[0] = -1; - iterator->depth = 0; - } - - return iterator; -} - -static void simple_iterator_free_guts_(FLAC__Metadata_SimpleIterator *iterator) -{ - FLAC__ASSERT(0 != iterator); - - if(0 != iterator->file) { - fclose(iterator->file); - iterator->file = 0; - if(iterator->has_stats) - set_file_stats_(iterator->filename, &iterator->stats); - } - if(0 != iterator->filename) { - free(iterator->filename); - iterator->filename = 0; - } - if(0 != iterator->tempfile_path_prefix) { - free(iterator->tempfile_path_prefix); - iterator->tempfile_path_prefix = 0; - } -} - -FLAC_API void FLAC__metadata_simple_iterator_delete(FLAC__Metadata_SimpleIterator *iterator) -{ - FLAC__ASSERT(0 != iterator); - - simple_iterator_free_guts_(iterator); - free(iterator); -} - -FLAC_API FLAC__Metadata_SimpleIteratorStatus FLAC__metadata_simple_iterator_status(FLAC__Metadata_SimpleIterator *iterator) -{ - FLAC__Metadata_SimpleIteratorStatus status; - - FLAC__ASSERT(0 != iterator); - - status = iterator->status; - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK; - return status; -} - -static FLAC__bool simple_iterator_prime_input_(FLAC__Metadata_SimpleIterator *iterator, FLAC__bool read_only) -{ - unsigned ret; - - FLAC__ASSERT(0 != iterator); - - if(read_only || 0 == (iterator->file = fopen(iterator->filename, "r+b"))) { - iterator->is_writable = false; - if(read_only || errno == EACCES) { - if(0 == (iterator->file = fopen(iterator->filename, "rb"))) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ERROR_OPENING_FILE; - return false; - } - } - else { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ERROR_OPENING_FILE; - return false; - } - } - else { - iterator->is_writable = true; - } - - ret = seek_to_first_metadata_block_(iterator->file); - switch(ret) { - case 0: - iterator->depth = 0; - iterator->first_offset = iterator->offset[iterator->depth] = ftello(iterator->file); - return read_metadata_block_header_(iterator); - case 1: - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - return false; - case 2: - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR; - return false; - case 3: - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_A_FLAC_FILE; - return false; - default: - FLAC__ASSERT(0); - return false; - } -} - -#if 0 -@@@ If we decide to finish implementing this, put this comment back in metadata.h -/* - * The 'tempfile_path_prefix' allows you to specify a directory where - * tempfiles should go. Remember that if your metadata edits cause the - * FLAC file to grow, the entire file will have to be rewritten. If - * 'tempfile_path_prefix' is NULL, the temp file will be written in the - * same directory as the original FLAC file. This makes replacing the - * original with the tempfile fast but requires extra space in the same - * partition for the tempfile. If space is a problem, you can pass a - * directory name belonging to a different partition in - * 'tempfile_path_prefix'. Note that you should use the forward slash - * '/' as the directory separator. A trailing slash is not needed; it - * will be added automatically. - */ -FLAC__bool FLAC__metadata_simple_iterator_init(FLAC__Metadata_SimpleIterator *iterator, const char *filename, FLAC__bool preserve_file_stats, const char *tempfile_path_prefix); -#endif - -FLAC_API FLAC__bool FLAC__metadata_simple_iterator_init(FLAC__Metadata_SimpleIterator *iterator, const char *filename, FLAC__bool read_only, FLAC__bool preserve_file_stats) -{ - const char *tempfile_path_prefix = 0; /*@@@ search for comments near 'rename(...)' for what it will take to finish implementing this */ - - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != filename); - - simple_iterator_free_guts_(iterator); - - if(!read_only && preserve_file_stats) - iterator->has_stats = get_file_stats_(filename, &iterator->stats); - - if(0 == (iterator->filename = strdup(filename))) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR; - return false; - } - if(0 != tempfile_path_prefix && 0 == (iterator->tempfile_path_prefix = strdup(tempfile_path_prefix))) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR; - return false; - } - - return simple_iterator_prime_input_(iterator, read_only); -} - -FLAC_API FLAC__bool FLAC__metadata_simple_iterator_is_writable(const FLAC__Metadata_SimpleIterator *iterator) -{ - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->file); - - return iterator->is_writable; -} - -FLAC_API FLAC__bool FLAC__metadata_simple_iterator_next(FLAC__Metadata_SimpleIterator *iterator) -{ - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->file); - - if(iterator->is_last) - return false; - - if(0 != fseeko(iterator->file, iterator->length, SEEK_CUR)) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR; - return false; - } - - iterator->offset[iterator->depth] = ftello(iterator->file); - - return read_metadata_block_header_(iterator); -} - -FLAC_API FLAC__bool FLAC__metadata_simple_iterator_prev(FLAC__Metadata_SimpleIterator *iterator) -{ - off_t this_offset; - - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->file); - - if(iterator->offset[iterator->depth] == iterator->first_offset) - return false; - - if(0 != fseeko(iterator->file, iterator->first_offset, SEEK_SET)) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR; - return false; - } - this_offset = iterator->first_offset; - if(!read_metadata_block_header_(iterator)) - return false; - - /* we ignore any error from ftello() and catch it in fseeko() */ - while(ftello(iterator->file) + (off_t)iterator->length < iterator->offset[iterator->depth]) { - if(0 != fseeko(iterator->file, iterator->length, SEEK_CUR)) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR; - return false; - } - this_offset = ftello(iterator->file); - if(!read_metadata_block_header_(iterator)) - return false; - } - - iterator->offset[iterator->depth] = this_offset; - - return true; -} - -/*@@@@add to tests*/ -FLAC_API FLAC__bool FLAC__metadata_simple_iterator_is_last(const FLAC__Metadata_SimpleIterator *iterator) -{ - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->file); - - return iterator->is_last; -} - -/*@@@@add to tests*/ -FLAC_API off_t FLAC__metadata_simple_iterator_get_block_offset(const FLAC__Metadata_SimpleIterator *iterator) -{ - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->file); - - return iterator->offset[iterator->depth]; -} - -FLAC_API FLAC__MetadataType FLAC__metadata_simple_iterator_get_block_type(const FLAC__Metadata_SimpleIterator *iterator) -{ - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->file); - - return iterator->type; -} - -/*@@@@add to tests*/ -FLAC_API unsigned FLAC__metadata_simple_iterator_get_block_length(const FLAC__Metadata_SimpleIterator *iterator) -{ - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->file); - - return iterator->length; -} - -/*@@@@add to tests*/ -FLAC_API FLAC__bool FLAC__metadata_simple_iterator_get_application_id(FLAC__Metadata_SimpleIterator *iterator, FLAC__byte *id) -{ - const unsigned id_bytes = FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8; - - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->file); - FLAC__ASSERT(0 != id); - - if(iterator->type != FLAC__METADATA_TYPE_APPLICATION) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT; - return false; - } - - if(fread(id, 1, id_bytes, iterator->file) != id_bytes) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - return false; - } - - /* back up */ - if(0 != fseeko(iterator->file, -((int)id_bytes), SEEK_CUR)) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR; - return false; - } - - return true; -} - -FLAC_API FLAC__StreamMetadata *FLAC__metadata_simple_iterator_get_block(FLAC__Metadata_SimpleIterator *iterator) -{ - FLAC__StreamMetadata *block = FLAC__metadata_object_new(iterator->type); - - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->file); - - if(0 != block) { - block->is_last = iterator->is_last; - block->length = iterator->length; - - if(!read_metadata_block_data_(iterator, block)) { - FLAC__metadata_object_delete(block); - return 0; - } - - /* back up to the beginning of the block data to stay consistent */ - if(0 != fseeko(iterator->file, iterator->offset[iterator->depth] + FLAC__STREAM_METADATA_HEADER_LENGTH, SEEK_SET)) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR; - FLAC__metadata_object_delete(block); - return 0; - } - } - else - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR; - - return block; -} - -FLAC_API FLAC__bool FLAC__metadata_simple_iterator_set_block(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block, FLAC__bool use_padding) -{ - FLAC__ASSERT_DECLARATION(off_t debug_target_offset = iterator->offset[iterator->depth];) - FLAC__bool ret; - - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->file); - FLAC__ASSERT(0 != block); - - if(!iterator->is_writable) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_WRITABLE; - return false; - } - - if(iterator->type == FLAC__METADATA_TYPE_STREAMINFO || block->type == FLAC__METADATA_TYPE_STREAMINFO) { - if(iterator->type != block->type) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT; - return false; - } - } - - block->is_last = iterator->is_last; - - if(iterator->length == block->length) - return write_metadata_block_stationary_(iterator, block); - else if(iterator->length > block->length) { - if(use_padding && iterator->length >= FLAC__STREAM_METADATA_HEADER_LENGTH + block->length) { - ret = write_metadata_block_stationary_with_padding_(iterator, block, iterator->length - FLAC__STREAM_METADATA_HEADER_LENGTH - block->length, block->is_last); - FLAC__ASSERT(!ret || iterator->offset[iterator->depth] == debug_target_offset); - FLAC__ASSERT(!ret || ftello(iterator->file) == debug_target_offset + (off_t)FLAC__STREAM_METADATA_HEADER_LENGTH); - return ret; - } - else { - ret = rewrite_whole_file_(iterator, block, /*append=*/false); - FLAC__ASSERT(!ret || iterator->offset[iterator->depth] == debug_target_offset); - FLAC__ASSERT(!ret || ftello(iterator->file) == debug_target_offset + (off_t)FLAC__STREAM_METADATA_HEADER_LENGTH); - return ret; - } - } - else /* iterator->length < block->length */ { - unsigned padding_leftover = 0; - FLAC__bool padding_is_last = false; - if(use_padding) { - /* first see if we can even use padding */ - if(iterator->is_last) { - use_padding = false; - } - else { - const unsigned extra_padding_bytes_required = block->length - iterator->length; - simple_iterator_push_(iterator); - if(!FLAC__metadata_simple_iterator_next(iterator)) { - (void)simple_iterator_pop_(iterator); - return false; - } - if(iterator->type != FLAC__METADATA_TYPE_PADDING) { - use_padding = false; - } - else { - if(FLAC__STREAM_METADATA_HEADER_LENGTH + iterator->length == extra_padding_bytes_required) { - padding_leftover = 0; - block->is_last = iterator->is_last; - } - else if(iterator->length < extra_padding_bytes_required) - use_padding = false; - else { - padding_leftover = FLAC__STREAM_METADATA_HEADER_LENGTH + iterator->length - extra_padding_bytes_required; - padding_is_last = iterator->is_last; - block->is_last = false; - } - } - if(!simple_iterator_pop_(iterator)) - return false; - } - } - if(use_padding) { - if(padding_leftover == 0) { - ret = write_metadata_block_stationary_(iterator, block); - FLAC__ASSERT(!ret || iterator->offset[iterator->depth] == debug_target_offset); - FLAC__ASSERT(!ret || ftello(iterator->file) == debug_target_offset + (off_t)FLAC__STREAM_METADATA_HEADER_LENGTH); - return ret; - } - else { - FLAC__ASSERT(padding_leftover >= FLAC__STREAM_METADATA_HEADER_LENGTH); - ret = write_metadata_block_stationary_with_padding_(iterator, block, padding_leftover - FLAC__STREAM_METADATA_HEADER_LENGTH, padding_is_last); - FLAC__ASSERT(!ret || iterator->offset[iterator->depth] == debug_target_offset); - FLAC__ASSERT(!ret || ftello(iterator->file) == debug_target_offset + (off_t)FLAC__STREAM_METADATA_HEADER_LENGTH); - return ret; - } - } - else { - ret = rewrite_whole_file_(iterator, block, /*append=*/false); - FLAC__ASSERT(!ret || iterator->offset[iterator->depth] == debug_target_offset); - FLAC__ASSERT(!ret || ftello(iterator->file) == debug_target_offset + (off_t)FLAC__STREAM_METADATA_HEADER_LENGTH); - return ret; - } - } -} - -FLAC_API FLAC__bool FLAC__metadata_simple_iterator_insert_block_after(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block, FLAC__bool use_padding) -{ - unsigned padding_leftover = 0; - FLAC__bool padding_is_last = false; - - FLAC__ASSERT_DECLARATION(off_t debug_target_offset = iterator->offset[iterator->depth] + FLAC__STREAM_METADATA_HEADER_LENGTH + iterator->length;) - FLAC__bool ret; - - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->file); - FLAC__ASSERT(0 != block); - - if(!iterator->is_writable) - return false; - - if(block->type == FLAC__METADATA_TYPE_STREAMINFO) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT; - return false; - } - - block->is_last = iterator->is_last; - - if(use_padding) { - /* first see if we can even use padding */ - if(iterator->is_last) { - use_padding = false; - } - else { - simple_iterator_push_(iterator); - if(!FLAC__metadata_simple_iterator_next(iterator)) { - (void)simple_iterator_pop_(iterator); - return false; - } - if(iterator->type != FLAC__METADATA_TYPE_PADDING) { - use_padding = false; - } - else { - if(iterator->length == block->length) { - padding_leftover = 0; - block->is_last = iterator->is_last; - } - else if(iterator->length < FLAC__STREAM_METADATA_HEADER_LENGTH + block->length) - use_padding = false; - else { - padding_leftover = iterator->length - block->length; - padding_is_last = iterator->is_last; - block->is_last = false; - } - } - if(!simple_iterator_pop_(iterator)) - return false; - } - } - if(use_padding) { - /* move to the next block, which is suitable padding */ - if(!FLAC__metadata_simple_iterator_next(iterator)) - return false; - if(padding_leftover == 0) { - ret = write_metadata_block_stationary_(iterator, block); - FLAC__ASSERT(iterator->offset[iterator->depth] == debug_target_offset); - FLAC__ASSERT(ftello(iterator->file) == debug_target_offset + (off_t)FLAC__STREAM_METADATA_HEADER_LENGTH); - return ret; - } - else { - FLAC__ASSERT(padding_leftover >= FLAC__STREAM_METADATA_HEADER_LENGTH); - ret = write_metadata_block_stationary_with_padding_(iterator, block, padding_leftover - FLAC__STREAM_METADATA_HEADER_LENGTH, padding_is_last); - FLAC__ASSERT(iterator->offset[iterator->depth] == debug_target_offset); - FLAC__ASSERT(ftello(iterator->file) == debug_target_offset + (off_t)FLAC__STREAM_METADATA_HEADER_LENGTH); - return ret; - } - } - else { - ret = rewrite_whole_file_(iterator, block, /*append=*/true); - FLAC__ASSERT(iterator->offset[iterator->depth] == debug_target_offset); - FLAC__ASSERT(ftello(iterator->file) == debug_target_offset + (off_t)FLAC__STREAM_METADATA_HEADER_LENGTH); - return ret; - } -} - -FLAC_API FLAC__bool FLAC__metadata_simple_iterator_delete_block(FLAC__Metadata_SimpleIterator *iterator, FLAC__bool use_padding) -{ - FLAC__ASSERT_DECLARATION(off_t debug_target_offset = iterator->offset[iterator->depth];) - FLAC__bool ret; - - if(iterator->type == FLAC__METADATA_TYPE_STREAMINFO) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT; - return false; - } - - if(use_padding) { - FLAC__StreamMetadata *padding = FLAC__metadata_object_new(FLAC__METADATA_TYPE_PADDING); - if(0 == padding) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR; - return false; - } - padding->length = iterator->length; - if(!FLAC__metadata_simple_iterator_set_block(iterator, padding, false)) { - FLAC__metadata_object_delete(padding); - return false; - } - FLAC__metadata_object_delete(padding); - if(!FLAC__metadata_simple_iterator_prev(iterator)) - return false; - FLAC__ASSERT(iterator->offset[iterator->depth] + (off_t)FLAC__STREAM_METADATA_HEADER_LENGTH + (off_t)iterator->length == debug_target_offset); - FLAC__ASSERT(ftello(iterator->file) + (off_t)iterator->length == debug_target_offset); - return true; - } - else { - ret = rewrite_whole_file_(iterator, 0, /*append=*/false); - FLAC__ASSERT(iterator->offset[iterator->depth] + (off_t)FLAC__STREAM_METADATA_HEADER_LENGTH + (off_t)iterator->length == debug_target_offset); - FLAC__ASSERT(ftello(iterator->file) + (off_t)iterator->length == debug_target_offset); - return ret; - } -} - - - -/**************************************************************************** - * - * Level 2 implementation - * - ***************************************************************************/ - - -typedef struct FLAC__Metadata_Node { - FLAC__StreamMetadata *data; - struct FLAC__Metadata_Node *prev, *next; -} FLAC__Metadata_Node; - -struct FLAC__Metadata_Chain { - char *filename; /* will be NULL if using callbacks */ - FLAC__bool is_ogg; - FLAC__Metadata_Node *head; - FLAC__Metadata_Node *tail; - unsigned nodes; - FLAC__Metadata_ChainStatus status; - off_t first_offset, last_offset; - /* - * This is the length of the chain initially read from the FLAC file. - * it is used to compare against the current length to decide whether - * or not the whole file has to be rewritten. - */ - off_t initial_length; - /* @@@ hacky, these are currently only needed by ogg reader */ - FLAC__IOHandle handle; - FLAC__IOCallback_Read read_cb; -}; - -struct FLAC__Metadata_Iterator { - FLAC__Metadata_Chain *chain; - FLAC__Metadata_Node *current; -}; - -FLAC_API const char * const FLAC__Metadata_ChainStatusString[] = { - "FLAC__METADATA_CHAIN_STATUS_OK", - "FLAC__METADATA_CHAIN_STATUS_ILLEGAL_INPUT", - "FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE", - "FLAC__METADATA_CHAIN_STATUS_NOT_A_FLAC_FILE", - "FLAC__METADATA_CHAIN_STATUS_NOT_WRITABLE", - "FLAC__METADATA_CHAIN_STATUS_BAD_METADATA", - "FLAC__METADATA_CHAIN_STATUS_READ_ERROR", - "FLAC__METADATA_CHAIN_STATUS_SEEK_ERROR", - "FLAC__METADATA_CHAIN_STATUS_WRITE_ERROR", - "FLAC__METADATA_CHAIN_STATUS_RENAME_ERROR", - "FLAC__METADATA_CHAIN_STATUS_UNLINK_ERROR", - "FLAC__METADATA_CHAIN_STATUS_MEMORY_ALLOCATION_ERROR", - "FLAC__METADATA_CHAIN_STATUS_INTERNAL_ERROR", - "FLAC__METADATA_CHAIN_STATUS_INVALID_CALLBACKS", - "FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH", - "FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL" -}; - - -static FLAC__Metadata_Node *node_new_(void) -{ - return (FLAC__Metadata_Node*)calloc(1, sizeof(FLAC__Metadata_Node)); -} - -static void node_delete_(FLAC__Metadata_Node *node) -{ - FLAC__ASSERT(0 != node); - if(0 != node->data) - FLAC__metadata_object_delete(node->data); - free(node); -} - -static void chain_init_(FLAC__Metadata_Chain *chain) -{ - FLAC__ASSERT(0 != chain); - - chain->filename = 0; - chain->is_ogg = false; - chain->head = chain->tail = 0; - chain->nodes = 0; - chain->status = FLAC__METADATA_CHAIN_STATUS_OK; - chain->initial_length = 0; - chain->read_cb = 0; -} - -static void chain_clear_(FLAC__Metadata_Chain *chain) -{ - FLAC__Metadata_Node *node, *next; - - FLAC__ASSERT(0 != chain); - - for(node = chain->head; node; ) { - next = node->next; - node_delete_(node); - node = next; - } - - if(0 != chain->filename) - free(chain->filename); - - chain_init_(chain); -} - -static void chain_append_node_(FLAC__Metadata_Chain *chain, FLAC__Metadata_Node *node) -{ - FLAC__ASSERT(0 != chain); - FLAC__ASSERT(0 != node); - FLAC__ASSERT(0 != node->data); - - node->next = node->prev = 0; - node->data->is_last = true; - if(0 != chain->tail) - chain->tail->data->is_last = false; - - if(0 == chain->head) - chain->head = node; - else { - FLAC__ASSERT(0 != chain->tail); - chain->tail->next = node; - node->prev = chain->tail; - } - chain->tail = node; - chain->nodes++; -} - -static void chain_remove_node_(FLAC__Metadata_Chain *chain, FLAC__Metadata_Node *node) -{ - FLAC__ASSERT(0 != chain); - FLAC__ASSERT(0 != node); - - if(node == chain->head) - chain->head = node->next; - else - node->prev->next = node->next; - - if(node == chain->tail) - chain->tail = node->prev; - else - node->next->prev = node->prev; - - if(0 != chain->tail) - chain->tail->data->is_last = true; - - chain->nodes--; -} - -static void chain_delete_node_(FLAC__Metadata_Chain *chain, FLAC__Metadata_Node *node) -{ - chain_remove_node_(chain, node); - node_delete_(node); -} - -static off_t chain_calculate_length_(FLAC__Metadata_Chain *chain) -{ - const FLAC__Metadata_Node *node; - off_t length = 0; - for(node = chain->head; node; node = node->next) - length += (FLAC__STREAM_METADATA_HEADER_LENGTH + node->data->length); - return length; -} - -static void iterator_insert_node_(FLAC__Metadata_Iterator *iterator, FLAC__Metadata_Node *node) -{ - FLAC__ASSERT(0 != node); - FLAC__ASSERT(0 != node->data); - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->current); - FLAC__ASSERT(0 != iterator->chain); - FLAC__ASSERT(0 != iterator->chain->head); - FLAC__ASSERT(0 != iterator->chain->tail); - - node->data->is_last = false; - - node->prev = iterator->current->prev; - node->next = iterator->current; - - if(0 == node->prev) - iterator->chain->head = node; - else - node->prev->next = node; - - iterator->current->prev = node; - - iterator->chain->nodes++; -} - -static void iterator_insert_node_after_(FLAC__Metadata_Iterator *iterator, FLAC__Metadata_Node *node) -{ - FLAC__ASSERT(0 != node); - FLAC__ASSERT(0 != node->data); - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->current); - FLAC__ASSERT(0 != iterator->chain); - FLAC__ASSERT(0 != iterator->chain->head); - FLAC__ASSERT(0 != iterator->chain->tail); - - iterator->current->data->is_last = false; - - node->prev = iterator->current; - node->next = iterator->current->next; - - if(0 == node->next) - iterator->chain->tail = node; - else - node->next->prev = node; - - node->prev->next = node; - - iterator->chain->tail->data->is_last = true; - - iterator->chain->nodes++; -} - -/* return true iff node and node->next are both padding */ -static FLAC__bool chain_merge_adjacent_padding_(FLAC__Metadata_Chain *chain, FLAC__Metadata_Node *node) -{ - if(node->data->type == FLAC__METADATA_TYPE_PADDING && 0 != node->next && node->next->data->type == FLAC__METADATA_TYPE_PADDING) { - const unsigned growth = FLAC__STREAM_METADATA_HEADER_LENGTH + node->next->data->length; - node->data->length += growth; - - chain_delete_node_(chain, node->next); - return true; - } - else - return false; -} - -/* Returns the new length of the chain, or 0 if there was an error. */ -/* WATCHOUT: This can get called multiple times before a write, so - * it should still work when this happens. - */ -/* WATCHOUT: Make sure to also update the logic in - * FLAC__metadata_chain_check_if_tempfile_needed() if the logic here changes. - */ -static off_t chain_prepare_for_write_(FLAC__Metadata_Chain *chain, FLAC__bool use_padding) -{ - off_t current_length = chain_calculate_length_(chain); - - if(use_padding) { - /* if the metadata shrank and the last block is padding, we just extend the last padding block */ - if(current_length < chain->initial_length && chain->tail->data->type == FLAC__METADATA_TYPE_PADDING) { - const off_t delta = chain->initial_length - current_length; - chain->tail->data->length += delta; - current_length += delta; - FLAC__ASSERT(current_length == chain->initial_length); - } - /* if the metadata shrank more than 4 bytes then there's room to add another padding block */ - else if(current_length + (off_t)FLAC__STREAM_METADATA_HEADER_LENGTH <= chain->initial_length) { - FLAC__StreamMetadata *padding; - FLAC__Metadata_Node *node; - if(0 == (padding = FLAC__metadata_object_new(FLAC__METADATA_TYPE_PADDING))) { - chain->status = FLAC__METADATA_CHAIN_STATUS_MEMORY_ALLOCATION_ERROR; - return 0; - } - padding->length = chain->initial_length - (FLAC__STREAM_METADATA_HEADER_LENGTH + current_length); - if(0 == (node = node_new_())) { - FLAC__metadata_object_delete(padding); - chain->status = FLAC__METADATA_CHAIN_STATUS_MEMORY_ALLOCATION_ERROR; - return 0; - } - node->data = padding; - chain_append_node_(chain, node); - current_length = chain_calculate_length_(chain); - FLAC__ASSERT(current_length == chain->initial_length); - } - /* if the metadata grew but the last block is padding, try cutting the padding to restore the original length so we don't have to rewrite the whole file */ - else if(current_length > chain->initial_length) { - const off_t delta = current_length - chain->initial_length; - if(chain->tail->data->type == FLAC__METADATA_TYPE_PADDING) { - /* if the delta is exactly the size of the last padding block, remove the padding block */ - if((off_t)chain->tail->data->length + (off_t)FLAC__STREAM_METADATA_HEADER_LENGTH == delta) { - chain_delete_node_(chain, chain->tail); - current_length = chain_calculate_length_(chain); - FLAC__ASSERT(current_length == chain->initial_length); - } - /* if there is at least 'delta' bytes of padding, trim the padding down */ - else if((off_t)chain->tail->data->length >= delta) { - chain->tail->data->length -= delta; - current_length -= delta; - FLAC__ASSERT(current_length == chain->initial_length); - } - } - } - } - - return current_length; -} - -static FLAC__bool chain_read_cb_(FLAC__Metadata_Chain *chain, FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__IOCallback_Seek seek_cb, FLAC__IOCallback_Tell tell_cb) -{ - FLAC__Metadata_Node *node; - - FLAC__ASSERT(0 != chain); - - /* we assume we're already at the beginning of the file */ - - switch(seek_to_first_metadata_block_cb_(handle, read_cb, seek_cb)) { - case 0: - break; - case 1: - chain->status = FLAC__METADATA_CHAIN_STATUS_READ_ERROR; - return false; - case 2: - chain->status = FLAC__METADATA_CHAIN_STATUS_SEEK_ERROR; - return false; - case 3: - chain->status = FLAC__METADATA_CHAIN_STATUS_NOT_A_FLAC_FILE; - return false; - default: - FLAC__ASSERT(0); - return false; - } - - { - FLAC__int64 pos = tell_cb(handle); - if(pos < 0) { - chain->status = FLAC__METADATA_CHAIN_STATUS_READ_ERROR; - return false; - } - chain->first_offset = (off_t)pos; - } - - { - FLAC__bool is_last; - FLAC__MetadataType type; - unsigned length; - - do { - node = node_new_(); - if(0 == node) { - chain->status = FLAC__METADATA_CHAIN_STATUS_MEMORY_ALLOCATION_ERROR; - return false; - } - - if(!read_metadata_block_header_cb_(handle, read_cb, &is_last, &type, &length)) { - chain->status = FLAC__METADATA_CHAIN_STATUS_READ_ERROR; - return false; - } - - node->data = FLAC__metadata_object_new(type); - if(0 == node->data) { - node_delete_(node); - chain->status = FLAC__METADATA_CHAIN_STATUS_MEMORY_ALLOCATION_ERROR; - return false; - } - - node->data->is_last = is_last; - node->data->length = length; - - chain->status = get_equivalent_status_(read_metadata_block_data_cb_(handle, read_cb, seek_cb, node->data)); - if(chain->status != FLAC__METADATA_CHAIN_STATUS_OK) { - node_delete_(node); - return false; - } - chain_append_node_(chain, node); - } while(!is_last); - } - - { - FLAC__int64 pos = tell_cb(handle); - if(pos < 0) { - chain->status = FLAC__METADATA_CHAIN_STATUS_READ_ERROR; - return false; - } - chain->last_offset = (off_t)pos; - } - - chain->initial_length = chain_calculate_length_(chain); - - return true; -} - -static FLAC__StreamDecoderReadStatus chain_read_ogg_read_cb_(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data) -{ - FLAC__Metadata_Chain *chain = (FLAC__Metadata_Chain*)client_data; - (void)decoder; - if(*bytes > 0 && chain->status == FLAC__METADATA_CHAIN_STATUS_OK) { - *bytes = chain->read_cb(buffer, sizeof(FLAC__byte), *bytes, chain->handle); - if(*bytes == 0) - return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; - else - return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; - } - else - return FLAC__STREAM_DECODER_READ_STATUS_ABORT; -} - -static FLAC__StreamDecoderWriteStatus chain_read_ogg_write_cb_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data) -{ - (void)decoder, (void)frame, (void)buffer, (void)client_data; - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; -} - -static void chain_read_ogg_metadata_cb_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) -{ - FLAC__Metadata_Chain *chain = (FLAC__Metadata_Chain*)client_data; - FLAC__Metadata_Node *node; - - (void)decoder; - - node = node_new_(); - if(0 == node) { - chain->status = FLAC__METADATA_CHAIN_STATUS_MEMORY_ALLOCATION_ERROR; - return; - } - - node->data = FLAC__metadata_object_clone(metadata); - if(0 == node->data) { - node_delete_(node); - chain->status = FLAC__METADATA_CHAIN_STATUS_MEMORY_ALLOCATION_ERROR; - return; - } - - chain_append_node_(chain, node); -} - -static void chain_read_ogg_error_cb_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) -{ - FLAC__Metadata_Chain *chain = (FLAC__Metadata_Chain*)client_data; - (void)decoder, (void)status; - chain->status = FLAC__METADATA_CHAIN_STATUS_INTERNAL_ERROR; /*@@@ maybe needs better error code */ -} - -static FLAC__bool chain_read_ogg_cb_(FLAC__Metadata_Chain *chain, FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb) -{ - FLAC__StreamDecoder *decoder; - - FLAC__ASSERT(0 != chain); - - /* we assume we're already at the beginning of the file */ - - chain->handle = handle; - chain->read_cb = read_cb; - if(0 == (decoder = FLAC__stream_decoder_new())) { - chain->status = FLAC__METADATA_CHAIN_STATUS_MEMORY_ALLOCATION_ERROR; - return false; - } - FLAC__stream_decoder_set_metadata_respond_all(decoder); - if(FLAC__stream_decoder_init_ogg_stream(decoder, chain_read_ogg_read_cb_, /*seek_callback=*/0, /*tell_callback=*/0, /*length_callback=*/0, /*eof_callback=*/0, chain_read_ogg_write_cb_, chain_read_ogg_metadata_cb_, chain_read_ogg_error_cb_, chain) != FLAC__STREAM_DECODER_INIT_STATUS_OK) { - FLAC__stream_decoder_delete(decoder); - chain->status = FLAC__METADATA_CHAIN_STATUS_INTERNAL_ERROR; /*@@@ maybe needs better error code */ - return false; - } - - chain->first_offset = 0; /*@@@ wrong; will need to be set correctly to implement metadata writing for Ogg FLAC */ - - if(!FLAC__stream_decoder_process_until_end_of_metadata(decoder)) - chain->status = FLAC__METADATA_CHAIN_STATUS_INTERNAL_ERROR; /*@@@ maybe needs better error code */ - if(chain->status != FLAC__METADATA_CHAIN_STATUS_OK) { - FLAC__stream_decoder_delete(decoder); - return false; - } - - FLAC__stream_decoder_delete(decoder); - - chain->last_offset = 0; /*@@@ wrong; will need to be set correctly to implement metadata writing for Ogg FLAC */ - - chain->initial_length = chain_calculate_length_(chain); - - return true; -} - -static FLAC__bool chain_rewrite_metadata_in_place_cb_(FLAC__Metadata_Chain *chain, FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, FLAC__IOCallback_Seek seek_cb) -{ - FLAC__Metadata_Node *node; - - FLAC__ASSERT(0 != chain); - FLAC__ASSERT(0 != chain->head); - - if(0 != seek_cb(handle, chain->first_offset, SEEK_SET)) { - chain->status = FLAC__METADATA_CHAIN_STATUS_SEEK_ERROR; - return false; - } - - for(node = chain->head; node; node = node->next) { - if(!write_metadata_block_header_cb_(handle, write_cb, node->data)) { - chain->status = FLAC__METADATA_CHAIN_STATUS_WRITE_ERROR; - return false; - } - if(!write_metadata_block_data_cb_(handle, write_cb, node->data)) { - chain->status = FLAC__METADATA_CHAIN_STATUS_WRITE_ERROR; - return false; - } - } - - /*FLAC__ASSERT(fflush(), ftello() == chain->last_offset);*/ - - chain->status = FLAC__METADATA_CHAIN_STATUS_OK; - return true; -} - -static FLAC__bool chain_rewrite_metadata_in_place_(FLAC__Metadata_Chain *chain) -{ - FILE *file; - FLAC__bool ret; - - FLAC__ASSERT(0 != chain->filename); - - if(0 == (file = fopen(chain->filename, "r+b"))) { - chain->status = FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE; - return false; - } - - /* chain_rewrite_metadata_in_place_cb_() sets chain->status for us */ - ret = chain_rewrite_metadata_in_place_cb_(chain, (FLAC__IOHandle)file, (FLAC__IOCallback_Write)fwrite, fseek_wrapper_); - - fclose(file); - - return ret; -} - -static FLAC__bool chain_rewrite_file_(FLAC__Metadata_Chain *chain, const char *tempfile_path_prefix) -{ - FILE *f, *tempfile; - char *tempfilename; - FLAC__Metadata_SimpleIteratorStatus status; - const FLAC__Metadata_Node *node; - - FLAC__ASSERT(0 != chain); - FLAC__ASSERT(0 != chain->filename); - FLAC__ASSERT(0 != chain->head); - - /* copy the file prefix (data up to first metadata block */ - if(0 == (f = fopen(chain->filename, "rb"))) { - chain->status = FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE; - return false; - } - if(!open_tempfile_(chain->filename, tempfile_path_prefix, &tempfile, &tempfilename, &status)) { - chain->status = get_equivalent_status_(status); - cleanup_tempfile_(&tempfile, &tempfilename); - return false; - } - if(!copy_n_bytes_from_file_(f, tempfile, chain->first_offset, &status)) { - chain->status = get_equivalent_status_(status); - cleanup_tempfile_(&tempfile, &tempfilename); - return false; - } - - /* write the metadata */ - for(node = chain->head; node; node = node->next) { - if(!write_metadata_block_header_(tempfile, &status, node->data)) { - chain->status = get_equivalent_status_(status); - return false; - } - if(!write_metadata_block_data_(tempfile, &status, node->data)) { - chain->status = get_equivalent_status_(status); - return false; - } - } - /*FLAC__ASSERT(fflush(), ftello() == chain->last_offset);*/ - - /* copy the file postfix (everything after the metadata) */ - if(0 != fseeko(f, chain->last_offset, SEEK_SET)) { - cleanup_tempfile_(&tempfile, &tempfilename); - chain->status = FLAC__METADATA_CHAIN_STATUS_SEEK_ERROR; - return false; - } - if(!copy_remaining_bytes_from_file_(f, tempfile, &status)) { - cleanup_tempfile_(&tempfile, &tempfilename); - chain->status = get_equivalent_status_(status); - return false; - } - - /* move the tempfile on top of the original */ - (void)fclose(f); - if(!transport_tempfile_(chain->filename, &tempfile, &tempfilename, &status)) - return false; - - return true; -} - -/* assumes 'handle' is already at beginning of file */ -static FLAC__bool chain_rewrite_file_cb_(FLAC__Metadata_Chain *chain, FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__IOCallback_Seek seek_cb, FLAC__IOCallback_Eof eof_cb, FLAC__IOHandle temp_handle, FLAC__IOCallback_Write temp_write_cb) -{ - FLAC__Metadata_SimpleIteratorStatus status; - const FLAC__Metadata_Node *node; - - FLAC__ASSERT(0 != chain); - FLAC__ASSERT(0 == chain->filename); - FLAC__ASSERT(0 != chain->head); - - /* copy the file prefix (data up to first metadata block */ - if(!copy_n_bytes_from_file_cb_(handle, read_cb, temp_handle, temp_write_cb, chain->first_offset, &status)) { - chain->status = get_equivalent_status_(status); - return false; - } - - /* write the metadata */ - for(node = chain->head; node; node = node->next) { - if(!write_metadata_block_header_cb_(temp_handle, temp_write_cb, node->data)) { - chain->status = FLAC__METADATA_CHAIN_STATUS_WRITE_ERROR; - return false; - } - if(!write_metadata_block_data_cb_(temp_handle, temp_write_cb, node->data)) { - chain->status = FLAC__METADATA_CHAIN_STATUS_WRITE_ERROR; - return false; - } - } - /*FLAC__ASSERT(fflush(), ftello() == chain->last_offset);*/ - - /* copy the file postfix (everything after the metadata) */ - if(0 != seek_cb(handle, chain->last_offset, SEEK_SET)) { - chain->status = FLAC__METADATA_CHAIN_STATUS_SEEK_ERROR; - return false; - } - if(!copy_remaining_bytes_from_file_cb_(handle, read_cb, eof_cb, temp_handle, temp_write_cb, &status)) { - chain->status = get_equivalent_status_(status); - return false; - } - - return true; -} - -FLAC_API FLAC__Metadata_Chain *FLAC__metadata_chain_new(void) -{ - FLAC__Metadata_Chain *chain = (FLAC__Metadata_Chain*)calloc(1, sizeof(FLAC__Metadata_Chain)); - - if(0 != chain) - chain_init_(chain); - - return chain; -} - -FLAC_API void FLAC__metadata_chain_delete(FLAC__Metadata_Chain *chain) -{ - FLAC__ASSERT(0 != chain); - - chain_clear_(chain); - - free(chain); -} - -FLAC_API FLAC__Metadata_ChainStatus FLAC__metadata_chain_status(FLAC__Metadata_Chain *chain) -{ - FLAC__Metadata_ChainStatus status; - - FLAC__ASSERT(0 != chain); - - status = chain->status; - chain->status = FLAC__METADATA_CHAIN_STATUS_OK; - return status; -} - -static FLAC__bool chain_read_(FLAC__Metadata_Chain *chain, const char *filename, FLAC__bool is_ogg) -{ - FILE *file; - FLAC__bool ret; - - FLAC__ASSERT(0 != chain); - FLAC__ASSERT(0 != filename); - - chain_clear_(chain); - - if(0 == (chain->filename = strdup(filename))) { - chain->status = FLAC__METADATA_CHAIN_STATUS_MEMORY_ALLOCATION_ERROR; - return false; - } - - chain->is_ogg = is_ogg; - - if(0 == (file = fopen(filename, "rb"))) { - chain->status = FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE; - return false; - } - - /* the function also sets chain->status for us */ - ret = is_ogg? - chain_read_ogg_cb_(chain, file, (FLAC__IOCallback_Read)fread) : - chain_read_cb_(chain, file, (FLAC__IOCallback_Read)fread, fseek_wrapper_, ftell_wrapper_) - ; - - fclose(file); - - return ret; -} - -FLAC_API FLAC__bool FLAC__metadata_chain_read(FLAC__Metadata_Chain *chain, const char *filename) -{ - return chain_read_(chain, filename, /*is_ogg=*/false); -} - -/*@@@@add to tests*/ -FLAC_API FLAC__bool FLAC__metadata_chain_read_ogg(FLAC__Metadata_Chain *chain, const char *filename) -{ - return chain_read_(chain, filename, /*is_ogg=*/true); -} - -static FLAC__bool chain_read_with_callbacks_(FLAC__Metadata_Chain *chain, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks, FLAC__bool is_ogg) -{ - FLAC__bool ret; - - FLAC__ASSERT(0 != chain); - - chain_clear_(chain); - - if (0 == callbacks.read || 0 == callbacks.seek || 0 == callbacks.tell) { - chain->status = FLAC__METADATA_CHAIN_STATUS_INVALID_CALLBACKS; - return false; - } - - chain->is_ogg = is_ogg; - - /* rewind */ - if(0 != callbacks.seek(handle, 0, SEEK_SET)) { - chain->status = FLAC__METADATA_CHAIN_STATUS_SEEK_ERROR; - return false; - } - - /* the function also sets chain->status for us */ - ret = is_ogg? - chain_read_ogg_cb_(chain, handle, callbacks.read) : - chain_read_cb_(chain, handle, callbacks.read, callbacks.seek, callbacks.tell) - ; - - return ret; -} - -FLAC_API FLAC__bool FLAC__metadata_chain_read_with_callbacks(FLAC__Metadata_Chain *chain, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks) -{ - return chain_read_with_callbacks_(chain, handle, callbacks, /*is_ogg=*/false); -} - -/*@@@@add to tests*/ -FLAC_API FLAC__bool FLAC__metadata_chain_read_ogg_with_callbacks(FLAC__Metadata_Chain *chain, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks) -{ - return chain_read_with_callbacks_(chain, handle, callbacks, /*is_ogg=*/true); -} - -FLAC_API FLAC__bool FLAC__metadata_chain_check_if_tempfile_needed(FLAC__Metadata_Chain *chain, FLAC__bool use_padding) -{ - /* This does all the same checks that are in chain_prepare_for_write_() - * but doesn't actually alter the chain. Make sure to update the logic - * here if chain_prepare_for_write_() changes. - */ - const off_t current_length = chain_calculate_length_(chain); - - FLAC__ASSERT(0 != chain); - - if(use_padding) { - /* if the metadata shrank and the last block is padding, we just extend the last padding block */ - if(current_length < chain->initial_length && chain->tail->data->type == FLAC__METADATA_TYPE_PADDING) - return false; - /* if the metadata shrank more than 4 bytes then there's room to add another padding block */ - else if(current_length + (off_t)FLAC__STREAM_METADATA_HEADER_LENGTH <= chain->initial_length) - return false; - /* if the metadata grew but the last block is padding, try cutting the padding to restore the original length so we don't have to rewrite the whole file */ - else if(current_length > chain->initial_length) { - const off_t delta = current_length - chain->initial_length; - if(chain->tail->data->type == FLAC__METADATA_TYPE_PADDING) { - /* if the delta is exactly the size of the last padding block, remove the padding block */ - if((off_t)chain->tail->data->length + (off_t)FLAC__STREAM_METADATA_HEADER_LENGTH == delta) - return false; - /* if there is at least 'delta' bytes of padding, trim the padding down */ - else if((off_t)chain->tail->data->length >= delta) - return false; - } - } - } - - return (current_length != chain->initial_length); -} - -FLAC_API FLAC__bool FLAC__metadata_chain_write(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__bool preserve_file_stats) -{ - struct stat stats; - const char *tempfile_path_prefix = 0; - off_t current_length; - - FLAC__ASSERT(0 != chain); - - if (chain->is_ogg) { /* cannot write back to Ogg FLAC yet */ - chain->status = FLAC__METADATA_CHAIN_STATUS_INTERNAL_ERROR; - return false; - } - - if (0 == chain->filename) { - chain->status = FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH; - return false; - } - - current_length = chain_prepare_for_write_(chain, use_padding); - - /* a return value of 0 means there was an error; chain->status is already set */ - if (0 == current_length) - return false; - - if(preserve_file_stats) - get_file_stats_(chain->filename, &stats); - - if(current_length == chain->initial_length) { - if(!chain_rewrite_metadata_in_place_(chain)) - return false; - } - else { - if(!chain_rewrite_file_(chain, tempfile_path_prefix)) - return false; - - /* recompute lengths and offsets */ - { - const FLAC__Metadata_Node *node; - chain->initial_length = current_length; - chain->last_offset = chain->first_offset; - for(node = chain->head; node; node = node->next) - chain->last_offset += (FLAC__STREAM_METADATA_HEADER_LENGTH + node->data->length); - } - } - - if(preserve_file_stats) - set_file_stats_(chain->filename, &stats); - - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_chain_write_with_callbacks(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks) -{ - off_t current_length; - - FLAC__ASSERT(0 != chain); - - if (chain->is_ogg) { /* cannot write back to Ogg FLAC yet */ - chain->status = FLAC__METADATA_CHAIN_STATUS_INTERNAL_ERROR; - return false; - } - - if (0 != chain->filename) { - chain->status = FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH; - return false; - } - - if (0 == callbacks.write || 0 == callbacks.seek) { - chain->status = FLAC__METADATA_CHAIN_STATUS_INVALID_CALLBACKS; - return false; - } - - if (FLAC__metadata_chain_check_if_tempfile_needed(chain, use_padding)) { - chain->status = FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL; - return false; - } - - current_length = chain_prepare_for_write_(chain, use_padding); - - /* a return value of 0 means there was an error; chain->status is already set */ - if (0 == current_length) - return false; - - FLAC__ASSERT(current_length == chain->initial_length); - - return chain_rewrite_metadata_in_place_cb_(chain, handle, callbacks.write, callbacks.seek); -} - -FLAC_API FLAC__bool FLAC__metadata_chain_write_with_callbacks_and_tempfile(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__IOHandle handle, FLAC__IOCallbacks callbacks, FLAC__IOHandle temp_handle, FLAC__IOCallbacks temp_callbacks) -{ - off_t current_length; - - FLAC__ASSERT(0 != chain); - - if (chain->is_ogg) { /* cannot write back to Ogg FLAC yet */ - chain->status = FLAC__METADATA_CHAIN_STATUS_INTERNAL_ERROR; - return false; - } - - if (0 != chain->filename) { - chain->status = FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH; - return false; - } - - if (0 == callbacks.read || 0 == callbacks.seek || 0 == callbacks.eof) { - chain->status = FLAC__METADATA_CHAIN_STATUS_INVALID_CALLBACKS; - return false; - } - if (0 == temp_callbacks.write) { - chain->status = FLAC__METADATA_CHAIN_STATUS_INVALID_CALLBACKS; - return false; - } - - if (!FLAC__metadata_chain_check_if_tempfile_needed(chain, use_padding)) { - chain->status = FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL; - return false; - } - - current_length = chain_prepare_for_write_(chain, use_padding); - - /* a return value of 0 means there was an error; chain->status is already set */ - if (0 == current_length) - return false; - - FLAC__ASSERT(current_length != chain->initial_length); - - /* rewind */ - if(0 != callbacks.seek(handle, 0, SEEK_SET)) { - chain->status = FLAC__METADATA_CHAIN_STATUS_SEEK_ERROR; - return false; - } - - if(!chain_rewrite_file_cb_(chain, handle, callbacks.read, callbacks.seek, callbacks.eof, temp_handle, temp_callbacks.write)) - return false; - - /* recompute lengths and offsets */ - { - const FLAC__Metadata_Node *node; - chain->initial_length = current_length; - chain->last_offset = chain->first_offset; - for(node = chain->head; node; node = node->next) - chain->last_offset += (FLAC__STREAM_METADATA_HEADER_LENGTH + node->data->length); - } - - return true; -} - -FLAC_API void FLAC__metadata_chain_merge_padding(FLAC__Metadata_Chain *chain) -{ - FLAC__Metadata_Node *node; - - FLAC__ASSERT(0 != chain); - - for(node = chain->head; node; ) { - if(!chain_merge_adjacent_padding_(chain, node)) - node = node->next; - } -} - -FLAC_API void FLAC__metadata_chain_sort_padding(FLAC__Metadata_Chain *chain) -{ - FLAC__Metadata_Node *node, *save; - unsigned i; - - FLAC__ASSERT(0 != chain); - - /* - * Don't try and be too smart... this simple algo is good enough for - * the small number of nodes that we deal with. - */ - for(i = 0, node = chain->head; i < chain->nodes; i++) { - if(node->data->type == FLAC__METADATA_TYPE_PADDING) { - save = node->next; - chain_remove_node_(chain, node); - chain_append_node_(chain, node); - node = save; - } - else { - node = node->next; - } - } - - FLAC__metadata_chain_merge_padding(chain); -} - - -FLAC_API FLAC__Metadata_Iterator *FLAC__metadata_iterator_new(void) -{ - FLAC__Metadata_Iterator *iterator = (FLAC__Metadata_Iterator*)calloc(1, sizeof(FLAC__Metadata_Iterator)); - - /* calloc() implies: - iterator->current = 0; - iterator->chain = 0; - */ - - return iterator; -} - -FLAC_API void FLAC__metadata_iterator_delete(FLAC__Metadata_Iterator *iterator) -{ - FLAC__ASSERT(0 != iterator); - - free(iterator); -} - -FLAC_API void FLAC__metadata_iterator_init(FLAC__Metadata_Iterator *iterator, FLAC__Metadata_Chain *chain) -{ - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != chain); - FLAC__ASSERT(0 != chain->head); - - iterator->chain = chain; - iterator->current = chain->head; -} - -FLAC_API FLAC__bool FLAC__metadata_iterator_next(FLAC__Metadata_Iterator *iterator) -{ - FLAC__ASSERT(0 != iterator); - - if(0 == iterator->current || 0 == iterator->current->next) - return false; - - iterator->current = iterator->current->next; - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_iterator_prev(FLAC__Metadata_Iterator *iterator) -{ - FLAC__ASSERT(0 != iterator); - - if(0 == iterator->current || 0 == iterator->current->prev) - return false; - - iterator->current = iterator->current->prev; - return true; -} - -FLAC_API FLAC__MetadataType FLAC__metadata_iterator_get_block_type(const FLAC__Metadata_Iterator *iterator) -{ - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->current); - FLAC__ASSERT(0 != iterator->current->data); - - return iterator->current->data->type; -} - -FLAC_API FLAC__StreamMetadata *FLAC__metadata_iterator_get_block(FLAC__Metadata_Iterator *iterator) -{ - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->current); - - return iterator->current->data; -} - -FLAC_API FLAC__bool FLAC__metadata_iterator_set_block(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block) -{ - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != block); - return FLAC__metadata_iterator_delete_block(iterator, false) && FLAC__metadata_iterator_insert_block_after(iterator, block); -} - -FLAC_API FLAC__bool FLAC__metadata_iterator_delete_block(FLAC__Metadata_Iterator *iterator, FLAC__bool replace_with_padding) -{ - FLAC__Metadata_Node *save; - - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->current); - - if(0 == iterator->current->prev) { - FLAC__ASSERT(iterator->current->data->type == FLAC__METADATA_TYPE_STREAMINFO); - return false; - } - - save = iterator->current->prev; - - if(replace_with_padding) { - FLAC__metadata_object_delete_data(iterator->current->data); - iterator->current->data->type = FLAC__METADATA_TYPE_PADDING; - } - else { - chain_delete_node_(iterator->chain, iterator->current); - } - - iterator->current = save; - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_iterator_insert_block_before(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block) -{ - FLAC__Metadata_Node *node; - - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->current); - FLAC__ASSERT(0 != block); - - if(block->type == FLAC__METADATA_TYPE_STREAMINFO) - return false; - - if(0 == iterator->current->prev) { - FLAC__ASSERT(iterator->current->data->type == FLAC__METADATA_TYPE_STREAMINFO); - return false; - } - - if(0 == (node = node_new_())) - return false; - - node->data = block; - iterator_insert_node_(iterator, node); - iterator->current = node; - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_iterator_insert_block_after(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block) -{ - FLAC__Metadata_Node *node; - - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->current); - FLAC__ASSERT(0 != block); - - if(block->type == FLAC__METADATA_TYPE_STREAMINFO) - return false; - - if(0 == (node = node_new_())) - return false; - - node->data = block; - iterator_insert_node_after_(iterator, node); - iterator->current = node; - return true; -} - - -/**************************************************************************** - * - * Local function definitions - * - ***************************************************************************/ - -void pack_uint32_(FLAC__uint32 val, FLAC__byte *b, unsigned bytes) -{ - unsigned i; - - b += bytes; - - for(i = 0; i < bytes; i++) { - *(--b) = (FLAC__byte)(val & 0xff); - val >>= 8; - } -} - -void pack_uint32_little_endian_(FLAC__uint32 val, FLAC__byte *b, unsigned bytes) -{ - unsigned i; - - for(i = 0; i < bytes; i++) { - *(b++) = (FLAC__byte)(val & 0xff); - val >>= 8; - } -} - -void pack_uint64_(FLAC__uint64 val, FLAC__byte *b, unsigned bytes) -{ - unsigned i; - - b += bytes; - - for(i = 0; i < bytes; i++) { - *(--b) = (FLAC__byte)(val & 0xff); - val >>= 8; - } -} - -FLAC__uint32 unpack_uint32_(FLAC__byte *b, unsigned bytes) -{ - FLAC__uint32 ret = 0; - unsigned i; - - for(i = 0; i < bytes; i++) - ret = (ret << 8) | (FLAC__uint32)(*b++); - - return ret; -} - -FLAC__uint32 unpack_uint32_little_endian_(FLAC__byte *b, unsigned bytes) -{ - FLAC__uint32 ret = 0; - unsigned i; - - b += bytes; - - for(i = 0; i < bytes; i++) - ret = (ret << 8) | (FLAC__uint32)(*--b); - - return ret; -} - -FLAC__uint64 unpack_uint64_(FLAC__byte *b, unsigned bytes) -{ - FLAC__uint64 ret = 0; - unsigned i; - - for(i = 0; i < bytes; i++) - ret = (ret << 8) | (FLAC__uint64)(*b++); - - return ret; -} - -FLAC__bool read_metadata_block_header_(FLAC__Metadata_SimpleIterator *iterator) -{ - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->file); - - if(!read_metadata_block_header_cb_((FLAC__IOHandle)iterator->file, (FLAC__IOCallback_Read)fread, &iterator->is_last, &iterator->type, &iterator->length)) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - return false; - } - - return true; -} - -FLAC__bool read_metadata_block_data_(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block) -{ - FLAC__ASSERT(0 != iterator); - FLAC__ASSERT(0 != iterator->file); - - iterator->status = read_metadata_block_data_cb_((FLAC__IOHandle)iterator->file, (FLAC__IOCallback_Read)fread, fseek_wrapper_, block); - - return (iterator->status == FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK); -} - -FLAC__bool read_metadata_block_header_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__bool *is_last, FLAC__MetadataType *type, unsigned *length) -{ - FLAC__byte raw_header[FLAC__STREAM_METADATA_HEADER_LENGTH]; - - if(read_cb(raw_header, 1, FLAC__STREAM_METADATA_HEADER_LENGTH, handle) != FLAC__STREAM_METADATA_HEADER_LENGTH) - return false; - - *is_last = raw_header[0] & 0x80? true : false; - *type = (FLAC__MetadataType)(raw_header[0] & 0x7f); - *length = unpack_uint32_(raw_header + 1, 3); - - /* Note that we don't check: - * if(iterator->type >= FLAC__METADATA_TYPE_UNDEFINED) - * we just will read in an opaque block - */ - - return true; -} - -FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__IOCallback_Seek seek_cb, FLAC__StreamMetadata *block) -{ - switch(block->type) { - case FLAC__METADATA_TYPE_STREAMINFO: - return read_metadata_block_data_streaminfo_cb_(handle, read_cb, &block->data.stream_info); - case FLAC__METADATA_TYPE_PADDING: - return read_metadata_block_data_padding_cb_(handle, seek_cb, &block->data.padding, block->length); - case FLAC__METADATA_TYPE_APPLICATION: - return read_metadata_block_data_application_cb_(handle, read_cb, &block->data.application, block->length); - case FLAC__METADATA_TYPE_SEEKTABLE: - return read_metadata_block_data_seektable_cb_(handle, read_cb, &block->data.seek_table, block->length); - case FLAC__METADATA_TYPE_VORBIS_COMMENT: - return read_metadata_block_data_vorbis_comment_cb_(handle, read_cb, &block->data.vorbis_comment); - case FLAC__METADATA_TYPE_CUESHEET: - return read_metadata_block_data_cuesheet_cb_(handle, read_cb, &block->data.cue_sheet); - case FLAC__METADATA_TYPE_PICTURE: - return read_metadata_block_data_picture_cb_(handle, read_cb, &block->data.picture); - default: - return read_metadata_block_data_unknown_cb_(handle, read_cb, &block->data.unknown, block->length); - } -} - -FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_streaminfo_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_StreamInfo *block) -{ - FLAC__byte buffer[FLAC__STREAM_METADATA_STREAMINFO_LENGTH], *b; - - if(read_cb(buffer, 1, FLAC__STREAM_METADATA_STREAMINFO_LENGTH, handle) != FLAC__STREAM_METADATA_STREAMINFO_LENGTH) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - - b = buffer; - - /* we are using hardcoded numbers for simplicity but we should - * probably eventually write a bit-level unpacker and use the - * _STREAMINFO_ constants. - */ - block->min_blocksize = unpack_uint32_(b, 2); b += 2; - block->max_blocksize = unpack_uint32_(b, 2); b += 2; - block->min_framesize = unpack_uint32_(b, 3); b += 3; - block->max_framesize = unpack_uint32_(b, 3); b += 3; - block->sample_rate = (unpack_uint32_(b, 2) << 4) | ((unsigned)(b[2] & 0xf0) >> 4); - block->channels = (unsigned)((b[2] & 0x0e) >> 1) + 1; - block->bits_per_sample = ((((unsigned)(b[2] & 0x01)) << 4) | (((unsigned)(b[3] & 0xf0)) >> 4)) + 1; - block->total_samples = (((FLAC__uint64)(b[3] & 0x0f)) << 32) | unpack_uint64_(b+4, 4); - memcpy(block->md5sum, b+8, 16); - - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK; -} - -FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_padding_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Seek seek_cb, FLAC__StreamMetadata_Padding *block, unsigned block_length) -{ - (void)block; /* nothing to do; we don't care about reading the padding bytes */ - - if(0 != seek_cb(handle, block_length, SEEK_CUR)) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR; - - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK; -} - -FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_application_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_Application *block, unsigned block_length) -{ - const unsigned id_bytes = FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8; - - if(read_cb(block->id, 1, id_bytes, handle) != id_bytes) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - - if(block_length < id_bytes) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - - block_length -= id_bytes; - - if(block_length == 0) { - block->data = 0; - } - else { - if(0 == (block->data = (FLAC__byte*)malloc(block_length))) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR; - - if(read_cb(block->data, 1, block_length, handle) != block_length) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - } - - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK; -} - -FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_seektable_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_SeekTable *block, unsigned block_length) -{ - unsigned i; - FLAC__byte buffer[FLAC__STREAM_METADATA_SEEKPOINT_LENGTH]; - - FLAC__ASSERT(block_length % FLAC__STREAM_METADATA_SEEKPOINT_LENGTH == 0); - - block->num_points = block_length / FLAC__STREAM_METADATA_SEEKPOINT_LENGTH; - - if(block->num_points == 0) - block->points = 0; - else if(0 == (block->points = (FLAC__StreamMetadata_SeekPoint*)safe_malloc_mul_2op_(block->num_points, /*times*/sizeof(FLAC__StreamMetadata_SeekPoint)))) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR; - - for(i = 0; i < block->num_points; i++) { - if(read_cb(buffer, 1, FLAC__STREAM_METADATA_SEEKPOINT_LENGTH, handle) != FLAC__STREAM_METADATA_SEEKPOINT_LENGTH) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - /* some MAGIC NUMBERs here */ - block->points[i].sample_number = unpack_uint64_(buffer, 8); - block->points[i].stream_offset = unpack_uint64_(buffer+8, 8); - block->points[i].frame_samples = unpack_uint32_(buffer+16, 2); - } - - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK; -} - -FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_vorbis_comment_entry_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_VorbisComment_Entry *entry) -{ - const unsigned entry_length_len = FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN / 8; - FLAC__byte buffer[4]; /* magic number is asserted below */ - - FLAC__ASSERT(FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN / 8 == sizeof(buffer)); - - if(read_cb(buffer, 1, entry_length_len, handle) != entry_length_len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - entry->length = unpack_uint32_little_endian_(buffer, entry_length_len); - - if(0 != entry->entry) - free(entry->entry); - - if(entry->length == 0) { - entry->entry = 0; - } - else { - if(0 == (entry->entry = (FLAC__byte*)safe_malloc_add_2op_(entry->length, /*+*/1))) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR; - - if(read_cb(entry->entry, 1, entry->length, handle) != entry->length) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - - entry->entry[entry->length] = '\0'; - } - - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK; -} - -FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_vorbis_comment_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_VorbisComment *block) -{ - unsigned i; - FLAC__Metadata_SimpleIteratorStatus status; - const unsigned num_comments_len = FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN / 8; - FLAC__byte buffer[4]; /* magic number is asserted below */ - - FLAC__ASSERT(FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN / 8 == sizeof(buffer)); - - if(FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK != (status = read_metadata_block_data_vorbis_comment_entry_cb_(handle, read_cb, &(block->vendor_string)))) - return status; - - if(read_cb(buffer, 1, num_comments_len, handle) != num_comments_len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - block->num_comments = unpack_uint32_little_endian_(buffer, num_comments_len); - - if(block->num_comments == 0) { - block->comments = 0; - } - else if(0 == (block->comments = (FLAC__StreamMetadata_VorbisComment_Entry*)calloc(block->num_comments, sizeof(FLAC__StreamMetadata_VorbisComment_Entry)))) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR; - - for(i = 0; i < block->num_comments; i++) { - if(FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK != (status = read_metadata_block_data_vorbis_comment_entry_cb_(handle, read_cb, block->comments + i))) - return status; - } - - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK; -} - -FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_cuesheet_track_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_CueSheet_Track *track) -{ - unsigned i, len; - FLAC__byte buffer[32]; /* asserted below that this is big enough */ - - FLAC__ASSERT(sizeof(buffer) >= sizeof(FLAC__uint64)); - FLAC__ASSERT(sizeof(buffer) >= FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN/8); - FLAC__ASSERT(sizeof(buffer) >= (FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN + FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN + FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN) / 8); - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN / 8; - if(read_cb(buffer, 1, len, handle) != len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - track->offset = unpack_uint64_(buffer, len); - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN / 8; - if(read_cb(buffer, 1, len, handle) != len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - track->number = (FLAC__byte)unpack_uint32_(buffer, len); - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN / 8; - if(read_cb(track->isrc, 1, len, handle) != len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - - FLAC__ASSERT((FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN + FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN + FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN) % 8 == 0); - len = (FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN + FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN + FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN) / 8; - if(read_cb(buffer, 1, len, handle) != len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN == 1); - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN == 1); - track->type = buffer[0] >> 7; - track->pre_emphasis = (buffer[0] >> 6) & 1; - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN / 8; - if(read_cb(buffer, 1, len, handle) != len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - track->num_indices = (FLAC__byte)unpack_uint32_(buffer, len); - - if(track->num_indices == 0) { - track->indices = 0; - } - else if(0 == (track->indices = (FLAC__StreamMetadata_CueSheet_Index*)calloc(track->num_indices, sizeof(FLAC__StreamMetadata_CueSheet_Index)))) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR; - - for(i = 0; i < track->num_indices; i++) { - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN / 8; - if(read_cb(buffer, 1, len, handle) != len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - track->indices[i].offset = unpack_uint64_(buffer, len); - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN / 8; - if(read_cb(buffer, 1, len, handle) != len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - track->indices[i].number = (FLAC__byte)unpack_uint32_(buffer, len); - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN / 8; - if(read_cb(buffer, 1, len, handle) != len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - } - - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK; -} - -FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_cuesheet_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_CueSheet *block) -{ - unsigned i, len; - FLAC__Metadata_SimpleIteratorStatus status; - FLAC__byte buffer[1024]; /* MSVC needs a constant expression so we put a magic number and assert */ - - FLAC__ASSERT((FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN + FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN)/8 <= sizeof(buffer)); - FLAC__ASSERT(sizeof(FLAC__uint64) <= sizeof(buffer)); - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN / 8; - if(read_cb(block->media_catalog_number, 1, len, handle) != len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN / 8; - if(read_cb(buffer, 1, len, handle) != len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - block->lead_in = unpack_uint64_(buffer, len); - - FLAC__ASSERT((FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN + FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN) % 8 == 0); - len = (FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN + FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN) / 8; - if(read_cb(buffer, 1, len, handle) != len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - block->is_cd = buffer[0]&0x80? true : false; - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN / 8; - if(read_cb(buffer, 1, len, handle) != len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - block->num_tracks = unpack_uint32_(buffer, len); - - if(block->num_tracks == 0) { - block->tracks = 0; - } - else if(0 == (block->tracks = (FLAC__StreamMetadata_CueSheet_Track*)calloc(block->num_tracks, sizeof(FLAC__StreamMetadata_CueSheet_Track)))) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR; - - for(i = 0; i < block->num_tracks; i++) { - if(FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK != (status = read_metadata_block_data_cuesheet_track_cb_(handle, read_cb, block->tracks + i))) - return status; - } - - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK; -} - -static FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_picture_cstring_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__byte **data, FLAC__uint32 *length, FLAC__uint32 length_len) -{ - FLAC__byte buffer[sizeof(FLAC__uint32)]; - - FLAC__ASSERT(0 != data); - FLAC__ASSERT(length_len%8 == 0); - - length_len /= 8; /* convert to bytes */ - - FLAC__ASSERT(sizeof(buffer) >= length_len); - - if(read_cb(buffer, 1, length_len, handle) != length_len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - *length = unpack_uint32_(buffer, length_len); - - if(0 != *data) - free(*data); - - if(0 == (*data = (FLAC__byte*)safe_malloc_add_2op_(*length, /*+*/1))) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR; - - if(*length > 0) { - if(read_cb(*data, 1, *length, handle) != *length) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - } - - (*data)[*length] = '\0'; - - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK; -} - -FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_picture_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_Picture *block) -{ - FLAC__Metadata_SimpleIteratorStatus status; - FLAC__byte buffer[4]; /* asserted below that this is big enough */ - FLAC__uint32 len; - - FLAC__ASSERT(sizeof(buffer) >= FLAC__STREAM_METADATA_PICTURE_TYPE_LEN/8); - FLAC__ASSERT(sizeof(buffer) >= FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN/8); - FLAC__ASSERT(sizeof(buffer) >= FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN/8); - FLAC__ASSERT(sizeof(buffer) >= FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN/8); - FLAC__ASSERT(sizeof(buffer) >= FLAC__STREAM_METADATA_PICTURE_COLORS_LEN/8); - - FLAC__ASSERT(FLAC__STREAM_METADATA_PICTURE_TYPE_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_PICTURE_TYPE_LEN / 8; - if(read_cb(buffer, 1, len, handle) != len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - block->type = (FLAC__StreamMetadata_Picture_Type)unpack_uint32_(buffer, len); - - if((status = read_metadata_block_data_picture_cstring_cb_(handle, read_cb, (FLAC__byte**)(&(block->mime_type)), &len, FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN)) != FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK) - return status; - - if((status = read_metadata_block_data_picture_cstring_cb_(handle, read_cb, &(block->description), &len, FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN)) != FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK) - return status; - - FLAC__ASSERT(FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN / 8; - if(read_cb(buffer, 1, len, handle) != len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - block->width = unpack_uint32_(buffer, len); - - FLAC__ASSERT(FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN / 8; - if(read_cb(buffer, 1, len, handle) != len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - block->height = unpack_uint32_(buffer, len); - - FLAC__ASSERT(FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN / 8; - if(read_cb(buffer, 1, len, handle) != len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - block->depth = unpack_uint32_(buffer, len); - - FLAC__ASSERT(FLAC__STREAM_METADATA_PICTURE_COLORS_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_PICTURE_COLORS_LEN / 8; - if(read_cb(buffer, 1, len, handle) != len) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - block->colors = unpack_uint32_(buffer, len); - - /* for convenience we use read_metadata_block_data_picture_cstring_cb_() even though it adds an extra terminating NUL we don't use */ - if((status = read_metadata_block_data_picture_cstring_cb_(handle, read_cb, &(block->data), &(block->data_length), FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN)) != FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK) - return status; - - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK; -} - -FLAC__Metadata_SimpleIteratorStatus read_metadata_block_data_unknown_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__StreamMetadata_Unknown *block, unsigned block_length) -{ - if(block_length == 0) { - block->data = 0; - } - else { - if(0 == (block->data = (FLAC__byte*)malloc(block_length))) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR; - - if(read_cb(block->data, 1, block_length, handle) != block_length) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - } - - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK; -} - -FLAC__bool write_metadata_block_header_(FILE *file, FLAC__Metadata_SimpleIteratorStatus *status, const FLAC__StreamMetadata *block) -{ - FLAC__ASSERT(0 != file); - FLAC__ASSERT(0 != status); - - if(!write_metadata_block_header_cb_((FLAC__IOHandle)file, (FLAC__IOCallback_Write)fwrite, block)) { - *status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_WRITE_ERROR; - return false; - } - - return true; -} - -FLAC__bool write_metadata_block_data_(FILE *file, FLAC__Metadata_SimpleIteratorStatus *status, const FLAC__StreamMetadata *block) -{ - FLAC__ASSERT(0 != file); - FLAC__ASSERT(0 != status); - - if (write_metadata_block_data_cb_((FLAC__IOHandle)file, (FLAC__IOCallback_Write)fwrite, block)) { - *status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK; - return true; - } - else { - *status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_WRITE_ERROR; - return false; - } -} - -FLAC__bool write_metadata_block_header_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata *block) -{ - FLAC__byte buffer[FLAC__STREAM_METADATA_HEADER_LENGTH]; - - FLAC__ASSERT(block->length < (1u << FLAC__STREAM_METADATA_LENGTH_LEN)); - - buffer[0] = (block->is_last? 0x80 : 0) | (FLAC__byte)block->type; - pack_uint32_(block->length, buffer + 1, 3); - - if(write_cb(buffer, 1, FLAC__STREAM_METADATA_HEADER_LENGTH, handle) != FLAC__STREAM_METADATA_HEADER_LENGTH) - return false; - - return true; -} - -FLAC__bool write_metadata_block_data_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata *block) -{ - FLAC__ASSERT(0 != block); - - switch(block->type) { - case FLAC__METADATA_TYPE_STREAMINFO: - return write_metadata_block_data_streaminfo_cb_(handle, write_cb, &block->data.stream_info); - case FLAC__METADATA_TYPE_PADDING: - return write_metadata_block_data_padding_cb_(handle, write_cb, &block->data.padding, block->length); - case FLAC__METADATA_TYPE_APPLICATION: - return write_metadata_block_data_application_cb_(handle, write_cb, &block->data.application, block->length); - case FLAC__METADATA_TYPE_SEEKTABLE: - return write_metadata_block_data_seektable_cb_(handle, write_cb, &block->data.seek_table); - case FLAC__METADATA_TYPE_VORBIS_COMMENT: - return write_metadata_block_data_vorbis_comment_cb_(handle, write_cb, &block->data.vorbis_comment); - case FLAC__METADATA_TYPE_CUESHEET: - return write_metadata_block_data_cuesheet_cb_(handle, write_cb, &block->data.cue_sheet); - case FLAC__METADATA_TYPE_PICTURE: - return write_metadata_block_data_picture_cb_(handle, write_cb, &block->data.picture); - default: - return write_metadata_block_data_unknown_cb_(handle, write_cb, &block->data.unknown, block->length); - } -} - -FLAC__bool write_metadata_block_data_streaminfo_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata_StreamInfo *block) -{ - FLAC__byte buffer[FLAC__STREAM_METADATA_STREAMINFO_LENGTH]; - const unsigned channels1 = block->channels - 1; - const unsigned bps1 = block->bits_per_sample - 1; - - /* we are using hardcoded numbers for simplicity but we should - * probably eventually write a bit-level packer and use the - * _STREAMINFO_ constants. - */ - pack_uint32_(block->min_blocksize, buffer, 2); - pack_uint32_(block->max_blocksize, buffer+2, 2); - pack_uint32_(block->min_framesize, buffer+4, 3); - pack_uint32_(block->max_framesize, buffer+7, 3); - buffer[10] = (block->sample_rate >> 12) & 0xff; - buffer[11] = (block->sample_rate >> 4) & 0xff; - buffer[12] = ((block->sample_rate & 0x0f) << 4) | (channels1 << 1) | (bps1 >> 4); - buffer[13] = (FLAC__byte)(((bps1 & 0x0f) << 4) | ((block->total_samples >> 32) & 0x0f)); - pack_uint32_((FLAC__uint32)block->total_samples, buffer+14, 4); - memcpy(buffer+18, block->md5sum, 16); - - if(write_cb(buffer, 1, FLAC__STREAM_METADATA_STREAMINFO_LENGTH, handle) != FLAC__STREAM_METADATA_STREAMINFO_LENGTH) - return false; - - return true; -} - -FLAC__bool write_metadata_block_data_padding_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata_Padding *block, unsigned block_length) -{ - unsigned i, n = block_length; - FLAC__byte buffer[1024]; - - (void)block; - - memset(buffer, 0, 1024); - - for(i = 0; i < n/1024; i++) - if(write_cb(buffer, 1, 1024, handle) != 1024) - return false; - - n %= 1024; - - if(write_cb(buffer, 1, n, handle) != n) - return false; - - return true; -} - -FLAC__bool write_metadata_block_data_application_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata_Application *block, unsigned block_length) -{ - const unsigned id_bytes = FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8; - - if(write_cb(block->id, 1, id_bytes, handle) != id_bytes) - return false; - - block_length -= id_bytes; - - if(write_cb(block->data, 1, block_length, handle) != block_length) - return false; - - return true; -} - -FLAC__bool write_metadata_block_data_seektable_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata_SeekTable *block) -{ - unsigned i; - FLAC__byte buffer[FLAC__STREAM_METADATA_SEEKPOINT_LENGTH]; - - for(i = 0; i < block->num_points; i++) { - /* some MAGIC NUMBERs here */ - pack_uint64_(block->points[i].sample_number, buffer, 8); - pack_uint64_(block->points[i].stream_offset, buffer+8, 8); - pack_uint32_(block->points[i].frame_samples, buffer+16, 2); - if(write_cb(buffer, 1, FLAC__STREAM_METADATA_SEEKPOINT_LENGTH, handle) != FLAC__STREAM_METADATA_SEEKPOINT_LENGTH) - return false; - } - - return true; -} - -FLAC__bool write_metadata_block_data_vorbis_comment_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata_VorbisComment *block) -{ - unsigned i; - const unsigned entry_length_len = FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN / 8; - const unsigned num_comments_len = FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN / 8; - FLAC__byte buffer[4]; /* magic number is asserted below */ - - FLAC__ASSERT(max(FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN, FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN) / 8 == sizeof(buffer)); - - pack_uint32_little_endian_(block->vendor_string.length, buffer, entry_length_len); - if(write_cb(buffer, 1, entry_length_len, handle) != entry_length_len) - return false; - if(write_cb(block->vendor_string.entry, 1, block->vendor_string.length, handle) != block->vendor_string.length) - return false; - - pack_uint32_little_endian_(block->num_comments, buffer, num_comments_len); - if(write_cb(buffer, 1, num_comments_len, handle) != num_comments_len) - return false; - - for(i = 0; i < block->num_comments; i++) { - pack_uint32_little_endian_(block->comments[i].length, buffer, entry_length_len); - if(write_cb(buffer, 1, entry_length_len, handle) != entry_length_len) - return false; - if(write_cb(block->comments[i].entry, 1, block->comments[i].length, handle) != block->comments[i].length) - return false; - } - - return true; -} - -FLAC__bool write_metadata_block_data_cuesheet_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata_CueSheet *block) -{ - unsigned i, j, len; - FLAC__byte buffer[1024]; /* asserted below that this is big enough */ - - FLAC__ASSERT(sizeof(buffer) >= sizeof(FLAC__uint64)); - FLAC__ASSERT(sizeof(buffer) >= FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN/8); - FLAC__ASSERT(sizeof(buffer) >= (FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN + FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN + FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN + FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN)/8); - FLAC__ASSERT(sizeof(buffer) >= FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN/8); - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN / 8; - if(write_cb(block->media_catalog_number, 1, len, handle) != len) - return false; - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN / 8; - pack_uint64_(block->lead_in, buffer, len); - if(write_cb(buffer, 1, len, handle) != len) - return false; - - FLAC__ASSERT((FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN + FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN) % 8 == 0); - len = (FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN + FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN) / 8; - memset(buffer, 0, len); - if(block->is_cd) - buffer[0] |= 0x80; - if(write_cb(buffer, 1, len, handle) != len) - return false; - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN / 8; - pack_uint32_(block->num_tracks, buffer, len); - if(write_cb(buffer, 1, len, handle) != len) - return false; - - for(i = 0; i < block->num_tracks; i++) { - FLAC__StreamMetadata_CueSheet_Track *track = block->tracks + i; - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN / 8; - pack_uint64_(track->offset, buffer, len); - if(write_cb(buffer, 1, len, handle) != len) - return false; - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN / 8; - pack_uint32_(track->number, buffer, len); - if(write_cb(buffer, 1, len, handle) != len) - return false; - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN / 8; - if(write_cb(track->isrc, 1, len, handle) != len) - return false; - - FLAC__ASSERT((FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN + FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN + FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN) % 8 == 0); - len = (FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN + FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN + FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN) / 8; - memset(buffer, 0, len); - buffer[0] = (track->type << 7) | (track->pre_emphasis << 6); - if(write_cb(buffer, 1, len, handle) != len) - return false; - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN / 8; - pack_uint32_(track->num_indices, buffer, len); - if(write_cb(buffer, 1, len, handle) != len) - return false; - - for(j = 0; j < track->num_indices; j++) { - FLAC__StreamMetadata_CueSheet_Index *index = track->indices + j; - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN / 8; - pack_uint64_(index->offset, buffer, len); - if(write_cb(buffer, 1, len, handle) != len) - return false; - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN / 8; - pack_uint32_(index->number, buffer, len); - if(write_cb(buffer, 1, len, handle) != len) - return false; - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN % 8 == 0); - len = FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN / 8; - memset(buffer, 0, len); - if(write_cb(buffer, 1, len, handle) != len) - return false; - } - } - - return true; -} - -FLAC__bool write_metadata_block_data_picture_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata_Picture *block) -{ - unsigned len; - size_t slen; - FLAC__byte buffer[4]; /* magic number is asserted below */ - - FLAC__ASSERT(0 == FLAC__STREAM_METADATA_PICTURE_TYPE_LEN%8); - FLAC__ASSERT(0 == FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN%8); - FLAC__ASSERT(0 == FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN%8); - FLAC__ASSERT(0 == FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN%8); - FLAC__ASSERT(0 == FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN%8); - FLAC__ASSERT(0 == FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN%8); - FLAC__ASSERT(0 == FLAC__STREAM_METADATA_PICTURE_COLORS_LEN%8); - FLAC__ASSERT(0 == FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN%8); - FLAC__ASSERT(sizeof(buffer) >= FLAC__STREAM_METADATA_PICTURE_TYPE_LEN/8); - FLAC__ASSERT(sizeof(buffer) >= FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN/8); - FLAC__ASSERT(sizeof(buffer) >= FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN/8); - FLAC__ASSERT(sizeof(buffer) >= FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN/8); - FLAC__ASSERT(sizeof(buffer) >= FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN/8); - FLAC__ASSERT(sizeof(buffer) >= FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN/8); - FLAC__ASSERT(sizeof(buffer) >= FLAC__STREAM_METADATA_PICTURE_COLORS_LEN/8); - FLAC__ASSERT(sizeof(buffer) >= FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN/8); - - len = FLAC__STREAM_METADATA_PICTURE_TYPE_LEN/8; - pack_uint32_(block->type, buffer, len); - if(write_cb(buffer, 1, len, handle) != len) - return false; - - len = FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN/8; - slen = strlen(block->mime_type); - pack_uint32_(slen, buffer, len); - if(write_cb(buffer, 1, len, handle) != len) - return false; - if(write_cb(block->mime_type, 1, slen, handle) != slen) - return false; - - len = FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN/8; - slen = strlen((const char *)block->description); - pack_uint32_(slen, buffer, len); - if(write_cb(buffer, 1, len, handle) != len) - return false; - if(write_cb(block->description, 1, slen, handle) != slen) - return false; - - len = FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN/8; - pack_uint32_(block->width, buffer, len); - if(write_cb(buffer, 1, len, handle) != len) - return false; - - len = FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN/8; - pack_uint32_(block->height, buffer, len); - if(write_cb(buffer, 1, len, handle) != len) - return false; - - len = FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN/8; - pack_uint32_(block->depth, buffer, len); - if(write_cb(buffer, 1, len, handle) != len) - return false; - - len = FLAC__STREAM_METADATA_PICTURE_COLORS_LEN/8; - pack_uint32_(block->colors, buffer, len); - if(write_cb(buffer, 1, len, handle) != len) - return false; - - len = FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN/8; - pack_uint32_(block->data_length, buffer, len); - if(write_cb(buffer, 1, len, handle) != len) - return false; - if(write_cb(block->data, 1, block->data_length, handle) != block->data_length) - return false; - - return true; -} - -FLAC__bool write_metadata_block_data_unknown_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Write write_cb, const FLAC__StreamMetadata_Unknown *block, unsigned block_length) -{ - if(write_cb(block->data, 1, block_length, handle) != block_length) - return false; - - return true; -} - -FLAC__bool write_metadata_block_stationary_(FLAC__Metadata_SimpleIterator *iterator, const FLAC__StreamMetadata *block) -{ - if(0 != fseeko(iterator->file, iterator->offset[iterator->depth], SEEK_SET)) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR; - return false; - } - - if(!write_metadata_block_header_(iterator->file, &iterator->status, block)) - return false; - - if(!write_metadata_block_data_(iterator->file, &iterator->status, block)) - return false; - - if(0 != fseeko(iterator->file, iterator->offset[iterator->depth], SEEK_SET)) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR; - return false; - } - - return read_metadata_block_header_(iterator); -} - -FLAC__bool write_metadata_block_stationary_with_padding_(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block, unsigned padding_length, FLAC__bool padding_is_last) -{ - FLAC__StreamMetadata *padding; - - if(0 != fseeko(iterator->file, iterator->offset[iterator->depth], SEEK_SET)) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR; - return false; - } - - block->is_last = false; - - if(!write_metadata_block_header_(iterator->file, &iterator->status, block)) - return false; - - if(!write_metadata_block_data_(iterator->file, &iterator->status, block)) - return false; - - if(0 == (padding = FLAC__metadata_object_new(FLAC__METADATA_TYPE_PADDING))) - return FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR; - - padding->is_last = padding_is_last; - padding->length = padding_length; - - if(!write_metadata_block_header_(iterator->file, &iterator->status, padding)) { - FLAC__metadata_object_delete(padding); - return false; - } - - if(!write_metadata_block_data_(iterator->file, &iterator->status, padding)) { - FLAC__metadata_object_delete(padding); - return false; - } - - FLAC__metadata_object_delete(padding); - - if(0 != fseeko(iterator->file, iterator->offset[iterator->depth], SEEK_SET)) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR; - return false; - } - - return read_metadata_block_header_(iterator); -} - -FLAC__bool rewrite_whole_file_(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block, FLAC__bool append) -{ - FILE *tempfile; - char *tempfilename; - int fixup_is_last_code = 0; /* 0 => no need to change any is_last flags */ - off_t fixup_is_last_flag_offset = -1; - - FLAC__ASSERT(0 != block || append == false); - - if(iterator->is_last) { - if(append) { - fixup_is_last_code = 1; /* 1 => clear the is_last flag at the following offset */ - fixup_is_last_flag_offset = iterator->offset[iterator->depth]; - } - else if(0 == block) { - simple_iterator_push_(iterator); - if(!FLAC__metadata_simple_iterator_prev(iterator)) { - (void)simple_iterator_pop_(iterator); - return false; - } - fixup_is_last_code = -1; /* -1 => set the is_last the flag at the following offset */ - fixup_is_last_flag_offset = iterator->offset[iterator->depth]; - if(!simple_iterator_pop_(iterator)) - return false; - } - } - - if(!simple_iterator_copy_file_prefix_(iterator, &tempfile, &tempfilename, append)) - return false; - - if(0 != block) { - if(!write_metadata_block_header_(tempfile, &iterator->status, block)) { - cleanup_tempfile_(&tempfile, &tempfilename); - return false; - } - - if(!write_metadata_block_data_(tempfile, &iterator->status, block)) { - cleanup_tempfile_(&tempfile, &tempfilename); - return false; - } - } - - if(!simple_iterator_copy_file_postfix_(iterator, &tempfile, &tempfilename, fixup_is_last_code, fixup_is_last_flag_offset, block==0)) - return false; - - if(append) - return FLAC__metadata_simple_iterator_next(iterator); - - return true; -} - -void simple_iterator_push_(FLAC__Metadata_SimpleIterator *iterator) -{ - FLAC__ASSERT(iterator->depth+1 < SIMPLE_ITERATOR_MAX_PUSH_DEPTH); - iterator->offset[iterator->depth+1] = iterator->offset[iterator->depth]; - iterator->depth++; -} - -FLAC__bool simple_iterator_pop_(FLAC__Metadata_SimpleIterator *iterator) -{ - FLAC__ASSERT(iterator->depth > 0); - iterator->depth--; - if(0 != fseeko(iterator->file, iterator->offset[iterator->depth], SEEK_SET)) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR; - return false; - } - - return read_metadata_block_header_(iterator); -} - -/* return meanings: - * 0: ok - * 1: read error - * 2: seek error - * 3: not a FLAC file - */ -unsigned seek_to_first_metadata_block_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__IOCallback_Seek seek_cb) -{ - FLAC__byte buffer[4]; - size_t n; - unsigned i; - - FLAC__ASSERT(FLAC__STREAM_SYNC_LENGTH == sizeof(buffer)); - - /* skip any id3v2 tag */ - errno = 0; - n = read_cb(buffer, 1, 4, handle); - if(errno) - return 1; - else if(n != 4) - return 3; - else if(0 == memcmp(buffer, "ID3", 3)) { - unsigned tag_length = 0; - - /* skip to the tag length */ - if(seek_cb(handle, 2, SEEK_CUR) < 0) - return 2; - - /* read the length */ - for(i = 0; i < 4; i++) { - if(read_cb(buffer, 1, 1, handle) < 1 || buffer[0] & 0x80) - return 1; - tag_length <<= 7; - tag_length |= (buffer[0] & 0x7f); - } - - /* skip the rest of the tag */ - if(seek_cb(handle, tag_length, SEEK_CUR) < 0) - return 2; - - /* read the stream sync code */ - errno = 0; - n = read_cb(buffer, 1, 4, handle); - if(errno) - return 1; - else if(n != 4) - return 3; - } - - /* check for the fLaC signature */ - if(0 == memcmp(FLAC__STREAM_SYNC_STRING, buffer, FLAC__STREAM_SYNC_LENGTH)) - return 0; - else - return 3; -} - -unsigned seek_to_first_metadata_block_(FILE *f) -{ - return seek_to_first_metadata_block_cb_((FLAC__IOHandle)f, (FLAC__IOCallback_Read)fread, fseek_wrapper_); -} - -FLAC__bool simple_iterator_copy_file_prefix_(FLAC__Metadata_SimpleIterator *iterator, FILE **tempfile, char **tempfilename, FLAC__bool append) -{ - const off_t offset_end = append? iterator->offset[iterator->depth] + (off_t)FLAC__STREAM_METADATA_HEADER_LENGTH + (off_t)iterator->length : iterator->offset[iterator->depth]; - - if(0 != fseeko(iterator->file, 0, SEEK_SET)) { - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR; - return false; - } - if(!open_tempfile_(iterator->filename, iterator->tempfile_path_prefix, tempfile, tempfilename, &iterator->status)) { - cleanup_tempfile_(tempfile, tempfilename); - return false; - } - if(!copy_n_bytes_from_file_(iterator->file, *tempfile, offset_end, &iterator->status)) { - cleanup_tempfile_(tempfile, tempfilename); - return false; - } - - return true; -} - -FLAC__bool simple_iterator_copy_file_postfix_(FLAC__Metadata_SimpleIterator *iterator, FILE **tempfile, char **tempfilename, int fixup_is_last_code, off_t fixup_is_last_flag_offset, FLAC__bool backup) -{ - off_t save_offset = iterator->offset[iterator->depth]; - FLAC__ASSERT(0 != *tempfile); - - if(0 != fseeko(iterator->file, save_offset + (off_t)FLAC__STREAM_METADATA_HEADER_LENGTH + (off_t)iterator->length, SEEK_SET)) { - cleanup_tempfile_(tempfile, tempfilename); - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR; - return false; - } - if(!copy_remaining_bytes_from_file_(iterator->file, *tempfile, &iterator->status)) { - cleanup_tempfile_(tempfile, tempfilename); - return false; - } - - if(fixup_is_last_code != 0) { - /* - * if code == 1, it means a block was appended to the end so - * we have to clear the is_last flag of the previous block - * if code == -1, it means the last block was deleted so - * we have to set the is_last flag of the previous block - */ - /* MAGIC NUMBERs here; we know the is_last flag is the high bit of the byte at this location */ - FLAC__byte x; - if(0 != fseeko(*tempfile, fixup_is_last_flag_offset, SEEK_SET)) { - cleanup_tempfile_(tempfile, tempfilename); - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR; - return false; - } - if(fread(&x, 1, 1, *tempfile) != 1) { - cleanup_tempfile_(tempfile, tempfilename); - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - return false; - } - if(fixup_is_last_code > 0) { - FLAC__ASSERT(x & 0x80); - x &= 0x7f; - } - else { - FLAC__ASSERT(!(x & 0x80)); - x |= 0x80; - } - if(0 != fseeko(*tempfile, fixup_is_last_flag_offset, SEEK_SET)) { - cleanup_tempfile_(tempfile, tempfilename); - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR; - return false; - } - if(local__fwrite(&x, 1, 1, *tempfile) != 1) { - cleanup_tempfile_(tempfile, tempfilename); - iterator->status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_WRITE_ERROR; - return false; - } - } - - (void)fclose(iterator->file); - - if(!transport_tempfile_(iterator->filename, tempfile, tempfilename, &iterator->status)) - return false; - - if(iterator->has_stats) - set_file_stats_(iterator->filename, &iterator->stats); - - if(!simple_iterator_prime_input_(iterator, !iterator->is_writable)) - return false; - if(backup) { - while(iterator->offset[iterator->depth] + (off_t)FLAC__STREAM_METADATA_HEADER_LENGTH + (off_t)iterator->length < save_offset) - if(!FLAC__metadata_simple_iterator_next(iterator)) - return false; - return true; - } - else { - /* move the iterator to it's original block faster by faking a push, then doing a pop_ */ - FLAC__ASSERT(iterator->depth == 0); - iterator->offset[0] = save_offset; - iterator->depth++; - return simple_iterator_pop_(iterator); - } -} - -FLAC__bool copy_n_bytes_from_file_(FILE *file, FILE *tempfile, off_t bytes, FLAC__Metadata_SimpleIteratorStatus *status) -{ - FLAC__byte buffer[8192]; - size_t n; - - FLAC__ASSERT(bytes >= 0); - while(bytes > 0) { - n = min(sizeof(buffer), (size_t)bytes); - if(fread(buffer, 1, n, file) != n) { - *status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - return false; - } - if(local__fwrite(buffer, 1, n, tempfile) != n) { - *status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_WRITE_ERROR; - return false; - } - bytes -= n; - } - - return true; -} - -FLAC__bool copy_n_bytes_from_file_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__IOHandle temp_handle, FLAC__IOCallback_Write temp_write_cb, off_t bytes, FLAC__Metadata_SimpleIteratorStatus *status) -{ - FLAC__byte buffer[8192]; - size_t n; - - FLAC__ASSERT(bytes >= 0); - while(bytes > 0) { - n = min(sizeof(buffer), (size_t)bytes); - if(read_cb(buffer, 1, n, handle) != n) { - *status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - return false; - } - if(temp_write_cb(buffer, 1, n, temp_handle) != n) { - *status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_WRITE_ERROR; - return false; - } - bytes -= n; - } - - return true; -} - -FLAC__bool copy_remaining_bytes_from_file_(FILE *file, FILE *tempfile, FLAC__Metadata_SimpleIteratorStatus *status) -{ - FLAC__byte buffer[8192]; - size_t n; - - while(!feof(file)) { - n = fread(buffer, 1, sizeof(buffer), file); - if(n == 0 && !feof(file)) { - *status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - return false; - } - if(n > 0 && local__fwrite(buffer, 1, n, tempfile) != n) { - *status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_WRITE_ERROR; - return false; - } - } - - return true; -} - -FLAC__bool copy_remaining_bytes_from_file_cb_(FLAC__IOHandle handle, FLAC__IOCallback_Read read_cb, FLAC__IOCallback_Eof eof_cb, FLAC__IOHandle temp_handle, FLAC__IOCallback_Write temp_write_cb, FLAC__Metadata_SimpleIteratorStatus *status) -{ - FLAC__byte buffer[8192]; - size_t n; - - while(!eof_cb(handle)) { - n = read_cb(buffer, 1, sizeof(buffer), handle); - if(n == 0 && !eof_cb(handle)) { - *status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR; - return false; - } - if(n > 0 && temp_write_cb(buffer, 1, n, temp_handle) != n) { - *status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_WRITE_ERROR; - return false; - } - } - - return true; -} - -FLAC__bool open_tempfile_(const char *filename, const char *tempfile_path_prefix, FILE **tempfile, char **tempfilename, FLAC__Metadata_SimpleIteratorStatus *status) -{ - static const char *tempfile_suffix = ".metadata_edit"; - if(0 == tempfile_path_prefix) { - if(0 == (*tempfilename = (char*)safe_malloc_add_3op_(strlen(filename), /*+*/strlen(tempfile_suffix), /*+*/1))) { - *status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR; - return false; - } - strcpy(*tempfilename, filename); - strcat(*tempfilename, tempfile_suffix); - } - else { - const char *p = strrchr(filename, '/'); - if(0 == p) - p = filename; - else - p++; - - if(0 == (*tempfilename = (char*)safe_malloc_add_4op_(strlen(tempfile_path_prefix), /*+*/strlen(p), /*+*/strlen(tempfile_suffix), /*+*/2))) { - *status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR; - return false; - } - strcpy(*tempfilename, tempfile_path_prefix); - strcat(*tempfilename, "/"); - strcat(*tempfilename, p); - strcat(*tempfilename, tempfile_suffix); - } - - if(0 == (*tempfile = fopen(*tempfilename, "w+b"))) { - *status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ERROR_OPENING_FILE; - return false; - } - - return true; -} - -FLAC__bool transport_tempfile_(const char *filename, FILE **tempfile, char **tempfilename, FLAC__Metadata_SimpleIteratorStatus *status) -{ - FLAC__ASSERT(0 != filename); - FLAC__ASSERT(0 != tempfile); - FLAC__ASSERT(0 != *tempfile); - FLAC__ASSERT(0 != tempfilename); - FLAC__ASSERT(0 != *tempfilename); - FLAC__ASSERT(0 != status); - - (void)fclose(*tempfile); - *tempfile = 0; - -#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__ || defined __EMX__ - /* on some flavors of windows, rename() will fail if the destination already exists */ - if(unlink(filename) < 0) { - cleanup_tempfile_(tempfile, tempfilename); - *status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_UNLINK_ERROR; - return false; - } -#endif - - /*@@@ to fully support the tempfile_path_prefix we need to update this piece to actually copy across filesystems instead of just rename(): */ - if(0 != rename(*tempfilename, filename)) { - cleanup_tempfile_(tempfile, tempfilename); - *status = FLAC__METADATA_SIMPLE_ITERATOR_STATUS_RENAME_ERROR; - return false; - } - - cleanup_tempfile_(tempfile, tempfilename); - - return true; -} - -void cleanup_tempfile_(FILE **tempfile, char **tempfilename) -{ - if(0 != *tempfile) { - (void)fclose(*tempfile); - *tempfile = 0; - } - - if(0 != *tempfilename) { - (void)unlink(*tempfilename); - free(*tempfilename); - *tempfilename = 0; - } -} - -FLAC__bool get_file_stats_(const char *filename, struct stat *stats) -{ - FLAC__ASSERT(0 != filename); - FLAC__ASSERT(0 != stats); - return (0 == stat(filename, stats)); -} - -void set_file_stats_(const char *filename, struct stat *stats) -{ - struct utimbuf srctime; - - FLAC__ASSERT(0 != filename); - FLAC__ASSERT(0 != stats); - - srctime.actime = stats->st_atime; - srctime.modtime = stats->st_mtime; - (void)chmod(filename, stats->st_mode); - (void)utime(filename, &srctime); -#if !defined _MSC_VER && !defined __BORLANDC__ && !defined __MINGW32__ && !defined __EMX__ - (void)chown(filename, stats->st_uid, -1); - (void)chown(filename, -1, stats->st_gid); -#endif -} - -int fseek_wrapper_(FLAC__IOHandle handle, FLAC__int64 offset, int whence) -{ - return fseeko((FILE*)handle, (off_t)offset, whence); -} - -FLAC__int64 ftell_wrapper_(FLAC__IOHandle handle) -{ - return ftello((FILE*)handle); -} - -FLAC__Metadata_ChainStatus get_equivalent_status_(FLAC__Metadata_SimpleIteratorStatus status) -{ - switch(status) { - case FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK: - return FLAC__METADATA_CHAIN_STATUS_OK; - case FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT: - return FLAC__METADATA_CHAIN_STATUS_ILLEGAL_INPUT; - case FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ERROR_OPENING_FILE: - return FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE; - case FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_A_FLAC_FILE: - return FLAC__METADATA_CHAIN_STATUS_NOT_A_FLAC_FILE; - case FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_WRITABLE: - return FLAC__METADATA_CHAIN_STATUS_NOT_WRITABLE; - case FLAC__METADATA_SIMPLE_ITERATOR_STATUS_BAD_METADATA: - return FLAC__METADATA_CHAIN_STATUS_BAD_METADATA; - case FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR: - return FLAC__METADATA_CHAIN_STATUS_READ_ERROR; - case FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR: - return FLAC__METADATA_CHAIN_STATUS_SEEK_ERROR; - case FLAC__METADATA_SIMPLE_ITERATOR_STATUS_WRITE_ERROR: - return FLAC__METADATA_CHAIN_STATUS_WRITE_ERROR; - case FLAC__METADATA_SIMPLE_ITERATOR_STATUS_RENAME_ERROR: - return FLAC__METADATA_CHAIN_STATUS_RENAME_ERROR; - case FLAC__METADATA_SIMPLE_ITERATOR_STATUS_UNLINK_ERROR: - return FLAC__METADATA_CHAIN_STATUS_UNLINK_ERROR; - case FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR: - return FLAC__METADATA_CHAIN_STATUS_MEMORY_ALLOCATION_ERROR; - case FLAC__METADATA_SIMPLE_ITERATOR_STATUS_INTERNAL_ERROR: - default: - return FLAC__METADATA_CHAIN_STATUS_INTERNAL_ERROR; - } -} diff --git a/3rdparty/libflac/src/libFLAC/metadata_object.c b/3rdparty/libflac/src/libFLAC/metadata_object.c deleted file mode 100644 index 6f8bccf4563..00000000000 --- a/3rdparty/libflac/src/libFLAC/metadata_object.c +++ /dev/null @@ -1,1819 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdlib.h> -#include <string.h> - -#include "private/metadata.h" - -#include "FLAC/assert.h" -#include "share/alloc.h" - - -/**************************************************************************** - * - * Local routines - * - ***************************************************************************/ - -/* copy bytes: - * from = NULL && bytes = 0 - * to <- NULL - * from != NULL && bytes > 0 - * to <- copy of from - * else ASSERT - * malloc error leaves 'to' unchanged - */ -static FLAC__bool copy_bytes_(FLAC__byte **to, const FLAC__byte *from, unsigned bytes) -{ - FLAC__ASSERT(0 != to); - if(bytes > 0 && 0 != from) { - FLAC__byte *x; - if(0 == (x = (FLAC__byte*)safe_malloc_(bytes))) - return false; - memcpy(x, from, bytes); - *to = x; - } - else { - FLAC__ASSERT(0 == from); - FLAC__ASSERT(bytes == 0); - *to = 0; - } - return true; -} - -#if 0 /* UNUSED */ -/* like copy_bytes_(), but free()s the original '*to' if the copy succeeds and the original '*to' is non-NULL */ -static FLAC__bool free_copy_bytes_(FLAC__byte **to, const FLAC__byte *from, unsigned bytes) -{ - FLAC__byte *copy; - FLAC__ASSERT(0 != to); - if(copy_bytes_(©, from, bytes)) { - if(*to) - free(*to); - *to = copy; - return true; - } - else - return false; -} -#endif - -/* reallocate entry to 1 byte larger and add a terminating NUL */ -/* realloc() failure leaves entry unchanged */ -static FLAC__bool ensure_null_terminated_(FLAC__byte **entry, unsigned length) -{ - FLAC__byte *x = (FLAC__byte*)safe_realloc_add_2op_(*entry, length, /*+*/1); - if(0 != x) { - x[length] = '\0'; - *entry = x; - return true; - } - else - return false; -} - -/* copies the NUL-terminated C-string 'from' to '*to', leaving '*to' - * unchanged if malloc fails, free()ing the original '*to' if it - * succeeds and the original '*to' was not NULL - */ -static FLAC__bool copy_cstring_(char **to, const char *from) -{ - char *copy = strdup(from); - FLAC__ASSERT(to); - if(copy) { - if(*to) - free(*to); - *to = copy; - return true; - } - else - return false; -} - -static FLAC__bool copy_vcentry_(FLAC__StreamMetadata_VorbisComment_Entry *to, const FLAC__StreamMetadata_VorbisComment_Entry *from) -{ - to->length = from->length; - if(0 == from->entry) { - FLAC__ASSERT(from->length == 0); - to->entry = 0; - } - else { - FLAC__byte *x; - FLAC__ASSERT(from->length > 0); - if(0 == (x = (FLAC__byte*)safe_malloc_add_2op_(from->length, /*+*/1))) - return false; - memcpy(x, from->entry, from->length); - x[from->length] = '\0'; - to->entry = x; - } - return true; -} - -static FLAC__bool copy_track_(FLAC__StreamMetadata_CueSheet_Track *to, const FLAC__StreamMetadata_CueSheet_Track *from) -{ - memcpy(to, from, sizeof(FLAC__StreamMetadata_CueSheet_Track)); - if(0 == from->indices) { - FLAC__ASSERT(from->num_indices == 0); - } - else { - FLAC__StreamMetadata_CueSheet_Index *x; - FLAC__ASSERT(from->num_indices > 0); - if(0 == (x = (FLAC__StreamMetadata_CueSheet_Index*)safe_malloc_mul_2op_(from->num_indices, /*times*/sizeof(FLAC__StreamMetadata_CueSheet_Index)))) - return false; - memcpy(x, from->indices, from->num_indices * sizeof(FLAC__StreamMetadata_CueSheet_Index)); - to->indices = x; - } - return true; -} - -static void seektable_calculate_length_(FLAC__StreamMetadata *object) -{ - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); - - object->length = object->data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH; -} - -static FLAC__StreamMetadata_SeekPoint *seekpoint_array_new_(unsigned num_points) -{ - FLAC__StreamMetadata_SeekPoint *object_array; - - FLAC__ASSERT(num_points > 0); - - object_array = (FLAC__StreamMetadata_SeekPoint*)safe_malloc_mul_2op_(num_points, /*times*/sizeof(FLAC__StreamMetadata_SeekPoint)); - - if(0 != object_array) { - unsigned i; - for(i = 0; i < num_points; i++) { - object_array[i].sample_number = FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER; - object_array[i].stream_offset = 0; - object_array[i].frame_samples = 0; - } - } - - return object_array; -} - -static void vorbiscomment_calculate_length_(FLAC__StreamMetadata *object) -{ - unsigned i; - - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - - object->length = (FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN) / 8; - object->length += object->data.vorbis_comment.vendor_string.length; - object->length += (FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN) / 8; - for(i = 0; i < object->data.vorbis_comment.num_comments; i++) { - object->length += (FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN / 8); - object->length += object->data.vorbis_comment.comments[i].length; - } -} - -static FLAC__StreamMetadata_VorbisComment_Entry *vorbiscomment_entry_array_new_(unsigned num_comments) -{ - FLAC__ASSERT(num_comments > 0); - - return (FLAC__StreamMetadata_VorbisComment_Entry*)safe_calloc_(num_comments, sizeof(FLAC__StreamMetadata_VorbisComment_Entry)); -} - -static void vorbiscomment_entry_array_delete_(FLAC__StreamMetadata_VorbisComment_Entry *object_array, unsigned num_comments) -{ - unsigned i; - - FLAC__ASSERT(0 != object_array && num_comments > 0); - - for(i = 0; i < num_comments; i++) - if(0 != object_array[i].entry) - free(object_array[i].entry); - - if(0 != object_array) - free(object_array); -} - -static FLAC__StreamMetadata_VorbisComment_Entry *vorbiscomment_entry_array_copy_(const FLAC__StreamMetadata_VorbisComment_Entry *object_array, unsigned num_comments) -{ - FLAC__StreamMetadata_VorbisComment_Entry *return_array; - - FLAC__ASSERT(0 != object_array); - FLAC__ASSERT(num_comments > 0); - - return_array = vorbiscomment_entry_array_new_(num_comments); - - if(0 != return_array) { - unsigned i; - - for(i = 0; i < num_comments; i++) { - if(!copy_vcentry_(return_array+i, object_array+i)) { - vorbiscomment_entry_array_delete_(return_array, num_comments); - return 0; - } - } - } - - return return_array; -} - -static FLAC__bool vorbiscomment_set_entry_(FLAC__StreamMetadata *object, FLAC__StreamMetadata_VorbisComment_Entry *dest, const FLAC__StreamMetadata_VorbisComment_Entry *src, FLAC__bool copy) -{ - FLAC__byte *save; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(0 != dest); - FLAC__ASSERT(0 != src); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - FLAC__ASSERT((0 != src->entry && src->length > 0) || (0 == src->entry && src->length == 0)); - - save = dest->entry; - - if(0 != src->entry && src->length > 0) { - if(copy) { - /* do the copy first so that if we fail we leave the dest object untouched */ - if(!copy_vcentry_(dest, src)) - return false; - } - else { - /* we have to make sure that the string we're taking over is null-terminated */ - - /* - * Stripping the const from src->entry is OK since we're taking - * ownership of the pointer. This is a hack around a deficiency - * in the API where the same function is used for 'copy' and - * 'own', but the source entry is a const pointer. If we were - * precise, the 'own' flavor would be a separate function with a - * non-const source pointer. But it's not, so we hack away. - */ - if(!ensure_null_terminated_((FLAC__byte**)(&src->entry), src->length)) - return false; - *dest = *src; - } - } - else { - /* the src is null */ - *dest = *src; - } - - if(0 != save) - free(save); - - vorbiscomment_calculate_length_(object); - return true; -} - -static int vorbiscomment_find_entry_from_(const FLAC__StreamMetadata *object, unsigned offset, const char *field_name, unsigned field_name_length) -{ - unsigned i; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - FLAC__ASSERT(0 != field_name); - - for(i = offset; i < object->data.vorbis_comment.num_comments; i++) { - if(FLAC__metadata_object_vorbiscomment_entry_matches(object->data.vorbis_comment.comments[i], field_name, field_name_length)) - return (int)i; - } - - return -1; -} - -static void cuesheet_calculate_length_(FLAC__StreamMetadata *object) -{ - unsigned i; - - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); - - object->length = ( - FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN + - FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN + - FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN + - FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN + - FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN - ) / 8; - - object->length += object->data.cue_sheet.num_tracks * ( - FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN - ) / 8; - - for(i = 0; i < object->data.cue_sheet.num_tracks; i++) { - object->length += object->data.cue_sheet.tracks[i].num_indices * ( - FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN + - FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN + - FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN - ) / 8; - } -} - -static FLAC__StreamMetadata_CueSheet_Index *cuesheet_track_index_array_new_(unsigned num_indices) -{ - FLAC__ASSERT(num_indices > 0); - - return (FLAC__StreamMetadata_CueSheet_Index*)safe_calloc_(num_indices, sizeof(FLAC__StreamMetadata_CueSheet_Index)); -} - -static FLAC__StreamMetadata_CueSheet_Track *cuesheet_track_array_new_(unsigned num_tracks) -{ - FLAC__ASSERT(num_tracks > 0); - - return (FLAC__StreamMetadata_CueSheet_Track*)safe_calloc_(num_tracks, sizeof(FLAC__StreamMetadata_CueSheet_Track)); -} - -static void cuesheet_track_array_delete_(FLAC__StreamMetadata_CueSheet_Track *object_array, unsigned num_tracks) -{ - unsigned i; - - FLAC__ASSERT(0 != object_array && num_tracks > 0); - - for(i = 0; i < num_tracks; i++) { - if(0 != object_array[i].indices) { - FLAC__ASSERT(object_array[i].num_indices > 0); - free(object_array[i].indices); - } - } - - if(0 != object_array) - free(object_array); -} - -static FLAC__StreamMetadata_CueSheet_Track *cuesheet_track_array_copy_(const FLAC__StreamMetadata_CueSheet_Track *object_array, unsigned num_tracks) -{ - FLAC__StreamMetadata_CueSheet_Track *return_array; - - FLAC__ASSERT(0 != object_array); - FLAC__ASSERT(num_tracks > 0); - - return_array = cuesheet_track_array_new_(num_tracks); - - if(0 != return_array) { - unsigned i; - - for(i = 0; i < num_tracks; i++) { - if(!copy_track_(return_array+i, object_array+i)) { - cuesheet_track_array_delete_(return_array, num_tracks); - return 0; - } - } - } - - return return_array; -} - -static FLAC__bool cuesheet_set_track_(FLAC__StreamMetadata *object, FLAC__StreamMetadata_CueSheet_Track *dest, const FLAC__StreamMetadata_CueSheet_Track *src, FLAC__bool copy) -{ - FLAC__StreamMetadata_CueSheet_Index *save; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(0 != dest); - FLAC__ASSERT(0 != src); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); - FLAC__ASSERT((0 != src->indices && src->num_indices > 0) || (0 == src->indices && src->num_indices == 0)); - - save = dest->indices; - - /* do the copy first so that if we fail we leave the object untouched */ - if(copy) { - if(!copy_track_(dest, src)) - return false; - } - else { - *dest = *src; - } - - if(0 != save) - free(save); - - cuesheet_calculate_length_(object); - return true; -} - - -/**************************************************************************** - * - * Metadata object routines - * - ***************************************************************************/ - -FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_new(FLAC__MetadataType type) -{ - FLAC__StreamMetadata *object; - - if(type > FLAC__MAX_METADATA_TYPE_CODE) - return 0; - - object = (FLAC__StreamMetadata*)calloc(1, sizeof(FLAC__StreamMetadata)); - if(0 != object) { - object->is_last = false; - object->type = type; - switch(type) { - case FLAC__METADATA_TYPE_STREAMINFO: - object->length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH; - break; - case FLAC__METADATA_TYPE_PADDING: - /* calloc() took care of this for us: - object->length = 0; - */ - break; - case FLAC__METADATA_TYPE_APPLICATION: - object->length = FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8; - /* calloc() took care of this for us: - object->data.application.data = 0; - */ - break; - case FLAC__METADATA_TYPE_SEEKTABLE: - /* calloc() took care of this for us: - object->length = 0; - object->data.seek_table.num_points = 0; - object->data.seek_table.points = 0; - */ - break; - case FLAC__METADATA_TYPE_VORBIS_COMMENT: - object->data.vorbis_comment.vendor_string.length = (unsigned)strlen(FLAC__VENDOR_STRING); - if(!copy_bytes_(&object->data.vorbis_comment.vendor_string.entry, (const FLAC__byte*)FLAC__VENDOR_STRING, object->data.vorbis_comment.vendor_string.length+1)) { - free(object); - return 0; - } - vorbiscomment_calculate_length_(object); - break; - case FLAC__METADATA_TYPE_CUESHEET: - cuesheet_calculate_length_(object); - break; - case FLAC__METADATA_TYPE_PICTURE: - object->length = ( - FLAC__STREAM_METADATA_PICTURE_TYPE_LEN + - FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN + /* empty mime_type string */ - FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN + /* empty description string */ - FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN + - FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN + - FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN + - FLAC__STREAM_METADATA_PICTURE_COLORS_LEN + - FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN + - 0 /* no data */ - ) / 8; - object->data.picture.type = FLAC__STREAM_METADATA_PICTURE_TYPE_OTHER; - object->data.picture.mime_type = 0; - object->data.picture.description = 0; - /* calloc() took care of this for us: - object->data.picture.width = 0; - object->data.picture.height = 0; - object->data.picture.depth = 0; - object->data.picture.colors = 0; - object->data.picture.data_length = 0; - object->data.picture.data = 0; - */ - /* now initialize mime_type and description with empty strings to make things easier on the client */ - if(!copy_cstring_(&object->data.picture.mime_type, "")) { - free(object); - return 0; - } - if(!copy_cstring_((char**)(&object->data.picture.description), "")) { - if(object->data.picture.mime_type) - free(object->data.picture.mime_type); - free(object); - return 0; - } - break; - default: - /* calloc() took care of this for us: - object->length = 0; - object->data.unknown.data = 0; - */ - break; - } - } - - return object; -} - -FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_clone(const FLAC__StreamMetadata *object) -{ - FLAC__StreamMetadata *to; - - FLAC__ASSERT(0 != object); - - if(0 != (to = FLAC__metadata_object_new(object->type))) { - to->is_last = object->is_last; - to->type = object->type; - to->length = object->length; - switch(to->type) { - case FLAC__METADATA_TYPE_STREAMINFO: - memcpy(&to->data.stream_info, &object->data.stream_info, sizeof(FLAC__StreamMetadata_StreamInfo)); - break; - case FLAC__METADATA_TYPE_PADDING: - break; - case FLAC__METADATA_TYPE_APPLICATION: - if(to->length < FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8) { /* underflow check */ - FLAC__metadata_object_delete(to); - return 0; - } - memcpy(&to->data.application.id, &object->data.application.id, FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8); - if(!copy_bytes_(&to->data.application.data, object->data.application.data, object->length - FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8)) { - FLAC__metadata_object_delete(to); - return 0; - } - break; - case FLAC__METADATA_TYPE_SEEKTABLE: - to->data.seek_table.num_points = object->data.seek_table.num_points; - if(to->data.seek_table.num_points > SIZE_MAX / sizeof(FLAC__StreamMetadata_SeekPoint)) { /* overflow check */ - FLAC__metadata_object_delete(to); - return 0; - } - if(!copy_bytes_((FLAC__byte**)&to->data.seek_table.points, (FLAC__byte*)object->data.seek_table.points, object->data.seek_table.num_points * sizeof(FLAC__StreamMetadata_SeekPoint))) { - FLAC__metadata_object_delete(to); - return 0; - } - break; - case FLAC__METADATA_TYPE_VORBIS_COMMENT: - if(0 != to->data.vorbis_comment.vendor_string.entry) { - free(to->data.vorbis_comment.vendor_string.entry); - to->data.vorbis_comment.vendor_string.entry = 0; - } - if(!copy_vcentry_(&to->data.vorbis_comment.vendor_string, &object->data.vorbis_comment.vendor_string)) { - FLAC__metadata_object_delete(to); - return 0; - } - if(object->data.vorbis_comment.num_comments == 0) { - FLAC__ASSERT(0 == object->data.vorbis_comment.comments); - to->data.vorbis_comment.comments = 0; - } - else { - FLAC__ASSERT(0 != object->data.vorbis_comment.comments); - to->data.vorbis_comment.comments = vorbiscomment_entry_array_copy_(object->data.vorbis_comment.comments, object->data.vorbis_comment.num_comments); - if(0 == to->data.vorbis_comment.comments) { - FLAC__metadata_object_delete(to); - return 0; - } - } - to->data.vorbis_comment.num_comments = object->data.vorbis_comment.num_comments; - break; - case FLAC__METADATA_TYPE_CUESHEET: - memcpy(&to->data.cue_sheet, &object->data.cue_sheet, sizeof(FLAC__StreamMetadata_CueSheet)); - if(object->data.cue_sheet.num_tracks == 0) { - FLAC__ASSERT(0 == object->data.cue_sheet.tracks); - } - else { - FLAC__ASSERT(0 != object->data.cue_sheet.tracks); - to->data.cue_sheet.tracks = cuesheet_track_array_copy_(object->data.cue_sheet.tracks, object->data.cue_sheet.num_tracks); - if(0 == to->data.cue_sheet.tracks) { - FLAC__metadata_object_delete(to); - return 0; - } - } - break; - case FLAC__METADATA_TYPE_PICTURE: - to->data.picture.type = object->data.picture.type; - if(!copy_cstring_(&to->data.picture.mime_type, object->data.picture.mime_type)) { - FLAC__metadata_object_delete(to); - return 0; - } - if(!copy_cstring_((char**)(&to->data.picture.description), (const char*)object->data.picture.description)) { - FLAC__metadata_object_delete(to); - return 0; - } - to->data.picture.width = object->data.picture.width; - to->data.picture.height = object->data.picture.height; - to->data.picture.depth = object->data.picture.depth; - to->data.picture.colors = object->data.picture.colors; - to->data.picture.data_length = object->data.picture.data_length; - if(!copy_bytes_((&to->data.picture.data), object->data.picture.data, object->data.picture.data_length)) { - FLAC__metadata_object_delete(to); - return 0; - } - break; - default: - if(!copy_bytes_(&to->data.unknown.data, object->data.unknown.data, object->length)) { - FLAC__metadata_object_delete(to); - return 0; - } - break; - } - } - - return to; -} - -void FLAC__metadata_object_delete_data(FLAC__StreamMetadata *object) -{ - FLAC__ASSERT(0 != object); - - switch(object->type) { - case FLAC__METADATA_TYPE_STREAMINFO: - case FLAC__METADATA_TYPE_PADDING: - break; - case FLAC__METADATA_TYPE_APPLICATION: - if(0 != object->data.application.data) { - free(object->data.application.data); - object->data.application.data = 0; - } - break; - case FLAC__METADATA_TYPE_SEEKTABLE: - if(0 != object->data.seek_table.points) { - free(object->data.seek_table.points); - object->data.seek_table.points = 0; - } - break; - case FLAC__METADATA_TYPE_VORBIS_COMMENT: - if(0 != object->data.vorbis_comment.vendor_string.entry) { - free(object->data.vorbis_comment.vendor_string.entry); - object->data.vorbis_comment.vendor_string.entry = 0; - } - if(0 != object->data.vorbis_comment.comments) { - FLAC__ASSERT(object->data.vorbis_comment.num_comments > 0); - vorbiscomment_entry_array_delete_(object->data.vorbis_comment.comments, object->data.vorbis_comment.num_comments); - } - break; - case FLAC__METADATA_TYPE_CUESHEET: - if(0 != object->data.cue_sheet.tracks) { - FLAC__ASSERT(object->data.cue_sheet.num_tracks > 0); - cuesheet_track_array_delete_(object->data.cue_sheet.tracks, object->data.cue_sheet.num_tracks); - } - break; - case FLAC__METADATA_TYPE_PICTURE: - if(0 != object->data.picture.mime_type) { - free(object->data.picture.mime_type); - object->data.picture.mime_type = 0; - } - if(0 != object->data.picture.description) { - free(object->data.picture.description); - object->data.picture.description = 0; - } - if(0 != object->data.picture.data) { - free(object->data.picture.data); - object->data.picture.data = 0; - } - break; - default: - if(0 != object->data.unknown.data) { - free(object->data.unknown.data); - object->data.unknown.data = 0; - } - break; - } -} - -FLAC_API void FLAC__metadata_object_delete(FLAC__StreamMetadata *object) -{ - FLAC__metadata_object_delete_data(object); - free(object); -} - -static FLAC__bool compare_block_data_streaminfo_(const FLAC__StreamMetadata_StreamInfo *block1, const FLAC__StreamMetadata_StreamInfo *block2) -{ - if(block1->min_blocksize != block2->min_blocksize) - return false; - if(block1->max_blocksize != block2->max_blocksize) - return false; - if(block1->min_framesize != block2->min_framesize) - return false; - if(block1->max_framesize != block2->max_framesize) - return false; - if(block1->sample_rate != block2->sample_rate) - return false; - if(block1->channels != block2->channels) - return false; - if(block1->bits_per_sample != block2->bits_per_sample) - return false; - if(block1->total_samples != block2->total_samples) - return false; - if(0 != memcmp(block1->md5sum, block2->md5sum, 16)) - return false; - return true; -} - -static FLAC__bool compare_block_data_application_(const FLAC__StreamMetadata_Application *block1, const FLAC__StreamMetadata_Application *block2, unsigned block_length) -{ - FLAC__ASSERT(0 != block1); - FLAC__ASSERT(0 != block2); - FLAC__ASSERT(block_length >= sizeof(block1->id)); - - if(0 != memcmp(block1->id, block2->id, sizeof(block1->id))) - return false; - if(0 != block1->data && 0 != block2->data) - return 0 == memcmp(block1->data, block2->data, block_length - sizeof(block1->id)); - else - return block1->data == block2->data; -} - -static FLAC__bool compare_block_data_seektable_(const FLAC__StreamMetadata_SeekTable *block1, const FLAC__StreamMetadata_SeekTable *block2) -{ - unsigned i; - - FLAC__ASSERT(0 != block1); - FLAC__ASSERT(0 != block2); - - if(block1->num_points != block2->num_points) - return false; - - if(0 != block1->points && 0 != block2->points) { - for(i = 0; i < block1->num_points; i++) { - if(block1->points[i].sample_number != block2->points[i].sample_number) - return false; - if(block1->points[i].stream_offset != block2->points[i].stream_offset) - return false; - if(block1->points[i].frame_samples != block2->points[i].frame_samples) - return false; - } - return true; - } - else - return block1->points == block2->points; -} - -static FLAC__bool compare_block_data_vorbiscomment_(const FLAC__StreamMetadata_VorbisComment *block1, const FLAC__StreamMetadata_VorbisComment *block2) -{ - unsigned i; - - if(block1->vendor_string.length != block2->vendor_string.length) - return false; - - if(0 != block1->vendor_string.entry && 0 != block2->vendor_string.entry) { - if(0 != memcmp(block1->vendor_string.entry, block2->vendor_string.entry, block1->vendor_string.length)) - return false; - } - else if(block1->vendor_string.entry != block2->vendor_string.entry) - return false; - - if(block1->num_comments != block2->num_comments) - return false; - - for(i = 0; i < block1->num_comments; i++) { - if(0 != block1->comments[i].entry && 0 != block2->comments[i].entry) { - if(0 != memcmp(block1->comments[i].entry, block2->comments[i].entry, block1->comments[i].length)) - return false; - } - else if(block1->comments[i].entry != block2->comments[i].entry) - return false; - } - return true; -} - -static FLAC__bool compare_block_data_cuesheet_(const FLAC__StreamMetadata_CueSheet *block1, const FLAC__StreamMetadata_CueSheet *block2) -{ - unsigned i, j; - - if(0 != strcmp(block1->media_catalog_number, block2->media_catalog_number)) - return false; - - if(block1->lead_in != block2->lead_in) - return false; - - if(block1->is_cd != block2->is_cd) - return false; - - if(block1->num_tracks != block2->num_tracks) - return false; - - if(0 != block1->tracks && 0 != block2->tracks) { - FLAC__ASSERT(block1->num_tracks > 0); - for(i = 0; i < block1->num_tracks; i++) { - if(block1->tracks[i].offset != block2->tracks[i].offset) - return false; - if(block1->tracks[i].number != block2->tracks[i].number) - return false; - if(0 != memcmp(block1->tracks[i].isrc, block2->tracks[i].isrc, sizeof(block1->tracks[i].isrc))) - return false; - if(block1->tracks[i].type != block2->tracks[i].type) - return false; - if(block1->tracks[i].pre_emphasis != block2->tracks[i].pre_emphasis) - return false; - if(block1->tracks[i].num_indices != block2->tracks[i].num_indices) - return false; - if(0 != block1->tracks[i].indices && 0 != block2->tracks[i].indices) { - FLAC__ASSERT(block1->tracks[i].num_indices > 0); - for(j = 0; j < block1->tracks[i].num_indices; j++) { - if(block1->tracks[i].indices[j].offset != block2->tracks[i].indices[j].offset) - return false; - if(block1->tracks[i].indices[j].number != block2->tracks[i].indices[j].number) - return false; - } - } - else if(block1->tracks[i].indices != block2->tracks[i].indices) - return false; - } - } - else if(block1->tracks != block2->tracks) - return false; - return true; -} - -static FLAC__bool compare_block_data_picture_(const FLAC__StreamMetadata_Picture *block1, const FLAC__StreamMetadata_Picture *block2) -{ - if(block1->type != block2->type) - return false; - if(block1->mime_type != block2->mime_type && (0 == block1->mime_type || 0 == block2->mime_type || strcmp(block1->mime_type, block2->mime_type))) - return false; - if(block1->description != block2->description && (0 == block1->description || 0 == block2->description || strcmp((const char *)block1->description, (const char *)block2->description))) - return false; - if(block1->width != block2->width) - return false; - if(block1->height != block2->height) - return false; - if(block1->depth != block2->depth) - return false; - if(block1->colors != block2->colors) - return false; - if(block1->data_length != block2->data_length) - return false; - if(block1->data != block2->data && (0 == block1->data || 0 == block2->data || memcmp(block1->data, block2->data, block1->data_length))) - return false; - return true; -} - -static FLAC__bool compare_block_data_unknown_(const FLAC__StreamMetadata_Unknown *block1, const FLAC__StreamMetadata_Unknown *block2, unsigned block_length) -{ - FLAC__ASSERT(0 != block1); - FLAC__ASSERT(0 != block2); - - if(0 != block1->data && 0 != block2->data) - return 0 == memcmp(block1->data, block2->data, block_length); - else - return block1->data == block2->data; -} - -FLAC_API FLAC__bool FLAC__metadata_object_is_equal(const FLAC__StreamMetadata *block1, const FLAC__StreamMetadata *block2) -{ - FLAC__ASSERT(0 != block1); - FLAC__ASSERT(0 != block2); - - if(block1->type != block2->type) { - return false; - } - if(block1->is_last != block2->is_last) { - return false; - } - if(block1->length != block2->length) { - return false; - } - switch(block1->type) { - case FLAC__METADATA_TYPE_STREAMINFO: - return compare_block_data_streaminfo_(&block1->data.stream_info, &block2->data.stream_info); - case FLAC__METADATA_TYPE_PADDING: - return true; /* we don't compare the padding guts */ - case FLAC__METADATA_TYPE_APPLICATION: - return compare_block_data_application_(&block1->data.application, &block2->data.application, block1->length); - case FLAC__METADATA_TYPE_SEEKTABLE: - return compare_block_data_seektable_(&block1->data.seek_table, &block2->data.seek_table); - case FLAC__METADATA_TYPE_VORBIS_COMMENT: - return compare_block_data_vorbiscomment_(&block1->data.vorbis_comment, &block2->data.vorbis_comment); - case FLAC__METADATA_TYPE_CUESHEET: - return compare_block_data_cuesheet_(&block1->data.cue_sheet, &block2->data.cue_sheet); - case FLAC__METADATA_TYPE_PICTURE: - return compare_block_data_picture_(&block1->data.picture, &block2->data.picture); - default: - return compare_block_data_unknown_(&block1->data.unknown, &block2->data.unknown, block1->length); - } -} - -FLAC_API FLAC__bool FLAC__metadata_object_application_set_data(FLAC__StreamMetadata *object, FLAC__byte *data, unsigned length, FLAC__bool copy) -{ - FLAC__byte *save; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_APPLICATION); - FLAC__ASSERT((0 != data && length > 0) || (0 == data && length == 0 && copy == false)); - - save = object->data.application.data; - - /* do the copy first so that if we fail we leave the object untouched */ - if(copy) { - if(!copy_bytes_(&object->data.application.data, data, length)) - return false; - } - else { - object->data.application.data = data; - } - - if(0 != save) - free(save); - - object->length = FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8 + length; - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_object_seektable_resize_points(FLAC__StreamMetadata *object, unsigned new_num_points) -{ - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); - - if(0 == object->data.seek_table.points) { - FLAC__ASSERT(object->data.seek_table.num_points == 0); - if(0 == new_num_points) - return true; - else if(0 == (object->data.seek_table.points = seekpoint_array_new_(new_num_points))) - return false; - } - else { - const size_t old_size = object->data.seek_table.num_points * sizeof(FLAC__StreamMetadata_SeekPoint); - const size_t new_size = new_num_points * sizeof(FLAC__StreamMetadata_SeekPoint); - - /* overflow check */ - if((size_t)new_num_points > SIZE_MAX / sizeof(FLAC__StreamMetadata_SeekPoint)) - return false; - - FLAC__ASSERT(object->data.seek_table.num_points > 0); - - if(new_size == 0) { - free(object->data.seek_table.points); - object->data.seek_table.points = 0; - } - else if(0 == (object->data.seek_table.points = (FLAC__StreamMetadata_SeekPoint*)realloc(object->data.seek_table.points, new_size))) - return false; - - /* if growing, set new elements to placeholders */ - if(new_size > old_size) { - unsigned i; - for(i = object->data.seek_table.num_points; i < new_num_points; i++) { - object->data.seek_table.points[i].sample_number = FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER; - object->data.seek_table.points[i].stream_offset = 0; - object->data.seek_table.points[i].frame_samples = 0; - } - } - } - - object->data.seek_table.num_points = new_num_points; - - seektable_calculate_length_(object); - return true; -} - -FLAC_API void FLAC__metadata_object_seektable_set_point(FLAC__StreamMetadata *object, unsigned point_num, FLAC__StreamMetadata_SeekPoint point) -{ - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); - FLAC__ASSERT(point_num < object->data.seek_table.num_points); - - object->data.seek_table.points[point_num] = point; -} - -FLAC_API FLAC__bool FLAC__metadata_object_seektable_insert_point(FLAC__StreamMetadata *object, unsigned point_num, FLAC__StreamMetadata_SeekPoint point) -{ - int i; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); - FLAC__ASSERT(point_num <= object->data.seek_table.num_points); - - if(!FLAC__metadata_object_seektable_resize_points(object, object->data.seek_table.num_points+1)) - return false; - - /* move all points >= point_num forward one space */ - for(i = (int)object->data.seek_table.num_points-1; i > (int)point_num; i--) - object->data.seek_table.points[i] = object->data.seek_table.points[i-1]; - - FLAC__metadata_object_seektable_set_point(object, point_num, point); - seektable_calculate_length_(object); - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_object_seektable_delete_point(FLAC__StreamMetadata *object, unsigned point_num) -{ - unsigned i; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); - FLAC__ASSERT(point_num < object->data.seek_table.num_points); - - /* move all points > point_num backward one space */ - for(i = point_num; i < object->data.seek_table.num_points-1; i++) - object->data.seek_table.points[i] = object->data.seek_table.points[i+1]; - - return FLAC__metadata_object_seektable_resize_points(object, object->data.seek_table.num_points-1); -} - -FLAC_API FLAC__bool FLAC__metadata_object_seektable_is_legal(const FLAC__StreamMetadata *object) -{ - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); - - return FLAC__format_seektable_is_legal(&object->data.seek_table); -} - -FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_placeholders(FLAC__StreamMetadata *object, unsigned num) -{ - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); - - if(num > 0) - /* WATCHOUT: we rely on the fact that growing the array adds PLACEHOLDERS at the end */ - return FLAC__metadata_object_seektable_resize_points(object, object->data.seek_table.num_points + num); - else - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_point(FLAC__StreamMetadata *object, FLAC__uint64 sample_number) -{ - FLAC__StreamMetadata_SeekTable *seek_table; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); - - seek_table = &object->data.seek_table; - - if(!FLAC__metadata_object_seektable_resize_points(object, seek_table->num_points + 1)) - return false; - - seek_table->points[seek_table->num_points - 1].sample_number = sample_number; - seek_table->points[seek_table->num_points - 1].stream_offset = 0; - seek_table->points[seek_table->num_points - 1].frame_samples = 0; - - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_points(FLAC__StreamMetadata *object, FLAC__uint64 sample_numbers[], unsigned num) -{ - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); - FLAC__ASSERT(0 != sample_numbers || num == 0); - - if(num > 0) { - FLAC__StreamMetadata_SeekTable *seek_table = &object->data.seek_table; - unsigned i, j; - - i = seek_table->num_points; - - if(!FLAC__metadata_object_seektable_resize_points(object, seek_table->num_points + num)) - return false; - - for(j = 0; j < num; i++, j++) { - seek_table->points[i].sample_number = sample_numbers[j]; - seek_table->points[i].stream_offset = 0; - seek_table->points[i].frame_samples = 0; - } - } - - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_spaced_points(FLAC__StreamMetadata *object, unsigned num, FLAC__uint64 total_samples) -{ - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); - FLAC__ASSERT(total_samples > 0); - - if(num > 0 && total_samples > 0) { - FLAC__StreamMetadata_SeekTable *seek_table = &object->data.seek_table; - unsigned i, j; - - i = seek_table->num_points; - - if(!FLAC__metadata_object_seektable_resize_points(object, seek_table->num_points + num)) - return false; - - for(j = 0; j < num; i++, j++) { - seek_table->points[i].sample_number = total_samples * (FLAC__uint64)j / (FLAC__uint64)num; - seek_table->points[i].stream_offset = 0; - seek_table->points[i].frame_samples = 0; - } - } - - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_spaced_points_by_samples(FLAC__StreamMetadata *object, unsigned samples, FLAC__uint64 total_samples) -{ - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); - FLAC__ASSERT(samples > 0); - FLAC__ASSERT(total_samples > 0); - - if(samples > 0 && total_samples > 0) { - FLAC__StreamMetadata_SeekTable *seek_table = &object->data.seek_table; - unsigned i, j; - FLAC__uint64 num, sample; - - num = 1 + total_samples / samples; /* 1+ for the first sample at 0 */ - /* now account for the fact that we don't place a seekpoint at "total_samples" since samples are number from 0: */ - if(total_samples % samples == 0) - num--; - - i = seek_table->num_points; - - if(!FLAC__metadata_object_seektable_resize_points(object, seek_table->num_points + (unsigned)num)) - return false; - - sample = 0; - for(j = 0; j < num; i++, j++, sample += samples) { - seek_table->points[i].sample_number = sample; - seek_table->points[i].stream_offset = 0; - seek_table->points[i].frame_samples = 0; - } - } - - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_sort(FLAC__StreamMetadata *object, FLAC__bool compact) -{ - unsigned unique; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_SEEKTABLE); - - unique = FLAC__format_seektable_sort(&object->data.seek_table); - - return !compact || FLAC__metadata_object_seektable_resize_points(object, unique); -} - -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_set_vendor_string(FLAC__StreamMetadata *object, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy) -{ - if(!FLAC__format_vorbiscomment_entry_value_is_legal(entry.entry, entry.length)) - return false; - return vorbiscomment_set_entry_(object, &object->data.vorbis_comment.vendor_string, &entry, copy); -} - -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_resize_comments(FLAC__StreamMetadata *object, unsigned new_num_comments) -{ - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - - if(0 == object->data.vorbis_comment.comments) { - FLAC__ASSERT(object->data.vorbis_comment.num_comments == 0); - if(0 == new_num_comments) - return true; - else if(0 == (object->data.vorbis_comment.comments = vorbiscomment_entry_array_new_(new_num_comments))) - return false; - } - else { - const size_t old_size = object->data.vorbis_comment.num_comments * sizeof(FLAC__StreamMetadata_VorbisComment_Entry); - const size_t new_size = new_num_comments * sizeof(FLAC__StreamMetadata_VorbisComment_Entry); - - /* overflow check */ - if((size_t)new_num_comments > SIZE_MAX / sizeof(FLAC__StreamMetadata_VorbisComment_Entry)) - return false; - - FLAC__ASSERT(object->data.vorbis_comment.num_comments > 0); - - /* if shrinking, free the truncated entries */ - if(new_num_comments < object->data.vorbis_comment.num_comments) { - unsigned i; - for(i = new_num_comments; i < object->data.vorbis_comment.num_comments; i++) - if(0 != object->data.vorbis_comment.comments[i].entry) - free(object->data.vorbis_comment.comments[i].entry); - } - - if(new_size == 0) { - free(object->data.vorbis_comment.comments); - object->data.vorbis_comment.comments = 0; - } - else if(0 == (object->data.vorbis_comment.comments = (FLAC__StreamMetadata_VorbisComment_Entry*)realloc(object->data.vorbis_comment.comments, new_size))) - return false; - - /* if growing, zero all the length/pointers of new elements */ - if(new_size > old_size) - memset(object->data.vorbis_comment.comments + object->data.vorbis_comment.num_comments, 0, new_size - old_size); - } - - object->data.vorbis_comment.num_comments = new_num_comments; - - vorbiscomment_calculate_length_(object); - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_set_comment(FLAC__StreamMetadata *object, unsigned comment_num, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy) -{ - FLAC__ASSERT(0 != object); - FLAC__ASSERT(comment_num < object->data.vorbis_comment.num_comments); - - if(!FLAC__format_vorbiscomment_entry_is_legal(entry.entry, entry.length)) - return false; - return vorbiscomment_set_entry_(object, &object->data.vorbis_comment.comments[comment_num], &entry, copy); -} - -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_insert_comment(FLAC__StreamMetadata *object, unsigned comment_num, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy) -{ - FLAC__StreamMetadata_VorbisComment *vc; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - FLAC__ASSERT(comment_num <= object->data.vorbis_comment.num_comments); - - if(!FLAC__format_vorbiscomment_entry_is_legal(entry.entry, entry.length)) - return false; - - vc = &object->data.vorbis_comment; - - if(!FLAC__metadata_object_vorbiscomment_resize_comments(object, vc->num_comments+1)) - return false; - - /* move all comments >= comment_num forward one space */ - memmove(&vc->comments[comment_num+1], &vc->comments[comment_num], sizeof(FLAC__StreamMetadata_VorbisComment_Entry)*(vc->num_comments-1-comment_num)); - vc->comments[comment_num].length = 0; - vc->comments[comment_num].entry = 0; - - return FLAC__metadata_object_vorbiscomment_set_comment(object, comment_num, entry, copy); -} - -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_append_comment(FLAC__StreamMetadata *object, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy) -{ - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - return FLAC__metadata_object_vorbiscomment_insert_comment(object, object->data.vorbis_comment.num_comments, entry, copy); -} - -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_replace_comment(FLAC__StreamMetadata *object, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool all, FLAC__bool copy) -{ - FLAC__ASSERT(0 != entry.entry && entry.length > 0); - - if(!FLAC__format_vorbiscomment_entry_is_legal(entry.entry, entry.length)) - return false; - - { - int i; - size_t field_name_length; - const FLAC__byte *eq = (FLAC__byte*)memchr(entry.entry, '=', entry.length); - - FLAC__ASSERT(0 != eq); - - if(0 == eq) - return false; /* double protection */ - - field_name_length = eq-entry.entry; - - if((i = vorbiscomment_find_entry_from_(object, 0, (const char *)entry.entry, field_name_length)) >= 0) { - unsigned index = (unsigned)i; - if(!FLAC__metadata_object_vorbiscomment_set_comment(object, index, entry, copy)) - return false; - if(all && (index+1 < object->data.vorbis_comment.num_comments)) { - for(i = vorbiscomment_find_entry_from_(object, index+1, (const char *)entry.entry, field_name_length); i >= 0; ) { - if(!FLAC__metadata_object_vorbiscomment_delete_comment(object, (unsigned)i)) - return false; - if((unsigned)i < object->data.vorbis_comment.num_comments) - i = vorbiscomment_find_entry_from_(object, (unsigned)i, (const char *)entry.entry, field_name_length); - else - i = -1; - } - } - return true; - } - else - return FLAC__metadata_object_vorbiscomment_append_comment(object, entry, copy); - } -} - -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_delete_comment(FLAC__StreamMetadata *object, unsigned comment_num) -{ - FLAC__StreamMetadata_VorbisComment *vc; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - FLAC__ASSERT(comment_num < object->data.vorbis_comment.num_comments); - - vc = &object->data.vorbis_comment; - - /* free the comment at comment_num */ - if(0 != vc->comments[comment_num].entry) - free(vc->comments[comment_num].entry); - - /* move all comments > comment_num backward one space */ - memmove(&vc->comments[comment_num], &vc->comments[comment_num+1], sizeof(FLAC__StreamMetadata_VorbisComment_Entry)*(vc->num_comments-comment_num-1)); - vc->comments[vc->num_comments-1].length = 0; - vc->comments[vc->num_comments-1].entry = 0; - - return FLAC__metadata_object_vorbiscomment_resize_comments(object, vc->num_comments-1); -} - -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(FLAC__StreamMetadata_VorbisComment_Entry *entry, const char *field_name, const char *field_value) -{ - FLAC__ASSERT(0 != entry); - FLAC__ASSERT(0 != field_name); - FLAC__ASSERT(0 != field_value); - - if(!FLAC__format_vorbiscomment_entry_name_is_legal(field_name)) - return false; - if(!FLAC__format_vorbiscomment_entry_value_is_legal((const FLAC__byte *)field_value, (unsigned)(-1))) - return false; - - { - const size_t nn = strlen(field_name); - const size_t nv = strlen(field_value); - entry->length = nn + 1 /*=*/ + nv; - if(0 == (entry->entry = (FLAC__byte*)safe_malloc_add_4op_(nn, /*+*/1, /*+*/nv, /*+*/1))) - return false; - memcpy(entry->entry, field_name, nn); - entry->entry[nn] = '='; - memcpy(entry->entry+nn+1, field_value, nv); - entry->entry[entry->length] = '\0'; - } - - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_to_name_value_pair(const FLAC__StreamMetadata_VorbisComment_Entry entry, char **field_name, char **field_value) -{ - FLAC__ASSERT(0 != entry.entry && entry.length > 0); - FLAC__ASSERT(0 != field_name); - FLAC__ASSERT(0 != field_value); - - if(!FLAC__format_vorbiscomment_entry_is_legal(entry.entry, entry.length)) - return false; - - { - const FLAC__byte *eq = (FLAC__byte*)memchr(entry.entry, '=', entry.length); - const size_t nn = eq-entry.entry; - const size_t nv = entry.length-nn-1; /* -1 for the '=' */ - FLAC__ASSERT(0 != eq); - if(0 == eq) - return false; /* double protection */ - if(0 == (*field_name = (char*)safe_malloc_add_2op_(nn, /*+*/1))) - return false; - if(0 == (*field_value = (char*)safe_malloc_add_2op_(nv, /*+*/1))) { - free(*field_name); - return false; - } - memcpy(*field_name, entry.entry, nn); - memcpy(*field_value, entry.entry+nn+1, nv); - (*field_name)[nn] = '\0'; - (*field_value)[nv] = '\0'; - } - - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_matches(const FLAC__StreamMetadata_VorbisComment_Entry entry, const char *field_name, unsigned field_name_length) -{ - FLAC__ASSERT(0 != entry.entry && entry.length > 0); - { - const FLAC__byte *eq = (FLAC__byte*)memchr(entry.entry, '=', entry.length); -#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__ || defined __EMX__ -#define FLAC__STRNCASECMP strnicmp -#else -#define FLAC__STRNCASECMP strncasecmp -#endif - return (0 != eq && (unsigned)(eq-entry.entry) == field_name_length && 0 == FLAC__STRNCASECMP(field_name, (const char *)entry.entry, field_name_length)); -#undef FLAC__STRNCASECMP - } -} - -FLAC_API int FLAC__metadata_object_vorbiscomment_find_entry_from(const FLAC__StreamMetadata *object, unsigned offset, const char *field_name) -{ - FLAC__ASSERT(0 != field_name); - - return vorbiscomment_find_entry_from_(object, offset, field_name, strlen(field_name)); -} - -FLAC_API int FLAC__metadata_object_vorbiscomment_remove_entry_matching(FLAC__StreamMetadata *object, const char *field_name) -{ - const unsigned field_name_length = strlen(field_name); - unsigned i; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - - for(i = 0; i < object->data.vorbis_comment.num_comments; i++) { - if(FLAC__metadata_object_vorbiscomment_entry_matches(object->data.vorbis_comment.comments[i], field_name, field_name_length)) { - if(!FLAC__metadata_object_vorbiscomment_delete_comment(object, i)) - return -1; - else - return 1; - } - } - - return 0; -} - -FLAC_API int FLAC__metadata_object_vorbiscomment_remove_entries_matching(FLAC__StreamMetadata *object, const char *field_name) -{ - FLAC__bool ok = true; - unsigned matching = 0; - const unsigned field_name_length = strlen(field_name); - int i; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - - /* must delete from end to start otherwise it will interfere with our iteration */ - for(i = (int)object->data.vorbis_comment.num_comments - 1; ok && i >= 0; i--) { - if(FLAC__metadata_object_vorbiscomment_entry_matches(object->data.vorbis_comment.comments[i], field_name, field_name_length)) { - matching++; - ok &= FLAC__metadata_object_vorbiscomment_delete_comment(object, (unsigned)i); - } - } - - return ok? (int)matching : -1; -} - -FLAC_API FLAC__StreamMetadata_CueSheet_Track *FLAC__metadata_object_cuesheet_track_new(void) -{ - return (FLAC__StreamMetadata_CueSheet_Track*)calloc(1, sizeof(FLAC__StreamMetadata_CueSheet_Track)); -} - -FLAC_API FLAC__StreamMetadata_CueSheet_Track *FLAC__metadata_object_cuesheet_track_clone(const FLAC__StreamMetadata_CueSheet_Track *object) -{ - FLAC__StreamMetadata_CueSheet_Track *to; - - FLAC__ASSERT(0 != object); - - if(0 != (to = FLAC__metadata_object_cuesheet_track_new())) { - if(!copy_track_(to, object)) { - FLAC__metadata_object_cuesheet_track_delete(to); - return 0; - } - } - - return to; -} - -void FLAC__metadata_object_cuesheet_track_delete_data(FLAC__StreamMetadata_CueSheet_Track *object) -{ - FLAC__ASSERT(0 != object); - - if(0 != object->indices) { - FLAC__ASSERT(object->num_indices > 0); - free(object->indices); - } -} - -FLAC_API void FLAC__metadata_object_cuesheet_track_delete(FLAC__StreamMetadata_CueSheet_Track *object) -{ - FLAC__metadata_object_cuesheet_track_delete_data(object); - free(object); -} - -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_resize_indices(FLAC__StreamMetadata *object, unsigned track_num, unsigned new_num_indices) -{ - FLAC__StreamMetadata_CueSheet_Track *track; - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); - FLAC__ASSERT(track_num < object->data.cue_sheet.num_tracks); - - track = &object->data.cue_sheet.tracks[track_num]; - - if(0 == track->indices) { - FLAC__ASSERT(track->num_indices == 0); - if(0 == new_num_indices) - return true; - else if(0 == (track->indices = cuesheet_track_index_array_new_(new_num_indices))) - return false; - } - else { - const size_t old_size = track->num_indices * sizeof(FLAC__StreamMetadata_CueSheet_Index); - const size_t new_size = new_num_indices * sizeof(FLAC__StreamMetadata_CueSheet_Index); - - /* overflow check */ - if((size_t)new_num_indices > SIZE_MAX / sizeof(FLAC__StreamMetadata_CueSheet_Index)) - return false; - - FLAC__ASSERT(track->num_indices > 0); - - if(new_size == 0) { - free(track->indices); - track->indices = 0; - } - else if(0 == (track->indices = (FLAC__StreamMetadata_CueSheet_Index*)realloc(track->indices, new_size))) - return false; - - /* if growing, zero all the lengths/pointers of new elements */ - if(new_size > old_size) - memset(track->indices + track->num_indices, 0, new_size - old_size); - } - - track->num_indices = new_num_indices; - - cuesheet_calculate_length_(object); - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_insert_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num, FLAC__StreamMetadata_CueSheet_Index index) -{ - FLAC__StreamMetadata_CueSheet_Track *track; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); - FLAC__ASSERT(track_num < object->data.cue_sheet.num_tracks); - FLAC__ASSERT(index_num <= object->data.cue_sheet.tracks[track_num].num_indices); - - track = &object->data.cue_sheet.tracks[track_num]; - - if(!FLAC__metadata_object_cuesheet_track_resize_indices(object, track_num, track->num_indices+1)) - return false; - - /* move all indices >= index_num forward one space */ - memmove(&track->indices[index_num+1], &track->indices[index_num], sizeof(FLAC__StreamMetadata_CueSheet_Index)*(track->num_indices-1-index_num)); - - track->indices[index_num] = index; - cuesheet_calculate_length_(object); - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_insert_blank_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num) -{ - FLAC__StreamMetadata_CueSheet_Index index; - memset(&index, 0, sizeof(index)); - return FLAC__metadata_object_cuesheet_track_insert_index(object, track_num, index_num, index); -} - -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_delete_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num) -{ - FLAC__StreamMetadata_CueSheet_Track *track; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); - FLAC__ASSERT(track_num < object->data.cue_sheet.num_tracks); - FLAC__ASSERT(index_num < object->data.cue_sheet.tracks[track_num].num_indices); - - track = &object->data.cue_sheet.tracks[track_num]; - - /* move all indices > index_num backward one space */ - memmove(&track->indices[index_num], &track->indices[index_num+1], sizeof(FLAC__StreamMetadata_CueSheet_Index)*(track->num_indices-index_num-1)); - - FLAC__metadata_object_cuesheet_track_resize_indices(object, track_num, track->num_indices-1); - cuesheet_calculate_length_(object); - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_resize_tracks(FLAC__StreamMetadata *object, unsigned new_num_tracks) -{ - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); - - if(0 == object->data.cue_sheet.tracks) { - FLAC__ASSERT(object->data.cue_sheet.num_tracks == 0); - if(0 == new_num_tracks) - return true; - else if(0 == (object->data.cue_sheet.tracks = cuesheet_track_array_new_(new_num_tracks))) - return false; - } - else { - const size_t old_size = object->data.cue_sheet.num_tracks * sizeof(FLAC__StreamMetadata_CueSheet_Track); - const size_t new_size = new_num_tracks * sizeof(FLAC__StreamMetadata_CueSheet_Track); - - /* overflow check */ - if((size_t)new_num_tracks > SIZE_MAX / sizeof(FLAC__StreamMetadata_CueSheet_Track)) - return false; - - FLAC__ASSERT(object->data.cue_sheet.num_tracks > 0); - - /* if shrinking, free the truncated entries */ - if(new_num_tracks < object->data.cue_sheet.num_tracks) { - unsigned i; - for(i = new_num_tracks; i < object->data.cue_sheet.num_tracks; i++) - if(0 != object->data.cue_sheet.tracks[i].indices) - free(object->data.cue_sheet.tracks[i].indices); - } - - if(new_size == 0) { - free(object->data.cue_sheet.tracks); - object->data.cue_sheet.tracks = 0; - } - else if(0 == (object->data.cue_sheet.tracks = (FLAC__StreamMetadata_CueSheet_Track*)realloc(object->data.cue_sheet.tracks, new_size))) - return false; - - /* if growing, zero all the lengths/pointers of new elements */ - if(new_size > old_size) - memset(object->data.cue_sheet.tracks + object->data.cue_sheet.num_tracks, 0, new_size - old_size); - } - - object->data.cue_sheet.num_tracks = new_num_tracks; - - cuesheet_calculate_length_(object); - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_set_track(FLAC__StreamMetadata *object, unsigned track_num, FLAC__StreamMetadata_CueSheet_Track *track, FLAC__bool copy) -{ - FLAC__ASSERT(0 != object); - FLAC__ASSERT(track_num < object->data.cue_sheet.num_tracks); - - return cuesheet_set_track_(object, object->data.cue_sheet.tracks + track_num, track, copy); -} - -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_insert_track(FLAC__StreamMetadata *object, unsigned track_num, FLAC__StreamMetadata_CueSheet_Track *track, FLAC__bool copy) -{ - FLAC__StreamMetadata_CueSheet *cs; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); - FLAC__ASSERT(track_num <= object->data.cue_sheet.num_tracks); - - cs = &object->data.cue_sheet; - - if(!FLAC__metadata_object_cuesheet_resize_tracks(object, cs->num_tracks+1)) - return false; - - /* move all tracks >= track_num forward one space */ - memmove(&cs->tracks[track_num+1], &cs->tracks[track_num], sizeof(FLAC__StreamMetadata_CueSheet_Track)*(cs->num_tracks-1-track_num)); - cs->tracks[track_num].num_indices = 0; - cs->tracks[track_num].indices = 0; - - return FLAC__metadata_object_cuesheet_set_track(object, track_num, track, copy); -} - -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_insert_blank_track(FLAC__StreamMetadata *object, unsigned track_num) -{ - FLAC__StreamMetadata_CueSheet_Track track; - memset(&track, 0, sizeof(track)); - return FLAC__metadata_object_cuesheet_insert_track(object, track_num, &track, /*copy=*/false); -} - -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_delete_track(FLAC__StreamMetadata *object, unsigned track_num) -{ - FLAC__StreamMetadata_CueSheet *cs; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); - FLAC__ASSERT(track_num < object->data.cue_sheet.num_tracks); - - cs = &object->data.cue_sheet; - - /* free the track at track_num */ - if(0 != cs->tracks[track_num].indices) - free(cs->tracks[track_num].indices); - - /* move all tracks > track_num backward one space */ - memmove(&cs->tracks[track_num], &cs->tracks[track_num+1], sizeof(FLAC__StreamMetadata_CueSheet_Track)*(cs->num_tracks-track_num-1)); - cs->tracks[cs->num_tracks-1].num_indices = 0; - cs->tracks[cs->num_tracks-1].indices = 0; - - return FLAC__metadata_object_cuesheet_resize_tracks(object, cs->num_tracks-1); -} - -FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_is_legal(const FLAC__StreamMetadata *object, FLAC__bool check_cd_da_subset, const char **violation) -{ - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); - - return FLAC__format_cuesheet_is_legal(&object->data.cue_sheet, check_cd_da_subset, violation); -} - -static FLAC__uint64 get_index_01_offset_(const FLAC__StreamMetadata_CueSheet *cs, unsigned track) -{ - if (track >= (cs->num_tracks-1) || cs->tracks[track].num_indices < 1) - return 0; - else if (cs->tracks[track].indices[0].number == 1) - return cs->tracks[track].indices[0].offset + cs->tracks[track].offset + cs->lead_in; - else if (cs->tracks[track].num_indices < 2) - return 0; - else if (cs->tracks[track].indices[1].number == 1) - return cs->tracks[track].indices[1].offset + cs->tracks[track].offset + cs->lead_in; - else - return 0; -} - -static FLAC__uint32 cddb_add_digits_(FLAC__uint32 x) -{ - FLAC__uint32 n = 0; - while (x) { - n += (x%10); - x /= 10; - } - return n; -} - -/*@@@@add to tests*/ -FLAC_API FLAC__uint32 FLAC__metadata_object_cuesheet_calculate_cddb_id(const FLAC__StreamMetadata *object) -{ - const FLAC__StreamMetadata_CueSheet *cs; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_CUESHEET); - - cs = &object->data.cue_sheet; - - if (cs->num_tracks < 2) /* need at least one real track and the lead-out track */ - return 0; - - { - FLAC__uint32 i, length, sum = 0; - for (i = 0; i < (cs->num_tracks-1); i++) /* -1 to avoid counting the lead-out */ - sum += cddb_add_digits_((FLAC__uint32)(get_index_01_offset_(cs, i) / 44100)); - length = (FLAC__uint32)((cs->tracks[cs->num_tracks-1].offset+cs->lead_in) / 44100) - (FLAC__uint32)(get_index_01_offset_(cs, 0) / 44100); - - return (sum % 0xFF) << 24 | length << 8 | (FLAC__uint32)(cs->num_tracks-1); - } -} - -FLAC_API FLAC__bool FLAC__metadata_object_picture_set_mime_type(FLAC__StreamMetadata *object, char *mime_type, FLAC__bool copy) -{ - char *old; - size_t old_length, new_length; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_PICTURE); - FLAC__ASSERT(0 != mime_type); - - old = object->data.picture.mime_type; - old_length = old? strlen(old) : 0; - new_length = strlen(mime_type); - - /* do the copy first so that if we fail we leave the object untouched */ - if(copy) { - if(new_length >= SIZE_MAX) /* overflow check */ - return false; - if(!copy_bytes_((FLAC__byte**)(&object->data.picture.mime_type), (FLAC__byte*)mime_type, new_length+1)) - return false; - } - else { - object->data.picture.mime_type = mime_type; - } - - if(0 != old) - free(old); - - object->length -= old_length; - object->length += new_length; - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_object_picture_set_description(FLAC__StreamMetadata *object, FLAC__byte *description, FLAC__bool copy) -{ - FLAC__byte *old; - size_t old_length, new_length; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_PICTURE); - FLAC__ASSERT(0 != description); - - old = object->data.picture.description; - old_length = old? strlen((const char *)old) : 0; - new_length = strlen((const char *)description); - - /* do the copy first so that if we fail we leave the object untouched */ - if(copy) { - if(new_length >= SIZE_MAX) /* overflow check */ - return false; - if(!copy_bytes_(&object->data.picture.description, description, new_length+1)) - return false; - } - else { - object->data.picture.description = description; - } - - if(0 != old) - free(old); - - object->length -= old_length; - object->length += new_length; - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_object_picture_set_data(FLAC__StreamMetadata *object, FLAC__byte *data, FLAC__uint32 length, FLAC__bool copy) -{ - FLAC__byte *old; - - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_PICTURE); - FLAC__ASSERT((0 != data && length > 0) || (0 == data && length == 0 && copy == false)); - - old = object->data.picture.data; - - /* do the copy first so that if we fail we leave the object untouched */ - if(copy) { - if(!copy_bytes_(&object->data.picture.data, data, length)) - return false; - } - else { - object->data.picture.data = data; - } - - if(0 != old) - free(old); - - object->length -= object->data.picture.data_length; - object->data.picture.data_length = length; - object->length += length; - return true; -} - -FLAC_API FLAC__bool FLAC__metadata_object_picture_is_legal(const FLAC__StreamMetadata *object, const char **violation) -{ - FLAC__ASSERT(0 != object); - FLAC__ASSERT(object->type == FLAC__METADATA_TYPE_PICTURE); - - return FLAC__format_picture_is_legal(&object->data.picture, violation); -} diff --git a/3rdparty/libflac/src/libFLAC/ogg_decoder_aspect.c b/3rdparty/libflac/src/libFLAC/ogg_decoder_aspect.c deleted file mode 100644 index 945b2c3c0d8..00000000000 --- a/3rdparty/libflac/src/libFLAC/ogg_decoder_aspect.c +++ /dev/null @@ -1,253 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <string.h> /* for memcpy() */ -#include "FLAC/assert.h" -#include "private/ogg_decoder_aspect.h" -#include "private/ogg_mapping.h" - -#ifdef max -#undef max -#endif -#define max(x,y) ((x)>(y)?(x):(y)) - -/*********************************************************************** - * - * Public class methods - * - ***********************************************************************/ - -FLAC__bool FLAC__ogg_decoder_aspect_init(FLAC__OggDecoderAspect *aspect) -{ - /* we will determine the serial number later if necessary */ - if(ogg_stream_init(&aspect->stream_state, aspect->serial_number) != 0) - return false; - - if(ogg_sync_init(&aspect->sync_state) != 0) - return false; - - aspect->version_major = ~(0u); - aspect->version_minor = ~(0u); - - aspect->need_serial_number = aspect->use_first_serial_number; - - aspect->end_of_stream = false; - aspect->have_working_page = false; - - return true; -} - -void FLAC__ogg_decoder_aspect_finish(FLAC__OggDecoderAspect *aspect) -{ - (void)ogg_sync_clear(&aspect->sync_state); - (void)ogg_stream_clear(&aspect->stream_state); -} - -void FLAC__ogg_decoder_aspect_set_serial_number(FLAC__OggDecoderAspect *aspect, long value) -{ - aspect->use_first_serial_number = false; - aspect->serial_number = value; -} - -void FLAC__ogg_decoder_aspect_set_defaults(FLAC__OggDecoderAspect *aspect) -{ - aspect->use_first_serial_number = true; -} - -void FLAC__ogg_decoder_aspect_flush(FLAC__OggDecoderAspect *aspect) -{ - (void)ogg_stream_reset(&aspect->stream_state); - (void)ogg_sync_reset(&aspect->sync_state); - aspect->end_of_stream = false; - aspect->have_working_page = false; -} - -void FLAC__ogg_decoder_aspect_reset(FLAC__OggDecoderAspect *aspect) -{ - FLAC__ogg_decoder_aspect_flush(aspect); - - if(aspect->use_first_serial_number) - aspect->need_serial_number = true; -} - -FLAC__OggDecoderAspectReadStatus FLAC__ogg_decoder_aspect_read_callback_wrapper(FLAC__OggDecoderAspect *aspect, FLAC__byte buffer[], size_t *bytes, FLAC__OggDecoderAspectReadCallbackProxy read_callback, const FLAC__StreamDecoder *decoder, void *client_data) -{ - static const size_t OGG_BYTES_CHUNK = 8192; - const size_t bytes_requested = *bytes; - - /* - * The FLAC decoding API uses pull-based reads, whereas Ogg decoding - * is push-based. In libFLAC, when you ask to decode a frame, the - * decoder will eventually call the read callback to supply some data, - * but how much it asks for depends on how much free space it has in - * its internal buffer. It does not try to grow its internal buffer - * to accomodate a whole frame because then the internal buffer size - * could not be limited, which is necessary in embedded applications. - * - * Ogg however grows its internal buffer until a whole page is present; - * only then can you get decoded data out. So we can't just ask for - * the same number of bytes from Ogg, then pass what's decoded down to - * libFLAC. If what libFLAC is asking for will not contain a whole - * page, then we will get no data from ogg_sync_pageout(), and at the - * same time cannot just read more data from the client for the purpose - * of getting a whole decoded page because the decoded size might be - * larger than libFLAC's internal buffer. - * - * Instead, whenever this read callback wrapper is called, we will - * continually request data from the client until we have at least one - * page, and manage pages internally so that we can send pieces of - * pages down to libFLAC in such a way that we obey its size - * requirement. To limit the amount of callbacks, we will always try - * to read in enough pages to return the full number of bytes - * requested. - */ - *bytes = 0; - while (*bytes < bytes_requested && !aspect->end_of_stream) { - if (aspect->have_working_page) { - if (aspect->have_working_packet) { - size_t n = bytes_requested - *bytes; - if ((size_t)aspect->working_packet.bytes <= n) { - /* the rest of the packet will fit in the buffer */ - n = aspect->working_packet.bytes; - memcpy(buffer, aspect->working_packet.packet, n); - *bytes += n; - buffer += n; - aspect->have_working_packet = false; - } - else { - /* only n bytes of the packet will fit in the buffer */ - memcpy(buffer, aspect->working_packet.packet, n); - *bytes += n; - buffer += n; - aspect->working_packet.packet += n; - aspect->working_packet.bytes -= n; - } - } - else { - /* try and get another packet */ - const int ret = ogg_stream_packetout(&aspect->stream_state, &aspect->working_packet); - if (ret > 0) { - aspect->have_working_packet = true; - /* if it is the first header packet, check for magic and a supported Ogg FLAC mapping version */ - if (aspect->working_packet.bytes > 0 && aspect->working_packet.packet[0] == FLAC__OGG_MAPPING_FIRST_HEADER_PACKET_TYPE) { - const FLAC__byte *b = aspect->working_packet.packet; - const unsigned header_length = - FLAC__OGG_MAPPING_PACKET_TYPE_LENGTH + - FLAC__OGG_MAPPING_MAGIC_LENGTH + - FLAC__OGG_MAPPING_VERSION_MAJOR_LENGTH + - FLAC__OGG_MAPPING_VERSION_MINOR_LENGTH + - FLAC__OGG_MAPPING_NUM_HEADERS_LENGTH; - if (aspect->working_packet.bytes < (long)header_length) - return FLAC__OGG_DECODER_ASPECT_READ_STATUS_NOT_FLAC; - b += FLAC__OGG_MAPPING_PACKET_TYPE_LENGTH; - if (memcmp(b, FLAC__OGG_MAPPING_MAGIC, FLAC__OGG_MAPPING_MAGIC_LENGTH)) - return FLAC__OGG_DECODER_ASPECT_READ_STATUS_NOT_FLAC; - b += FLAC__OGG_MAPPING_MAGIC_LENGTH; - aspect->version_major = (unsigned)(*b); - b += FLAC__OGG_MAPPING_VERSION_MAJOR_LENGTH; - aspect->version_minor = (unsigned)(*b); - if (aspect->version_major != 1) - return FLAC__OGG_DECODER_ASPECT_READ_STATUS_UNSUPPORTED_MAPPING_VERSION; - aspect->working_packet.packet += header_length; - aspect->working_packet.bytes -= header_length; - } - } - else if (ret == 0) { - aspect->have_working_page = false; - } - else { /* ret < 0 */ - /* lost sync, we'll leave the working page for the next call */ - return FLAC__OGG_DECODER_ASPECT_READ_STATUS_LOST_SYNC; - } - } - } - else { - /* try and get another page */ - const int ret = ogg_sync_pageout(&aspect->sync_state, &aspect->working_page); - if (ret > 0) { - /* got a page, grab the serial number if necessary */ - if(aspect->need_serial_number) { - aspect->stream_state.serialno = aspect->serial_number = ogg_page_serialno(&aspect->working_page); - aspect->need_serial_number = false; - } - if(ogg_stream_pagein(&aspect->stream_state, &aspect->working_page) == 0) { - aspect->have_working_page = true; - aspect->have_working_packet = false; - } - /* else do nothing, could be a page from another stream */ - } - else if (ret == 0) { - /* need more data */ - const size_t ogg_bytes_to_read = max(bytes_requested - *bytes, OGG_BYTES_CHUNK); - char *oggbuf = ogg_sync_buffer(&aspect->sync_state, ogg_bytes_to_read); - - if(0 == oggbuf) { - return FLAC__OGG_DECODER_ASPECT_READ_STATUS_MEMORY_ALLOCATION_ERROR; - } - else { - size_t ogg_bytes_read = ogg_bytes_to_read; - - switch(read_callback(decoder, (FLAC__byte*)oggbuf, &ogg_bytes_read, client_data)) { - case FLAC__OGG_DECODER_ASPECT_READ_STATUS_OK: - break; - case FLAC__OGG_DECODER_ASPECT_READ_STATUS_END_OF_STREAM: - aspect->end_of_stream = true; - break; - case FLAC__OGG_DECODER_ASPECT_READ_STATUS_ABORT: - return FLAC__OGG_DECODER_ASPECT_READ_STATUS_ABORT; - default: - FLAC__ASSERT(0); - } - - if(ogg_sync_wrote(&aspect->sync_state, ogg_bytes_read) < 0) { - /* double protection; this will happen if the read callback returns more bytes than the max requested, which would overflow Ogg's internal buffer */ - FLAC__ASSERT(0); - return FLAC__OGG_DECODER_ASPECT_READ_STATUS_ERROR; - } - } - } - else { /* ret < 0 */ - /* lost sync, bail out */ - return FLAC__OGG_DECODER_ASPECT_READ_STATUS_LOST_SYNC; - } - } - } - - if (aspect->end_of_stream && *bytes == 0) { - return FLAC__OGG_DECODER_ASPECT_READ_STATUS_END_OF_STREAM; - } - - return FLAC__OGG_DECODER_ASPECT_READ_STATUS_OK; -} diff --git a/3rdparty/libflac/src/libFLAC/ogg_encoder_aspect.c b/3rdparty/libflac/src/libFLAC/ogg_encoder_aspect.c deleted file mode 100644 index a9928c3d6e1..00000000000 --- a/3rdparty/libflac/src/libFLAC/ogg_encoder_aspect.c +++ /dev/null @@ -1,227 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <string.h> /* for memset() */ -#include "FLAC/assert.h" -#include "private/ogg_encoder_aspect.h" -#include "private/ogg_mapping.h" - -static const FLAC__byte FLAC__OGG_MAPPING_VERSION_MAJOR = 1; -static const FLAC__byte FLAC__OGG_MAPPING_VERSION_MINOR = 0; - -/*********************************************************************** - * - * Public class methods - * - ***********************************************************************/ - -FLAC__bool FLAC__ogg_encoder_aspect_init(FLAC__OggEncoderAspect *aspect) -{ - /* we will determine the serial number later if necessary */ - if(ogg_stream_init(&aspect->stream_state, aspect->serial_number) != 0) - return false; - - aspect->seen_magic = false; - aspect->is_first_packet = true; - aspect->samples_written = 0; - - return true; -} - -void FLAC__ogg_encoder_aspect_finish(FLAC__OggEncoderAspect *aspect) -{ - (void)ogg_stream_clear(&aspect->stream_state); - /*@@@ what about the page? */ -} - -void FLAC__ogg_encoder_aspect_set_serial_number(FLAC__OggEncoderAspect *aspect, long value) -{ - aspect->serial_number = value; -} - -FLAC__bool FLAC__ogg_encoder_aspect_set_num_metadata(FLAC__OggEncoderAspect *aspect, unsigned value) -{ - if(value < (1u << FLAC__OGG_MAPPING_NUM_HEADERS_LEN)) { - aspect->num_metadata = value; - return true; - } - else - return false; -} - -void FLAC__ogg_encoder_aspect_set_defaults(FLAC__OggEncoderAspect *aspect) -{ - aspect->serial_number = 0; - aspect->num_metadata = 0; -} - -/* - * The basic FLAC -> Ogg mapping goes like this: - * - * - 'fLaC' magic and STREAMINFO block get combined into the first - * packet. The packet is prefixed with - * + the one-byte packet type 0x7F - * + 'FLAC' magic - * + the 2 byte Ogg FLAC mapping version number - * + tne 2 byte big-endian # of header packets - * - The first packet is flushed to the first page. - * - Each subsequent metadata block goes into its own packet. - * - Each metadata packet is flushed to page (this is not required, - * the mapping only requires that a flush must occur after all - * metadata is written). - * - Each subsequent FLAC audio frame goes into its own packet. - * - * WATCHOUT: - * This depends on the behavior of FLAC__StreamEncoder that we get a - * separate write callback for the fLaC magic, and then separate write - * callbacks for each metadata block and audio frame. - */ -FLAC__StreamEncoderWriteStatus FLAC__ogg_encoder_aspect_write_callback_wrapper(FLAC__OggEncoderAspect *aspect, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, FLAC__bool is_last_block, FLAC__OggEncoderAspectWriteCallbackProxy write_callback, void *encoder, void *client_data) -{ - /* WATCHOUT: - * This depends on the behavior of FLAC__StreamEncoder that 'samples' - * will be 0 for metadata writes. - */ - const FLAC__bool is_metadata = (samples == 0); - - /* - * Treat fLaC magic packet specially. We will note when we see it, then - * wait until we get the STREAMINFO and prepend it in that packet - */ - if(aspect->seen_magic) { - ogg_packet packet; - FLAC__byte synthetic_first_packet_body[ - FLAC__OGG_MAPPING_PACKET_TYPE_LENGTH + - FLAC__OGG_MAPPING_MAGIC_LENGTH + - FLAC__OGG_MAPPING_VERSION_MAJOR_LENGTH + - FLAC__OGG_MAPPING_VERSION_MINOR_LENGTH + - FLAC__OGG_MAPPING_NUM_HEADERS_LENGTH + - FLAC__STREAM_SYNC_LENGTH + - FLAC__STREAM_METADATA_HEADER_LENGTH + - FLAC__STREAM_METADATA_STREAMINFO_LENGTH - ]; - - memset(&packet, 0, sizeof(packet)); - packet.granulepos = aspect->samples_written + samples; - - if(aspect->is_first_packet) { - FLAC__byte *b = synthetic_first_packet_body; - if(bytes != FLAC__STREAM_METADATA_HEADER_LENGTH + FLAC__STREAM_METADATA_STREAMINFO_LENGTH) { - /* - * If we get here, our assumption about the way write callbacks happen - * (explained above) is wrong - */ - FLAC__ASSERT(0); - return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR; - } - /* add first header packet type */ - *b = FLAC__OGG_MAPPING_FIRST_HEADER_PACKET_TYPE; - b += FLAC__OGG_MAPPING_PACKET_TYPE_LENGTH; - /* add 'FLAC' mapping magic */ - memcpy(b, FLAC__OGG_MAPPING_MAGIC, FLAC__OGG_MAPPING_MAGIC_LENGTH); - b += FLAC__OGG_MAPPING_MAGIC_LENGTH; - /* add Ogg FLAC mapping major version number */ - memcpy(b, &FLAC__OGG_MAPPING_VERSION_MAJOR, FLAC__OGG_MAPPING_VERSION_MAJOR_LENGTH); - b += FLAC__OGG_MAPPING_VERSION_MAJOR_LENGTH; - /* add Ogg FLAC mapping minor version number */ - memcpy(b, &FLAC__OGG_MAPPING_VERSION_MINOR, FLAC__OGG_MAPPING_VERSION_MINOR_LENGTH); - b += FLAC__OGG_MAPPING_VERSION_MINOR_LENGTH; - /* add number of header packets */ - *b = (FLAC__byte)(aspect->num_metadata >> 8); - b++; - *b = (FLAC__byte)(aspect->num_metadata); - b++; - /* add native FLAC 'fLaC' magic */ - memcpy(b, FLAC__STREAM_SYNC_STRING, FLAC__STREAM_SYNC_LENGTH); - b += FLAC__STREAM_SYNC_LENGTH; - /* add STREAMINFO */ - memcpy(b, buffer, bytes); - FLAC__ASSERT(b + bytes - synthetic_first_packet_body == sizeof(synthetic_first_packet_body)); - packet.packet = (unsigned char *)synthetic_first_packet_body; - packet.bytes = sizeof(synthetic_first_packet_body); - - packet.b_o_s = 1; - aspect->is_first_packet = false; - } - else { - packet.packet = (unsigned char *)buffer; - packet.bytes = bytes; - } - - if(is_last_block) { - /* we used to check: - * FLAC__ASSERT(total_samples_estimate == 0 || total_samples_estimate == aspect->samples_written + samples); - * but it's really not useful since total_samples_estimate is an estimate and can be inexact - */ - packet.e_o_s = 1; - } - - if(ogg_stream_packetin(&aspect->stream_state, &packet) != 0) - return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR; - - /*@@@ can't figure out a way to pass a useful number for 'samples' to the write_callback, so we'll just pass 0 */ - if(is_metadata) { - while(ogg_stream_flush(&aspect->stream_state, &aspect->page) != 0) { - if(write_callback(encoder, aspect->page.header, aspect->page.header_len, 0, current_frame, client_data) != FLAC__STREAM_ENCODER_WRITE_STATUS_OK) - return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR; - if(write_callback(encoder, aspect->page.body, aspect->page.body_len, 0, current_frame, client_data) != FLAC__STREAM_ENCODER_WRITE_STATUS_OK) - return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR; - } - } - else { - while(ogg_stream_pageout(&aspect->stream_state, &aspect->page) != 0) { - if(write_callback(encoder, aspect->page.header, aspect->page.header_len, 0, current_frame, client_data) != FLAC__STREAM_ENCODER_WRITE_STATUS_OK) - return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR; - if(write_callback(encoder, aspect->page.body, aspect->page.body_len, 0, current_frame, client_data) != FLAC__STREAM_ENCODER_WRITE_STATUS_OK) - return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR; - } - } - } - else if(is_metadata && current_frame == 0 && samples == 0 && bytes == 4 && 0 == memcmp(buffer, FLAC__STREAM_SYNC_STRING, sizeof(FLAC__STREAM_SYNC_STRING))) { - aspect->seen_magic = true; - } - else { - /* - * If we get here, our assumption about the way write callbacks happen - * explained above is wrong - */ - FLAC__ASSERT(0); - return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR; - } - - aspect->samples_written += samples; - - return FLAC__STREAM_ENCODER_WRITE_STATUS_OK; -} diff --git a/3rdparty/libflac/src/libFLAC/ogg_helper.c b/3rdparty/libflac/src/libFLAC/ogg_helper.c deleted file mode 100644 index f406777e047..00000000000 --- a/3rdparty/libflac/src/libFLAC/ogg_helper.c +++ /dev/null @@ -1,209 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec - * Copyright (C) 2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdlib.h> /* for malloc() */ -#include <string.h> /* for memcmp(), memcpy() */ -#include "FLAC/assert.h" -#include "share/alloc.h" -#include "private/ogg_helper.h" -#include "protected/stream_encoder.h" - - -static FLAC__bool full_read_(FLAC__StreamEncoder *encoder, FLAC__byte *buffer, size_t bytes, FLAC__StreamEncoderReadCallback read_callback, void *client_data) -{ - while(bytes > 0) { - size_t bytes_read = bytes; - switch(read_callback(encoder, buffer, &bytes_read, client_data)) { - case FLAC__STREAM_ENCODER_READ_STATUS_CONTINUE: - bytes -= bytes_read; - buffer += bytes_read; - break; - case FLAC__STREAM_ENCODER_READ_STATUS_END_OF_STREAM: - if(bytes_read == 0) { - encoder->protected_->state = FLAC__STREAM_ENCODER_OGG_ERROR; - return false; - } - bytes -= bytes_read; - buffer += bytes_read; - break; - case FLAC__STREAM_ENCODER_READ_STATUS_ABORT: - encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; - return false; - case FLAC__STREAM_ENCODER_READ_STATUS_UNSUPPORTED: - return false; - default: - /* double protection: */ - FLAC__ASSERT(0); - encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; - return false; - } - } - - return true; -} - -void simple_ogg_page__init(ogg_page *page) -{ - page->header = 0; - page->header_len = 0; - page->body = 0; - page->body_len = 0; -} - -void simple_ogg_page__clear(ogg_page *page) -{ - if(page->header) - free(page->header); - if(page->body) - free(page->body); - simple_ogg_page__init(page); -} - -FLAC__bool simple_ogg_page__get_at(FLAC__StreamEncoder *encoder, FLAC__uint64 position, ogg_page *page, FLAC__StreamEncoderSeekCallback seek_callback, FLAC__StreamEncoderReadCallback read_callback, void *client_data) -{ - static const unsigned OGG_HEADER_FIXED_PORTION_LEN = 27; - static const unsigned OGG_MAX_HEADER_LEN = 27/*OGG_HEADER_FIXED_PORTION_LEN*/ + 255; - FLAC__byte crc[4]; - FLAC__StreamEncoderSeekStatus seek_status; - - FLAC__ASSERT(page->header == 0); - FLAC__ASSERT(page->header_len == 0); - FLAC__ASSERT(page->body == 0); - FLAC__ASSERT(page->body_len == 0); - - /* move the stream pointer to the supposed beginning of the page */ - if(0 == seek_callback) - return false; - if((seek_status = seek_callback((FLAC__StreamEncoder*)encoder, position, client_data)) != FLAC__STREAM_ENCODER_SEEK_STATUS_OK) { - if(seek_status == FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR) - encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; - return false; - } - - /* allocate space for the page header */ - if(0 == (page->header = (unsigned char *)safe_malloc_(OGG_MAX_HEADER_LEN))) { - encoder->protected_->state = FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR; - return false; - } - - /* read in the fixed part of the page header (up to but not including - * the segment table */ - if(!full_read_(encoder, page->header, OGG_HEADER_FIXED_PORTION_LEN, read_callback, client_data)) - return false; - - page->header_len = OGG_HEADER_FIXED_PORTION_LEN + page->header[26]; - - /* check to see if it's a correct, "simple" page (one packet only) */ - if( - memcmp(page->header, "OggS", 4) || /* doesn't start with OggS */ - (page->header[5] & 0x01) || /* continued packet */ - memcmp(page->header+6, "\0\0\0\0\0\0\0\0", 8) || /* granulepos is non-zero */ - page->header[26] == 0 /* packet is 0-size */ - ) { - encoder->protected_->state = FLAC__STREAM_ENCODER_OGG_ERROR; - return false; - } - - /* read in the segment table */ - if(!full_read_(encoder, page->header + OGG_HEADER_FIXED_PORTION_LEN, page->header[26], read_callback, client_data)) - return false; - - { - unsigned i; - - /* check to see that it specifies a single packet */ - for(i = 0; i < (unsigned)page->header[26] - 1; i++) { - if(page->header[i + OGG_HEADER_FIXED_PORTION_LEN] != 255) { - encoder->protected_->state = FLAC__STREAM_ENCODER_OGG_ERROR; - return false; - } - } - - page->body_len = 255 * i + page->header[i + OGG_HEADER_FIXED_PORTION_LEN]; - } - - /* allocate space for the page body */ - if(0 == (page->body = (unsigned char *)safe_malloc_(page->body_len))) { - encoder->protected_->state = FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR; - return false; - } - - /* read in the page body */ - if(!full_read_(encoder, page->body, page->body_len, read_callback, client_data)) - return false; - - /* check the CRC */ - memcpy(crc, page->header+22, 4); - ogg_page_checksum_set(page); - if(memcmp(crc, page->header+22, 4)) { - encoder->protected_->state = FLAC__STREAM_ENCODER_OGG_ERROR; - return false; - } - - return true; -} - -FLAC__bool simple_ogg_page__set_at(FLAC__StreamEncoder *encoder, FLAC__uint64 position, ogg_page *page, FLAC__StreamEncoderSeekCallback seek_callback, FLAC__StreamEncoderWriteCallback write_callback, void *client_data) -{ - FLAC__StreamEncoderSeekStatus seek_status; - - FLAC__ASSERT(page->header != 0); - FLAC__ASSERT(page->header_len != 0); - FLAC__ASSERT(page->body != 0); - FLAC__ASSERT(page->body_len != 0); - - /* move the stream pointer to the supposed beginning of the page */ - if(0 == seek_callback) - return false; - if((seek_status = seek_callback((FLAC__StreamEncoder*)encoder, position, client_data)) != FLAC__STREAM_ENCODER_SEEK_STATUS_OK) { - if(seek_status == FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR) - encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; - return false; - } - - ogg_page_checksum_set(page); - - /* re-write the page */ - if(write_callback((FLAC__StreamEncoder*)encoder, page->header, page->header_len, 0, 0, client_data) != FLAC__STREAM_ENCODER_WRITE_STATUS_OK) { - encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; - return false; - } - if(write_callback((FLAC__StreamEncoder*)encoder, page->body, page->body_len, 0, 0, client_data) != FLAC__STREAM_ENCODER_WRITE_STATUS_OK) { - encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; - return false; - } - - return true; -} diff --git a/3rdparty/libflac/src/libFLAC/ogg_mapping.c b/3rdparty/libflac/src/libFLAC/ogg_mapping.c deleted file mode 100644 index cd87197cb17..00000000000 --- a/3rdparty/libflac/src/libFLAC/ogg_mapping.c +++ /dev/null @@ -1,47 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec - * Copyright (C) 2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include "private/ogg_mapping.h" - -const unsigned FLAC__OGG_MAPPING_PACKET_TYPE_LEN = 8; /* bits */ - -const FLAC__byte FLAC__OGG_MAPPING_FIRST_HEADER_PACKET_TYPE = 0x7f; - -const FLAC__byte * const FLAC__OGG_MAPPING_MAGIC = (const FLAC__byte * const)"FLAC"; - -const unsigned FLAC__OGG_MAPPING_VERSION_MAJOR_LEN = 8; /* bits */ -const unsigned FLAC__OGG_MAPPING_VERSION_MINOR_LEN = 8; /* bits */ - -const unsigned FLAC__OGG_MAPPING_NUM_HEADERS_LEN = 16; /* bits */ diff --git a/3rdparty/libflac/src/libFLAC/ppc/Makefile.am b/3rdparty/libflac/src/libFLAC/ppc/Makefile.am deleted file mode 100644 index 87cd95c63fb..00000000000 --- a/3rdparty/libflac/src/libFLAC/ppc/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -# libFLAC - Free Lossless Audio Codec library -# Copyright (C) 2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -SUBDIRS = as gas diff --git a/3rdparty/libflac/src/libFLAC/ppc/Makefile.in b/3rdparty/libflac/src/libFLAC/ppc/Makefile.in deleted file mode 100644 index 308a21b04cd..00000000000 --- a/3rdparty/libflac/src/libFLAC/ppc/Makefile.in +++ /dev/null @@ -1,533 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# libFLAC - Free Lossless Audio Codec library -# Copyright (C) 2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -SUBDIRS = as gas -subdir = src/libFLAC/ppc -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = - -RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ - ps-recursive install-info-recursive uninstall-info-recursive \ - all-recursive install-data-recursive install-exec-recursive \ - installdirs-recursive install-recursive uninstall-recursive \ - check-recursive installcheck-recursive -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -DIST_SUBDIRS = $(SUBDIRS) -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/libFLAC/ppc/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if (etags --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - else \ - include_option=--include; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: - -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags - -dvi: dvi-recursive - -dvi-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ - clean-generic clean-libtool clean-recursive ctags \ - ctags-recursive distclean distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am \ - dvi-recursive info info-am info-recursive install install-am \ - install-data install-data-am install-data-recursive \ - install-exec install-exec-am install-exec-recursive \ - install-info install-info-am install-info-recursive install-man \ - install-recursive install-strip installcheck installcheck-am \ - installdirs installdirs-am installdirs-recursive \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-libtool mostlyclean-recursive pdf pdf-am \ - pdf-recursive ps ps-am ps-recursive tags tags-recursive \ - uninstall uninstall-am uninstall-info-am \ - uninstall-info-recursive uninstall-recursive - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/libFLAC/ppc/as/Makefile.am b/3rdparty/libflac/src/libFLAC/ppc/as/Makefile.am deleted file mode 100644 index 919938bb423..00000000000 --- a/3rdparty/libflac/src/libFLAC/ppc/as/Makefile.am +++ /dev/null @@ -1,52 +0,0 @@ -# libFLAC - Free Lossless Audio Codec library -# Copyright (C) 2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#@@@ -if FLaC__HAS_AS__TEMPORARILY_DISABLED - -SUFFIXES = .s .lo - -STRIP_NON_ASM = sh $(top_srcdir)/strip_non_asm_libtool_args.sh - -# For some unknown reason libtool can't figure out the tag for 'as', so -# we fake it with --tag=CC and strip out unwanted options. -.s.lo: - $(LIBTOOL) --tag=CC --mode=compile $(STRIP_NON_ASM) as -force_cpusubtype_ALL -o $@ $< - -noinst_LTLIBRARIES = libFLAC-asm.la -libFLAC_asm_la_SOURCES = \ - lpc_asm.s - -else - -EXTRA_DIST = \ - lpc_asm.s - -endif diff --git a/3rdparty/libflac/src/libFLAC/ppc/as/Makefile.in b/3rdparty/libflac/src/libFLAC/ppc/as/Makefile.in deleted file mode 100644 index 1565e461af5..00000000000 --- a/3rdparty/libflac/src/libFLAC/ppc/as/Makefile.in +++ /dev/null @@ -1,503 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# libFLAC - Free Lossless Audio Codec library -# Copyright (C) 2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - - -#@@@ -@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@SUFFIXES = .s .lo - -@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@STRIP_NON_ASM = sh $(top_srcdir)/strip_non_asm_libtool_args.sh - -@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@noinst_LTLIBRARIES = libFLAC-asm.la -@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@libFLAC_asm_la_SOURCES = \ -@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ lpc_asm.s - - -@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@EXTRA_DIST = \ -@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ lpc_asm.s - -subdir = src/libFLAC/ppc/as -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) - -libFLAC_asm_la_LDFLAGS = -libFLAC_asm_la_LIBADD = -am__libFLAC_asm_la_SOURCES_DIST = lpc_asm.s -@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@am_libFLAC_asm_la_OBJECTS = \ -@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ lpc_asm.lo -libFLAC_asm_la_OBJECTS = $(am_libFLAC_asm_la_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS) -LTCCASCOMPILE = $(LIBTOOL) --mode=compile $(CCAS) $(AM_CCASFLAGS) \ - $(CCASFLAGS) -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(am__libFLAC_asm_la_SOURCES_DIST) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(libFLAC_asm_la_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .lo .o .obj .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/libFLAC/ppc/as/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" = "$$p" && dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libFLAC-asm.la: $(libFLAC_asm_la_OBJECTS) $(libFLAC_asm_la_DEPENDENCIES) - $(LINK) $(libFLAC_asm_la_LDFLAGS) $(libFLAC_asm_la_OBJECTS) $(libFLAC_asm_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -.s.o: - $(CCASCOMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.s.obj: - $(CCASCOMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -@FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@.s.lo: - $(LTCCASCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am - - -# For some unknown reason libtool can't figure out the tag for 'as', so -# we fake it with --tag=CC and strip out unwanted options. -@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@.s.lo: -@FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ $(LIBTOOL) --tag=CC --mode=compile $(STRIP_NON_ASM) as -force_cpusubtype_ALL -o $@ $< -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/libFLAC/ppc/as/lpc_asm.s b/3rdparty/libflac/src/libFLAC/ppc/as/lpc_asm.s deleted file mode 100644 index ca39c6ffeea..00000000000 --- a/3rdparty/libflac/src/libFLAC/ppc/as/lpc_asm.s +++ /dev/null @@ -1,429 +0,0 @@ -; libFLAC - Free Lossless Audio Codec library -; Copyright (C) 2004,2005,2006,2007 Josh Coalson -; -; Redistribution and use in source and binary forms, with or without -; modification, are permitted provided that the following conditions -; are met: -; -; - Redistributions of source code must retain the above copyright -; notice, this list of conditions and the following disclaimer. -; -; - Redistributions in binary form must reproduce the above copyright -; notice, this list of conditions and the following disclaimer in the -; documentation and/or other materials provided with the distribution. -; -; - Neither the name of the Xiph.org Foundation nor the names of its -; contributors may be used to endorse or promote products derived from -; this software without specific prior written permission. -; -; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -; ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -.text - .align 2 -.globl _FLAC__lpc_restore_signal_asm_ppc_altivec_16 - -.globl _FLAC__lpc_restore_signal_asm_ppc_altivec_16_order8 - -_FLAC__lpc_restore_signal_asm_ppc_altivec_16: -; r3: residual[] -; r4: data_len -; r5: qlp_coeff[] -; r6: order -; r7: lp_quantization -; r8: data[] - -; see src/libFLAC/lpc.c:FLAC__lpc_restore_signal() -; these is a PowerPC/Altivec assembly version which requires bps<=16 (or actual -; bps<=15 for mid-side coding, since that uses an extra bit) - -; these should be fast; the inner loop is unrolled (it takes no more than -; 3*(order%4) instructions, all of which are arithmetic), and all of the -; coefficients and all relevant history stay in registers, so the outer loop -; has only one load from memory (the residual) - -; I have not yet run this through simg4, so there may be some avoidable stalls, -; and there may be a somewhat more clever way to do the outer loop - -; the branch mechanism may prevent dynamic loading; I still need to examine -; this issue, and there may be a more elegant method - - stmw r31,-4(r1) - - addi r9,r1,-28 - li r31,0xf - andc r9,r9,r31 ; for quadword-aligned stack data - - slwi r6,r6,2 ; adjust for word size - slwi r4,r4,2 - add r4,r4,r8 ; r4 = data+data_len - - mfspr r0,256 ; cache old vrsave - addis r31,0,hi16(0xfffffc00) - ori r31,r31,lo16(0xfffffc00) - mtspr 256,r31 ; declare VRs in vrsave - - cmplw cr0,r8,r4 ; i<data_len - bc 4,0,L1400 - - ; load coefficients into v0-v7 and initial history into v8-v15 - li r31,0xf - and r31,r8,r31 ; r31: data%4 - li r11,16 - subf r31,r31,r11 ; r31: 4-(data%4) - slwi r31,r31,3 ; convert to bits for vsro - li r10,-4 - stw r31,-4(r9) - lvewx v0,r10,r9 - vspltisb v18,-1 - vsro v18,v18,v0 ; v18: mask vector - - li r31,0x8 - lvsl v0,0,r31 - vsldoi v0,v0,v0,12 - li r31,0xc - lvsl v1,0,r31 - vspltisb v2,0 - vspltisb v3,-1 - vmrglw v2,v2,v3 - vsel v0,v1,v0,v2 ; v0: reversal permutation vector - - add r10,r5,r6 - lvsl v17,0,r5 ; v17: coefficient alignment permutation vector - vperm v17,v17,v17,v0 ; v17: reversal coefficient alignment permutation vector - - mr r11,r8 - lvsl v16,0,r11 ; v16: history alignment permutation vector - - lvx v0,0,r5 - addi r5,r5,16 - lvx v1,0,r5 - vperm v0,v0,v1,v17 - lvx v8,0,r11 - addi r11,r11,-16 - lvx v9,0,r11 - vperm v8,v9,v8,v16 - cmplw cr0,r5,r10 - bc 12,0,L1101 - vand v0,v0,v18 - addis r31,0,hi16(L1307) - ori r31,r31,lo16(L1307) - b L1199 - -L1101: - addi r5,r5,16 - lvx v2,0,r5 - vperm v1,v1,v2,v17 - addi r11,r11,-16 - lvx v10,0,r11 - vperm v9,v10,v9,v16 - cmplw cr0,r5,r10 - bc 12,0,L1102 - vand v1,v1,v18 - addis r31,0,hi16(L1306) - ori r31,r31,lo16(L1306) - b L1199 - -L1102: - addi r5,r5,16 - lvx v3,0,r5 - vperm v2,v2,v3,v17 - addi r11,r11,-16 - lvx v11,0,r11 - vperm v10,v11,v10,v16 - cmplw cr0,r5,r10 - bc 12,0,L1103 - vand v2,v2,v18 - addis r31,0,hi16(L1305) - ori r31,r31,lo16(L1305) - b L1199 - -L1103: - addi r5,r5,16 - lvx v4,0,r5 - vperm v3,v3,v4,v17 - addi r11,r11,-16 - lvx v12,0,r11 - vperm v11,v12,v11,v16 - cmplw cr0,r5,r10 - bc 12,0,L1104 - vand v3,v3,v18 - addis r31,0,hi16(L1304) - ori r31,r31,lo16(L1304) - b L1199 - -L1104: - addi r5,r5,16 - lvx v5,0,r5 - vperm v4,v4,v5,v17 - addi r11,r11,-16 - lvx v13,0,r11 - vperm v12,v13,v12,v16 - cmplw cr0,r5,r10 - bc 12,0,L1105 - vand v4,v4,v18 - addis r31,0,hi16(L1303) - ori r31,r31,lo16(L1303) - b L1199 - -L1105: - addi r5,r5,16 - lvx v6,0,r5 - vperm v5,v5,v6,v17 - addi r11,r11,-16 - lvx v14,0,r11 - vperm v13,v14,v13,v16 - cmplw cr0,r5,r10 - bc 12,0,L1106 - vand v5,v5,v18 - addis r31,0,hi16(L1302) - ori r31,r31,lo16(L1302) - b L1199 - -L1106: - addi r5,r5,16 - lvx v7,0,r5 - vperm v6,v6,v7,v17 - addi r11,r11,-16 - lvx v15,0,r11 - vperm v14,v15,v14,v16 - cmplw cr0,r5,r10 - bc 12,0,L1107 - vand v6,v6,v18 - addis r31,0,hi16(L1301) - ori r31,r31,lo16(L1301) - b L1199 - -L1107: - addi r5,r5,16 - lvx v19,0,r5 - vperm v7,v7,v19,v17 - addi r11,r11,-16 - lvx v19,0,r11 - vperm v15,v19,v15,v16 - vand v7,v7,v18 - addis r31,0,hi16(L1300) - ori r31,r31,lo16(L1300) - -L1199: - mtctr r31 - - ; set up invariant vectors - vspltish v16,0 ; v16: zero vector - - li r10,-12 - lvsr v17,r10,r8 ; v17: result shift vector - lvsl v18,r10,r3 ; v18: residual shift back vector - - li r10,-4 - stw r7,-4(r9) - lvewx v19,r10,r9 ; v19: lp_quantization vector - -L1200: - vmulosh v20,v0,v8 ; v20: sum vector - bcctr 20,0 - -L1300: - vmulosh v21,v7,v15 - vsldoi v15,v15,v14,4 ; increment history - vaddsws v20,v20,v21 - -L1301: - vmulosh v21,v6,v14 - vsldoi v14,v14,v13,4 - vaddsws v20,v20,v21 - -L1302: - vmulosh v21,v5,v13 - vsldoi v13,v13,v12,4 - vaddsws v20,v20,v21 - -L1303: - vmulosh v21,v4,v12 - vsldoi v12,v12,v11,4 - vaddsws v20,v20,v21 - -L1304: - vmulosh v21,v3,v11 - vsldoi v11,v11,v10,4 - vaddsws v20,v20,v21 - -L1305: - vmulosh v21,v2,v10 - vsldoi v10,v10,v9,4 - vaddsws v20,v20,v21 - -L1306: - vmulosh v21,v1,v9 - vsldoi v9,v9,v8,4 - vaddsws v20,v20,v21 - -L1307: - vsumsws v20,v20,v16 ; v20[3]: sum - vsraw v20,v20,v19 ; v20[3]: sum >> lp_quantization - - lvewx v21,0,r3 ; v21[n]: *residual - vperm v21,v21,v21,v18 ; v21[3]: *residual - vaddsws v20,v21,v20 ; v20[3]: *residual + (sum >> lp_quantization) - vsldoi v18,v18,v18,4 ; increment shift vector - - vperm v21,v20,v20,v17 ; v21[n]: shift for storage - vsldoi v17,v17,v17,12 ; increment shift vector - stvewx v21,0,r8 - - vsldoi v20,v20,v20,12 - vsldoi v8,v8,v20,4 ; insert value onto history - - addi r3,r3,4 - addi r8,r8,4 - cmplw cr0,r8,r4 ; i<data_len - bc 12,0,L1200 - -L1400: - mtspr 256,r0 ; restore old vrsave - lmw r31,-4(r1) - blr - -_FLAC__lpc_restore_signal_asm_ppc_altivec_16_order8: -; r3: residual[] -; r4: data_len -; r5: qlp_coeff[] -; r6: order -; r7: lp_quantization -; r8: data[] - -; see _FLAC__lpc_restore_signal_asm_ppc_altivec_16() above -; this version assumes order<=8; it uses fewer vector registers, which should -; save time in context switches, and has less code, which may improve -; instruction caching - - stmw r31,-4(r1) - - addi r9,r1,-28 - li r31,0xf - andc r9,r9,r31 ; for quadword-aligned stack data - - slwi r6,r6,2 ; adjust for word size - slwi r4,r4,2 - add r4,r4,r8 ; r4 = data+data_len - - mfspr r0,256 ; cache old vrsave - addis r31,0,hi16(0xffc00000) - ori r31,r31,lo16(0xffc00000) - mtspr 256,r31 ; declare VRs in vrsave - - cmplw cr0,r8,r4 ; i<data_len - bc 4,0,L2400 - - ; load coefficients into v0-v1 and initial history into v2-v3 - li r31,0xf - and r31,r8,r31 ; r31: data%4 - li r11,16 - subf r31,r31,r11 ; r31: 4-(data%4) - slwi r31,r31,3 ; convert to bits for vsro - li r10,-4 - stw r31,-4(r9) - lvewx v0,r10,r9 - vspltisb v6,-1 - vsro v6,v6,v0 ; v6: mask vector - - li r31,0x8 - lvsl v0,0,r31 - vsldoi v0,v0,v0,12 - li r31,0xc - lvsl v1,0,r31 - vspltisb v2,0 - vspltisb v3,-1 - vmrglw v2,v2,v3 - vsel v0,v1,v0,v2 ; v0: reversal permutation vector - - add r10,r5,r6 - lvsl v5,0,r5 ; v5: coefficient alignment permutation vector - vperm v5,v5,v5,v0 ; v5: reversal coefficient alignment permutation vector - - mr r11,r8 - lvsl v4,0,r11 ; v4: history alignment permutation vector - - lvx v0,0,r5 - addi r5,r5,16 - lvx v1,0,r5 - vperm v0,v0,v1,v5 - lvx v2,0,r11 - addi r11,r11,-16 - lvx v3,0,r11 - vperm v2,v3,v2,v4 - cmplw cr0,r5,r10 - bc 12,0,L2101 - vand v0,v0,v6 - addis r31,0,hi16(L2301) - ori r31,r31,lo16(L2301) - b L2199 - -L2101: - addi r5,r5,16 - lvx v7,0,r5 - vperm v1,v1,v7,v5 - addi r11,r11,-16 - lvx v7,0,r11 - vperm v3,v7,v3,v4 - vand v1,v1,v6 - addis r31,0,hi16(L2300) - ori r31,r31,lo16(L2300) - -L2199: - mtctr r31 - - ; set up invariant vectors - vspltish v4,0 ; v4: zero vector - - li r10,-12 - lvsr v5,r10,r8 ; v5: result shift vector - lvsl v6,r10,r3 ; v6: residual shift back vector - - li r10,-4 - stw r7,-4(r9) - lvewx v7,r10,r9 ; v7: lp_quantization vector - -L2200: - vmulosh v8,v0,v2 ; v8: sum vector - bcctr 20,0 - -L2300: - vmulosh v9,v1,v3 - vsldoi v3,v3,v2,4 - vaddsws v8,v8,v9 - -L2301: - vsumsws v8,v8,v4 ; v8[3]: sum - vsraw v8,v8,v7 ; v8[3]: sum >> lp_quantization - - lvewx v9,0,r3 ; v9[n]: *residual - vperm v9,v9,v9,v6 ; v9[3]: *residual - vaddsws v8,v9,v8 ; v8[3]: *residual + (sum >> lp_quantization) - vsldoi v6,v6,v6,4 ; increment shift vector - - vperm v9,v8,v8,v5 ; v9[n]: shift for storage - vsldoi v5,v5,v5,12 ; increment shift vector - stvewx v9,0,r8 - - vsldoi v8,v8,v8,12 - vsldoi v2,v2,v8,4 ; insert value onto history - - addi r3,r3,4 - addi r8,r8,4 - cmplw cr0,r8,r4 ; i<data_len - bc 12,0,L2200 - -L2400: - mtspr 256,r0 ; restore old vrsave - lmw r31,-4(r1) - blr diff --git a/3rdparty/libflac/src/libFLAC/ppc/gas/Makefile.am b/3rdparty/libflac/src/libFLAC/ppc/gas/Makefile.am deleted file mode 100644 index 3a66c27ae46..00000000000 --- a/3rdparty/libflac/src/libFLAC/ppc/gas/Makefile.am +++ /dev/null @@ -1,52 +0,0 @@ -# libFLAC - Free Lossless Audio Codec library -# Copyright (C) 2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#@@@ -if FLaC__HAS_GAS__TEMPORARILY_DISABLED - -SUFFIXES = .s .lo - -STRIP_NON_ASM = sh $(top_srcdir)/strip_non_asm_libtool_args.sh - -# For some unknown reason libtool can't figure out the tag for 'gas', so -# we fake it with --tag=CC and strip out unwanted options. -.s.lo: - $(LIBTOOL) --tag=CC --mode=compile $(STRIP_NON_ASM) gas -force_cpusubtype_ALL -o $@ $< - -noinst_LTLIBRARIES = libFLAC-asm.la -libFLAC_asm_la_SOURCES = \ - lpc_asm.s - -else - -EXTRA_DIST = \ - lpc_asm.s - -endif diff --git a/3rdparty/libflac/src/libFLAC/ppc/gas/Makefile.in b/3rdparty/libflac/src/libFLAC/ppc/gas/Makefile.in deleted file mode 100644 index f4c97bc36d7..00000000000 --- a/3rdparty/libflac/src/libFLAC/ppc/gas/Makefile.in +++ /dev/null @@ -1,503 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# libFLAC - Free Lossless Audio Codec library -# Copyright (C) 2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - - -#@@@ -@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@SUFFIXES = .s .lo - -@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@STRIP_NON_ASM = sh $(top_srcdir)/strip_non_asm_libtool_args.sh - -@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@noinst_LTLIBRARIES = libFLAC-asm.la -@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@libFLAC_asm_la_SOURCES = \ -@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ lpc_asm.s - - -@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@EXTRA_DIST = \ -@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ lpc_asm.s - -subdir = src/libFLAC/ppc/gas -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) - -libFLAC_asm_la_LDFLAGS = -libFLAC_asm_la_LIBADD = -am__libFLAC_asm_la_SOURCES_DIST = lpc_asm.s -@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@am_libFLAC_asm_la_OBJECTS = \ -@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ lpc_asm.lo -libFLAC_asm_la_OBJECTS = $(am_libFLAC_asm_la_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -CCASCOMPILE = $(CCAS) $(AM_CCASFLAGS) $(CCASFLAGS) -LTCCASCOMPILE = $(LIBTOOL) --mode=compile $(CCAS) $(AM_CCASFLAGS) \ - $(CCASFLAGS) -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(am__libFLAC_asm_la_SOURCES_DIST) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(libFLAC_asm_la_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .lo .o .obj .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/libFLAC/ppc/gas/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" = "$$p" && dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libFLAC-asm.la: $(libFLAC_asm_la_OBJECTS) $(libFLAC_asm_la_DEPENDENCIES) - $(LINK) $(libFLAC_asm_la_LDFLAGS) $(libFLAC_asm_la_OBJECTS) $(libFLAC_asm_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -.s.o: - $(CCASCOMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.s.obj: - $(CCASCOMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -@FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@.s.lo: - $(LTCCASCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am - - -# For some unknown reason libtool can't figure out the tag for 'gas', so -# we fake it with --tag=CC and strip out unwanted options. -@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@.s.lo: -@FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ $(LIBTOOL) --tag=CC --mode=compile $(STRIP_NON_ASM) gas -force_cpusubtype_ALL -o $@ $< -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/libFLAC/ppc/gas/lpc_asm.s b/3rdparty/libflac/src/libFLAC/ppc/gas/lpc_asm.s deleted file mode 100644 index 2203570189e..00000000000 --- a/3rdparty/libflac/src/libFLAC/ppc/gas/lpc_asm.s +++ /dev/null @@ -1,431 +0,0 @@ -# libFLAC - Free Lossless Audio Codec library -# Copyright (C) 2004,2005,2006,2007 Josh Coalson -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# - Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# - Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# - Neither the name of the Xiph.org Foundation nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -.text - .align 2 -.globl _FLAC__lpc_restore_signal_asm_ppc_altivec_16 -.type _FLAC__lpc_restore_signal_asm_ppc_altivec_16, @function - -.globl _FLAC__lpc_restore_signal_asm_ppc_altivec_16_order8 -.type _FLAC__lpc_restore_signal_asm_ppc_altivec_16_order8, @function - -_FLAC__lpc_restore_signal_asm_ppc_altivec_16: -# r3: residual[] -# r4: data_len -# r5: qlp_coeff[] -# r6: order -# r7: lp_quantization -# r8: data[] - -# see src/libFLAC/lpc.c:FLAC__lpc_restore_signal() -# these is a PowerPC/Altivec assembly version which requires bps<=16 (or actual -# bps<=15 for mid-side coding, since that uses an extra bit) - -# these should be fast; the inner loop is unrolled (it takes no more than -# 3*(order%4) instructions, all of which are arithmetic), and all of the -# coefficients and all relevant history stay in registers, so the outer loop -# has only one load from memory (the residual) - -# I have not yet run this through simg4, so there may be some avoidable stalls, -# and there may be a somewhat more clever way to do the outer loop - -# the branch mechanism may prevent dynamic loading; I still need to examine -# this issue, and there may be a more elegant method - - stmw r31,-4(r1) - - addi r9,r1,-28 - li r31,0xf - andc r9,r9,r31 # for quadword-aligned stack data - - slwi r6,r6,2 # adjust for word size - slwi r4,r4,2 - add r4,r4,r8 # r4 = data+data_len - - mfspr r0,256 # cache old vrsave - addis r31,0,0xffff - ori r31,r31,0xfc00 - mtspr 256,r31 # declare VRs in vrsave - - cmplw cr0,r8,r4 # i<data_len - bc 4,0,L1400 - - # load coefficients into v0-v7 and initial history into v8-v15 - li r31,0xf - and r31,r8,r31 # r31: data%4 - li r11,16 - subf r31,r31,r11 # r31: 4-(data%4) - slwi r31,r31,3 # convert to bits for vsro - li r10,-4 - stw r31,-4(r9) - lvewx v0,r10,r9 - vspltisb v18,-1 - vsro v18,v18,v0 # v18: mask vector - - li r31,0x8 - lvsl v0,0,r31 - vsldoi v0,v0,v0,12 - li r31,0xc - lvsl v1,0,r31 - vspltisb v2,0 - vspltisb v3,-1 - vmrglw v2,v2,v3 - vsel v0,v1,v0,v2 # v0: reversal permutation vector - - add r10,r5,r6 - lvsl v17,0,r5 # v17: coefficient alignment permutation vector - vperm v17,v17,v17,v0 # v17: reversal coefficient alignment permutation vector - - mr r11,r8 - lvsl v16,0,r11 # v16: history alignment permutation vector - - lvx v0,0,r5 - addi r5,r5,16 - lvx v1,0,r5 - vperm v0,v0,v1,v17 - lvx v8,0,r11 - addi r11,r11,-16 - lvx v9,0,r11 - vperm v8,v9,v8,v16 - cmplw cr0,r5,r10 - bc 12,0,L1101 - vand v0,v0,v18 - addis r31,0,L1307@ha - ori r31,r31,L1307@l - b L1199 - -L1101: - addi r5,r5,16 - lvx v2,0,r5 - vperm v1,v1,v2,v17 - addi r11,r11,-16 - lvx v10,0,r11 - vperm v9,v10,v9,v16 - cmplw cr0,r5,r10 - bc 12,0,L1102 - vand v1,v1,v18 - addis r31,0,L1306@ha - ori r31,r31,L1306@l - b L1199 - -L1102: - addi r5,r5,16 - lvx v3,0,r5 - vperm v2,v2,v3,v17 - addi r11,r11,-16 - lvx v11,0,r11 - vperm v10,v11,v10,v16 - cmplw cr0,r5,r10 - bc 12,0,L1103 - vand v2,v2,v18 - lis r31,L1305@ha - la r31,L1305@l(r31) - b L1199 - -L1103: - addi r5,r5,16 - lvx v4,0,r5 - vperm v3,v3,v4,v17 - addi r11,r11,-16 - lvx v12,0,r11 - vperm v11,v12,v11,v16 - cmplw cr0,r5,r10 - bc 12,0,L1104 - vand v3,v3,v18 - lis r31,L1304@ha - la r31,L1304@l(r31) - b L1199 - -L1104: - addi r5,r5,16 - lvx v5,0,r5 - vperm v4,v4,v5,v17 - addi r11,r11,-16 - lvx v13,0,r11 - vperm v12,v13,v12,v16 - cmplw cr0,r5,r10 - bc 12,0,L1105 - vand v4,v4,v18 - lis r31,L1303@ha - la r31,L1303@l(r31) - b L1199 - -L1105: - addi r5,r5,16 - lvx v6,0,r5 - vperm v5,v5,v6,v17 - addi r11,r11,-16 - lvx v14,0,r11 - vperm v13,v14,v13,v16 - cmplw cr0,r5,r10 - bc 12,0,L1106 - vand v5,v5,v18 - lis r31,L1302@ha - la r31,L1302@l(r31) - b L1199 - -L1106: - addi r5,r5,16 - lvx v7,0,r5 - vperm v6,v6,v7,v17 - addi r11,r11,-16 - lvx v15,0,r11 - vperm v14,v15,v14,v16 - cmplw cr0,r5,r10 - bc 12,0,L1107 - vand v6,v6,v18 - lis r31,L1301@ha - la r31,L1301@l(r31) - b L1199 - -L1107: - addi r5,r5,16 - lvx v19,0,r5 - vperm v7,v7,v19,v17 - addi r11,r11,-16 - lvx v19,0,r11 - vperm v15,v19,v15,v16 - vand v7,v7,v18 - lis r31,L1300@ha - la r31,L1300@l(r31) - -L1199: - mtctr r31 - - # set up invariant vectors - vspltish v16,0 # v16: zero vector - - li r10,-12 - lvsr v17,r10,r8 # v17: result shift vector - lvsl v18,r10,r3 # v18: residual shift back vector - - li r10,-4 - stw r7,-4(r9) - lvewx v19,r10,r9 # v19: lp_quantization vector - -L1200: - vmulosh v20,v0,v8 # v20: sum vector - bcctr 20,0 - -L1300: - vmulosh v21,v7,v15 - vsldoi v15,v15,v14,4 # increment history - vaddsws v20,v20,v21 - -L1301: - vmulosh v21,v6,v14 - vsldoi v14,v14,v13,4 - vaddsws v20,v20,v21 - -L1302: - vmulosh v21,v5,v13 - vsldoi v13,v13,v12,4 - vaddsws v20,v20,v21 - -L1303: - vmulosh v21,v4,v12 - vsldoi v12,v12,v11,4 - vaddsws v20,v20,v21 - -L1304: - vmulosh v21,v3,v11 - vsldoi v11,v11,v10,4 - vaddsws v20,v20,v21 - -L1305: - vmulosh v21,v2,v10 - vsldoi v10,v10,v9,4 - vaddsws v20,v20,v21 - -L1306: - vmulosh v21,v1,v9 - vsldoi v9,v9,v8,4 - vaddsws v20,v20,v21 - -L1307: - vsumsws v20,v20,v16 # v20[3]: sum - vsraw v20,v20,v19 # v20[3]: sum >> lp_quantization - - lvewx v21,0,r3 # v21[n]: *residual - vperm v21,v21,v21,v18 # v21[3]: *residual - vaddsws v20,v21,v20 # v20[3]: *residual + (sum >> lp_quantization) - vsldoi v18,v18,v18,4 # increment shift vector - - vperm v21,v20,v20,v17 # v21[n]: shift for storage - vsldoi v17,v17,v17,12 # increment shift vector - stvewx v21,0,r8 - - vsldoi v20,v20,v20,12 - vsldoi v8,v8,v20,4 # insert value onto history - - addi r3,r3,4 - addi r8,r8,4 - cmplw cr0,r8,r4 # i<data_len - bc 12,0,L1200 - -L1400: - mtspr 256,r0 # restore old vrsave - lmw r31,-4(r1) - blr - -_FLAC__lpc_restore_signal_asm_ppc_altivec_16_order8: -# r3: residual[] -# r4: data_len -# r5: qlp_coeff[] -# r6: order -# r7: lp_quantization -# r8: data[] - -# see _FLAC__lpc_restore_signal_asm_ppc_altivec_16() above -# this version assumes order<=8; it uses fewer vector registers, which should -# save time in context switches, and has less code, which may improve -# instruction caching - - stmw r31,-4(r1) - - addi r9,r1,-28 - li r31,0xf - andc r9,r9,r31 # for quadword-aligned stack data - - slwi r6,r6,2 # adjust for word size - slwi r4,r4,2 - add r4,r4,r8 # r4 = data+data_len - - mfspr r0,256 # cache old vrsave - addis r31,0,0xffc0 - ori r31,r31,0x0000 - mtspr 256,r31 # declare VRs in vrsave - - cmplw cr0,r8,r4 # i<data_len - bc 4,0,L2400 - - # load coefficients into v0-v1 and initial history into v2-v3 - li r31,0xf - and r31,r8,r31 # r31: data%4 - li r11,16 - subf r31,r31,r11 # r31: 4-(data%4) - slwi r31,r31,3 # convert to bits for vsro - li r10,-4 - stw r31,-4(r9) - lvewx v0,r10,r9 - vspltisb v6,-1 - vsro v6,v6,v0 # v6: mask vector - - li r31,0x8 - lvsl v0,0,r31 - vsldoi v0,v0,v0,12 - li r31,0xc - lvsl v1,0,r31 - vspltisb v2,0 - vspltisb v3,-1 - vmrglw v2,v2,v3 - vsel v0,v1,v0,v2 # v0: reversal permutation vector - - add r10,r5,r6 - lvsl v5,0,r5 # v5: coefficient alignment permutation vector - vperm v5,v5,v5,v0 # v5: reversal coefficient alignment permutation vector - - mr r11,r8 - lvsl v4,0,r11 # v4: history alignment permutation vector - - lvx v0,0,r5 - addi r5,r5,16 - lvx v1,0,r5 - vperm v0,v0,v1,v5 - lvx v2,0,r11 - addi r11,r11,-16 - lvx v3,0,r11 - vperm v2,v3,v2,v4 - cmplw cr0,r5,r10 - bc 12,0,L2101 - vand v0,v0,v6 - lis r31,L2301@ha - la r31,L2301@l(r31) - b L2199 - -L2101: - addi r5,r5,16 - lvx v7,0,r5 - vperm v1,v1,v7,v5 - addi r11,r11,-16 - lvx v7,0,r11 - vperm v3,v7,v3,v4 - vand v1,v1,v6 - lis r31,L2300@ha - la r31,L2300@l(r31) - -L2199: - mtctr r31 - - # set up invariant vectors - vspltish v4,0 # v4: zero vector - - li r10,-12 - lvsr v5,r10,r8 # v5: result shift vector - lvsl v6,r10,r3 # v6: residual shift back vector - - li r10,-4 - stw r7,-4(r9) - lvewx v7,r10,r9 # v7: lp_quantization vector - -L2200: - vmulosh v8,v0,v2 # v8: sum vector - bcctr 20,0 - -L2300: - vmulosh v9,v1,v3 - vsldoi v3,v3,v2,4 - vaddsws v8,v8,v9 - -L2301: - vsumsws v8,v8,v4 # v8[3]: sum - vsraw v8,v8,v7 # v8[3]: sum >> lp_quantization - - lvewx v9,0,r3 # v9[n]: *residual - vperm v9,v9,v9,v6 # v9[3]: *residual - vaddsws v8,v9,v8 # v8[3]: *residual + (sum >> lp_quantization) - vsldoi v6,v6,v6,4 # increment shift vector - - vperm v9,v8,v8,v5 # v9[n]: shift for storage - vsldoi v5,v5,v5,12 # increment shift vector - stvewx v9,0,r8 - - vsldoi v8,v8,v8,12 - vsldoi v2,v2,v8,4 # insert value onto history - - addi r3,r3,4 - addi r8,r8,4 - cmplw cr0,r8,r4 # i<data_len - bc 12,0,L2200 - -L2400: - mtspr 256,r0 # restore old vrsave - lmw r31,-4(r1) - blr diff --git a/3rdparty/libflac/src/libFLAC/stream_decoder.c b/3rdparty/libflac/src/libFLAC/stream_decoder.c deleted file mode 100644 index 198d5dcc883..00000000000 --- a/3rdparty/libflac/src/libFLAC/stream_decoder.c +++ /dev/null @@ -1,3390 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#if defined _MSC_VER || defined __MINGW32__ -#include <io.h> /* for _setmode() */ -#include <fcntl.h> /* for _O_BINARY */ -#endif -#if defined __CYGWIN__ || defined __EMX__ -#include <io.h> /* for setmode(), O_BINARY */ -#include <fcntl.h> /* for _O_BINARY */ -#endif -#include <stdio.h> -#include <stdlib.h> /* for malloc() */ -#include <string.h> /* for memset/memcpy() */ -#include <sys/stat.h> /* for stat() */ -#include <sys/types.h> /* for off_t */ -#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__ /* @@@ [2G limit] */ -#ifndef fseeko -#define fseeko fseek -#endif -#ifndef ftello -#define ftello ftell -#endif -#endif -#include "FLAC/assert.h" -#include "share/alloc.h" -#include "protected/stream_decoder.h" -#include "private/bitreader.h" -#include "private/bitmath.h" -#include "private/cpu.h" -#include "private/crc.h" -#include "private/fixed.h" -#include "private/format.h" -#include "private/lpc.h" -#include "private/md5.h" -#include "private/memory.h" - -#ifdef max -#undef max -#endif -#define max(a,b) ((a)>(b)?(a):(b)) - -/* adjust for compilers that can't understand using LLU suffix for uint64_t literals */ -#ifdef _MSC_VER -#define FLAC__U64L(x) x -#else -#define FLAC__U64L(x) x##LLU -#endif - - -/* technically this should be in an "export.c" but this is convenient enough */ -FLAC_API int FLAC_API_SUPPORTS_OGG_FLAC = -#if FLAC__HAS_OGG - 1 -#else - 0 -#endif -; - - -/*********************************************************************** - * - * Private static data - * - ***********************************************************************/ - -static FLAC__byte ID3V2_TAG_[3] = { 'I', 'D', '3' }; - -/*********************************************************************** - * - * Private class method prototypes - * - ***********************************************************************/ - -static void set_defaults_(FLAC__StreamDecoder *decoder); -static FILE *get_binary_stdin_(void); -static FLAC__bool allocate_output_(FLAC__StreamDecoder *decoder, unsigned size, unsigned channels); -static FLAC__bool has_id_filtered_(FLAC__StreamDecoder *decoder, FLAC__byte *id); -static FLAC__bool find_metadata_(FLAC__StreamDecoder *decoder); -static FLAC__bool read_metadata_(FLAC__StreamDecoder *decoder); -static FLAC__bool read_metadata_streaminfo_(FLAC__StreamDecoder *decoder, FLAC__bool is_last, unsigned length); -static FLAC__bool read_metadata_seektable_(FLAC__StreamDecoder *decoder, FLAC__bool is_last, unsigned length); -static FLAC__bool read_metadata_vorbiscomment_(FLAC__StreamDecoder *decoder, FLAC__StreamMetadata_VorbisComment *obj); -static FLAC__bool read_metadata_cuesheet_(FLAC__StreamDecoder *decoder, FLAC__StreamMetadata_CueSheet *obj); -static FLAC__bool read_metadata_picture_(FLAC__StreamDecoder *decoder, FLAC__StreamMetadata_Picture *obj); -static FLAC__bool skip_id3v2_tag_(FLAC__StreamDecoder *decoder); -static FLAC__bool frame_sync_(FLAC__StreamDecoder *decoder); -static FLAC__bool read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame, FLAC__bool do_full_decode); -static FLAC__bool read_frame_header_(FLAC__StreamDecoder *decoder); -static FLAC__bool read_subframe_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, FLAC__bool do_full_decode); -static FLAC__bool read_subframe_constant_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, FLAC__bool do_full_decode); -static FLAC__bool read_subframe_fixed_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, const unsigned order, FLAC__bool do_full_decode); -static FLAC__bool read_subframe_lpc_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, const unsigned order, FLAC__bool do_full_decode); -static FLAC__bool read_subframe_verbatim_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, FLAC__bool do_full_decode); -static FLAC__bool read_residual_partitioned_rice_(FLAC__StreamDecoder *decoder, unsigned predictor_order, unsigned partition_order, FLAC__EntropyCodingMethod_PartitionedRiceContents *partitioned_rice_contents, FLAC__int32 *residual, FLAC__bool is_extended); -static FLAC__bool read_zero_padding_(FLAC__StreamDecoder *decoder); -static FLAC__bool read_callback_(FLAC__byte buffer[], size_t *bytes, void *client_data); -#if FLAC__HAS_OGG -static FLAC__StreamDecoderReadStatus read_callback_ogg_aspect_(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes); -static FLAC__OggDecoderAspectReadStatus read_callback_proxy_(const void *void_decoder, FLAC__byte buffer[], size_t *bytes, void *client_data); -#endif -static FLAC__StreamDecoderWriteStatus write_audio_frame_to_client_(FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[]); -static void send_error_to_client_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status); -static FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 stream_length, FLAC__uint64 target_sample); -#if FLAC__HAS_OGG -static FLAC__bool seek_to_absolute_sample_ogg_(FLAC__StreamDecoder *decoder, FLAC__uint64 stream_length, FLAC__uint64 target_sample); -#endif -static FLAC__StreamDecoderReadStatus file_read_callback_(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data); -static FLAC__StreamDecoderSeekStatus file_seek_callback_(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data); -static FLAC__StreamDecoderTellStatus file_tell_callback_(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data); -static FLAC__StreamDecoderLengthStatus file_length_callback_(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data); -static FLAC__bool file_eof_callback_(const FLAC__StreamDecoder *decoder, void *client_data); - -/*********************************************************************** - * - * Private class data - * - ***********************************************************************/ - -typedef struct FLAC__StreamDecoderPrivate { -#if FLAC__HAS_OGG - FLAC__bool is_ogg; -#endif - FLAC__StreamDecoderReadCallback read_callback; - FLAC__StreamDecoderSeekCallback seek_callback; - FLAC__StreamDecoderTellCallback tell_callback; - FLAC__StreamDecoderLengthCallback length_callback; - FLAC__StreamDecoderEofCallback eof_callback; - FLAC__StreamDecoderWriteCallback write_callback; - FLAC__StreamDecoderMetadataCallback metadata_callback; - FLAC__StreamDecoderErrorCallback error_callback; - /* generic 32-bit datapath: */ - void (*local_lpc_restore_signal)(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); - /* generic 64-bit datapath: */ - void (*local_lpc_restore_signal_64bit)(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); - /* for use when the signal is <= 16 bits-per-sample, or <= 15 bits-per-sample on a side channel (which requires 1 extra bit): */ - void (*local_lpc_restore_signal_16bit)(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); - /* for use when the signal is <= 16 bits-per-sample, or <= 15 bits-per-sample on a side channel (which requires 1 extra bit), AND order <= 8: */ - void (*local_lpc_restore_signal_16bit_order8)(const FLAC__int32 residual[], unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 data[]); - FLAC__bool (*local_bitreader_read_rice_signed_block)(FLAC__BitReader *br, int vals[], unsigned nvals, unsigned parameter); - void *client_data; - FILE *file; /* only used if FLAC__stream_decoder_init_file()/FLAC__stream_decoder_init_file() called, else NULL */ - FLAC__BitReader *input; - FLAC__int32 *output[FLAC__MAX_CHANNELS]; - FLAC__int32 *residual[FLAC__MAX_CHANNELS]; /* WATCHOUT: these are the aligned pointers; the real pointers that should be free()'d are residual_unaligned[] below */ - FLAC__EntropyCodingMethod_PartitionedRiceContents partitioned_rice_contents[FLAC__MAX_CHANNELS]; - unsigned output_capacity, output_channels; - FLAC__uint32 fixed_block_size, next_fixed_block_size; - FLAC__uint64 samples_decoded; - FLAC__bool has_stream_info, has_seek_table; - FLAC__StreamMetadata stream_info; - FLAC__StreamMetadata seek_table; - FLAC__bool metadata_filter[128]; /* MAGIC number 128 == total number of metadata block types == 1 << 7 */ - FLAC__byte *metadata_filter_ids; - size_t metadata_filter_ids_count, metadata_filter_ids_capacity; /* units for both are IDs, not bytes */ - FLAC__Frame frame; - FLAC__bool cached; /* true if there is a byte in lookahead */ - FLAC__CPUInfo cpuinfo; - FLAC__byte header_warmup[2]; /* contains the sync code and reserved bits */ - FLAC__byte lookahead; /* temp storage when we need to look ahead one byte in the stream */ - /* unaligned (original) pointers to allocated data */ - FLAC__int32 *residual_unaligned[FLAC__MAX_CHANNELS]; - FLAC__bool do_md5_checking; /* initially gets protected_->md5_checking but is turned off after a seek or if the metadata has a zero MD5 */ - FLAC__bool internal_reset_hack; /* used only during init() so we can call reset to set up the decoder without rewinding the input */ - FLAC__bool is_seeking; - FLAC__MD5Context md5context; - FLAC__byte computed_md5sum[16]; /* this is the sum we computed from the decoded data */ - /* (the rest of these are only used for seeking) */ - FLAC__Frame last_frame; /* holds the info of the last frame we seeked to */ - FLAC__uint64 first_frame_offset; /* hint to the seek routine of where in the stream the first audio frame starts */ - FLAC__uint64 target_sample; - unsigned unparseable_frame_count; /* used to tell whether we're decoding a future version of FLAC or just got a bad sync */ -#if FLAC__HAS_OGG - FLAC__bool got_a_frame; /* hack needed in Ogg FLAC seek routine to check when process_single() actually writes a frame */ -#endif -} FLAC__StreamDecoderPrivate; - -/*********************************************************************** - * - * Public static class data - * - ***********************************************************************/ - -FLAC_API const char * const FLAC__StreamDecoderStateString[] = { - "FLAC__STREAM_DECODER_SEARCH_FOR_METADATA", - "FLAC__STREAM_DECODER_READ_METADATA", - "FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC", - "FLAC__STREAM_DECODER_READ_FRAME", - "FLAC__STREAM_DECODER_END_OF_STREAM", - "FLAC__STREAM_DECODER_OGG_ERROR", - "FLAC__STREAM_DECODER_SEEK_ERROR", - "FLAC__STREAM_DECODER_ABORTED", - "FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR", - "FLAC__STREAM_DECODER_UNINITIALIZED" -}; - -FLAC_API const char * const FLAC__StreamDecoderInitStatusString[] = { - "FLAC__STREAM_DECODER_INIT_STATUS_OK", - "FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER", - "FLAC__STREAM_DECODER_INIT_STATUS_INVALID_CALLBACKS", - "FLAC__STREAM_DECODER_INIT_STATUS_MEMORY_ALLOCATION_ERROR", - "FLAC__STREAM_DECODER_INIT_STATUS_ERROR_OPENING_FILE", - "FLAC__STREAM_DECODER_INIT_STATUS_ALREADY_INITIALIZED" -}; - -FLAC_API const char * const FLAC__StreamDecoderReadStatusString[] = { - "FLAC__STREAM_DECODER_READ_STATUS_CONTINUE", - "FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM", - "FLAC__STREAM_DECODER_READ_STATUS_ABORT" -}; - -FLAC_API const char * const FLAC__StreamDecoderSeekStatusString[] = { - "FLAC__STREAM_DECODER_SEEK_STATUS_OK", - "FLAC__STREAM_DECODER_SEEK_STATUS_ERROR", - "FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED" -}; - -FLAC_API const char * const FLAC__StreamDecoderTellStatusString[] = { - "FLAC__STREAM_DECODER_TELL_STATUS_OK", - "FLAC__STREAM_DECODER_TELL_STATUS_ERROR", - "FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED" -}; - -FLAC_API const char * const FLAC__StreamDecoderLengthStatusString[] = { - "FLAC__STREAM_DECODER_LENGTH_STATUS_OK", - "FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR", - "FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED" -}; - -FLAC_API const char * const FLAC__StreamDecoderWriteStatusString[] = { - "FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE", - "FLAC__STREAM_DECODER_WRITE_STATUS_ABORT" -}; - -FLAC_API const char * const FLAC__StreamDecoderErrorStatusString[] = { - "FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC", - "FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER", - "FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH", - "FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM" -}; - -/*********************************************************************** - * - * Class constructor/destructor - * - ***********************************************************************/ -FLAC_API FLAC__StreamDecoder *FLAC__stream_decoder_new(void) -{ - FLAC__StreamDecoder *decoder; - unsigned i; - - FLAC__ASSERT(sizeof(int) >= 4); /* we want to die right away if this is not true */ - - decoder = (FLAC__StreamDecoder*)calloc(1, sizeof(FLAC__StreamDecoder)); - if(decoder == 0) { - return 0; - } - - decoder->protected_ = (FLAC__StreamDecoderProtected*)calloc(1, sizeof(FLAC__StreamDecoderProtected)); - if(decoder->protected_ == 0) { - free(decoder); - return 0; - } - - decoder->private_ = (FLAC__StreamDecoderPrivate*)calloc(1, sizeof(FLAC__StreamDecoderPrivate)); - if(decoder->private_ == 0) { - free(decoder->protected_); - free(decoder); - return 0; - } - - decoder->private_->input = FLAC__bitreader_new(); - if(decoder->private_->input == 0) { - free(decoder->private_); - free(decoder->protected_); - free(decoder); - return 0; - } - - decoder->private_->metadata_filter_ids_capacity = 16; - if(0 == (decoder->private_->metadata_filter_ids = (FLAC__byte*)malloc((FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8) * decoder->private_->metadata_filter_ids_capacity))) { - FLAC__bitreader_delete(decoder->private_->input); - free(decoder->private_); - free(decoder->protected_); - free(decoder); - return 0; - } - - for(i = 0; i < FLAC__MAX_CHANNELS; i++) { - decoder->private_->output[i] = 0; - decoder->private_->residual_unaligned[i] = decoder->private_->residual[i] = 0; - } - - decoder->private_->output_capacity = 0; - decoder->private_->output_channels = 0; - decoder->private_->has_seek_table = false; - - for(i = 0; i < FLAC__MAX_CHANNELS; i++) - FLAC__format_entropy_coding_method_partitioned_rice_contents_init(&decoder->private_->partitioned_rice_contents[i]); - - decoder->private_->file = 0; - - set_defaults_(decoder); - - decoder->protected_->state = FLAC__STREAM_DECODER_UNINITIALIZED; - - return decoder; -} - -FLAC_API void FLAC__stream_decoder_delete(FLAC__StreamDecoder *decoder) -{ - unsigned i; - - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->protected_); - FLAC__ASSERT(0 != decoder->private_); - FLAC__ASSERT(0 != decoder->private_->input); - - (void)FLAC__stream_decoder_finish(decoder); - - if(0 != decoder->private_->metadata_filter_ids) - free(decoder->private_->metadata_filter_ids); - - FLAC__bitreader_delete(decoder->private_->input); - - for(i = 0; i < FLAC__MAX_CHANNELS; i++) - FLAC__format_entropy_coding_method_partitioned_rice_contents_clear(&decoder->private_->partitioned_rice_contents[i]); - - free(decoder->private_); - free(decoder->protected_); - free(decoder); -} - -/*********************************************************************** - * - * Public class methods - * - ***********************************************************************/ - -static FLAC__StreamDecoderInitStatus init_stream_internal_( - FLAC__StreamDecoder *decoder, - FLAC__StreamDecoderReadCallback read_callback, - FLAC__StreamDecoderSeekCallback seek_callback, - FLAC__StreamDecoderTellCallback tell_callback, - FLAC__StreamDecoderLengthCallback length_callback, - FLAC__StreamDecoderEofCallback eof_callback, - FLAC__StreamDecoderWriteCallback write_callback, - FLAC__StreamDecoderMetadataCallback metadata_callback, - FLAC__StreamDecoderErrorCallback error_callback, - void *client_data, - FLAC__bool is_ogg -) -{ - FLAC__ASSERT(0 != decoder); - - if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED) - return FLAC__STREAM_DECODER_INIT_STATUS_ALREADY_INITIALIZED; - -#if !FLAC__HAS_OGG - if(is_ogg) - return FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER; -#endif - - if( - 0 == read_callback || - 0 == write_callback || - 0 == error_callback || - (seek_callback && (0 == tell_callback || 0 == length_callback || 0 == eof_callback)) - ) - return FLAC__STREAM_DECODER_INIT_STATUS_INVALID_CALLBACKS; - -#if FLAC__HAS_OGG - decoder->private_->is_ogg = is_ogg; - if(is_ogg && !FLAC__ogg_decoder_aspect_init(&decoder->protected_->ogg_decoder_aspect)) - return decoder->protected_->state = FLAC__STREAM_DECODER_OGG_ERROR; -#endif - - /* - * get the CPU info and set the function pointers - */ - FLAC__cpu_info(&decoder->private_->cpuinfo); - /* first default to the non-asm routines */ - decoder->private_->local_lpc_restore_signal = FLAC__lpc_restore_signal; - decoder->private_->local_lpc_restore_signal_64bit = FLAC__lpc_restore_signal_wide; - decoder->private_->local_lpc_restore_signal_16bit = FLAC__lpc_restore_signal; - decoder->private_->local_lpc_restore_signal_16bit_order8 = FLAC__lpc_restore_signal; - decoder->private_->local_bitreader_read_rice_signed_block = FLAC__bitreader_read_rice_signed_block; - /* now override with asm where appropriate */ -#ifndef FLAC__NO_ASM - if(decoder->private_->cpuinfo.use_asm) { -#ifdef FLAC__CPU_IA32 - FLAC__ASSERT(decoder->private_->cpuinfo.type == FLAC__CPUINFO_TYPE_IA32); -#ifdef FLAC__HAS_NASM -#if 1 /*@@@@@@ OPT: not clearly faster, needs more testing */ - if(decoder->private_->cpuinfo.data.ia32.bswap) - decoder->private_->local_bitreader_read_rice_signed_block = FLAC__bitreader_read_rice_signed_block_asm_ia32_bswap; -#endif - if(decoder->private_->cpuinfo.data.ia32.mmx) { - decoder->private_->local_lpc_restore_signal = FLAC__lpc_restore_signal_asm_ia32; - decoder->private_->local_lpc_restore_signal_16bit = FLAC__lpc_restore_signal_asm_ia32_mmx; - decoder->private_->local_lpc_restore_signal_16bit_order8 = FLAC__lpc_restore_signal_asm_ia32_mmx; - } - else { - decoder->private_->local_lpc_restore_signal = FLAC__lpc_restore_signal_asm_ia32; - decoder->private_->local_lpc_restore_signal_16bit = FLAC__lpc_restore_signal_asm_ia32; - decoder->private_->local_lpc_restore_signal_16bit_order8 = FLAC__lpc_restore_signal_asm_ia32; - } -#endif -#elif defined FLAC__CPU_PPC - FLAC__ASSERT(decoder->private_->cpuinfo.type == FLAC__CPUINFO_TYPE_PPC); - if(decoder->private_->cpuinfo.data.ppc.altivec) { - decoder->private_->local_lpc_restore_signal_16bit = FLAC__lpc_restore_signal_asm_ppc_altivec_16; - decoder->private_->local_lpc_restore_signal_16bit_order8 = FLAC__lpc_restore_signal_asm_ppc_altivec_16_order8; - } -#endif - } -#endif - - /* from here on, errors are fatal */ - - if(!FLAC__bitreader_init(decoder->private_->input, decoder->private_->cpuinfo, read_callback_, decoder)) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - return FLAC__STREAM_DECODER_INIT_STATUS_MEMORY_ALLOCATION_ERROR; - } - - decoder->private_->read_callback = read_callback; - decoder->private_->seek_callback = seek_callback; - decoder->private_->tell_callback = tell_callback; - decoder->private_->length_callback = length_callback; - decoder->private_->eof_callback = eof_callback; - decoder->private_->write_callback = write_callback; - decoder->private_->metadata_callback = metadata_callback; - decoder->private_->error_callback = error_callback; - decoder->private_->client_data = client_data; - decoder->private_->fixed_block_size = decoder->private_->next_fixed_block_size = 0; - decoder->private_->samples_decoded = 0; - decoder->private_->has_stream_info = false; - decoder->private_->cached = false; - - decoder->private_->do_md5_checking = decoder->protected_->md5_checking; - decoder->private_->is_seeking = false; - - decoder->private_->internal_reset_hack = true; /* so the following reset does not try to rewind the input */ - if(!FLAC__stream_decoder_reset(decoder)) { - /* above call sets the state for us */ - return FLAC__STREAM_DECODER_INIT_STATUS_MEMORY_ALLOCATION_ERROR; - } - - return FLAC__STREAM_DECODER_INIT_STATUS_OK; -} - -FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_stream( - FLAC__StreamDecoder *decoder, - FLAC__StreamDecoderReadCallback read_callback, - FLAC__StreamDecoderSeekCallback seek_callback, - FLAC__StreamDecoderTellCallback tell_callback, - FLAC__StreamDecoderLengthCallback length_callback, - FLAC__StreamDecoderEofCallback eof_callback, - FLAC__StreamDecoderWriteCallback write_callback, - FLAC__StreamDecoderMetadataCallback metadata_callback, - FLAC__StreamDecoderErrorCallback error_callback, - void *client_data -) -{ - return init_stream_internal_( - decoder, - read_callback, - seek_callback, - tell_callback, - length_callback, - eof_callback, - write_callback, - metadata_callback, - error_callback, - client_data, - /*is_ogg=*/false - ); -} - -FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_ogg_stream( - FLAC__StreamDecoder *decoder, - FLAC__StreamDecoderReadCallback read_callback, - FLAC__StreamDecoderSeekCallback seek_callback, - FLAC__StreamDecoderTellCallback tell_callback, - FLAC__StreamDecoderLengthCallback length_callback, - FLAC__StreamDecoderEofCallback eof_callback, - FLAC__StreamDecoderWriteCallback write_callback, - FLAC__StreamDecoderMetadataCallback metadata_callback, - FLAC__StreamDecoderErrorCallback error_callback, - void *client_data -) -{ - return init_stream_internal_( - decoder, - read_callback, - seek_callback, - tell_callback, - length_callback, - eof_callback, - write_callback, - metadata_callback, - error_callback, - client_data, - /*is_ogg=*/true - ); -} - -static FLAC__StreamDecoderInitStatus init_FILE_internal_( - FLAC__StreamDecoder *decoder, - FILE *file, - FLAC__StreamDecoderWriteCallback write_callback, - FLAC__StreamDecoderMetadataCallback metadata_callback, - FLAC__StreamDecoderErrorCallback error_callback, - void *client_data, - FLAC__bool is_ogg -) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != file); - - if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED) - return decoder->protected_->state = FLAC__STREAM_DECODER_INIT_STATUS_ALREADY_INITIALIZED; - - if(0 == write_callback || 0 == error_callback) - return decoder->protected_->state = FLAC__STREAM_DECODER_INIT_STATUS_INVALID_CALLBACKS; - - /* - * To make sure that our file does not go unclosed after an error, we - * must assign the FILE pointer before any further error can occur in - * this routine. - */ - if(file == stdin) - file = get_binary_stdin_(); /* just to be safe */ - - decoder->private_->file = file; - - return init_stream_internal_( - decoder, - file_read_callback_, - decoder->private_->file == stdin? 0: file_seek_callback_, - decoder->private_->file == stdin? 0: file_tell_callback_, - decoder->private_->file == stdin? 0: file_length_callback_, - file_eof_callback_, - write_callback, - metadata_callback, - error_callback, - client_data, - is_ogg - ); -} - -FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_FILE( - FLAC__StreamDecoder *decoder, - FILE *file, - FLAC__StreamDecoderWriteCallback write_callback, - FLAC__StreamDecoderMetadataCallback metadata_callback, - FLAC__StreamDecoderErrorCallback error_callback, - void *client_data -) -{ - return init_FILE_internal_(decoder, file, write_callback, metadata_callback, error_callback, client_data, /*is_ogg=*/false); -} - -FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_ogg_FILE( - FLAC__StreamDecoder *decoder, - FILE *file, - FLAC__StreamDecoderWriteCallback write_callback, - FLAC__StreamDecoderMetadataCallback metadata_callback, - FLAC__StreamDecoderErrorCallback error_callback, - void *client_data -) -{ - return init_FILE_internal_(decoder, file, write_callback, metadata_callback, error_callback, client_data, /*is_ogg=*/true); -} - -static FLAC__StreamDecoderInitStatus init_file_internal_( - FLAC__StreamDecoder *decoder, - const char *filename, - FLAC__StreamDecoderWriteCallback write_callback, - FLAC__StreamDecoderMetadataCallback metadata_callback, - FLAC__StreamDecoderErrorCallback error_callback, - void *client_data, - FLAC__bool is_ogg -) -{ - FILE *file; - - FLAC__ASSERT(0 != decoder); - - /* - * To make sure that our file does not go unclosed after an error, we - * have to do the same entrance checks here that are later performed - * in FLAC__stream_decoder_init_FILE() before the FILE* is assigned. - */ - if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED) - return decoder->protected_->state = FLAC__STREAM_DECODER_INIT_STATUS_ALREADY_INITIALIZED; - - if(0 == write_callback || 0 == error_callback) - return decoder->protected_->state = FLAC__STREAM_DECODER_INIT_STATUS_INVALID_CALLBACKS; - - file = filename? fopen(filename, "rb") : stdin; - - if(0 == file) - return FLAC__STREAM_DECODER_INIT_STATUS_ERROR_OPENING_FILE; - - return init_FILE_internal_(decoder, file, write_callback, metadata_callback, error_callback, client_data, is_ogg); -} - -FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_file( - FLAC__StreamDecoder *decoder, - const char *filename, - FLAC__StreamDecoderWriteCallback write_callback, - FLAC__StreamDecoderMetadataCallback metadata_callback, - FLAC__StreamDecoderErrorCallback error_callback, - void *client_data -) -{ - return init_file_internal_(decoder, filename, write_callback, metadata_callback, error_callback, client_data, /*is_ogg=*/false); -} - -FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_ogg_file( - FLAC__StreamDecoder *decoder, - const char *filename, - FLAC__StreamDecoderWriteCallback write_callback, - FLAC__StreamDecoderMetadataCallback metadata_callback, - FLAC__StreamDecoderErrorCallback error_callback, - void *client_data -) -{ - return init_file_internal_(decoder, filename, write_callback, metadata_callback, error_callback, client_data, /*is_ogg=*/true); -} - -FLAC_API FLAC__bool FLAC__stream_decoder_finish(FLAC__StreamDecoder *decoder) -{ - FLAC__bool md5_failed = false; - unsigned i; - - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->private_); - FLAC__ASSERT(0 != decoder->protected_); - - if(decoder->protected_->state == FLAC__STREAM_DECODER_UNINITIALIZED) - return true; - - /* see the comment in FLAC__seekable_stream_decoder_reset() as to why we - * always call FLAC__MD5Final() - */ - FLAC__MD5Final(decoder->private_->computed_md5sum, &decoder->private_->md5context); - - if(decoder->private_->has_seek_table && 0 != decoder->private_->seek_table.data.seek_table.points) { - free(decoder->private_->seek_table.data.seek_table.points); - decoder->private_->seek_table.data.seek_table.points = 0; - decoder->private_->has_seek_table = false; - } - FLAC__bitreader_free(decoder->private_->input); - for(i = 0; i < FLAC__MAX_CHANNELS; i++) { - /* WATCHOUT: - * FLAC__lpc_restore_signal_asm_ia32_mmx() requires that the - * output arrays have a buffer of up to 3 zeroes in front - * (at negative indices) for alignment purposes; we use 4 - * to keep the data well-aligned. - */ - if(0 != decoder->private_->output[i]) { - free(decoder->private_->output[i]-4); - decoder->private_->output[i] = 0; - } - if(0 != decoder->private_->residual_unaligned[i]) { - free(decoder->private_->residual_unaligned[i]); - decoder->private_->residual_unaligned[i] = decoder->private_->residual[i] = 0; - } - } - decoder->private_->output_capacity = 0; - decoder->private_->output_channels = 0; - -#if FLAC__HAS_OGG - if(decoder->private_->is_ogg) - FLAC__ogg_decoder_aspect_finish(&decoder->protected_->ogg_decoder_aspect); -#endif - - if(0 != decoder->private_->file) { - if(decoder->private_->file != stdin) - fclose(decoder->private_->file); - decoder->private_->file = 0; - } - - if(decoder->private_->do_md5_checking) { - if(memcmp(decoder->private_->stream_info.data.stream_info.md5sum, decoder->private_->computed_md5sum, 16)) - md5_failed = true; - } - decoder->private_->is_seeking = false; - - set_defaults_(decoder); - - decoder->protected_->state = FLAC__STREAM_DECODER_UNINITIALIZED; - - return !md5_failed; -} - -FLAC_API FLAC__bool FLAC__stream_decoder_set_ogg_serial_number(FLAC__StreamDecoder *decoder, long value) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->private_); - FLAC__ASSERT(0 != decoder->protected_); - if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED) - return false; -#if FLAC__HAS_OGG - /* can't check decoder->private_->is_ogg since that's not set until init time */ - FLAC__ogg_decoder_aspect_set_serial_number(&decoder->protected_->ogg_decoder_aspect, value); - return true; -#else - (void)value; - return false; -#endif -} - -FLAC_API FLAC__bool FLAC__stream_decoder_set_md5_checking(FLAC__StreamDecoder *decoder, FLAC__bool value) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->protected_); - if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED) - return false; - decoder->protected_->md5_checking = value; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond(FLAC__StreamDecoder *decoder, FLAC__MetadataType type) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->private_); - FLAC__ASSERT(0 != decoder->protected_); - FLAC__ASSERT((unsigned)type <= FLAC__MAX_METADATA_TYPE_CODE); - /* double protection */ - if((unsigned)type > FLAC__MAX_METADATA_TYPE_CODE) - return false; - if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED) - return false; - decoder->private_->metadata_filter[type] = true; - if(type == FLAC__METADATA_TYPE_APPLICATION) - decoder->private_->metadata_filter_ids_count = 0; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->private_); - FLAC__ASSERT(0 != decoder->protected_); - FLAC__ASSERT(0 != id); - if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED) - return false; - - if(decoder->private_->metadata_filter[FLAC__METADATA_TYPE_APPLICATION]) - return true; - - FLAC__ASSERT(0 != decoder->private_->metadata_filter_ids); - - if(decoder->private_->metadata_filter_ids_count == decoder->private_->metadata_filter_ids_capacity) { - if(0 == (decoder->private_->metadata_filter_ids = (FLAC__byte*)safe_realloc_mul_2op_(decoder->private_->metadata_filter_ids, decoder->private_->metadata_filter_ids_capacity, /*times*/2))) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - return false; - } - decoder->private_->metadata_filter_ids_capacity *= 2; - } - - memcpy(decoder->private_->metadata_filter_ids + decoder->private_->metadata_filter_ids_count * (FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8), id, (FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8)); - decoder->private_->metadata_filter_ids_count++; - - return true; -} - -FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_all(FLAC__StreamDecoder *decoder) -{ - unsigned i; - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->private_); - FLAC__ASSERT(0 != decoder->protected_); - if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED) - return false; - for(i = 0; i < sizeof(decoder->private_->metadata_filter) / sizeof(decoder->private_->metadata_filter[0]); i++) - decoder->private_->metadata_filter[i] = true; - decoder->private_->metadata_filter_ids_count = 0; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore(FLAC__StreamDecoder *decoder, FLAC__MetadataType type) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->private_); - FLAC__ASSERT(0 != decoder->protected_); - FLAC__ASSERT((unsigned)type <= FLAC__MAX_METADATA_TYPE_CODE); - /* double protection */ - if((unsigned)type > FLAC__MAX_METADATA_TYPE_CODE) - return false; - if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED) - return false; - decoder->private_->metadata_filter[type] = false; - if(type == FLAC__METADATA_TYPE_APPLICATION) - decoder->private_->metadata_filter_ids_count = 0; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->private_); - FLAC__ASSERT(0 != decoder->protected_); - FLAC__ASSERT(0 != id); - if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED) - return false; - - if(!decoder->private_->metadata_filter[FLAC__METADATA_TYPE_APPLICATION]) - return true; - - FLAC__ASSERT(0 != decoder->private_->metadata_filter_ids); - - if(decoder->private_->metadata_filter_ids_count == decoder->private_->metadata_filter_ids_capacity) { - if(0 == (decoder->private_->metadata_filter_ids = (FLAC__byte*)safe_realloc_mul_2op_(decoder->private_->metadata_filter_ids, decoder->private_->metadata_filter_ids_capacity, /*times*/2))) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - return false; - } - decoder->private_->metadata_filter_ids_capacity *= 2; - } - - memcpy(decoder->private_->metadata_filter_ids + decoder->private_->metadata_filter_ids_count * (FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8), id, (FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8)); - decoder->private_->metadata_filter_ids_count++; - - return true; -} - -FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_all(FLAC__StreamDecoder *decoder) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->private_); - FLAC__ASSERT(0 != decoder->protected_); - if(decoder->protected_->state != FLAC__STREAM_DECODER_UNINITIALIZED) - return false; - memset(decoder->private_->metadata_filter, 0, sizeof(decoder->private_->metadata_filter)); - decoder->private_->metadata_filter_ids_count = 0; - return true; -} - -FLAC_API FLAC__StreamDecoderState FLAC__stream_decoder_get_state(const FLAC__StreamDecoder *decoder) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->protected_); - return decoder->protected_->state; -} - -FLAC_API const char *FLAC__stream_decoder_get_resolved_state_string(const FLAC__StreamDecoder *decoder) -{ - return FLAC__StreamDecoderStateString[decoder->protected_->state]; -} - -FLAC_API FLAC__bool FLAC__stream_decoder_get_md5_checking(const FLAC__StreamDecoder *decoder) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->protected_); - return decoder->protected_->md5_checking; -} - -FLAC_API FLAC__uint64 FLAC__stream_decoder_get_total_samples(const FLAC__StreamDecoder *decoder) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->protected_); - return decoder->private_->has_stream_info? decoder->private_->stream_info.data.stream_info.total_samples : 0; -} - -FLAC_API unsigned FLAC__stream_decoder_get_channels(const FLAC__StreamDecoder *decoder) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->protected_); - return decoder->protected_->channels; -} - -FLAC_API FLAC__ChannelAssignment FLAC__stream_decoder_get_channel_assignment(const FLAC__StreamDecoder *decoder) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->protected_); - return decoder->protected_->channel_assignment; -} - -FLAC_API unsigned FLAC__stream_decoder_get_bits_per_sample(const FLAC__StreamDecoder *decoder) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->protected_); - return decoder->protected_->bits_per_sample; -} - -FLAC_API unsigned FLAC__stream_decoder_get_sample_rate(const FLAC__StreamDecoder *decoder) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->protected_); - return decoder->protected_->sample_rate; -} - -FLAC_API unsigned FLAC__stream_decoder_get_blocksize(const FLAC__StreamDecoder *decoder) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->protected_); - return decoder->protected_->blocksize; -} - -FLAC_API FLAC__bool FLAC__stream_decoder_get_decode_position(const FLAC__StreamDecoder *decoder, FLAC__uint64 *position) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->private_); - FLAC__ASSERT(0 != position); - -#if FLAC__HAS_OGG - if(decoder->private_->is_ogg) - return false; -#endif - if(0 == decoder->private_->tell_callback) - return false; - if(decoder->private_->tell_callback(decoder, position, decoder->private_->client_data) != FLAC__STREAM_DECODER_TELL_STATUS_OK) - return false; - /* should never happen since all FLAC frames and metadata blocks are byte aligned, but check just in case */ - if(!FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input)) - return false; - FLAC__ASSERT(*position >= FLAC__stream_decoder_get_input_bytes_unconsumed(decoder)); - *position -= FLAC__stream_decoder_get_input_bytes_unconsumed(decoder); - return true; -} - -FLAC_API FLAC__bool FLAC__stream_decoder_flush(FLAC__StreamDecoder *decoder) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->private_); - FLAC__ASSERT(0 != decoder->protected_); - - decoder->private_->samples_decoded = 0; - decoder->private_->do_md5_checking = false; - -#if FLAC__HAS_OGG - if(decoder->private_->is_ogg) - FLAC__ogg_decoder_aspect_flush(&decoder->protected_->ogg_decoder_aspect); -#endif - - if(!FLAC__bitreader_clear(decoder->private_->input)) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - return false; - } - decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; - - return true; -} - -FLAC_API FLAC__bool FLAC__stream_decoder_reset(FLAC__StreamDecoder *decoder) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->private_); - FLAC__ASSERT(0 != decoder->protected_); - - if(!FLAC__stream_decoder_flush(decoder)) { - /* above call sets the state for us */ - return false; - } - -#if FLAC__HAS_OGG - /*@@@ could go in !internal_reset_hack block below */ - if(decoder->private_->is_ogg) - FLAC__ogg_decoder_aspect_reset(&decoder->protected_->ogg_decoder_aspect); -#endif - - /* Rewind if necessary. If FLAC__stream_decoder_init() is calling us, - * (internal_reset_hack) don't try to rewind since we are already at - * the beginning of the stream and don't want to fail if the input is - * not seekable. - */ - if(!decoder->private_->internal_reset_hack) { - if(decoder->private_->file == stdin) - return false; /* can't rewind stdin, reset fails */ - if(decoder->private_->seek_callback && decoder->private_->seek_callback(decoder, 0, decoder->private_->client_data) == FLAC__STREAM_DECODER_SEEK_STATUS_ERROR) - return false; /* seekable and seek fails, reset fails */ - } - else - decoder->private_->internal_reset_hack = false; - - decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_METADATA; - - decoder->private_->has_stream_info = false; - if(decoder->private_->has_seek_table && 0 != decoder->private_->seek_table.data.seek_table.points) { - free(decoder->private_->seek_table.data.seek_table.points); - decoder->private_->seek_table.data.seek_table.points = 0; - decoder->private_->has_seek_table = false; - } - decoder->private_->do_md5_checking = decoder->protected_->md5_checking; - /* - * This goes in reset() and not flush() because according to the spec, a - * fixed-blocksize stream must stay that way through the whole stream. - */ - decoder->private_->fixed_block_size = decoder->private_->next_fixed_block_size = 0; - - /* We initialize the FLAC__MD5Context even though we may never use it. This - * is because md5 checking may be turned on to start and then turned off if - * a seek occurs. So we init the context here and finalize it in - * FLAC__stream_decoder_finish() to make sure things are always cleaned up - * properly. - */ - FLAC__MD5Init(&decoder->private_->md5context); - - decoder->private_->first_frame_offset = 0; - decoder->private_->unparseable_frame_count = 0; - - return true; -} - -FLAC_API FLAC__bool FLAC__stream_decoder_process_single(FLAC__StreamDecoder *decoder) -{ - FLAC__bool got_a_frame; - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->protected_); - - while(1) { - switch(decoder->protected_->state) { - case FLAC__STREAM_DECODER_SEARCH_FOR_METADATA: - if(!find_metadata_(decoder)) - return false; /* above function sets the status for us */ - break; - case FLAC__STREAM_DECODER_READ_METADATA: - if(!read_metadata_(decoder)) - return false; /* above function sets the status for us */ - else - return true; - case FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC: - if(!frame_sync_(decoder)) - return true; /* above function sets the status for us */ - break; - case FLAC__STREAM_DECODER_READ_FRAME: - if(!read_frame_(decoder, &got_a_frame, /*do_full_decode=*/true)) - return false; /* above function sets the status for us */ - if(got_a_frame) - return true; /* above function sets the status for us */ - break; - case FLAC__STREAM_DECODER_END_OF_STREAM: - case FLAC__STREAM_DECODER_ABORTED: - return true; - default: - FLAC__ASSERT(0); - return false; - } - } -} - -FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_metadata(FLAC__StreamDecoder *decoder) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->protected_); - - while(1) { - switch(decoder->protected_->state) { - case FLAC__STREAM_DECODER_SEARCH_FOR_METADATA: - if(!find_metadata_(decoder)) - return false; /* above function sets the status for us */ - break; - case FLAC__STREAM_DECODER_READ_METADATA: - if(!read_metadata_(decoder)) - return false; /* above function sets the status for us */ - break; - case FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC: - case FLAC__STREAM_DECODER_READ_FRAME: - case FLAC__STREAM_DECODER_END_OF_STREAM: - case FLAC__STREAM_DECODER_ABORTED: - return true; - default: - FLAC__ASSERT(0); - return false; - } - } -} - -FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_stream(FLAC__StreamDecoder *decoder) -{ - FLAC__bool dummy; - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->protected_); - - while(1) { - switch(decoder->protected_->state) { - case FLAC__STREAM_DECODER_SEARCH_FOR_METADATA: - if(!find_metadata_(decoder)) - return false; /* above function sets the status for us */ - break; - case FLAC__STREAM_DECODER_READ_METADATA: - if(!read_metadata_(decoder)) - return false; /* above function sets the status for us */ - break; - case FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC: - if(!frame_sync_(decoder)) - return true; /* above function sets the status for us */ - break; - case FLAC__STREAM_DECODER_READ_FRAME: - if(!read_frame_(decoder, &dummy, /*do_full_decode=*/true)) - return false; /* above function sets the status for us */ - break; - case FLAC__STREAM_DECODER_END_OF_STREAM: - case FLAC__STREAM_DECODER_ABORTED: - return true; - default: - FLAC__ASSERT(0); - return false; - } - } -} - -FLAC_API FLAC__bool FLAC__stream_decoder_skip_single_frame(FLAC__StreamDecoder *decoder) -{ - FLAC__bool got_a_frame; - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->protected_); - - while(1) { - switch(decoder->protected_->state) { - case FLAC__STREAM_DECODER_SEARCH_FOR_METADATA: - case FLAC__STREAM_DECODER_READ_METADATA: - return false; /* above function sets the status for us */ - case FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC: - if(!frame_sync_(decoder)) - return true; /* above function sets the status for us */ - break; - case FLAC__STREAM_DECODER_READ_FRAME: - if(!read_frame_(decoder, &got_a_frame, /*do_full_decode=*/false)) - return false; /* above function sets the status for us */ - if(got_a_frame) - return true; /* above function sets the status for us */ - break; - case FLAC__STREAM_DECODER_END_OF_STREAM: - case FLAC__STREAM_DECODER_ABORTED: - return true; - default: - FLAC__ASSERT(0); - return false; - } - } -} - -FLAC_API FLAC__bool FLAC__stream_decoder_seek_absolute(FLAC__StreamDecoder *decoder, FLAC__uint64 sample) -{ - FLAC__uint64 length; - - FLAC__ASSERT(0 != decoder); - - if( - decoder->protected_->state != FLAC__STREAM_DECODER_SEARCH_FOR_METADATA && - decoder->protected_->state != FLAC__STREAM_DECODER_READ_METADATA && - decoder->protected_->state != FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC && - decoder->protected_->state != FLAC__STREAM_DECODER_READ_FRAME && - decoder->protected_->state != FLAC__STREAM_DECODER_END_OF_STREAM - ) - return false; - - if(0 == decoder->private_->seek_callback) - return false; - - FLAC__ASSERT(decoder->private_->seek_callback); - FLAC__ASSERT(decoder->private_->tell_callback); - FLAC__ASSERT(decoder->private_->length_callback); - FLAC__ASSERT(decoder->private_->eof_callback); - - if(FLAC__stream_decoder_get_total_samples(decoder) > 0 && sample >= FLAC__stream_decoder_get_total_samples(decoder)) - return false; - - decoder->private_->is_seeking = true; - - /* turn off md5 checking if a seek is attempted */ - decoder->private_->do_md5_checking = false; - - /* get the file length (currently our algorithm needs to know the length so it's also an error to get FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED) */ - if(decoder->private_->length_callback(decoder, &length, decoder->private_->client_data) != FLAC__STREAM_DECODER_LENGTH_STATUS_OK) { - decoder->private_->is_seeking = false; - return false; - } - - /* if we haven't finished processing the metadata yet, do that so we have the STREAMINFO, SEEK_TABLE, and first_frame_offset */ - if( - decoder->protected_->state == FLAC__STREAM_DECODER_SEARCH_FOR_METADATA || - decoder->protected_->state == FLAC__STREAM_DECODER_READ_METADATA - ) { - if(!FLAC__stream_decoder_process_until_end_of_metadata(decoder)) { - /* above call sets the state for us */ - decoder->private_->is_seeking = false; - return false; - } - /* check this again in case we didn't know total_samples the first time */ - if(FLAC__stream_decoder_get_total_samples(decoder) > 0 && sample >= FLAC__stream_decoder_get_total_samples(decoder)) { - decoder->private_->is_seeking = false; - return false; - } - } - - { - const FLAC__bool ok = -#if FLAC__HAS_OGG - decoder->private_->is_ogg? - seek_to_absolute_sample_ogg_(decoder, length, sample) : -#endif - seek_to_absolute_sample_(decoder, length, sample) - ; - decoder->private_->is_seeking = false; - return ok; - } -} - -/*********************************************************************** - * - * Protected class methods - * - ***********************************************************************/ - -unsigned FLAC__stream_decoder_get_input_bytes_unconsumed(const FLAC__StreamDecoder *decoder) -{ - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input)); - FLAC__ASSERT(!(FLAC__bitreader_get_input_bits_unconsumed(decoder->private_->input) & 7)); - return FLAC__bitreader_get_input_bits_unconsumed(decoder->private_->input) / 8; -} - -/*********************************************************************** - * - * Private class methods - * - ***********************************************************************/ - -void set_defaults_(FLAC__StreamDecoder *decoder) -{ -#if FLAC__HAS_OGG - decoder->private_->is_ogg = false; -#endif - decoder->private_->read_callback = 0; - decoder->private_->seek_callback = 0; - decoder->private_->tell_callback = 0; - decoder->private_->length_callback = 0; - decoder->private_->eof_callback = 0; - decoder->private_->write_callback = 0; - decoder->private_->metadata_callback = 0; - decoder->private_->error_callback = 0; - decoder->private_->client_data = 0; - - memset(decoder->private_->metadata_filter, 0, sizeof(decoder->private_->metadata_filter)); - decoder->private_->metadata_filter[FLAC__METADATA_TYPE_STREAMINFO] = true; - decoder->private_->metadata_filter_ids_count = 0; - - decoder->protected_->md5_checking = false; - -#if FLAC__HAS_OGG - FLAC__ogg_decoder_aspect_set_defaults(&decoder->protected_->ogg_decoder_aspect); -#endif -} - -/* - * This will forcibly set stdin to binary mode (for OSes that require it) - */ -FILE *get_binary_stdin_(void) -{ - /* if something breaks here it is probably due to the presence or - * absence of an underscore before the identifiers 'setmode', - * 'fileno', and/or 'O_BINARY'; check your system header files. - */ -#if defined _MSC_VER || defined __MINGW32__ - _setmode(_fileno(stdin), _O_BINARY); -#elif defined __CYGWIN__ - /* almost certainly not needed for any modern Cygwin, but let's be safe... */ - setmode(_fileno(stdin), _O_BINARY); -#elif defined __EMX__ - setmode(fileno(stdin), O_BINARY); -#endif - - return stdin; -} - -FLAC__bool allocate_output_(FLAC__StreamDecoder *decoder, unsigned size, unsigned channels) -{ - unsigned i; - FLAC__int32 *tmp; - - if(size <= decoder->private_->output_capacity && channels <= decoder->private_->output_channels) - return true; - - /* simply using realloc() is not practical because the number of channels may change mid-stream */ - - for(i = 0; i < FLAC__MAX_CHANNELS; i++) { - if(0 != decoder->private_->output[i]) { - free(decoder->private_->output[i]-4); - decoder->private_->output[i] = 0; - } - if(0 != decoder->private_->residual_unaligned[i]) { - free(decoder->private_->residual_unaligned[i]); - decoder->private_->residual_unaligned[i] = decoder->private_->residual[i] = 0; - } - } - - for(i = 0; i < channels; i++) { - /* WATCHOUT: - * FLAC__lpc_restore_signal_asm_ia32_mmx() requires that the - * output arrays have a buffer of up to 3 zeroes in front - * (at negative indices) for alignment purposes; we use 4 - * to keep the data well-aligned. - */ - tmp = (FLAC__int32*)safe_malloc_muladd2_(sizeof(FLAC__int32), /*times (*/size, /*+*/4/*)*/); - if(tmp == 0) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - return false; - } - memset(tmp, 0, sizeof(FLAC__int32)*4); - decoder->private_->output[i] = tmp + 4; - - /* WATCHOUT: - * minimum of quadword alignment for PPC vector optimizations is REQUIRED: - */ - if(!FLAC__memory_alloc_aligned_int32_array(size, &decoder->private_->residual_unaligned[i], &decoder->private_->residual[i])) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - return false; - } - } - - decoder->private_->output_capacity = size; - decoder->private_->output_channels = channels; - - return true; -} - -FLAC__bool has_id_filtered_(FLAC__StreamDecoder *decoder, FLAC__byte *id) -{ - size_t i; - - FLAC__ASSERT(0 != decoder); - FLAC__ASSERT(0 != decoder->private_); - - for(i = 0; i < decoder->private_->metadata_filter_ids_count; i++) - if(0 == memcmp(decoder->private_->metadata_filter_ids + i * (FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8), id, (FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8))) - return true; - - return false; -} - -FLAC__bool find_metadata_(FLAC__StreamDecoder *decoder) -{ - FLAC__uint32 x; - unsigned i, id; - FLAC__bool first = true; - - FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input)); - - for(i = id = 0; i < 4; ) { - if(decoder->private_->cached) { - x = (FLAC__uint32)decoder->private_->lookahead; - decoder->private_->cached = false; - } - else { - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8)) - return false; /* read_callback_ sets the state for us */ - } - if(x == FLAC__STREAM_SYNC_STRING[i]) { - first = true; - i++; - id = 0; - continue; - } - if(x == ID3V2_TAG_[id]) { - id++; - i = 0; - if(id == 3) { - if(!skip_id3v2_tag_(decoder)) - return false; /* skip_id3v2_tag_ sets the state for us */ - } - continue; - } - id = 0; - if(x == 0xff) { /* MAGIC NUMBER for the first 8 frame sync bits */ - decoder->private_->header_warmup[0] = (FLAC__byte)x; - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8)) - return false; /* read_callback_ sets the state for us */ - - /* we have to check if we just read two 0xff's in a row; the second may actually be the beginning of the sync code */ - /* else we have to check if the second byte is the end of a sync code */ - if(x == 0xff) { /* MAGIC NUMBER for the first 8 frame sync bits */ - decoder->private_->lookahead = (FLAC__byte)x; - decoder->private_->cached = true; - } - else if(x >> 2 == 0x3e) { /* MAGIC NUMBER for the last 6 sync bits */ - decoder->private_->header_warmup[1] = (FLAC__byte)x; - decoder->protected_->state = FLAC__STREAM_DECODER_READ_FRAME; - return true; - } - } - i = 0; - if(first) { - send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC); - first = false; - } - } - - decoder->protected_->state = FLAC__STREAM_DECODER_READ_METADATA; - return true; -} - -FLAC__bool read_metadata_(FLAC__StreamDecoder *decoder) -{ - FLAC__bool is_last; - FLAC__uint32 i, x, type, length; - - FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input)); - - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_IS_LAST_LEN)) - return false; /* read_callback_ sets the state for us */ - is_last = x? true : false; - - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &type, FLAC__STREAM_METADATA_TYPE_LEN)) - return false; /* read_callback_ sets the state for us */ - - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &length, FLAC__STREAM_METADATA_LENGTH_LEN)) - return false; /* read_callback_ sets the state for us */ - - if(type == FLAC__METADATA_TYPE_STREAMINFO) { - if(!read_metadata_streaminfo_(decoder, is_last, length)) - return false; - - decoder->private_->has_stream_info = true; - if(0 == memcmp(decoder->private_->stream_info.data.stream_info.md5sum, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16)) - decoder->private_->do_md5_checking = false; - if(!decoder->private_->is_seeking && decoder->private_->metadata_filter[FLAC__METADATA_TYPE_STREAMINFO] && decoder->private_->metadata_callback) - decoder->private_->metadata_callback(decoder, &decoder->private_->stream_info, decoder->private_->client_data); - } - else if(type == FLAC__METADATA_TYPE_SEEKTABLE) { - if(!read_metadata_seektable_(decoder, is_last, length)) - return false; - - decoder->private_->has_seek_table = true; - if(!decoder->private_->is_seeking && decoder->private_->metadata_filter[FLAC__METADATA_TYPE_SEEKTABLE] && decoder->private_->metadata_callback) - decoder->private_->metadata_callback(decoder, &decoder->private_->seek_table, decoder->private_->client_data); - } - else { - FLAC__bool skip_it = !decoder->private_->metadata_filter[type]; - unsigned real_length = length; - FLAC__StreamMetadata block; - - block.is_last = is_last; - block.type = (FLAC__MetadataType)type; - block.length = length; - memset(&block.data, 0, sizeof(block.data)); - - if(type == FLAC__METADATA_TYPE_APPLICATION) { - if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, block.data.application.id, FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8)) - return false; /* read_callback_ sets the state for us */ - - if(real_length < FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8) { /* underflow check */ - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR;/*@@@@@@ maybe wrong error? need to resync?*/ - return false; - } - - real_length -= FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8; - - if(decoder->private_->metadata_filter_ids_count > 0 && has_id_filtered_(decoder, block.data.application.id)) - skip_it = !skip_it; - } - - if(skip_it) { - if(!FLAC__bitreader_skip_byte_block_aligned_no_crc(decoder->private_->input, real_length)) - return false; /* read_callback_ sets the state for us */ - } - else { - switch(type) { - case FLAC__METADATA_TYPE_PADDING: - /* skip the padding bytes */ - if(!FLAC__bitreader_skip_byte_block_aligned_no_crc(decoder->private_->input, real_length)) - return false; /* read_callback_ sets the state for us */ - break; - case FLAC__METADATA_TYPE_APPLICATION: - /* remember, we read the ID already */ - if(real_length > 0) { - if(0 == (block.data.application.data = (FLAC__byte*)malloc(real_length))) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - return false; - } - if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, block.data.application.data, real_length)) - return false; /* read_callback_ sets the state for us */ - } - else - block.data.application.data = 0; - break; - case FLAC__METADATA_TYPE_VORBIS_COMMENT: - if(!read_metadata_vorbiscomment_(decoder, &block.data.vorbis_comment)) - return false; - break; - case FLAC__METADATA_TYPE_CUESHEET: - if(!read_metadata_cuesheet_(decoder, &block.data.cue_sheet)) - return false; - break; - case FLAC__METADATA_TYPE_PICTURE: - if(!read_metadata_picture_(decoder, &block.data.picture)) - return false; - break; - case FLAC__METADATA_TYPE_STREAMINFO: - case FLAC__METADATA_TYPE_SEEKTABLE: - FLAC__ASSERT(0); - break; - default: - if(real_length > 0) { - if(0 == (block.data.unknown.data = (FLAC__byte*)malloc(real_length))) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - return false; - } - if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, block.data.unknown.data, real_length)) - return false; /* read_callback_ sets the state for us */ - } - else - block.data.unknown.data = 0; - break; - } - if(!decoder->private_->is_seeking && decoder->private_->metadata_callback) - decoder->private_->metadata_callback(decoder, &block, decoder->private_->client_data); - - /* now we have to free any malloc()ed data in the block */ - switch(type) { - case FLAC__METADATA_TYPE_PADDING: - break; - case FLAC__METADATA_TYPE_APPLICATION: - if(0 != block.data.application.data) - free(block.data.application.data); - break; - case FLAC__METADATA_TYPE_VORBIS_COMMENT: - if(0 != block.data.vorbis_comment.vendor_string.entry) - free(block.data.vorbis_comment.vendor_string.entry); - if(block.data.vorbis_comment.num_comments > 0) - for(i = 0; i < block.data.vorbis_comment.num_comments; i++) - if(0 != block.data.vorbis_comment.comments[i].entry) - free(block.data.vorbis_comment.comments[i].entry); - if(0 != block.data.vorbis_comment.comments) - free(block.data.vorbis_comment.comments); - break; - case FLAC__METADATA_TYPE_CUESHEET: - if(block.data.cue_sheet.num_tracks > 0) - for(i = 0; i < block.data.cue_sheet.num_tracks; i++) - if(0 != block.data.cue_sheet.tracks[i].indices) - free(block.data.cue_sheet.tracks[i].indices); - if(0 != block.data.cue_sheet.tracks) - free(block.data.cue_sheet.tracks); - break; - case FLAC__METADATA_TYPE_PICTURE: - if(0 != block.data.picture.mime_type) - free(block.data.picture.mime_type); - if(0 != block.data.picture.description) - free(block.data.picture.description); - if(0 != block.data.picture.data) - free(block.data.picture.data); - break; - case FLAC__METADATA_TYPE_STREAMINFO: - case FLAC__METADATA_TYPE_SEEKTABLE: - FLAC__ASSERT(0); - default: - if(0 != block.data.unknown.data) - free(block.data.unknown.data); - break; - } - } - } - - if(is_last) { - /* if this fails, it's OK, it's just a hint for the seek routine */ - if(!FLAC__stream_decoder_get_decode_position(decoder, &decoder->private_->first_frame_offset)) - decoder->private_->first_frame_offset = 0; - decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; - } - - return true; -} - -FLAC__bool read_metadata_streaminfo_(FLAC__StreamDecoder *decoder, FLAC__bool is_last, unsigned length) -{ - FLAC__uint32 x; - unsigned bits, used_bits = 0; - - FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input)); - - decoder->private_->stream_info.type = FLAC__METADATA_TYPE_STREAMINFO; - decoder->private_->stream_info.is_last = is_last; - decoder->private_->stream_info.length = length; - - bits = FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN; - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, bits)) - return false; /* read_callback_ sets the state for us */ - decoder->private_->stream_info.data.stream_info.min_blocksize = x; - used_bits += bits; - - bits = FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN; - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN)) - return false; /* read_callback_ sets the state for us */ - decoder->private_->stream_info.data.stream_info.max_blocksize = x; - used_bits += bits; - - bits = FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN; - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN)) - return false; /* read_callback_ sets the state for us */ - decoder->private_->stream_info.data.stream_info.min_framesize = x; - used_bits += bits; - - bits = FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN; - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN)) - return false; /* read_callback_ sets the state for us */ - decoder->private_->stream_info.data.stream_info.max_framesize = x; - used_bits += bits; - - bits = FLAC__STREAM_METADATA_STREAMINFO_SAMPLE_RATE_LEN; - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_STREAMINFO_SAMPLE_RATE_LEN)) - return false; /* read_callback_ sets the state for us */ - decoder->private_->stream_info.data.stream_info.sample_rate = x; - used_bits += bits; - - bits = FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN; - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN)) - return false; /* read_callback_ sets the state for us */ - decoder->private_->stream_info.data.stream_info.channels = x+1; - used_bits += bits; - - bits = FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN; - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN)) - return false; /* read_callback_ sets the state for us */ - decoder->private_->stream_info.data.stream_info.bits_per_sample = x+1; - used_bits += bits; - - bits = FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN; - if(!FLAC__bitreader_read_raw_uint64(decoder->private_->input, &decoder->private_->stream_info.data.stream_info.total_samples, FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN)) - return false; /* read_callback_ sets the state for us */ - used_bits += bits; - - if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, decoder->private_->stream_info.data.stream_info.md5sum, 16)) - return false; /* read_callback_ sets the state for us */ - used_bits += 16*8; - - /* skip the rest of the block */ - FLAC__ASSERT(used_bits % 8 == 0); - length -= (used_bits / 8); - if(!FLAC__bitreader_skip_byte_block_aligned_no_crc(decoder->private_->input, length)) - return false; /* read_callback_ sets the state for us */ - - return true; -} - -FLAC__bool read_metadata_seektable_(FLAC__StreamDecoder *decoder, FLAC__bool is_last, unsigned length) -{ - FLAC__uint32 i, x; - FLAC__uint64 xx; - - FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input)); - - decoder->private_->seek_table.type = FLAC__METADATA_TYPE_SEEKTABLE; - decoder->private_->seek_table.is_last = is_last; - decoder->private_->seek_table.length = length; - - decoder->private_->seek_table.data.seek_table.num_points = length / FLAC__STREAM_METADATA_SEEKPOINT_LENGTH; - - /* use realloc since we may pass through here several times (e.g. after seeking) */ - if(0 == (decoder->private_->seek_table.data.seek_table.points = (FLAC__StreamMetadata_SeekPoint*)safe_realloc_mul_2op_(decoder->private_->seek_table.data.seek_table.points, decoder->private_->seek_table.data.seek_table.num_points, /*times*/sizeof(FLAC__StreamMetadata_SeekPoint)))) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - return false; - } - for(i = 0; i < decoder->private_->seek_table.data.seek_table.num_points; i++) { - if(!FLAC__bitreader_read_raw_uint64(decoder->private_->input, &xx, FLAC__STREAM_METADATA_SEEKPOINT_SAMPLE_NUMBER_LEN)) - return false; /* read_callback_ sets the state for us */ - decoder->private_->seek_table.data.seek_table.points[i].sample_number = xx; - - if(!FLAC__bitreader_read_raw_uint64(decoder->private_->input, &xx, FLAC__STREAM_METADATA_SEEKPOINT_STREAM_OFFSET_LEN)) - return false; /* read_callback_ sets the state for us */ - decoder->private_->seek_table.data.seek_table.points[i].stream_offset = xx; - - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_SEEKPOINT_FRAME_SAMPLES_LEN)) - return false; /* read_callback_ sets the state for us */ - decoder->private_->seek_table.data.seek_table.points[i].frame_samples = x; - } - length -= (decoder->private_->seek_table.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH); - /* if there is a partial point left, skip over it */ - if(length > 0) { - /*@@@ do a send_error_to_client_() here? there's an argument for either way */ - if(!FLAC__bitreader_skip_byte_block_aligned_no_crc(decoder->private_->input, length)) - return false; /* read_callback_ sets the state for us */ - } - - return true; -} - -FLAC__bool read_metadata_vorbiscomment_(FLAC__StreamDecoder *decoder, FLAC__StreamMetadata_VorbisComment *obj) -{ - FLAC__uint32 i; - - FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input)); - - /* read vendor string */ - FLAC__ASSERT(FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN == 32); - if(!FLAC__bitreader_read_uint32_little_endian(decoder->private_->input, &obj->vendor_string.length)) - return false; /* read_callback_ sets the state for us */ - if(obj->vendor_string.length > 0) { - if(0 == (obj->vendor_string.entry = (FLAC__byte*)safe_malloc_add_2op_(obj->vendor_string.length, /*+*/1))) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - return false; - } - if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, obj->vendor_string.entry, obj->vendor_string.length)) - return false; /* read_callback_ sets the state for us */ - obj->vendor_string.entry[obj->vendor_string.length] = '\0'; - } - else - obj->vendor_string.entry = 0; - - /* read num comments */ - FLAC__ASSERT(FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN == 32); - if(!FLAC__bitreader_read_uint32_little_endian(decoder->private_->input, &obj->num_comments)) - return false; /* read_callback_ sets the state for us */ - - /* read comments */ - if(obj->num_comments > 0) { - if(0 == (obj->comments = (FLAC__StreamMetadata_VorbisComment_Entry*)safe_malloc_mul_2op_(obj->num_comments, /*times*/sizeof(FLAC__StreamMetadata_VorbisComment_Entry)))) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - return false; - } - for(i = 0; i < obj->num_comments; i++) { - FLAC__ASSERT(FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN == 32); - if(!FLAC__bitreader_read_uint32_little_endian(decoder->private_->input, &obj->comments[i].length)) - return false; /* read_callback_ sets the state for us */ - if(obj->comments[i].length > 0) { - if(0 == (obj->comments[i].entry = (FLAC__byte*)safe_malloc_add_2op_(obj->comments[i].length, /*+*/1))) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - return false; - } - if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, obj->comments[i].entry, obj->comments[i].length)) - return false; /* read_callback_ sets the state for us */ - obj->comments[i].entry[obj->comments[i].length] = '\0'; - } - else - obj->comments[i].entry = 0; - } - } - else { - obj->comments = 0; - } - - return true; -} - -FLAC__bool read_metadata_cuesheet_(FLAC__StreamDecoder *decoder, FLAC__StreamMetadata_CueSheet *obj) -{ - FLAC__uint32 i, j, x; - - FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input)); - - memset(obj, 0, sizeof(FLAC__StreamMetadata_CueSheet)); - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN % 8 == 0); - if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, (FLAC__byte*)obj->media_catalog_number, FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN/8)) - return false; /* read_callback_ sets the state for us */ - - if(!FLAC__bitreader_read_raw_uint64(decoder->private_->input, &obj->lead_in, FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN)) - return false; /* read_callback_ sets the state for us */ - - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN)) - return false; /* read_callback_ sets the state for us */ - obj->is_cd = x? true : false; - - if(!FLAC__bitreader_skip_bits_no_crc(decoder->private_->input, FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN)) - return false; /* read_callback_ sets the state for us */ - - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN)) - return false; /* read_callback_ sets the state for us */ - obj->num_tracks = x; - - if(obj->num_tracks > 0) { - if(0 == (obj->tracks = (FLAC__StreamMetadata_CueSheet_Track*)safe_calloc_(obj->num_tracks, sizeof(FLAC__StreamMetadata_CueSheet_Track)))) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - return false; - } - for(i = 0; i < obj->num_tracks; i++) { - FLAC__StreamMetadata_CueSheet_Track *track = &obj->tracks[i]; - if(!FLAC__bitreader_read_raw_uint64(decoder->private_->input, &track->offset, FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN)) - return false; /* read_callback_ sets the state for us */ - - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN)) - return false; /* read_callback_ sets the state for us */ - track->number = (FLAC__byte)x; - - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN % 8 == 0); - if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, (FLAC__byte*)track->isrc, FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN/8)) - return false; /* read_callback_ sets the state for us */ - - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN)) - return false; /* read_callback_ sets the state for us */ - track->type = x; - - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN)) - return false; /* read_callback_ sets the state for us */ - track->pre_emphasis = x; - - if(!FLAC__bitreader_skip_bits_no_crc(decoder->private_->input, FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN)) - return false; /* read_callback_ sets the state for us */ - - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN)) - return false; /* read_callback_ sets the state for us */ - track->num_indices = (FLAC__byte)x; - - if(track->num_indices > 0) { - if(0 == (track->indices = (FLAC__StreamMetadata_CueSheet_Index*)safe_calloc_(track->num_indices, sizeof(FLAC__StreamMetadata_CueSheet_Index)))) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - return false; - } - for(j = 0; j < track->num_indices; j++) { - FLAC__StreamMetadata_CueSheet_Index *index = &track->indices[j]; - if(!FLAC__bitreader_read_raw_uint64(decoder->private_->input, &index->offset, FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN)) - return false; /* read_callback_ sets the state for us */ - - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN)) - return false; /* read_callback_ sets the state for us */ - index->number = (FLAC__byte)x; - - if(!FLAC__bitreader_skip_bits_no_crc(decoder->private_->input, FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN)) - return false; /* read_callback_ sets the state for us */ - } - } - } - } - - return true; -} - -FLAC__bool read_metadata_picture_(FLAC__StreamDecoder *decoder, FLAC__StreamMetadata_Picture *obj) -{ - FLAC__uint32 x; - - FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input)); - - /* read type */ - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_PICTURE_TYPE_LEN)) - return false; /* read_callback_ sets the state for us */ - obj->type = x; - - /* read MIME type */ - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN)) - return false; /* read_callback_ sets the state for us */ - if(0 == (obj->mime_type = (char*)safe_malloc_add_2op_(x, /*+*/1))) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - return false; - } - if(x > 0) { - if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, (FLAC__byte*)obj->mime_type, x)) - return false; /* read_callback_ sets the state for us */ - } - obj->mime_type[x] = '\0'; - - /* read description */ - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN)) - return false; /* read_callback_ sets the state for us */ - if(0 == (obj->description = (FLAC__byte*)safe_malloc_add_2op_(x, /*+*/1))) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - return false; - } - if(x > 0) { - if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, obj->description, x)) - return false; /* read_callback_ sets the state for us */ - } - obj->description[x] = '\0'; - - /* read width */ - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &obj->width, FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN)) - return false; /* read_callback_ sets the state for us */ - - /* read height */ - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &obj->height, FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN)) - return false; /* read_callback_ sets the state for us */ - - /* read depth */ - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &obj->depth, FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN)) - return false; /* read_callback_ sets the state for us */ - - /* read colors */ - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &obj->colors, FLAC__STREAM_METADATA_PICTURE_COLORS_LEN)) - return false; /* read_callback_ sets the state for us */ - - /* read data */ - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &(obj->data_length), FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN)) - return false; /* read_callback_ sets the state for us */ - if(0 == (obj->data = (FLAC__byte*)safe_malloc_(obj->data_length))) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - return false; - } - if(obj->data_length > 0) { - if(!FLAC__bitreader_read_byte_block_aligned_no_crc(decoder->private_->input, obj->data, obj->data_length)) - return false; /* read_callback_ sets the state for us */ - } - - return true; -} - -FLAC__bool skip_id3v2_tag_(FLAC__StreamDecoder *decoder) -{ - FLAC__uint32 x; - unsigned i, skip; - - /* skip the version and flags bytes */ - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 24)) - return false; /* read_callback_ sets the state for us */ - /* get the size (in bytes) to skip */ - skip = 0; - for(i = 0; i < 4; i++) { - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8)) - return false; /* read_callback_ sets the state for us */ - skip <<= 7; - skip |= (x & 0x7f); - } - /* skip the rest of the tag */ - if(!FLAC__bitreader_skip_byte_block_aligned_no_crc(decoder->private_->input, skip)) - return false; /* read_callback_ sets the state for us */ - return true; -} - -FLAC__bool frame_sync_(FLAC__StreamDecoder *decoder) -{ - FLAC__uint32 x; - FLAC__bool first = true; - - /* If we know the total number of samples in the stream, stop if we've read that many. */ - /* This will stop us, for example, from wasting time trying to sync on an ID3V1 tag. */ - if(FLAC__stream_decoder_get_total_samples(decoder) > 0) { - if(decoder->private_->samples_decoded >= FLAC__stream_decoder_get_total_samples(decoder)) { - decoder->protected_->state = FLAC__STREAM_DECODER_END_OF_STREAM; - return true; - } - } - - /* make sure we're byte aligned */ - if(!FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input)) { - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__bitreader_bits_left_for_byte_alignment(decoder->private_->input))) - return false; /* read_callback_ sets the state for us */ - } - - while(1) { - if(decoder->private_->cached) { - x = (FLAC__uint32)decoder->private_->lookahead; - decoder->private_->cached = false; - } - else { - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8)) - return false; /* read_callback_ sets the state for us */ - } - if(x == 0xff) { /* MAGIC NUMBER for the first 8 frame sync bits */ - decoder->private_->header_warmup[0] = (FLAC__byte)x; - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8)) - return false; /* read_callback_ sets the state for us */ - - /* we have to check if we just read two 0xff's in a row; the second may actually be the beginning of the sync code */ - /* else we have to check if the second byte is the end of a sync code */ - if(x == 0xff) { /* MAGIC NUMBER for the first 8 frame sync bits */ - decoder->private_->lookahead = (FLAC__byte)x; - decoder->private_->cached = true; - } - else if(x >> 2 == 0x3e) { /* MAGIC NUMBER for the last 6 sync bits */ - decoder->private_->header_warmup[1] = (FLAC__byte)x; - decoder->protected_->state = FLAC__STREAM_DECODER_READ_FRAME; - return true; - } - } - if(first) { - send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC); - first = false; - } - } - - return true; -} - -FLAC__bool read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame, FLAC__bool do_full_decode) -{ - unsigned channel; - unsigned i; - FLAC__int32 mid, side; - unsigned frame_crc; /* the one we calculate from the input stream */ - FLAC__uint32 x; - - *got_a_frame = false; - - /* init the CRC */ - frame_crc = 0; - frame_crc = FLAC__CRC16_UPDATE(decoder->private_->header_warmup[0], frame_crc); - frame_crc = FLAC__CRC16_UPDATE(decoder->private_->header_warmup[1], frame_crc); - FLAC__bitreader_reset_read_crc16(decoder->private_->input, (FLAC__uint16)frame_crc); - - if(!read_frame_header_(decoder)) - return false; - if(decoder->protected_->state == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC) /* means we didn't sync on a valid header */ - return true; - if(!allocate_output_(decoder, decoder->private_->frame.header.blocksize, decoder->private_->frame.header.channels)) - return false; - for(channel = 0; channel < decoder->private_->frame.header.channels; channel++) { - /* - * first figure the correct bits-per-sample of the subframe - */ - unsigned bps = decoder->private_->frame.header.bits_per_sample; - switch(decoder->private_->frame.header.channel_assignment) { - case FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT: - /* no adjustment needed */ - break; - case FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE: - FLAC__ASSERT(decoder->private_->frame.header.channels == 2); - if(channel == 1) - bps++; - break; - case FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE: - FLAC__ASSERT(decoder->private_->frame.header.channels == 2); - if(channel == 0) - bps++; - break; - case FLAC__CHANNEL_ASSIGNMENT_MID_SIDE: - FLAC__ASSERT(decoder->private_->frame.header.channels == 2); - if(channel == 1) - bps++; - break; - default: - FLAC__ASSERT(0); - } - /* - * now read it - */ - if(!read_subframe_(decoder, channel, bps, do_full_decode)) - return false; - if(decoder->protected_->state == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC) /* means bad sync or got corruption */ - return true; - } - if(!read_zero_padding_(decoder)) - return false; - if(decoder->protected_->state == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC) /* means bad sync or got corruption (i.e. "zero bits" were not all zeroes) */ - return true; - - /* - * Read the frame CRC-16 from the footer and check - */ - frame_crc = FLAC__bitreader_get_read_crc16(decoder->private_->input); - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, FLAC__FRAME_FOOTER_CRC_LEN)) - return false; /* read_callback_ sets the state for us */ - if(frame_crc == x) { - if(do_full_decode) { - /* Undo any special channel coding */ - switch(decoder->private_->frame.header.channel_assignment) { - case FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT: - /* do nothing */ - break; - case FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE: - FLAC__ASSERT(decoder->private_->frame.header.channels == 2); - for(i = 0; i < decoder->private_->frame.header.blocksize; i++) - decoder->private_->output[1][i] = decoder->private_->output[0][i] - decoder->private_->output[1][i]; - break; - case FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE: - FLAC__ASSERT(decoder->private_->frame.header.channels == 2); - for(i = 0; i < decoder->private_->frame.header.blocksize; i++) - decoder->private_->output[0][i] += decoder->private_->output[1][i]; - break; - case FLAC__CHANNEL_ASSIGNMENT_MID_SIDE: - FLAC__ASSERT(decoder->private_->frame.header.channels == 2); - for(i = 0; i < decoder->private_->frame.header.blocksize; i++) { -#if 1 - mid = decoder->private_->output[0][i]; - side = decoder->private_->output[1][i]; - mid <<= 1; - mid |= (side & 1); /* i.e. if 'side' is odd... */ - decoder->private_->output[0][i] = (mid + side) >> 1; - decoder->private_->output[1][i] = (mid - side) >> 1; -#else - /* OPT: without 'side' temp variable */ - mid = (decoder->private_->output[0][i] << 1) | (decoder->private_->output[1][i] & 1); /* i.e. if 'side' is odd... */ - decoder->private_->output[0][i] = (mid + decoder->private_->output[1][i]) >> 1; - decoder->private_->output[1][i] = (mid - decoder->private_->output[1][i]) >> 1; -#endif - } - break; - default: - FLAC__ASSERT(0); - break; - } - } - } - else { - /* Bad frame, emit error and zero the output signal */ - send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH); - if(do_full_decode) { - for(channel = 0; channel < decoder->private_->frame.header.channels; channel++) { - memset(decoder->private_->output[channel], 0, sizeof(FLAC__int32) * decoder->private_->frame.header.blocksize); - } - } - } - - *got_a_frame = true; - - /* we wait to update fixed_block_size until here, when we're sure we've got a proper frame and hence a correct blocksize */ - if(decoder->private_->next_fixed_block_size) - decoder->private_->fixed_block_size = decoder->private_->next_fixed_block_size; - - /* put the latest values into the public section of the decoder instance */ - decoder->protected_->channels = decoder->private_->frame.header.channels; - decoder->protected_->channel_assignment = decoder->private_->frame.header.channel_assignment; - decoder->protected_->bits_per_sample = decoder->private_->frame.header.bits_per_sample; - decoder->protected_->sample_rate = decoder->private_->frame.header.sample_rate; - decoder->protected_->blocksize = decoder->private_->frame.header.blocksize; - - FLAC__ASSERT(decoder->private_->frame.header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER); - decoder->private_->samples_decoded = decoder->private_->frame.header.number.sample_number + decoder->private_->frame.header.blocksize; - - /* write it */ - if(do_full_decode) { - if(write_audio_frame_to_client_(decoder, &decoder->private_->frame, (const FLAC__int32 * const *)decoder->private_->output) != FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE) - return false; - } - - decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; - return true; -} - -FLAC__bool read_frame_header_(FLAC__StreamDecoder *decoder) -{ - FLAC__uint32 x; - FLAC__uint64 xx; - unsigned i, blocksize_hint = 0, sample_rate_hint = 0; - FLAC__byte crc8, raw_header[16]; /* MAGIC NUMBER based on the maximum frame header size, including CRC */ - unsigned raw_header_len; - FLAC__bool is_unparseable = false; - - FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input)); - - /* init the raw header with the saved bits from synchronization */ - raw_header[0] = decoder->private_->header_warmup[0]; - raw_header[1] = decoder->private_->header_warmup[1]; - raw_header_len = 2; - - /* check to make sure that reserved bit is 0 */ - if(raw_header[1] & 0x02) /* MAGIC NUMBER */ - is_unparseable = true; - - /* - * Note that along the way as we read the header, we look for a sync - * code inside. If we find one it would indicate that our original - * sync was bad since there cannot be a sync code in a valid header. - * - * Three kinds of things can go wrong when reading the frame header: - * 1) We may have sync'ed incorrectly and not landed on a frame header. - * If we don't find a sync code, it can end up looking like we read - * a valid but unparseable header, until getting to the frame header - * CRC. Even then we could get a false positive on the CRC. - * 2) We may have sync'ed correctly but on an unparseable frame (from a - * future encoder). - * 3) We may be on a damaged frame which appears valid but unparseable. - * - * For all these reasons, we try and read a complete frame header as - * long as it seems valid, even if unparseable, up until the frame - * header CRC. - */ - - /* - * read in the raw header as bytes so we can CRC it, and parse it on the way - */ - for(i = 0; i < 2; i++) { - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8)) - return false; /* read_callback_ sets the state for us */ - if(x == 0xff) { /* MAGIC NUMBER for the first 8 frame sync bits */ - /* if we get here it means our original sync was erroneous since the sync code cannot appear in the header */ - decoder->private_->lookahead = (FLAC__byte)x; - decoder->private_->cached = true; - send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER); - decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; - return true; - } - raw_header[raw_header_len++] = (FLAC__byte)x; - } - - switch(x = raw_header[2] >> 4) { - case 0: - is_unparseable = true; - break; - case 1: - decoder->private_->frame.header.blocksize = 192; - break; - case 2: - case 3: - case 4: - case 5: - decoder->private_->frame.header.blocksize = 576 << (x-2); - break; - case 6: - case 7: - blocksize_hint = x; - break; - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - decoder->private_->frame.header.blocksize = 256 << (x-8); - break; - default: - FLAC__ASSERT(0); - break; - } - - switch(x = raw_header[2] & 0x0f) { - case 0: - if(decoder->private_->has_stream_info) - decoder->private_->frame.header.sample_rate = decoder->private_->stream_info.data.stream_info.sample_rate; - else - is_unparseable = true; - break; - case 1: - decoder->private_->frame.header.sample_rate = 88200; - break; - case 2: - decoder->private_->frame.header.sample_rate = 176400; - break; - case 3: - decoder->private_->frame.header.sample_rate = 192000; - break; - case 4: - decoder->private_->frame.header.sample_rate = 8000; - break; - case 5: - decoder->private_->frame.header.sample_rate = 16000; - break; - case 6: - decoder->private_->frame.header.sample_rate = 22050; - break; - case 7: - decoder->private_->frame.header.sample_rate = 24000; - break; - case 8: - decoder->private_->frame.header.sample_rate = 32000; - break; - case 9: - decoder->private_->frame.header.sample_rate = 44100; - break; - case 10: - decoder->private_->frame.header.sample_rate = 48000; - break; - case 11: - decoder->private_->frame.header.sample_rate = 96000; - break; - case 12: - case 13: - case 14: - sample_rate_hint = x; - break; - case 15: - send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER); - decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; - return true; - default: - FLAC__ASSERT(0); - } - - x = (unsigned)(raw_header[3] >> 4); - if(x & 8) { - decoder->private_->frame.header.channels = 2; - switch(x & 7) { - case 0: - decoder->private_->frame.header.channel_assignment = FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE; - break; - case 1: - decoder->private_->frame.header.channel_assignment = FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE; - break; - case 2: - decoder->private_->frame.header.channel_assignment = FLAC__CHANNEL_ASSIGNMENT_MID_SIDE; - break; - default: - is_unparseable = true; - break; - } - } - else { - decoder->private_->frame.header.channels = (unsigned)x + 1; - decoder->private_->frame.header.channel_assignment = FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT; - } - - switch(x = (unsigned)(raw_header[3] & 0x0e) >> 1) { - case 0: - if(decoder->private_->has_stream_info) - decoder->private_->frame.header.bits_per_sample = decoder->private_->stream_info.data.stream_info.bits_per_sample; - else - is_unparseable = true; - break; - case 1: - decoder->private_->frame.header.bits_per_sample = 8; - break; - case 2: - decoder->private_->frame.header.bits_per_sample = 12; - break; - case 4: - decoder->private_->frame.header.bits_per_sample = 16; - break; - case 5: - decoder->private_->frame.header.bits_per_sample = 20; - break; - case 6: - decoder->private_->frame.header.bits_per_sample = 24; - break; - case 3: - case 7: - is_unparseable = true; - break; - default: - FLAC__ASSERT(0); - break; - } - - /* check to make sure that reserved bit is 0 */ - if(raw_header[3] & 0x01) /* MAGIC NUMBER */ - is_unparseable = true; - - /* read the frame's starting sample number (or frame number as the case may be) */ - if( - raw_header[1] & 0x01 || - /*@@@ this clause is a concession to the old way of doing variable blocksize; the only known implementation is flake and can probably be removed without inconveniencing anyone */ - (decoder->private_->has_stream_info && decoder->private_->stream_info.data.stream_info.min_blocksize != decoder->private_->stream_info.data.stream_info.max_blocksize) - ) { /* variable blocksize */ - if(!FLAC__bitreader_read_utf8_uint64(decoder->private_->input, &xx, raw_header, &raw_header_len)) - return false; /* read_callback_ sets the state for us */ - if(xx == FLAC__U64L(0xffffffffffffffff)) { /* i.e. non-UTF8 code... */ - decoder->private_->lookahead = raw_header[raw_header_len-1]; /* back up as much as we can */ - decoder->private_->cached = true; - send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER); - decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; - return true; - } - decoder->private_->frame.header.number_type = FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER; - decoder->private_->frame.header.number.sample_number = xx; - } - else { /* fixed blocksize */ - if(!FLAC__bitreader_read_utf8_uint32(decoder->private_->input, &x, raw_header, &raw_header_len)) - return false; /* read_callback_ sets the state for us */ - if(x == 0xffffffff) { /* i.e. non-UTF8 code... */ - decoder->private_->lookahead = raw_header[raw_header_len-1]; /* back up as much as we can */ - decoder->private_->cached = true; - send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER); - decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; - return true; - } - decoder->private_->frame.header.number_type = FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER; - decoder->private_->frame.header.number.frame_number = x; - } - - if(blocksize_hint) { - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8)) - return false; /* read_callback_ sets the state for us */ - raw_header[raw_header_len++] = (FLAC__byte)x; - if(blocksize_hint == 7) { - FLAC__uint32 _x; - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &_x, 8)) - return false; /* read_callback_ sets the state for us */ - raw_header[raw_header_len++] = (FLAC__byte)_x; - x = (x << 8) | _x; - } - decoder->private_->frame.header.blocksize = x+1; - } - - if(sample_rate_hint) { - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8)) - return false; /* read_callback_ sets the state for us */ - raw_header[raw_header_len++] = (FLAC__byte)x; - if(sample_rate_hint != 12) { - FLAC__uint32 _x; - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &_x, 8)) - return false; /* read_callback_ sets the state for us */ - raw_header[raw_header_len++] = (FLAC__byte)_x; - x = (x << 8) | _x; - } - if(sample_rate_hint == 12) - decoder->private_->frame.header.sample_rate = x*1000; - else if(sample_rate_hint == 13) - decoder->private_->frame.header.sample_rate = x; - else - decoder->private_->frame.header.sample_rate = x*10; - } - - /* read the CRC-8 byte */ - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8)) - return false; /* read_callback_ sets the state for us */ - crc8 = (FLAC__byte)x; - - if(FLAC__crc8(raw_header, raw_header_len) != crc8) { - send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER); - decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; - return true; - } - - /* calculate the sample number from the frame number if needed */ - decoder->private_->next_fixed_block_size = 0; - if(decoder->private_->frame.header.number_type == FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER) { - x = decoder->private_->frame.header.number.frame_number; - decoder->private_->frame.header.number_type = FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER; - if(decoder->private_->fixed_block_size) - decoder->private_->frame.header.number.sample_number = (FLAC__uint64)decoder->private_->fixed_block_size * (FLAC__uint64)x; - else if(decoder->private_->has_stream_info) { - if(decoder->private_->stream_info.data.stream_info.min_blocksize == decoder->private_->stream_info.data.stream_info.max_blocksize) { - decoder->private_->frame.header.number.sample_number = (FLAC__uint64)decoder->private_->stream_info.data.stream_info.min_blocksize * (FLAC__uint64)x; - decoder->private_->next_fixed_block_size = decoder->private_->stream_info.data.stream_info.max_blocksize; - } - else - is_unparseable = true; - } - else if(x == 0) { - decoder->private_->frame.header.number.sample_number = 0; - decoder->private_->next_fixed_block_size = decoder->private_->frame.header.blocksize; - } - else { - /* can only get here if the stream has invalid frame numbering and no STREAMINFO, so assume it's not the last (possibly short) frame */ - decoder->private_->frame.header.number.sample_number = (FLAC__uint64)decoder->private_->frame.header.blocksize * (FLAC__uint64)x; - } - } - - if(is_unparseable) { - send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM); - decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; - return true; - } - - return true; -} - -FLAC__bool read_subframe_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, FLAC__bool do_full_decode) -{ - FLAC__uint32 x; - FLAC__bool wasted_bits; - unsigned i; - - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &x, 8)) /* MAGIC NUMBER */ - return false; /* read_callback_ sets the state for us */ - - wasted_bits = (x & 1); - x &= 0xfe; - - if(wasted_bits) { - unsigned u; - if(!FLAC__bitreader_read_unary_unsigned(decoder->private_->input, &u)) - return false; /* read_callback_ sets the state for us */ - decoder->private_->frame.subframes[channel].wasted_bits = u+1; - bps -= decoder->private_->frame.subframes[channel].wasted_bits; - } - else - decoder->private_->frame.subframes[channel].wasted_bits = 0; - - /* - * Lots of magic numbers here - */ - if(x & 0x80) { - send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC); - decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; - return true; - } - else if(x == 0) { - if(!read_subframe_constant_(decoder, channel, bps, do_full_decode)) - return false; - } - else if(x == 2) { - if(!read_subframe_verbatim_(decoder, channel, bps, do_full_decode)) - return false; - } - else if(x < 16) { - send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM); - decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; - return true; - } - else if(x <= 24) { - if(!read_subframe_fixed_(decoder, channel, bps, (x>>1)&7, do_full_decode)) - return false; - if(decoder->protected_->state == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC) /* means bad sync or got corruption */ - return true; - } - else if(x < 64) { - send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM); - decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; - return true; - } - else { - if(!read_subframe_lpc_(decoder, channel, bps, ((x>>1)&31)+1, do_full_decode)) - return false; - if(decoder->protected_->state == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC) /* means bad sync or got corruption */ - return true; - } - - if(wasted_bits && do_full_decode) { - x = decoder->private_->frame.subframes[channel].wasted_bits; - for(i = 0; i < decoder->private_->frame.header.blocksize; i++) - decoder->private_->output[channel][i] <<= x; - } - - return true; -} - -FLAC__bool read_subframe_constant_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, FLAC__bool do_full_decode) -{ - FLAC__Subframe_Constant *subframe = &decoder->private_->frame.subframes[channel].data.constant; - FLAC__int32 x; - unsigned i; - FLAC__int32 *output = decoder->private_->output[channel]; - - decoder->private_->frame.subframes[channel].type = FLAC__SUBFRAME_TYPE_CONSTANT; - - if(!FLAC__bitreader_read_raw_int32(decoder->private_->input, &x, bps)) - return false; /* read_callback_ sets the state for us */ - - subframe->value = x; - - /* decode the subframe */ - if(do_full_decode) { - for(i = 0; i < decoder->private_->frame.header.blocksize; i++) - output[i] = x; - } - - return true; -} - -FLAC__bool read_subframe_fixed_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, const unsigned order, FLAC__bool do_full_decode) -{ - FLAC__Subframe_Fixed *subframe = &decoder->private_->frame.subframes[channel].data.fixed; - FLAC__int32 i32; - FLAC__uint32 u32; - unsigned u; - - decoder->private_->frame.subframes[channel].type = FLAC__SUBFRAME_TYPE_FIXED; - - subframe->residual = decoder->private_->residual[channel]; - subframe->order = order; - - /* read warm-up samples */ - for(u = 0; u < order; u++) { - if(!FLAC__bitreader_read_raw_int32(decoder->private_->input, &i32, bps)) - return false; /* read_callback_ sets the state for us */ - subframe->warmup[u] = i32; - } - - /* read entropy coding method info */ - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &u32, FLAC__ENTROPY_CODING_METHOD_TYPE_LEN)) - return false; /* read_callback_ sets the state for us */ - subframe->entropy_coding_method.type = (FLAC__EntropyCodingMethodType)u32; - switch(subframe->entropy_coding_method.type) { - case FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE: - case FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2: - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &u32, FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN)) - return false; /* read_callback_ sets the state for us */ - subframe->entropy_coding_method.data.partitioned_rice.order = u32; - subframe->entropy_coding_method.data.partitioned_rice.contents = &decoder->private_->partitioned_rice_contents[channel]; - break; - default: - send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM); - decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; - return true; - } - - /* read residual */ - switch(subframe->entropy_coding_method.type) { - case FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE: - case FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2: - if(!read_residual_partitioned_rice_(decoder, order, subframe->entropy_coding_method.data.partitioned_rice.order, &decoder->private_->partitioned_rice_contents[channel], decoder->private_->residual[channel], /*is_extended=*/subframe->entropy_coding_method.type == FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2)) - return false; - break; - default: - FLAC__ASSERT(0); - } - - /* decode the subframe */ - if(do_full_decode) { - memcpy(decoder->private_->output[channel], subframe->warmup, sizeof(FLAC__int32) * order); - FLAC__fixed_restore_signal(decoder->private_->residual[channel], decoder->private_->frame.header.blocksize-order, order, decoder->private_->output[channel]+order); - } - - return true; -} - -FLAC__bool read_subframe_lpc_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, const unsigned order, FLAC__bool do_full_decode) -{ - FLAC__Subframe_LPC *subframe = &decoder->private_->frame.subframes[channel].data.lpc; - FLAC__int32 i32; - FLAC__uint32 u32; - unsigned u; - - decoder->private_->frame.subframes[channel].type = FLAC__SUBFRAME_TYPE_LPC; - - subframe->residual = decoder->private_->residual[channel]; - subframe->order = order; - - /* read warm-up samples */ - for(u = 0; u < order; u++) { - if(!FLAC__bitreader_read_raw_int32(decoder->private_->input, &i32, bps)) - return false; /* read_callback_ sets the state for us */ - subframe->warmup[u] = i32; - } - - /* read qlp coeff precision */ - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &u32, FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN)) - return false; /* read_callback_ sets the state for us */ - if(u32 == (1u << FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN) - 1) { - send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC); - decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; - return true; - } - subframe->qlp_coeff_precision = u32+1; - - /* read qlp shift */ - if(!FLAC__bitreader_read_raw_int32(decoder->private_->input, &i32, FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN)) - return false; /* read_callback_ sets the state for us */ - subframe->quantization_level = i32; - - /* read quantized lp coefficiencts */ - for(u = 0; u < order; u++) { - if(!FLAC__bitreader_read_raw_int32(decoder->private_->input, &i32, subframe->qlp_coeff_precision)) - return false; /* read_callback_ sets the state for us */ - subframe->qlp_coeff[u] = i32; - } - - /* read entropy coding method info */ - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &u32, FLAC__ENTROPY_CODING_METHOD_TYPE_LEN)) - return false; /* read_callback_ sets the state for us */ - subframe->entropy_coding_method.type = (FLAC__EntropyCodingMethodType)u32; - switch(subframe->entropy_coding_method.type) { - case FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE: - case FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2: - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &u32, FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN)) - return false; /* read_callback_ sets the state for us */ - subframe->entropy_coding_method.data.partitioned_rice.order = u32; - subframe->entropy_coding_method.data.partitioned_rice.contents = &decoder->private_->partitioned_rice_contents[channel]; - break; - default: - send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM); - decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; - return true; - } - - /* read residual */ - switch(subframe->entropy_coding_method.type) { - case FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE: - case FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2: - if(!read_residual_partitioned_rice_(decoder, order, subframe->entropy_coding_method.data.partitioned_rice.order, &decoder->private_->partitioned_rice_contents[channel], decoder->private_->residual[channel], /*is_extended=*/subframe->entropy_coding_method.type == FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2)) - return false; - break; - default: - FLAC__ASSERT(0); - } - - /* decode the subframe */ - if(do_full_decode) { - memcpy(decoder->private_->output[channel], subframe->warmup, sizeof(FLAC__int32) * order); - /*@@@@@@ technically not pessimistic enough, should be more like - if( (FLAC__uint64)order * ((((FLAC__uint64)1)<<bps)-1) * ((1<<subframe->qlp_coeff_precision)-1) < (((FLAC__uint64)-1) << 32) ) - */ - if(bps + subframe->qlp_coeff_precision + FLAC__bitmath_ilog2(order) <= 32) - if(bps <= 16 && subframe->qlp_coeff_precision <= 16) { - if(order <= 8) - decoder->private_->local_lpc_restore_signal_16bit_order8(decoder->private_->residual[channel], decoder->private_->frame.header.blocksize-order, subframe->qlp_coeff, order, subframe->quantization_level, decoder->private_->output[channel]+order); - else - decoder->private_->local_lpc_restore_signal_16bit(decoder->private_->residual[channel], decoder->private_->frame.header.blocksize-order, subframe->qlp_coeff, order, subframe->quantization_level, decoder->private_->output[channel]+order); - } - else - decoder->private_->local_lpc_restore_signal(decoder->private_->residual[channel], decoder->private_->frame.header.blocksize-order, subframe->qlp_coeff, order, subframe->quantization_level, decoder->private_->output[channel]+order); - else - decoder->private_->local_lpc_restore_signal_64bit(decoder->private_->residual[channel], decoder->private_->frame.header.blocksize-order, subframe->qlp_coeff, order, subframe->quantization_level, decoder->private_->output[channel]+order); - } - - return true; -} - -FLAC__bool read_subframe_verbatim_(FLAC__StreamDecoder *decoder, unsigned channel, unsigned bps, FLAC__bool do_full_decode) -{ - FLAC__Subframe_Verbatim *subframe = &decoder->private_->frame.subframes[channel].data.verbatim; - FLAC__int32 x, *residual = decoder->private_->residual[channel]; - unsigned i; - - decoder->private_->frame.subframes[channel].type = FLAC__SUBFRAME_TYPE_VERBATIM; - - subframe->data = residual; - - for(i = 0; i < decoder->private_->frame.header.blocksize; i++) { - if(!FLAC__bitreader_read_raw_int32(decoder->private_->input, &x, bps)) - return false; /* read_callback_ sets the state for us */ - residual[i] = x; - } - - /* decode the subframe */ - if(do_full_decode) - memcpy(decoder->private_->output[channel], subframe->data, sizeof(FLAC__int32) * decoder->private_->frame.header.blocksize); - - return true; -} - -FLAC__bool read_residual_partitioned_rice_(FLAC__StreamDecoder *decoder, unsigned predictor_order, unsigned partition_order, FLAC__EntropyCodingMethod_PartitionedRiceContents *partitioned_rice_contents, FLAC__int32 *residual, FLAC__bool is_extended) -{ - FLAC__uint32 rice_parameter; - int i; - unsigned partition, sample, u; - const unsigned partitions = 1u << partition_order; - const unsigned partition_samples = partition_order > 0? decoder->private_->frame.header.blocksize >> partition_order : decoder->private_->frame.header.blocksize - predictor_order; - const unsigned plen = is_extended? FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN : FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN; - const unsigned pesc = is_extended? FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_ESCAPE_PARAMETER : FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER; - - /* sanity checks */ - if(partition_order == 0) { - if(decoder->private_->frame.header.blocksize < predictor_order) { - send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC); - decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; - return true; - } - } - else { - if(partition_samples < predictor_order) { - send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC); - decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; - return true; - } - } - - if(!FLAC__format_entropy_coding_method_partitioned_rice_contents_ensure_size(partitioned_rice_contents, max(6, partition_order))) { - decoder->protected_->state = FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR; - return false; - } - - sample = 0; - for(partition = 0; partition < partitions; partition++) { - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &rice_parameter, plen)) - return false; /* read_callback_ sets the state for us */ - partitioned_rice_contents->parameters[partition] = rice_parameter; - if(rice_parameter < pesc) { - partitioned_rice_contents->raw_bits[partition] = 0; - u = (partition_order == 0 || partition > 0)? partition_samples : partition_samples - predictor_order; - if(!decoder->private_->local_bitreader_read_rice_signed_block(decoder->private_->input, residual + sample, u, rice_parameter)) - return false; /* read_callback_ sets the state for us */ - sample += u; - } - else { - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &rice_parameter, FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_RAW_LEN)) - return false; /* read_callback_ sets the state for us */ - partitioned_rice_contents->raw_bits[partition] = rice_parameter; - for(u = (partition_order == 0 || partition > 0)? 0 : predictor_order; u < partition_samples; u++, sample++) { - if(!FLAC__bitreader_read_raw_int32(decoder->private_->input, &i, rice_parameter)) - return false; /* read_callback_ sets the state for us */ - residual[sample] = i; - } - } - } - - return true; -} - -FLAC__bool read_zero_padding_(FLAC__StreamDecoder *decoder) -{ - if(!FLAC__bitreader_is_consumed_byte_aligned(decoder->private_->input)) { - FLAC__uint32 zero = 0; - if(!FLAC__bitreader_read_raw_uint32(decoder->private_->input, &zero, FLAC__bitreader_bits_left_for_byte_alignment(decoder->private_->input))) - return false; /* read_callback_ sets the state for us */ - if(zero != 0) { - send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC); - decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; - } - } - return true; -} - -FLAC__bool read_callback_(FLAC__byte buffer[], size_t *bytes, void *client_data) -{ - FLAC__StreamDecoder *decoder = (FLAC__StreamDecoder *)client_data; - - if( -#if FLAC__HAS_OGG - /* see [1] HACK NOTE below for why we don't call the eof_callback when decoding Ogg FLAC */ - !decoder->private_->is_ogg && -#endif - decoder->private_->eof_callback && decoder->private_->eof_callback(decoder, decoder->private_->client_data) - ) { - *bytes = 0; - decoder->protected_->state = FLAC__STREAM_DECODER_END_OF_STREAM; - return false; - } - else if(*bytes > 0) { - /* While seeking, it is possible for our seek to land in the - * middle of audio data that looks exactly like a frame header - * from a future version of an encoder. When that happens, our - * error callback will get an - * FLAC__STREAM_DECODER_UNPARSEABLE_STREAM and increment its - * unparseable_frame_count. But there is a remote possibility - * that it is properly synced at such a "future-codec frame", - * so to make sure, we wait to see many "unparseable" errors in - * a row before bailing out. - */ - if(decoder->private_->is_seeking && decoder->private_->unparseable_frame_count > 20) { - decoder->protected_->state = FLAC__STREAM_DECODER_ABORTED; - return false; - } - else { - const FLAC__StreamDecoderReadStatus status = -#if FLAC__HAS_OGG - decoder->private_->is_ogg? - read_callback_ogg_aspect_(decoder, buffer, bytes) : -#endif - decoder->private_->read_callback(decoder, buffer, bytes, decoder->private_->client_data) - ; - if(status == FLAC__STREAM_DECODER_READ_STATUS_ABORT) { - decoder->protected_->state = FLAC__STREAM_DECODER_ABORTED; - return false; - } - else if(*bytes == 0) { - if( - status == FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM || - ( -#if FLAC__HAS_OGG - /* see [1] HACK NOTE below for why we don't call the eof_callback when decoding Ogg FLAC */ - !decoder->private_->is_ogg && -#endif - decoder->private_->eof_callback && decoder->private_->eof_callback(decoder, decoder->private_->client_data) - ) - ) { - decoder->protected_->state = FLAC__STREAM_DECODER_END_OF_STREAM; - return false; - } - else - return true; - } - else - return true; - } - } - else { - /* abort to avoid a deadlock */ - decoder->protected_->state = FLAC__STREAM_DECODER_ABORTED; - return false; - } - /* [1] @@@ HACK NOTE: The end-of-stream checking has to be hacked around - * for Ogg FLAC. This is because the ogg decoder aspect can lose sync - * and at the same time hit the end of the stream (for example, seeking - * to a point that is after the beginning of the last Ogg page). There - * is no way to report an Ogg sync loss through the callbacks (see note - * in read_callback_ogg_aspect_()) so it returns CONTINUE with *bytes==0. - * So to keep the decoder from stopping at this point we gate the call - * to the eof_callback and let the Ogg decoder aspect set the - * end-of-stream state when it is needed. - */ -} - -#if FLAC__HAS_OGG -FLAC__StreamDecoderReadStatus read_callback_ogg_aspect_(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes) -{ - switch(FLAC__ogg_decoder_aspect_read_callback_wrapper(&decoder->protected_->ogg_decoder_aspect, buffer, bytes, read_callback_proxy_, decoder, decoder->private_->client_data)) { - case FLAC__OGG_DECODER_ASPECT_READ_STATUS_OK: - return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; - /* we don't really have a way to handle lost sync via read - * callback so we'll let it pass and let the underlying - * FLAC decoder catch the error - */ - case FLAC__OGG_DECODER_ASPECT_READ_STATUS_LOST_SYNC: - return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; - case FLAC__OGG_DECODER_ASPECT_READ_STATUS_END_OF_STREAM: - return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; - case FLAC__OGG_DECODER_ASPECT_READ_STATUS_NOT_FLAC: - case FLAC__OGG_DECODER_ASPECT_READ_STATUS_UNSUPPORTED_MAPPING_VERSION: - case FLAC__OGG_DECODER_ASPECT_READ_STATUS_ABORT: - case FLAC__OGG_DECODER_ASPECT_READ_STATUS_ERROR: - case FLAC__OGG_DECODER_ASPECT_READ_STATUS_MEMORY_ALLOCATION_ERROR: - return FLAC__STREAM_DECODER_READ_STATUS_ABORT; - default: - FLAC__ASSERT(0); - /* double protection */ - return FLAC__STREAM_DECODER_READ_STATUS_ABORT; - } -} - -FLAC__OggDecoderAspectReadStatus read_callback_proxy_(const void *void_decoder, FLAC__byte buffer[], size_t *bytes, void *client_data) -{ - FLAC__StreamDecoder *decoder = (FLAC__StreamDecoder*)void_decoder; - - switch(decoder->private_->read_callback(decoder, buffer, bytes, client_data)) { - case FLAC__STREAM_DECODER_READ_STATUS_CONTINUE: - return FLAC__OGG_DECODER_ASPECT_READ_STATUS_OK; - case FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM: - return FLAC__OGG_DECODER_ASPECT_READ_STATUS_END_OF_STREAM; - case FLAC__STREAM_DECODER_READ_STATUS_ABORT: - return FLAC__OGG_DECODER_ASPECT_READ_STATUS_ABORT; - default: - /* double protection: */ - FLAC__ASSERT(0); - return FLAC__OGG_DECODER_ASPECT_READ_STATUS_ABORT; - } -} -#endif - -FLAC__StreamDecoderWriteStatus write_audio_frame_to_client_(FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[]) -{ - if(decoder->private_->is_seeking) { - FLAC__uint64 this_frame_sample = frame->header.number.sample_number; - FLAC__uint64 next_frame_sample = this_frame_sample + (FLAC__uint64)frame->header.blocksize; - FLAC__uint64 target_sample = decoder->private_->target_sample; - - FLAC__ASSERT(frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER); - -#if FLAC__HAS_OGG - decoder->private_->got_a_frame = true; -#endif - decoder->private_->last_frame = *frame; /* save the frame */ - if(this_frame_sample <= target_sample && target_sample < next_frame_sample) { /* we hit our target frame */ - unsigned delta = (unsigned)(target_sample - this_frame_sample); - /* kick out of seek mode */ - decoder->private_->is_seeking = false; - /* shift out the samples before target_sample */ - if(delta > 0) { - unsigned channel; - const FLAC__int32 *newbuffer[FLAC__MAX_CHANNELS]; - for(channel = 0; channel < frame->header.channels; channel++) - newbuffer[channel] = buffer[channel] + delta; - decoder->private_->last_frame.header.blocksize -= delta; - decoder->private_->last_frame.header.number.sample_number += (FLAC__uint64)delta; - /* write the relevant samples */ - return decoder->private_->write_callback(decoder, &decoder->private_->last_frame, newbuffer, decoder->private_->client_data); - } - else { - /* write the relevant samples */ - return decoder->private_->write_callback(decoder, frame, buffer, decoder->private_->client_data); - } - } - else { - return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; - } - } - else { - /* - * If we never got STREAMINFO, turn off MD5 checking to save - * cycles since we don't have a sum to compare to anyway - */ - if(!decoder->private_->has_stream_info) - decoder->private_->do_md5_checking = false; - if(decoder->private_->do_md5_checking) { - if(!FLAC__MD5Accumulate(&decoder->private_->md5context, buffer, frame->header.channels, frame->header.blocksize, (frame->header.bits_per_sample+7) / 8)) - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - } - return decoder->private_->write_callback(decoder, frame, buffer, decoder->private_->client_data); - } -} - -void send_error_to_client_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status) -{ - if(!decoder->private_->is_seeking) - decoder->private_->error_callback(decoder, status, decoder->private_->client_data); - else if(status == FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM) - decoder->private_->unparseable_frame_count++; -} - -FLAC__bool seek_to_absolute_sample_(FLAC__StreamDecoder *decoder, FLAC__uint64 stream_length, FLAC__uint64 target_sample) -{ - FLAC__uint64 first_frame_offset = decoder->private_->first_frame_offset, lower_bound, upper_bound, lower_bound_sample, upper_bound_sample, this_frame_sample; - FLAC__int64 pos = -1; - int i; - unsigned approx_bytes_per_frame; - FLAC__bool first_seek = true; - const FLAC__uint64 total_samples = FLAC__stream_decoder_get_total_samples(decoder); - const unsigned min_blocksize = decoder->private_->stream_info.data.stream_info.min_blocksize; - const unsigned max_blocksize = decoder->private_->stream_info.data.stream_info.max_blocksize; - const unsigned max_framesize = decoder->private_->stream_info.data.stream_info.max_framesize; - const unsigned min_framesize = decoder->private_->stream_info.data.stream_info.min_framesize; - /* take these from the current frame in case they've changed mid-stream */ - unsigned channels = FLAC__stream_decoder_get_channels(decoder); - unsigned bps = FLAC__stream_decoder_get_bits_per_sample(decoder); - const FLAC__StreamMetadata_SeekTable *seek_table = decoder->private_->has_seek_table? &decoder->private_->seek_table.data.seek_table : 0; - - /* use values from stream info if we didn't decode a frame */ - if(channels == 0) - channels = decoder->private_->stream_info.data.stream_info.channels; - if(bps == 0) - bps = decoder->private_->stream_info.data.stream_info.bits_per_sample; - - /* we are just guessing here */ - if(max_framesize > 0) - approx_bytes_per_frame = (max_framesize + min_framesize) / 2 + 1; - /* - * Check if it's a known fixed-blocksize stream. Note that though - * the spec doesn't allow zeroes in the STREAMINFO block, we may - * never get a STREAMINFO block when decoding so the value of - * min_blocksize might be zero. - */ - else if(min_blocksize == max_blocksize && min_blocksize > 0) { - /* note there are no () around 'bps/8' to keep precision up since it's an integer calulation */ - approx_bytes_per_frame = min_blocksize * channels * bps/8 + 64; - } - else - approx_bytes_per_frame = 4096 * channels * bps/8 + 64; - - /* - * First, we set an upper and lower bound on where in the - * stream we will search. For now we assume the worst case - * scenario, which is our best guess at the beginning of - * the first frame and end of the stream. - */ - lower_bound = first_frame_offset; - lower_bound_sample = 0; - upper_bound = stream_length; - upper_bound_sample = total_samples > 0 ? total_samples : target_sample /*estimate it*/; - - /* - * Now we refine the bounds if we have a seektable with - * suitable points. Note that according to the spec they - * must be ordered by ascending sample number. - * - * Note: to protect against invalid seek tables we will ignore points - * that have frame_samples==0 or sample_number>=total_samples - */ - if(seek_table) { - FLAC__uint64 new_lower_bound = lower_bound; - FLAC__uint64 new_upper_bound = upper_bound; - FLAC__uint64 new_lower_bound_sample = lower_bound_sample; - FLAC__uint64 new_upper_bound_sample = upper_bound_sample; - - /* find the closest seek point <= target_sample, if it exists */ - for(i = (int)seek_table->num_points - 1; i >= 0; i--) { - if( - seek_table->points[i].sample_number != FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER && - seek_table->points[i].frame_samples > 0 && /* defense against bad seekpoints */ - (total_samples <= 0 || seek_table->points[i].sample_number < total_samples) && /* defense against bad seekpoints */ - seek_table->points[i].sample_number <= target_sample - ) - break; - } - if(i >= 0) { /* i.e. we found a suitable seek point... */ - new_lower_bound = first_frame_offset + seek_table->points[i].stream_offset; - new_lower_bound_sample = seek_table->points[i].sample_number; - } - - /* find the closest seek point > target_sample, if it exists */ - for(i = 0; i < (int)seek_table->num_points; i++) { - if( - seek_table->points[i].sample_number != FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER && - seek_table->points[i].frame_samples > 0 && /* defense against bad seekpoints */ - (total_samples <= 0 || seek_table->points[i].sample_number < total_samples) && /* defense against bad seekpoints */ - seek_table->points[i].sample_number > target_sample - ) - break; - } - if(i < (int)seek_table->num_points) { /* i.e. we found a suitable seek point... */ - new_upper_bound = first_frame_offset + seek_table->points[i].stream_offset; - new_upper_bound_sample = seek_table->points[i].sample_number; - } - /* final protection against unsorted seek tables; keep original values if bogus */ - if(new_upper_bound >= new_lower_bound) { - lower_bound = new_lower_bound; - upper_bound = new_upper_bound; - lower_bound_sample = new_lower_bound_sample; - upper_bound_sample = new_upper_bound_sample; - } - } - - FLAC__ASSERT(upper_bound_sample >= lower_bound_sample); - /* there are 2 insidious ways that the following equality occurs, which - * we need to fix: - * 1) total_samples is 0 (unknown) and target_sample is 0 - * 2) total_samples is 0 (unknown) and target_sample happens to be - * exactly equal to the last seek point in the seek table; this - * means there is no seek point above it, and upper_bound_samples - * remains equal to the estimate (of target_samples) we made above - * in either case it does not hurt to move upper_bound_sample up by 1 - */ - if(upper_bound_sample == lower_bound_sample) - upper_bound_sample++; - - decoder->private_->target_sample = target_sample; - while(1) { - /* check if the bounds are still ok */ - if (lower_bound_sample >= upper_bound_sample || lower_bound > upper_bound) { - decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR; - return false; - } -#ifndef FLAC__INTEGER_ONLY_LIBRARY -#if defined _MSC_VER || defined __MINGW32__ - /* with VC++ you have to spoon feed it the casting */ - pos = (FLAC__int64)lower_bound + (FLAC__int64)((FLAC__double)(FLAC__int64)(target_sample - lower_bound_sample) / (FLAC__double)(FLAC__int64)(upper_bound_sample - lower_bound_sample) * (FLAC__double)(FLAC__int64)(upper_bound - lower_bound)) - approx_bytes_per_frame; -#else - pos = (FLAC__int64)lower_bound + (FLAC__int64)((FLAC__double)(target_sample - lower_bound_sample) / (FLAC__double)(upper_bound_sample - lower_bound_sample) * (FLAC__double)(upper_bound - lower_bound)) - approx_bytes_per_frame; -#endif -#else - /* a little less accurate: */ - if(upper_bound - lower_bound < 0xffffffff) - pos = (FLAC__int64)lower_bound + (FLAC__int64)(((target_sample - lower_bound_sample) * (upper_bound - lower_bound)) / (upper_bound_sample - lower_bound_sample)) - approx_bytes_per_frame; - else /* @@@ WATCHOUT, ~2TB limit */ - pos = (FLAC__int64)lower_bound + (FLAC__int64)((((target_sample - lower_bound_sample)>>8) * ((upper_bound - lower_bound)>>8)) / ((upper_bound_sample - lower_bound_sample)>>16)) - approx_bytes_per_frame; -#endif - if(pos >= (FLAC__int64)upper_bound) - pos = (FLAC__int64)upper_bound - 1; - if(pos < (FLAC__int64)lower_bound) - pos = (FLAC__int64)lower_bound; - if(decoder->private_->seek_callback(decoder, (FLAC__uint64)pos, decoder->private_->client_data) != FLAC__STREAM_DECODER_SEEK_STATUS_OK) { - decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR; - return false; - } - if(!FLAC__stream_decoder_flush(decoder)) { - /* above call sets the state for us */ - return false; - } - /* Now we need to get a frame. First we need to reset our - * unparseable_frame_count; if we get too many unparseable - * frames in a row, the read callback will return - * FLAC__STREAM_DECODER_READ_STATUS_ABORT, causing - * FLAC__stream_decoder_process_single() to return false. - */ - decoder->private_->unparseable_frame_count = 0; - if(!FLAC__stream_decoder_process_single(decoder)) { - decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR; - return false; - } - /* our write callback will change the state when it gets to the target frame */ - /* actually, we could have got_a_frame if our decoder is at FLAC__STREAM_DECODER_END_OF_STREAM so we need to check for that also */ -#if 0 - /*@@@@@@ used to be the following; not clear if the check for end of stream is needed anymore */ - if(decoder->protected_->state != FLAC__SEEKABLE_STREAM_DECODER_SEEKING && decoder->protected_->state != FLAC__STREAM_DECODER_END_OF_STREAM) - break; -#endif - if(!decoder->private_->is_seeking) - break; - - FLAC__ASSERT(decoder->private_->last_frame.header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER); - this_frame_sample = decoder->private_->last_frame.header.number.sample_number; - - if (0 == decoder->private_->samples_decoded || (this_frame_sample + decoder->private_->last_frame.header.blocksize >= upper_bound_sample && !first_seek)) { - if (pos == (FLAC__int64)lower_bound) { - /* can't move back any more than the first frame, something is fatally wrong */ - decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR; - return false; - } - /* our last move backwards wasn't big enough, try again */ - approx_bytes_per_frame = approx_bytes_per_frame? approx_bytes_per_frame * 2 : 16; - continue; - } - /* allow one seek over upper bound, so we can get a correct upper_bound_sample for streams with unknown total_samples */ - first_seek = false; - - /* make sure we are not seeking in corrupted stream */ - if (this_frame_sample < lower_bound_sample) { - decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR; - return false; - } - - /* we need to narrow the search */ - if(target_sample < this_frame_sample) { - upper_bound_sample = this_frame_sample + decoder->private_->last_frame.header.blocksize; -/*@@@@@@ what will decode position be if at end of stream? */ - if(!FLAC__stream_decoder_get_decode_position(decoder, &upper_bound)) { - decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR; - return false; - } - approx_bytes_per_frame = (unsigned)(2 * (upper_bound - pos) / 3 + 16); - } - else { /* target_sample >= this_frame_sample + this frame's blocksize */ - lower_bound_sample = this_frame_sample + decoder->private_->last_frame.header.blocksize; - if(!FLAC__stream_decoder_get_decode_position(decoder, &lower_bound)) { - decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR; - return false; - } - approx_bytes_per_frame = (unsigned)(2 * (lower_bound - pos) / 3 + 16); - } - } - - return true; -} - -#if FLAC__HAS_OGG -FLAC__bool seek_to_absolute_sample_ogg_(FLAC__StreamDecoder *decoder, FLAC__uint64 stream_length, FLAC__uint64 target_sample) -{ - FLAC__uint64 left_pos = 0, right_pos = stream_length; - FLAC__uint64 left_sample = 0, right_sample = FLAC__stream_decoder_get_total_samples(decoder); - FLAC__uint64 this_frame_sample = (FLAC__uint64)0 - 1; - FLAC__uint64 pos = 0; /* only initialized to avoid compiler warning */ - FLAC__bool did_a_seek; - unsigned iteration = 0; - - /* In the first iterations, we will calculate the target byte position - * by the distance from the target sample to left_sample and - * right_sample (let's call it "proportional search"). After that, we - * will switch to binary search. - */ - unsigned BINARY_SEARCH_AFTER_ITERATION = 2; - - /* We will switch to a linear search once our current sample is less - * than this number of samples ahead of the target sample - */ - static const FLAC__uint64 LINEAR_SEARCH_WITHIN_SAMPLES = FLAC__MAX_BLOCK_SIZE * 2; - - /* If the total number of samples is unknown, use a large value, and - * force binary search immediately. - */ - if(right_sample == 0) { - right_sample = (FLAC__uint64)(-1); - BINARY_SEARCH_AFTER_ITERATION = 0; - } - - decoder->private_->target_sample = target_sample; - for( ; ; iteration++) { - if (iteration == 0 || this_frame_sample > target_sample || target_sample - this_frame_sample > LINEAR_SEARCH_WITHIN_SAMPLES) { - if (iteration >= BINARY_SEARCH_AFTER_ITERATION) { - pos = (right_pos + left_pos) / 2; - } - else { -#ifndef FLAC__INTEGER_ONLY_LIBRARY -#if defined _MSC_VER || defined __MINGW32__ - /* with MSVC you have to spoon feed it the casting */ - pos = (FLAC__uint64)((FLAC__double)(FLAC__int64)(target_sample - left_sample) / (FLAC__double)(FLAC__int64)(right_sample - left_sample) * (FLAC__double)(FLAC__int64)(right_pos - left_pos)); -#else - pos = (FLAC__uint64)((FLAC__double)(target_sample - left_sample) / (FLAC__double)(right_sample - left_sample) * (FLAC__double)(right_pos - left_pos)); -#endif -#else - /* a little less accurate: */ - if ((target_sample-left_sample <= 0xffffffff) && (right_pos-left_pos <= 0xffffffff)) - pos = (FLAC__int64)(((target_sample-left_sample) * (right_pos-left_pos)) / (right_sample-left_sample)); - else /* @@@ WATCHOUT, ~2TB limit */ - pos = (FLAC__int64)((((target_sample-left_sample)>>8) * ((right_pos-left_pos)>>8)) / ((right_sample-left_sample)>>16)); -#endif - /* @@@ TODO: might want to limit pos to some distance - * before EOF, to make sure we land before the last frame, - * thereby getting a this_frame_sample and so having a better - * estimate. - */ - } - - /* physical seek */ - if(decoder->private_->seek_callback((FLAC__StreamDecoder*)decoder, (FLAC__uint64)pos, decoder->private_->client_data) != FLAC__STREAM_DECODER_SEEK_STATUS_OK) { - decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR; - return false; - } - if(!FLAC__stream_decoder_flush(decoder)) { - /* above call sets the state for us */ - return false; - } - did_a_seek = true; - } - else - did_a_seek = false; - - decoder->private_->got_a_frame = false; - if(!FLAC__stream_decoder_process_single(decoder)) { - decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR; - return false; - } - if(!decoder->private_->got_a_frame) { - if(did_a_seek) { - /* this can happen if we seek to a point after the last frame; we drop - * to binary search right away in this case to avoid any wasted - * iterations of proportional search. - */ - right_pos = pos; - BINARY_SEARCH_AFTER_ITERATION = 0; - } - else { - /* this can probably only happen if total_samples is unknown and the - * target_sample is past the end of the stream - */ - decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR; - return false; - } - } - /* our write callback will change the state when it gets to the target frame */ - else if(!decoder->private_->is_seeking) { - break; - } - else { - this_frame_sample = decoder->private_->last_frame.header.number.sample_number; - FLAC__ASSERT(decoder->private_->last_frame.header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER); - - if (did_a_seek) { - if (this_frame_sample <= target_sample) { - /* The 'equal' case should not happen, since - * FLAC__stream_decoder_process_single() - * should recognize that it has hit the - * target sample and we would exit through - * the 'break' above. - */ - FLAC__ASSERT(this_frame_sample != target_sample); - - left_sample = this_frame_sample; - /* sanity check to avoid infinite loop */ - if (left_pos == pos) { - decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR; - return false; - } - left_pos = pos; - } - else if(this_frame_sample > target_sample) { - right_sample = this_frame_sample; - /* sanity check to avoid infinite loop */ - if (right_pos == pos) { - decoder->protected_->state = FLAC__STREAM_DECODER_SEEK_ERROR; - return false; - } - right_pos = pos; - } - } - } - } - - return true; -} -#endif - -FLAC__StreamDecoderReadStatus file_read_callback_(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data) -{ - (void)client_data; - - if(*bytes > 0) { - *bytes = fread(buffer, sizeof(FLAC__byte), *bytes, decoder->private_->file); - if(ferror(decoder->private_->file)) - return FLAC__STREAM_DECODER_READ_STATUS_ABORT; - else if(*bytes == 0) - return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; - else - return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; - } - else - return FLAC__STREAM_DECODER_READ_STATUS_ABORT; /* abort to avoid a deadlock */ -} - -FLAC__StreamDecoderSeekStatus file_seek_callback_(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) -{ - (void)client_data; - - if(decoder->private_->file == stdin) - return FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED; - else if(fseeko(decoder->private_->file, (off_t)absolute_byte_offset, SEEK_SET) < 0) - return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; - else - return FLAC__STREAM_DECODER_SEEK_STATUS_OK; -} - -FLAC__StreamDecoderTellStatus file_tell_callback_(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data) -{ - off_t pos; - (void)client_data; - - if(decoder->private_->file == stdin) - return FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED; - else if((pos = ftello(decoder->private_->file)) < 0) - return FLAC__STREAM_DECODER_TELL_STATUS_ERROR; - else { - *absolute_byte_offset = (FLAC__uint64)pos; - return FLAC__STREAM_DECODER_TELL_STATUS_OK; - } -} - -FLAC__StreamDecoderLengthStatus file_length_callback_(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data) -{ - struct stat filestats; - (void)client_data; - - if(decoder->private_->file == stdin) - return FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED; - else if(fstat(fileno(decoder->private_->file), &filestats) != 0) - return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR; - else { - *stream_length = (FLAC__uint64)filestats.st_size; - return FLAC__STREAM_DECODER_LENGTH_STATUS_OK; - } -} - -FLAC__bool file_eof_callback_(const FLAC__StreamDecoder *decoder, void *client_data) -{ - (void)client_data; - - return feof(decoder->private_->file)? true : false; -} diff --git a/3rdparty/libflac/src/libFLAC/stream_encoder.c b/3rdparty/libflac/src/libFLAC/stream_encoder.c deleted file mode 100644 index afc79850096..00000000000 --- a/3rdparty/libflac/src/libFLAC/stream_encoder.c +++ /dev/null @@ -1,4361 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#if defined _MSC_VER || defined __MINGW32__ -#include <io.h> /* for _setmode() */ -#include <fcntl.h> /* for _O_BINARY */ -#endif -#if defined __CYGWIN__ || defined __EMX__ -#include <io.h> /* for setmode(), O_BINARY */ -#include <fcntl.h> /* for _O_BINARY */ -#endif -#include <limits.h> -#include <stdio.h> -#include <stdlib.h> /* for malloc() */ -#include <string.h> /* for memcpy() */ -#include <sys/types.h> /* for off_t */ -#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__ /* @@@ [2G limit] */ -#ifndef fseeko -#define fseeko fseek -#endif -#ifndef ftello -#define ftello ftell -#endif -#endif -#include "FLAC/assert.h" -#include "FLAC/stream_decoder.h" -#include "share/alloc.h" -#include "protected/stream_encoder.h" -#include "private/bitwriter.h" -#include "private/bitmath.h" -#include "private/crc.h" -#include "private/cpu.h" -#include "private/fixed.h" -#include "private/format.h" -#include "private/lpc.h" -#include "private/md5.h" -#include "private/memory.h" -#if FLAC__HAS_OGG -#include "private/ogg_helper.h" -#include "private/ogg_mapping.h" -#endif -#include "private/stream_encoder_framing.h" -#include "private/window.h" - -#ifndef FLaC__INLINE -#define FLaC__INLINE -#endif - -#ifdef min -#undef min -#endif -#define min(x,y) ((x)<(y)?(x):(y)) - -#ifdef max -#undef max -#endif -#define max(x,y) ((x)>(y)?(x):(y)) - -/* Exact Rice codeword length calculation is off by default. The simple - * (and fast) estimation (of how many bits a residual value will be - * encoded with) in this encoder is very good, almost always yielding - * compression within 0.1% of exact calculation. - */ -#undef EXACT_RICE_BITS_CALCULATION -/* Rice parameter searching is off by default. The simple (and fast) - * parameter estimation in this encoder is very good, almost always - * yielding compression within 0.1% of the optimal parameters. - */ -#undef ENABLE_RICE_PARAMETER_SEARCH - - -typedef struct { - FLAC__int32 *data[FLAC__MAX_CHANNELS]; - unsigned size; /* of each data[] in samples */ - unsigned tail; -} verify_input_fifo; - -typedef struct { - const FLAC__byte *data; - unsigned capacity; - unsigned bytes; -} verify_output; - -typedef enum { - ENCODER_IN_MAGIC = 0, - ENCODER_IN_METADATA = 1, - ENCODER_IN_AUDIO = 2 -} EncoderStateHint; - -static struct CompressionLevels { - FLAC__bool do_mid_side_stereo; - FLAC__bool loose_mid_side_stereo; - unsigned max_lpc_order; - unsigned qlp_coeff_precision; - FLAC__bool do_qlp_coeff_prec_search; - FLAC__bool do_escape_coding; - FLAC__bool do_exhaustive_model_search; - unsigned min_residual_partition_order; - unsigned max_residual_partition_order; - unsigned rice_parameter_search_dist; -} compression_levels_[] = { - { false, false, 0, 0, false, false, false, 0, 3, 0 }, - { true , true , 0, 0, false, false, false, 0, 3, 0 }, - { true , false, 0, 0, false, false, false, 0, 3, 0 }, - { false, false, 6, 0, false, false, false, 0, 4, 0 }, - { true , true , 8, 0, false, false, false, 0, 4, 0 }, - { true , false, 8, 0, false, false, false, 0, 5, 0 }, - { true , false, 8, 0, false, false, false, 0, 6, 0 }, - { true , false, 8, 0, false, false, true , 0, 6, 0 }, - { true , false, 12, 0, false, false, true , 0, 6, 0 } -}; - - -/*********************************************************************** - * - * Private class method prototypes - * - ***********************************************************************/ - -static void set_defaults_(FLAC__StreamEncoder *encoder); -static void free_(FLAC__StreamEncoder *encoder); -static FLAC__bool resize_buffers_(FLAC__StreamEncoder *encoder, unsigned new_blocksize); -static FLAC__bool write_bitbuffer_(FLAC__StreamEncoder *encoder, unsigned samples, FLAC__bool is_last_block); -static FLAC__StreamEncoderWriteStatus write_frame_(FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, FLAC__bool is_last_block); -static void update_metadata_(const FLAC__StreamEncoder *encoder); -#if FLAC__HAS_OGG -static void update_ogg_metadata_(FLAC__StreamEncoder *encoder); -#endif -static FLAC__bool process_frame_(FLAC__StreamEncoder *encoder, FLAC__bool is_fractional_block, FLAC__bool is_last_block); -static FLAC__bool process_subframes_(FLAC__StreamEncoder *encoder, FLAC__bool is_fractional_block); - -static FLAC__bool process_subframe_( - FLAC__StreamEncoder *encoder, - unsigned min_partition_order, - unsigned max_partition_order, - const FLAC__FrameHeader *frame_header, - unsigned subframe_bps, - const FLAC__int32 integer_signal[], - FLAC__Subframe *subframe[2], - FLAC__EntropyCodingMethod_PartitionedRiceContents *partitioned_rice_contents[2], - FLAC__int32 *residual[2], - unsigned *best_subframe, - unsigned *best_bits -); - -static FLAC__bool add_subframe_( - FLAC__StreamEncoder *encoder, - unsigned blocksize, - unsigned subframe_bps, - const FLAC__Subframe *subframe, - FLAC__BitWriter *frame -); - -static unsigned evaluate_constant_subframe_( - FLAC__StreamEncoder *encoder, - const FLAC__int32 signal, - unsigned blocksize, - unsigned subframe_bps, - FLAC__Subframe *subframe -); - -static unsigned evaluate_fixed_subframe_( - FLAC__StreamEncoder *encoder, - const FLAC__int32 signal[], - FLAC__int32 residual[], - FLAC__uint64 abs_residual_partition_sums[], - unsigned raw_bits_per_partition[], - unsigned blocksize, - unsigned subframe_bps, - unsigned order, - unsigned rice_parameter, - unsigned rice_parameter_limit, - unsigned min_partition_order, - unsigned max_partition_order, - FLAC__bool do_escape_coding, - unsigned rice_parameter_search_dist, - FLAC__Subframe *subframe, - FLAC__EntropyCodingMethod_PartitionedRiceContents *partitioned_rice_contents -); - -#ifndef FLAC__INTEGER_ONLY_LIBRARY -static unsigned evaluate_lpc_subframe_( - FLAC__StreamEncoder *encoder, - const FLAC__int32 signal[], - FLAC__int32 residual[], - FLAC__uint64 abs_residual_partition_sums[], - unsigned raw_bits_per_partition[], - const FLAC__real lp_coeff[], - unsigned blocksize, - unsigned subframe_bps, - unsigned order, - unsigned qlp_coeff_precision, - unsigned rice_parameter, - unsigned rice_parameter_limit, - unsigned min_partition_order, - unsigned max_partition_order, - FLAC__bool do_escape_coding, - unsigned rice_parameter_search_dist, - FLAC__Subframe *subframe, - FLAC__EntropyCodingMethod_PartitionedRiceContents *partitioned_rice_contents -); -#endif - -static unsigned evaluate_verbatim_subframe_( - FLAC__StreamEncoder *encoder, - const FLAC__int32 signal[], - unsigned blocksize, - unsigned subframe_bps, - FLAC__Subframe *subframe -); - -static unsigned find_best_partition_order_( - struct FLAC__StreamEncoderPrivate *private_, - const FLAC__int32 residual[], - FLAC__uint64 abs_residual_partition_sums[], - unsigned raw_bits_per_partition[], - unsigned residual_samples, - unsigned predictor_order, - unsigned rice_parameter, - unsigned rice_parameter_limit, - unsigned min_partition_order, - unsigned max_partition_order, - unsigned bps, - FLAC__bool do_escape_coding, - unsigned rice_parameter_search_dist, - FLAC__EntropyCodingMethod *best_ecm -); - -static void precompute_partition_info_sums_( - const FLAC__int32 residual[], - FLAC__uint64 abs_residual_partition_sums[], - unsigned residual_samples, - unsigned predictor_order, - unsigned min_partition_order, - unsigned max_partition_order, - unsigned bps -); - -static void precompute_partition_info_escapes_( - const FLAC__int32 residual[], - unsigned raw_bits_per_partition[], - unsigned residual_samples, - unsigned predictor_order, - unsigned min_partition_order, - unsigned max_partition_order -); - -static FLAC__bool set_partitioned_rice_( -#ifdef EXACT_RICE_BITS_CALCULATION - const FLAC__int32 residual[], -#endif - const FLAC__uint64 abs_residual_partition_sums[], - const unsigned raw_bits_per_partition[], - const unsigned residual_samples, - const unsigned predictor_order, - const unsigned suggested_rice_parameter, - const unsigned rice_parameter_limit, - const unsigned rice_parameter_search_dist, - const unsigned partition_order, - const FLAC__bool search_for_escapes, - FLAC__EntropyCodingMethod_PartitionedRiceContents *partitioned_rice_contents, - unsigned *bits -); - -static unsigned get_wasted_bits_(FLAC__int32 signal[], unsigned samples); - -/* verify-related routines: */ -static void append_to_verify_fifo_( - verify_input_fifo *fifo, - const FLAC__int32 * const input[], - unsigned input_offset, - unsigned channels, - unsigned wide_samples -); - -static void append_to_verify_fifo_interleaved_( - verify_input_fifo *fifo, - const FLAC__int32 input[], - unsigned input_offset, - unsigned channels, - unsigned wide_samples -); - -static FLAC__StreamDecoderReadStatus verify_read_callback_(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data); -static FLAC__StreamDecoderWriteStatus verify_write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data); -static void verify_metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data); -static void verify_error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data); - -static FLAC__StreamEncoderReadStatus file_read_callback_(const FLAC__StreamEncoder *encoder, FLAC__byte buffer[], size_t *bytes, void *client_data); -static FLAC__StreamEncoderSeekStatus file_seek_callback_(const FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data); -static FLAC__StreamEncoderTellStatus file_tell_callback_(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data); -static FLAC__StreamEncoderWriteStatus file_write_callback_(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data); -static FILE *get_binary_stdout_(void); - - -/*********************************************************************** - * - * Private class data - * - ***********************************************************************/ - -typedef struct FLAC__StreamEncoderPrivate { - unsigned input_capacity; /* current size (in samples) of the signal and residual buffers */ - FLAC__int32 *integer_signal[FLAC__MAX_CHANNELS]; /* the integer version of the input signal */ - FLAC__int32 *integer_signal_mid_side[2]; /* the integer version of the mid-side input signal (stereo only) */ -#ifndef FLAC__INTEGER_ONLY_LIBRARY - FLAC__real *real_signal[FLAC__MAX_CHANNELS]; /* (@@@ currently unused) the floating-point version of the input signal */ - FLAC__real *real_signal_mid_side[2]; /* (@@@ currently unused) the floating-point version of the mid-side input signal (stereo only) */ - FLAC__real *window[FLAC__MAX_APODIZATION_FUNCTIONS]; /* the pre-computed floating-point window for each apodization function */ - FLAC__real *windowed_signal; /* the integer_signal[] * current window[] */ -#endif - unsigned subframe_bps[FLAC__MAX_CHANNELS]; /* the effective bits per sample of the input signal (stream bps - wasted bits) */ - unsigned subframe_bps_mid_side[2]; /* the effective bits per sample of the mid-side input signal (stream bps - wasted bits + 0/1) */ - FLAC__int32 *residual_workspace[FLAC__MAX_CHANNELS][2]; /* each channel has a candidate and best workspace where the subframe residual signals will be stored */ - FLAC__int32 *residual_workspace_mid_side[2][2]; - FLAC__Subframe subframe_workspace[FLAC__MAX_CHANNELS][2]; - FLAC__Subframe subframe_workspace_mid_side[2][2]; - FLAC__Subframe *subframe_workspace_ptr[FLAC__MAX_CHANNELS][2]; - FLAC__Subframe *subframe_workspace_ptr_mid_side[2][2]; - FLAC__EntropyCodingMethod_PartitionedRiceContents partitioned_rice_contents_workspace[FLAC__MAX_CHANNELS][2]; - FLAC__EntropyCodingMethod_PartitionedRiceContents partitioned_rice_contents_workspace_mid_side[FLAC__MAX_CHANNELS][2]; - FLAC__EntropyCodingMethod_PartitionedRiceContents *partitioned_rice_contents_workspace_ptr[FLAC__MAX_CHANNELS][2]; - FLAC__EntropyCodingMethod_PartitionedRiceContents *partitioned_rice_contents_workspace_ptr_mid_side[FLAC__MAX_CHANNELS][2]; - unsigned best_subframe[FLAC__MAX_CHANNELS]; /* index (0 or 1) into 2nd dimension of the above workspaces */ - unsigned best_subframe_mid_side[2]; - unsigned best_subframe_bits[FLAC__MAX_CHANNELS]; /* size in bits of the best subframe for each channel */ - unsigned best_subframe_bits_mid_side[2]; - FLAC__uint64 *abs_residual_partition_sums; /* workspace where the sum of abs(candidate residual) for each partition is stored */ - unsigned *raw_bits_per_partition; /* workspace where the sum of silog2(candidate residual) for each partition is stored */ - FLAC__BitWriter *frame; /* the current frame being worked on */ - unsigned loose_mid_side_stereo_frames; /* rounded number of frames the encoder will use before trying both independent and mid/side frames again */ - unsigned loose_mid_side_stereo_frame_count; /* number of frames using the current channel assignment */ - FLAC__ChannelAssignment last_channel_assignment; - FLAC__StreamMetadata streaminfo; /* scratchpad for STREAMINFO as it is built */ - FLAC__StreamMetadata_SeekTable *seek_table; /* pointer into encoder->protected_->metadata_ where the seek table is */ - unsigned current_sample_number; - unsigned current_frame_number; - FLAC__MD5Context md5context; - FLAC__CPUInfo cpuinfo; -#ifndef FLAC__INTEGER_ONLY_LIBRARY - unsigned (*local_fixed_compute_best_predictor)(const FLAC__int32 data[], unsigned data_len, FLAC__float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]); -#else - unsigned (*local_fixed_compute_best_predictor)(const FLAC__int32 data[], unsigned data_len, FLAC__fixedpoint residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]); -#endif -#ifndef FLAC__INTEGER_ONLY_LIBRARY - void (*local_lpc_compute_autocorrelation)(const FLAC__real data[], unsigned data_len, unsigned lag, FLAC__real autoc[]); - void (*local_lpc_compute_residual_from_qlp_coefficients)(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); - void (*local_lpc_compute_residual_from_qlp_coefficients_64bit)(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); - void (*local_lpc_compute_residual_from_qlp_coefficients_16bit)(const FLAC__int32 *data, unsigned data_len, const FLAC__int32 qlp_coeff[], unsigned order, int lp_quantization, FLAC__int32 residual[]); -#endif - FLAC__bool use_wide_by_block; /* use slow 64-bit versions of some functions because of the block size */ - FLAC__bool use_wide_by_partition; /* use slow 64-bit versions of some functions because of the min partition order and blocksize */ - FLAC__bool use_wide_by_order; /* use slow 64-bit versions of some functions because of the lpc order */ - FLAC__bool disable_constant_subframes; - FLAC__bool disable_fixed_subframes; - FLAC__bool disable_verbatim_subframes; -#if FLAC__HAS_OGG - FLAC__bool is_ogg; -#endif - FLAC__StreamEncoderReadCallback read_callback; /* currently only needed for Ogg FLAC */ - FLAC__StreamEncoderSeekCallback seek_callback; - FLAC__StreamEncoderTellCallback tell_callback; - FLAC__StreamEncoderWriteCallback write_callback; - FLAC__StreamEncoderMetadataCallback metadata_callback; - FLAC__StreamEncoderProgressCallback progress_callback; - void *client_data; - unsigned first_seekpoint_to_check; - FILE *file; /* only used when encoding to a file */ - FLAC__uint64 bytes_written; - FLAC__uint64 samples_written; - unsigned frames_written; - unsigned total_frames_estimate; - /* unaligned (original) pointers to allocated data */ - FLAC__int32 *integer_signal_unaligned[FLAC__MAX_CHANNELS]; - FLAC__int32 *integer_signal_mid_side_unaligned[2]; -#ifndef FLAC__INTEGER_ONLY_LIBRARY - FLAC__real *real_signal_unaligned[FLAC__MAX_CHANNELS]; /* (@@@ currently unused) */ - FLAC__real *real_signal_mid_side_unaligned[2]; /* (@@@ currently unused) */ - FLAC__real *window_unaligned[FLAC__MAX_APODIZATION_FUNCTIONS]; - FLAC__real *windowed_signal_unaligned; -#endif - FLAC__int32 *residual_workspace_unaligned[FLAC__MAX_CHANNELS][2]; - FLAC__int32 *residual_workspace_mid_side_unaligned[2][2]; - FLAC__uint64 *abs_residual_partition_sums_unaligned; - unsigned *raw_bits_per_partition_unaligned; - /* - * These fields have been moved here from private function local - * declarations merely to save stack space during encoding. - */ -#ifndef FLAC__INTEGER_ONLY_LIBRARY - FLAC__real lp_coeff[FLAC__MAX_LPC_ORDER][FLAC__MAX_LPC_ORDER]; /* from process_subframe_() */ -#endif - FLAC__EntropyCodingMethod_PartitionedRiceContents partitioned_rice_contents_extra[2]; /* from find_best_partition_order_() */ - /* - * The data for the verify section - */ - struct { - FLAC__StreamDecoder *decoder; - EncoderStateHint state_hint; - FLAC__bool needs_magic_hack; - verify_input_fifo input_fifo; - verify_output output; - struct { - FLAC__uint64 absolute_sample; - unsigned frame_number; - unsigned channel; - unsigned sample; - FLAC__int32 expected; - FLAC__int32 got; - } error_stats; - } verify; - FLAC__bool is_being_deleted; /* if true, call to ..._finish() from ..._delete() will not call the callbacks */ -} FLAC__StreamEncoderPrivate; - -/*********************************************************************** - * - * Public static class data - * - ***********************************************************************/ - -FLAC_API const char * const FLAC__StreamEncoderStateString[] = { - "FLAC__STREAM_ENCODER_OK", - "FLAC__STREAM_ENCODER_UNINITIALIZED", - "FLAC__STREAM_ENCODER_OGG_ERROR", - "FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR", - "FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA", - "FLAC__STREAM_ENCODER_CLIENT_ERROR", - "FLAC__STREAM_ENCODER_IO_ERROR", - "FLAC__STREAM_ENCODER_FRAMING_ERROR", - "FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR" -}; - -FLAC_API const char * const FLAC__StreamEncoderInitStatusString[] = { - "FLAC__STREAM_ENCODER_INIT_STATUS_OK", - "FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR", - "FLAC__STREAM_ENCODER_INIT_STATUS_UNSUPPORTED_CONTAINER", - "FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_CALLBACKS", - "FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_NUMBER_OF_CHANNELS", - "FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BITS_PER_SAMPLE", - "FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_SAMPLE_RATE", - "FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BLOCK_SIZE", - "FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_MAX_LPC_ORDER", - "FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_QLP_COEFF_PRECISION", - "FLAC__STREAM_ENCODER_INIT_STATUS_BLOCK_SIZE_TOO_SMALL_FOR_LPC_ORDER", - "FLAC__STREAM_ENCODER_INIT_STATUS_NOT_STREAMABLE", - "FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA", - "FLAC__STREAM_ENCODER_INIT_STATUS_ALREADY_INITIALIZED" -}; - -FLAC_API const char * const FLAC__treamEncoderReadStatusString[] = { - "FLAC__STREAM_ENCODER_READ_STATUS_CONTINUE", - "FLAC__STREAM_ENCODER_READ_STATUS_END_OF_STREAM", - "FLAC__STREAM_ENCODER_READ_STATUS_ABORT", - "FLAC__STREAM_ENCODER_READ_STATUS_UNSUPPORTED" -}; - -FLAC_API const char * const FLAC__StreamEncoderWriteStatusString[] = { - "FLAC__STREAM_ENCODER_WRITE_STATUS_OK", - "FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR" -}; - -FLAC_API const char * const FLAC__StreamEncoderSeekStatusString[] = { - "FLAC__STREAM_ENCODER_SEEK_STATUS_OK", - "FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR", - "FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED" -}; - -FLAC_API const char * const FLAC__StreamEncoderTellStatusString[] = { - "FLAC__STREAM_ENCODER_TELL_STATUS_OK", - "FLAC__STREAM_ENCODER_TELL_STATUS_ERROR", - "FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED" -}; - -/* Number of samples that will be overread to watch for end of stream. By - * 'overread', we mean that the FLAC__stream_encoder_process*() calls will - * always try to read blocksize+1 samples before encoding a block, so that - * even if the stream has a total sample count that is an integral multiple - * of the blocksize, we will still notice when we are encoding the last - * block. This is needed, for example, to correctly set the end-of-stream - * marker in Ogg FLAC. - * - * WATCHOUT: some parts of the code assert that OVERREAD_ == 1 and there's - * not really any reason to change it. - */ -static const unsigned OVERREAD_ = 1; - -/*********************************************************************** - * - * Class constructor/destructor - * - */ -FLAC_API FLAC__StreamEncoder *FLAC__stream_encoder_new(void) -{ - FLAC__StreamEncoder *encoder; - unsigned i; - - FLAC__ASSERT(sizeof(int) >= 4); /* we want to die right away if this is not true */ - - encoder = (FLAC__StreamEncoder*)calloc(1, sizeof(FLAC__StreamEncoder)); - if(encoder == 0) { - return 0; - } - - encoder->protected_ = (FLAC__StreamEncoderProtected*)calloc(1, sizeof(FLAC__StreamEncoderProtected)); - if(encoder->protected_ == 0) { - free(encoder); - return 0; - } - - encoder->private_ = (FLAC__StreamEncoderPrivate*)calloc(1, sizeof(FLAC__StreamEncoderPrivate)); - if(encoder->private_ == 0) { - free(encoder->protected_); - free(encoder); - return 0; - } - - encoder->private_->frame = FLAC__bitwriter_new(); - if(encoder->private_->frame == 0) { - free(encoder->private_); - free(encoder->protected_); - free(encoder); - return 0; - } - - encoder->private_->file = 0; - - set_defaults_(encoder); - - encoder->private_->is_being_deleted = false; - - for(i = 0; i < FLAC__MAX_CHANNELS; i++) { - encoder->private_->subframe_workspace_ptr[i][0] = &encoder->private_->subframe_workspace[i][0]; - encoder->private_->subframe_workspace_ptr[i][1] = &encoder->private_->subframe_workspace[i][1]; - } - for(i = 0; i < 2; i++) { - encoder->private_->subframe_workspace_ptr_mid_side[i][0] = &encoder->private_->subframe_workspace_mid_side[i][0]; - encoder->private_->subframe_workspace_ptr_mid_side[i][1] = &encoder->private_->subframe_workspace_mid_side[i][1]; - } - for(i = 0; i < FLAC__MAX_CHANNELS; i++) { - encoder->private_->partitioned_rice_contents_workspace_ptr[i][0] = &encoder->private_->partitioned_rice_contents_workspace[i][0]; - encoder->private_->partitioned_rice_contents_workspace_ptr[i][1] = &encoder->private_->partitioned_rice_contents_workspace[i][1]; - } - for(i = 0; i < 2; i++) { - encoder->private_->partitioned_rice_contents_workspace_ptr_mid_side[i][0] = &encoder->private_->partitioned_rice_contents_workspace_mid_side[i][0]; - encoder->private_->partitioned_rice_contents_workspace_ptr_mid_side[i][1] = &encoder->private_->partitioned_rice_contents_workspace_mid_side[i][1]; - } - - for(i = 0; i < FLAC__MAX_CHANNELS; i++) { - FLAC__format_entropy_coding_method_partitioned_rice_contents_init(&encoder->private_->partitioned_rice_contents_workspace[i][0]); - FLAC__format_entropy_coding_method_partitioned_rice_contents_init(&encoder->private_->partitioned_rice_contents_workspace[i][1]); - } - for(i = 0; i < 2; i++) { - FLAC__format_entropy_coding_method_partitioned_rice_contents_init(&encoder->private_->partitioned_rice_contents_workspace_mid_side[i][0]); - FLAC__format_entropy_coding_method_partitioned_rice_contents_init(&encoder->private_->partitioned_rice_contents_workspace_mid_side[i][1]); - } - for(i = 0; i < 2; i++) - FLAC__format_entropy_coding_method_partitioned_rice_contents_init(&encoder->private_->partitioned_rice_contents_extra[i]); - - encoder->protected_->state = FLAC__STREAM_ENCODER_UNINITIALIZED; - - return encoder; -} - -FLAC_API void FLAC__stream_encoder_delete(FLAC__StreamEncoder *encoder) -{ - unsigned i; - - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->protected_); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->private_->frame); - - encoder->private_->is_being_deleted = true; - - (void)FLAC__stream_encoder_finish(encoder); - - if(0 != encoder->private_->verify.decoder) - FLAC__stream_decoder_delete(encoder->private_->verify.decoder); - - for(i = 0; i < FLAC__MAX_CHANNELS; i++) { - FLAC__format_entropy_coding_method_partitioned_rice_contents_clear(&encoder->private_->partitioned_rice_contents_workspace[i][0]); - FLAC__format_entropy_coding_method_partitioned_rice_contents_clear(&encoder->private_->partitioned_rice_contents_workspace[i][1]); - } - for(i = 0; i < 2; i++) { - FLAC__format_entropy_coding_method_partitioned_rice_contents_clear(&encoder->private_->partitioned_rice_contents_workspace_mid_side[i][0]); - FLAC__format_entropy_coding_method_partitioned_rice_contents_clear(&encoder->private_->partitioned_rice_contents_workspace_mid_side[i][1]); - } - for(i = 0; i < 2; i++) - FLAC__format_entropy_coding_method_partitioned_rice_contents_clear(&encoder->private_->partitioned_rice_contents_extra[i]); - - FLAC__bitwriter_delete(encoder->private_->frame); - free(encoder->private_); - free(encoder->protected_); - free(encoder); -} - -/*********************************************************************** - * - * Public class methods - * - ***********************************************************************/ - -static FLAC__StreamEncoderInitStatus init_stream_internal_( - FLAC__StreamEncoder *encoder, - FLAC__StreamEncoderReadCallback read_callback, - FLAC__StreamEncoderWriteCallback write_callback, - FLAC__StreamEncoderSeekCallback seek_callback, - FLAC__StreamEncoderTellCallback tell_callback, - FLAC__StreamEncoderMetadataCallback metadata_callback, - void *client_data, - FLAC__bool is_ogg -) -{ - unsigned i; - FLAC__bool metadata_has_seektable, metadata_has_vorbis_comment, metadata_picture_has_type1, metadata_picture_has_type2; - - FLAC__ASSERT(0 != encoder); - - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return FLAC__STREAM_ENCODER_INIT_STATUS_ALREADY_INITIALIZED; - -#if !FLAC__HAS_OGG - if(is_ogg) - return FLAC__STREAM_ENCODER_INIT_STATUS_UNSUPPORTED_CONTAINER; -#endif - - if(0 == write_callback || (seek_callback && 0 == tell_callback)) - return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_CALLBACKS; - - if(encoder->protected_->channels == 0 || encoder->protected_->channels > FLAC__MAX_CHANNELS) - return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_NUMBER_OF_CHANNELS; - - if(encoder->protected_->channels != 2) { - encoder->protected_->do_mid_side_stereo = false; - encoder->protected_->loose_mid_side_stereo = false; - } - else if(!encoder->protected_->do_mid_side_stereo) - encoder->protected_->loose_mid_side_stereo = false; - - if(encoder->protected_->bits_per_sample >= 32) - encoder->protected_->do_mid_side_stereo = false; /* since we currenty do 32-bit math, the side channel would have 33 bps and overflow */ - - if(encoder->protected_->bits_per_sample < FLAC__MIN_BITS_PER_SAMPLE || encoder->protected_->bits_per_sample > FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE) - return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BITS_PER_SAMPLE; - - if(!FLAC__format_sample_rate_is_valid(encoder->protected_->sample_rate)) - return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_SAMPLE_RATE; - - if(encoder->protected_->blocksize == 0) { - if(encoder->protected_->max_lpc_order == 0) - encoder->protected_->blocksize = 1152; - else - encoder->protected_->blocksize = 4096; - } - - if(encoder->protected_->blocksize < FLAC__MIN_BLOCK_SIZE || encoder->protected_->blocksize > FLAC__MAX_BLOCK_SIZE) - return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BLOCK_SIZE; - - if(encoder->protected_->max_lpc_order > FLAC__MAX_LPC_ORDER) - return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_MAX_LPC_ORDER; - - if(encoder->protected_->blocksize < encoder->protected_->max_lpc_order) - return FLAC__STREAM_ENCODER_INIT_STATUS_BLOCK_SIZE_TOO_SMALL_FOR_LPC_ORDER; - - if(encoder->protected_->qlp_coeff_precision == 0) { - if(encoder->protected_->bits_per_sample < 16) { - /* @@@ need some data about how to set this here w.r.t. blocksize and sample rate */ - /* @@@ until then we'll make a guess */ - encoder->protected_->qlp_coeff_precision = max(FLAC__MIN_QLP_COEFF_PRECISION, 2 + encoder->protected_->bits_per_sample / 2); - } - else if(encoder->protected_->bits_per_sample == 16) { - if(encoder->protected_->blocksize <= 192) - encoder->protected_->qlp_coeff_precision = 7; - else if(encoder->protected_->blocksize <= 384) - encoder->protected_->qlp_coeff_precision = 8; - else if(encoder->protected_->blocksize <= 576) - encoder->protected_->qlp_coeff_precision = 9; - else if(encoder->protected_->blocksize <= 1152) - encoder->protected_->qlp_coeff_precision = 10; - else if(encoder->protected_->blocksize <= 2304) - encoder->protected_->qlp_coeff_precision = 11; - else if(encoder->protected_->blocksize <= 4608) - encoder->protected_->qlp_coeff_precision = 12; - else - encoder->protected_->qlp_coeff_precision = 13; - } - else { - if(encoder->protected_->blocksize <= 384) - encoder->protected_->qlp_coeff_precision = FLAC__MAX_QLP_COEFF_PRECISION-2; - else if(encoder->protected_->blocksize <= 1152) - encoder->protected_->qlp_coeff_precision = FLAC__MAX_QLP_COEFF_PRECISION-1; - else - encoder->protected_->qlp_coeff_precision = FLAC__MAX_QLP_COEFF_PRECISION; - } - FLAC__ASSERT(encoder->protected_->qlp_coeff_precision <= FLAC__MAX_QLP_COEFF_PRECISION); - } - else if(encoder->protected_->qlp_coeff_precision < FLAC__MIN_QLP_COEFF_PRECISION || encoder->protected_->qlp_coeff_precision > FLAC__MAX_QLP_COEFF_PRECISION) - return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_QLP_COEFF_PRECISION; - - if(encoder->protected_->streamable_subset) { - if( - encoder->protected_->blocksize != 192 && - encoder->protected_->blocksize != 576 && - encoder->protected_->blocksize != 1152 && - encoder->protected_->blocksize != 2304 && - encoder->protected_->blocksize != 4608 && - encoder->protected_->blocksize != 256 && - encoder->protected_->blocksize != 512 && - encoder->protected_->blocksize != 1024 && - encoder->protected_->blocksize != 2048 && - encoder->protected_->blocksize != 4096 && - encoder->protected_->blocksize != 8192 && - encoder->protected_->blocksize != 16384 - ) - return FLAC__STREAM_ENCODER_INIT_STATUS_NOT_STREAMABLE; - if(!FLAC__format_sample_rate_is_subset(encoder->protected_->sample_rate)) - return FLAC__STREAM_ENCODER_INIT_STATUS_NOT_STREAMABLE; - if( - encoder->protected_->bits_per_sample != 8 && - encoder->protected_->bits_per_sample != 12 && - encoder->protected_->bits_per_sample != 16 && - encoder->protected_->bits_per_sample != 20 && - encoder->protected_->bits_per_sample != 24 - ) - return FLAC__STREAM_ENCODER_INIT_STATUS_NOT_STREAMABLE; - if(encoder->protected_->max_residual_partition_order > FLAC__SUBSET_MAX_RICE_PARTITION_ORDER) - return FLAC__STREAM_ENCODER_INIT_STATUS_NOT_STREAMABLE; - if( - encoder->protected_->sample_rate <= 48000 && - ( - encoder->protected_->blocksize > FLAC__SUBSET_MAX_BLOCK_SIZE_48000HZ || - encoder->protected_->max_lpc_order > FLAC__SUBSET_MAX_LPC_ORDER_48000HZ - ) - ) { - return FLAC__STREAM_ENCODER_INIT_STATUS_NOT_STREAMABLE; - } - } - - if(encoder->protected_->max_residual_partition_order >= (1u << FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN)) - encoder->protected_->max_residual_partition_order = (1u << FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN) - 1; - if(encoder->protected_->min_residual_partition_order >= encoder->protected_->max_residual_partition_order) - encoder->protected_->min_residual_partition_order = encoder->protected_->max_residual_partition_order; - -#if FLAC__HAS_OGG - /* reorder metadata if necessary to ensure that any VORBIS_COMMENT is the first, according to the mapping spec */ - if(is_ogg && 0 != encoder->protected_->metadata && encoder->protected_->num_metadata_blocks > 1) { - unsigned i; - for(i = 1; i < encoder->protected_->num_metadata_blocks; i++) { - if(0 != encoder->protected_->metadata[i] && encoder->protected_->metadata[i]->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) { - FLAC__StreamMetadata *vc = encoder->protected_->metadata[i]; - for( ; i > 0; i--) - encoder->protected_->metadata[i] = encoder->protected_->metadata[i-1]; - encoder->protected_->metadata[0] = vc; - break; - } - } - } -#endif - /* keep track of any SEEKTABLE block */ - if(0 != encoder->protected_->metadata && encoder->protected_->num_metadata_blocks > 0) { - unsigned i; - for(i = 0; i < encoder->protected_->num_metadata_blocks; i++) { - if(0 != encoder->protected_->metadata[i] && encoder->protected_->metadata[i]->type == FLAC__METADATA_TYPE_SEEKTABLE) { - encoder->private_->seek_table = &encoder->protected_->metadata[i]->data.seek_table; - break; /* take only the first one */ - } - } - } - - /* validate metadata */ - if(0 == encoder->protected_->metadata && encoder->protected_->num_metadata_blocks > 0) - return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA; - metadata_has_seektable = false; - metadata_has_vorbis_comment = false; - metadata_picture_has_type1 = false; - metadata_picture_has_type2 = false; - for(i = 0; i < encoder->protected_->num_metadata_blocks; i++) { - const FLAC__StreamMetadata *m = encoder->protected_->metadata[i]; - if(m->type == FLAC__METADATA_TYPE_STREAMINFO) - return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA; - else if(m->type == FLAC__METADATA_TYPE_SEEKTABLE) { - if(metadata_has_seektable) /* only one is allowed */ - return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA; - metadata_has_seektable = true; - if(!FLAC__format_seektable_is_legal(&m->data.seek_table)) - return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA; - } - else if(m->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) { - if(metadata_has_vorbis_comment) /* only one is allowed */ - return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA; - metadata_has_vorbis_comment = true; - } - else if(m->type == FLAC__METADATA_TYPE_CUESHEET) { - if(!FLAC__format_cuesheet_is_legal(&m->data.cue_sheet, m->data.cue_sheet.is_cd, /*violation=*/0)) - return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA; - } - else if(m->type == FLAC__METADATA_TYPE_PICTURE) { - if(!FLAC__format_picture_is_legal(&m->data.picture, /*violation=*/0)) - return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA; - if(m->data.picture.type == FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD) { - if(metadata_picture_has_type1) /* there should only be 1 per stream */ - return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA; - metadata_picture_has_type1 = true; - /* standard icon must be 32x32 pixel PNG */ - if( - m->data.picture.type == FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD && - ( - (strcmp(m->data.picture.mime_type, "image/png") && strcmp(m->data.picture.mime_type, "-->")) || - m->data.picture.width != 32 || - m->data.picture.height != 32 - ) - ) - return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA; - } - else if(m->data.picture.type == FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON) { - if(metadata_picture_has_type2) /* there should only be 1 per stream */ - return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA; - metadata_picture_has_type2 = true; - } - } - } - - encoder->private_->input_capacity = 0; - for(i = 0; i < encoder->protected_->channels; i++) { - encoder->private_->integer_signal_unaligned[i] = encoder->private_->integer_signal[i] = 0; -#ifndef FLAC__INTEGER_ONLY_LIBRARY - encoder->private_->real_signal_unaligned[i] = encoder->private_->real_signal[i] = 0; -#endif - } - for(i = 0; i < 2; i++) { - encoder->private_->integer_signal_mid_side_unaligned[i] = encoder->private_->integer_signal_mid_side[i] = 0; -#ifndef FLAC__INTEGER_ONLY_LIBRARY - encoder->private_->real_signal_mid_side_unaligned[i] = encoder->private_->real_signal_mid_side[i] = 0; -#endif - } -#ifndef FLAC__INTEGER_ONLY_LIBRARY - for(i = 0; i < encoder->protected_->num_apodizations; i++) - encoder->private_->window_unaligned[i] = encoder->private_->window[i] = 0; - encoder->private_->windowed_signal_unaligned = encoder->private_->windowed_signal = 0; -#endif - for(i = 0; i < encoder->protected_->channels; i++) { - encoder->private_->residual_workspace_unaligned[i][0] = encoder->private_->residual_workspace[i][0] = 0; - encoder->private_->residual_workspace_unaligned[i][1] = encoder->private_->residual_workspace[i][1] = 0; - encoder->private_->best_subframe[i] = 0; - } - for(i = 0; i < 2; i++) { - encoder->private_->residual_workspace_mid_side_unaligned[i][0] = encoder->private_->residual_workspace_mid_side[i][0] = 0; - encoder->private_->residual_workspace_mid_side_unaligned[i][1] = encoder->private_->residual_workspace_mid_side[i][1] = 0; - encoder->private_->best_subframe_mid_side[i] = 0; - } - encoder->private_->abs_residual_partition_sums_unaligned = encoder->private_->abs_residual_partition_sums = 0; - encoder->private_->raw_bits_per_partition_unaligned = encoder->private_->raw_bits_per_partition = 0; -#ifndef FLAC__INTEGER_ONLY_LIBRARY - encoder->private_->loose_mid_side_stereo_frames = (unsigned)((FLAC__double)encoder->protected_->sample_rate * 0.4 / (FLAC__double)encoder->protected_->blocksize + 0.5); -#else - /* 26214 is the approximate fixed-point equivalent to 0.4 (0.4 * 2^16) */ - /* sample rate can be up to 655350 Hz, and thus use 20 bits, so we do the multiply÷ by hand */ - FLAC__ASSERT(FLAC__MAX_SAMPLE_RATE <= 655350); - FLAC__ASSERT(FLAC__MAX_BLOCK_SIZE <= 65535); - FLAC__ASSERT(encoder->protected_->sample_rate <= 655350); - FLAC__ASSERT(encoder->protected_->blocksize <= 65535); - encoder->private_->loose_mid_side_stereo_frames = (unsigned)FLAC__fixedpoint_trunc((((FLAC__uint64)(encoder->protected_->sample_rate) * (FLAC__uint64)(26214)) << 16) / (encoder->protected_->blocksize<<16) + FLAC__FP_ONE_HALF); -#endif - if(encoder->private_->loose_mid_side_stereo_frames == 0) - encoder->private_->loose_mid_side_stereo_frames = 1; - encoder->private_->loose_mid_side_stereo_frame_count = 0; - encoder->private_->current_sample_number = 0; - encoder->private_->current_frame_number = 0; - - encoder->private_->use_wide_by_block = (encoder->protected_->bits_per_sample + FLAC__bitmath_ilog2(encoder->protected_->blocksize)+1 > 30); - encoder->private_->use_wide_by_order = (encoder->protected_->bits_per_sample + FLAC__bitmath_ilog2(max(encoder->protected_->max_lpc_order, FLAC__MAX_FIXED_ORDER))+1 > 30); /*@@@ need to use this? */ - encoder->private_->use_wide_by_partition = (false); /*@@@ need to set this */ - - /* - * get the CPU info and set the function pointers - */ - FLAC__cpu_info(&encoder->private_->cpuinfo); - /* first default to the non-asm routines */ -#ifndef FLAC__INTEGER_ONLY_LIBRARY - encoder->private_->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation; -#endif - encoder->private_->local_fixed_compute_best_predictor = FLAC__fixed_compute_best_predictor; -#ifndef FLAC__INTEGER_ONLY_LIBRARY - encoder->private_->local_lpc_compute_residual_from_qlp_coefficients = FLAC__lpc_compute_residual_from_qlp_coefficients; - encoder->private_->local_lpc_compute_residual_from_qlp_coefficients_64bit = FLAC__lpc_compute_residual_from_qlp_coefficients_wide; - encoder->private_->local_lpc_compute_residual_from_qlp_coefficients_16bit = FLAC__lpc_compute_residual_from_qlp_coefficients; -#endif - /* now override with asm where appropriate */ -#ifndef FLAC__INTEGER_ONLY_LIBRARY -# ifndef FLAC__NO_ASM - if(encoder->private_->cpuinfo.use_asm) { -# ifdef FLAC__CPU_IA32 - FLAC__ASSERT(encoder->private_->cpuinfo.type == FLAC__CPUINFO_TYPE_IA32); -# ifdef FLAC__HAS_NASM - if(encoder->private_->cpuinfo.data.ia32.sse) { - if(encoder->protected_->max_lpc_order < 4) - encoder->private_->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_4; - else if(encoder->protected_->max_lpc_order < 8) - encoder->private_->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_8; - else if(encoder->protected_->max_lpc_order < 12) - encoder->private_->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_12; - else - encoder->private_->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia32; - } - else if(encoder->private_->cpuinfo.data.ia32._3dnow) - encoder->private_->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia32_3dnow; - else - encoder->private_->local_lpc_compute_autocorrelation = FLAC__lpc_compute_autocorrelation_asm_ia32; - if(encoder->private_->cpuinfo.data.ia32.mmx) { - encoder->private_->local_lpc_compute_residual_from_qlp_coefficients = FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32; - encoder->private_->local_lpc_compute_residual_from_qlp_coefficients_16bit = FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32_mmx; - } - else { - encoder->private_->local_lpc_compute_residual_from_qlp_coefficients = FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32; - encoder->private_->local_lpc_compute_residual_from_qlp_coefficients_16bit = FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32; - } - if(encoder->private_->cpuinfo.data.ia32.mmx && encoder->private_->cpuinfo.data.ia32.cmov) - encoder->private_->local_fixed_compute_best_predictor = FLAC__fixed_compute_best_predictor_asm_ia32_mmx_cmov; -# endif /* FLAC__HAS_NASM */ -# endif /* FLAC__CPU_IA32 */ - } -# endif /* !FLAC__NO_ASM */ -#endif /* !FLAC__INTEGER_ONLY_LIBRARY */ - /* finally override based on wide-ness if necessary */ - if(encoder->private_->use_wide_by_block) { - encoder->private_->local_fixed_compute_best_predictor = FLAC__fixed_compute_best_predictor_wide; - } - - /* set state to OK; from here on, errors are fatal and we'll override the state then */ - encoder->protected_->state = FLAC__STREAM_ENCODER_OK; - -#if FLAC__HAS_OGG - encoder->private_->is_ogg = is_ogg; - if(is_ogg && !FLAC__ogg_encoder_aspect_init(&encoder->protected_->ogg_encoder_aspect)) { - encoder->protected_->state = FLAC__STREAM_ENCODER_OGG_ERROR; - return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; - } -#endif - - encoder->private_->read_callback = read_callback; - encoder->private_->write_callback = write_callback; - encoder->private_->seek_callback = seek_callback; - encoder->private_->tell_callback = tell_callback; - encoder->private_->metadata_callback = metadata_callback; - encoder->private_->client_data = client_data; - - if(!resize_buffers_(encoder, encoder->protected_->blocksize)) { - /* the above function sets the state for us in case of an error */ - return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; - } - - if(!FLAC__bitwriter_init(encoder->private_->frame)) { - encoder->protected_->state = FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR; - return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; - } - - /* - * Set up the verify stuff if necessary - */ - if(encoder->protected_->verify) { - /* - * First, set up the fifo which will hold the - * original signal to compare against - */ - encoder->private_->verify.input_fifo.size = encoder->protected_->blocksize+OVERREAD_; - for(i = 0; i < encoder->protected_->channels; i++) { - if(0 == (encoder->private_->verify.input_fifo.data[i] = (FLAC__int32*)safe_malloc_mul_2op_(sizeof(FLAC__int32), /*times*/encoder->private_->verify.input_fifo.size))) { - encoder->protected_->state = FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR; - return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; - } - } - encoder->private_->verify.input_fifo.tail = 0; - - /* - * Now set up a stream decoder for verification - */ - encoder->private_->verify.decoder = FLAC__stream_decoder_new(); - if(0 == encoder->private_->verify.decoder) { - encoder->protected_->state = FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR; - return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; - } - - if(FLAC__stream_decoder_init_stream(encoder->private_->verify.decoder, verify_read_callback_, /*seek_callback=*/0, /*tell_callback=*/0, /*length_callback=*/0, /*eof_callback=*/0, verify_write_callback_, verify_metadata_callback_, verify_error_callback_, /*client_data=*/encoder) != FLAC__STREAM_DECODER_INIT_STATUS_OK) { - encoder->protected_->state = FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR; - return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; - } - } - encoder->private_->verify.error_stats.absolute_sample = 0; - encoder->private_->verify.error_stats.frame_number = 0; - encoder->private_->verify.error_stats.channel = 0; - encoder->private_->verify.error_stats.sample = 0; - encoder->private_->verify.error_stats.expected = 0; - encoder->private_->verify.error_stats.got = 0; - - /* - * These must be done before we write any metadata, because that - * calls the write_callback, which uses these values. - */ - encoder->private_->first_seekpoint_to_check = 0; - encoder->private_->samples_written = 0; - encoder->protected_->streaminfo_offset = 0; - encoder->protected_->seektable_offset = 0; - encoder->protected_->audio_offset = 0; - - /* - * write the stream header - */ - if(encoder->protected_->verify) - encoder->private_->verify.state_hint = ENCODER_IN_MAGIC; - if(!FLAC__bitwriter_write_raw_uint32(encoder->private_->frame, FLAC__STREAM_SYNC, FLAC__STREAM_SYNC_LEN)) { - encoder->protected_->state = FLAC__STREAM_ENCODER_FRAMING_ERROR; - return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; - } - if(!write_bitbuffer_(encoder, 0, /*is_last_block=*/false)) { - /* the above function sets the state for us in case of an error */ - return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; - } - - /* - * write the STREAMINFO metadata block - */ - if(encoder->protected_->verify) - encoder->private_->verify.state_hint = ENCODER_IN_METADATA; - encoder->private_->streaminfo.type = FLAC__METADATA_TYPE_STREAMINFO; - encoder->private_->streaminfo.is_last = false; /* we will have at a minimum a VORBIS_COMMENT afterwards */ - encoder->private_->streaminfo.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH; - encoder->private_->streaminfo.data.stream_info.min_blocksize = encoder->protected_->blocksize; /* this encoder uses the same blocksize for the whole stream */ - encoder->private_->streaminfo.data.stream_info.max_blocksize = encoder->protected_->blocksize; - encoder->private_->streaminfo.data.stream_info.min_framesize = 0; /* we don't know this yet; have to fill it in later */ - encoder->private_->streaminfo.data.stream_info.max_framesize = 0; /* we don't know this yet; have to fill it in later */ - encoder->private_->streaminfo.data.stream_info.sample_rate = encoder->protected_->sample_rate; - encoder->private_->streaminfo.data.stream_info.channels = encoder->protected_->channels; - encoder->private_->streaminfo.data.stream_info.bits_per_sample = encoder->protected_->bits_per_sample; - encoder->private_->streaminfo.data.stream_info.total_samples = encoder->protected_->total_samples_estimate; /* we will replace this later with the real total */ - memset(encoder->private_->streaminfo.data.stream_info.md5sum, 0, 16); /* we don't know this yet; have to fill it in later */ - if(encoder->protected_->do_md5) - FLAC__MD5Init(&encoder->private_->md5context); - if(!FLAC__add_metadata_block(&encoder->private_->streaminfo, encoder->private_->frame)) { - encoder->protected_->state = FLAC__STREAM_ENCODER_FRAMING_ERROR; - return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; - } - if(!write_bitbuffer_(encoder, 0, /*is_last_block=*/false)) { - /* the above function sets the state for us in case of an error */ - return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; - } - - /* - * Now that the STREAMINFO block is written, we can init this to an - * absurdly-high value... - */ - encoder->private_->streaminfo.data.stream_info.min_framesize = (1u << FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN) - 1; - /* ... and clear this to 0 */ - encoder->private_->streaminfo.data.stream_info.total_samples = 0; - - /* - * Check to see if the supplied metadata contains a VORBIS_COMMENT; - * if not, we will write an empty one (FLAC__add_metadata_block() - * automatically supplies the vendor string). - * - * WATCHOUT: the Ogg FLAC mapping requires us to write this block after - * the STREAMINFO. (In the case that metadata_has_vorbis_comment is - * true it will have already insured that the metadata list is properly - * ordered.) - */ - if(!metadata_has_vorbis_comment) { - FLAC__StreamMetadata vorbis_comment; - vorbis_comment.type = FLAC__METADATA_TYPE_VORBIS_COMMENT; - vorbis_comment.is_last = (encoder->protected_->num_metadata_blocks == 0); - vorbis_comment.length = 4 + 4; /* MAGIC NUMBER */ - vorbis_comment.data.vorbis_comment.vendor_string.length = 0; - vorbis_comment.data.vorbis_comment.vendor_string.entry = 0; - vorbis_comment.data.vorbis_comment.num_comments = 0; - vorbis_comment.data.vorbis_comment.comments = 0; - if(!FLAC__add_metadata_block(&vorbis_comment, encoder->private_->frame)) { - encoder->protected_->state = FLAC__STREAM_ENCODER_FRAMING_ERROR; - return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; - } - if(!write_bitbuffer_(encoder, 0, /*is_last_block=*/false)) { - /* the above function sets the state for us in case of an error */ - return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; - } - } - - /* - * write the user's metadata blocks - */ - for(i = 0; i < encoder->protected_->num_metadata_blocks; i++) { - encoder->protected_->metadata[i]->is_last = (i == encoder->protected_->num_metadata_blocks - 1); - if(!FLAC__add_metadata_block(encoder->protected_->metadata[i], encoder->private_->frame)) { - encoder->protected_->state = FLAC__STREAM_ENCODER_FRAMING_ERROR; - return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; - } - if(!write_bitbuffer_(encoder, 0, /*is_last_block=*/false)) { - /* the above function sets the state for us in case of an error */ - return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; - } - } - - /* now that all the metadata is written, we save the stream offset */ - if(encoder->private_->tell_callback && encoder->private_->tell_callback(encoder, &encoder->protected_->audio_offset, encoder->private_->client_data) == FLAC__STREAM_ENCODER_TELL_STATUS_ERROR) { /* FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED just means we didn't get the offset; no error */ - encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; - return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; - } - - if(encoder->protected_->verify) - encoder->private_->verify.state_hint = ENCODER_IN_AUDIO; - - return FLAC__STREAM_ENCODER_INIT_STATUS_OK; -} - -FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_stream( - FLAC__StreamEncoder *encoder, - FLAC__StreamEncoderWriteCallback write_callback, - FLAC__StreamEncoderSeekCallback seek_callback, - FLAC__StreamEncoderTellCallback tell_callback, - FLAC__StreamEncoderMetadataCallback metadata_callback, - void *client_data -) -{ - return init_stream_internal_( - encoder, - /*read_callback=*/0, - write_callback, - seek_callback, - tell_callback, - metadata_callback, - client_data, - /*is_ogg=*/false - ); -} - -FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_stream( - FLAC__StreamEncoder *encoder, - FLAC__StreamEncoderReadCallback read_callback, - FLAC__StreamEncoderWriteCallback write_callback, - FLAC__StreamEncoderSeekCallback seek_callback, - FLAC__StreamEncoderTellCallback tell_callback, - FLAC__StreamEncoderMetadataCallback metadata_callback, - void *client_data -) -{ - return init_stream_internal_( - encoder, - read_callback, - write_callback, - seek_callback, - tell_callback, - metadata_callback, - client_data, - /*is_ogg=*/true - ); -} - -static FLAC__StreamEncoderInitStatus init_FILE_internal_( - FLAC__StreamEncoder *encoder, - FILE *file, - FLAC__StreamEncoderProgressCallback progress_callback, - void *client_data, - FLAC__bool is_ogg -) -{ - FLAC__StreamEncoderInitStatus init_status; - - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != file); - - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return FLAC__STREAM_ENCODER_INIT_STATUS_ALREADY_INITIALIZED; - - /* double protection */ - if(file == 0) { - encoder->protected_->state = FLAC__STREAM_ENCODER_IO_ERROR; - return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; - } - - /* - * To make sure that our file does not go unclosed after an error, we - * must assign the FILE pointer before any further error can occur in - * this routine. - */ - if(file == stdout) - file = get_binary_stdout_(); /* just to be safe */ - - encoder->private_->file = file; - - encoder->private_->progress_callback = progress_callback; - encoder->private_->bytes_written = 0; - encoder->private_->samples_written = 0; - encoder->private_->frames_written = 0; - - init_status = init_stream_internal_( - encoder, - encoder->private_->file == stdout? 0 : is_ogg? file_read_callback_ : 0, - file_write_callback_, - encoder->private_->file == stdout? 0 : file_seek_callback_, - encoder->private_->file == stdout? 0 : file_tell_callback_, - /*metadata_callback=*/0, - client_data, - is_ogg - ); - if(init_status != FLAC__STREAM_ENCODER_INIT_STATUS_OK) { - /* the above function sets the state for us in case of an error */ - return init_status; - } - - { - unsigned blocksize = FLAC__stream_encoder_get_blocksize(encoder); - - FLAC__ASSERT(blocksize != 0); - encoder->private_->total_frames_estimate = (unsigned)((FLAC__stream_encoder_get_total_samples_estimate(encoder) + blocksize - 1) / blocksize); - } - - return init_status; -} - -FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_FILE( - FLAC__StreamEncoder *encoder, - FILE *file, - FLAC__StreamEncoderProgressCallback progress_callback, - void *client_data -) -{ - return init_FILE_internal_(encoder, file, progress_callback, client_data, /*is_ogg=*/false); -} - -FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_FILE( - FLAC__StreamEncoder *encoder, - FILE *file, - FLAC__StreamEncoderProgressCallback progress_callback, - void *client_data -) -{ - return init_FILE_internal_(encoder, file, progress_callback, client_data, /*is_ogg=*/true); -} - -static FLAC__StreamEncoderInitStatus init_file_internal_( - FLAC__StreamEncoder *encoder, - const char *filename, - FLAC__StreamEncoderProgressCallback progress_callback, - void *client_data, - FLAC__bool is_ogg -) -{ - FILE *file; - - FLAC__ASSERT(0 != encoder); - - /* - * To make sure that our file does not go unclosed after an error, we - * have to do the same entrance checks here that are later performed - * in FLAC__stream_encoder_init_FILE() before the FILE* is assigned. - */ - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return FLAC__STREAM_ENCODER_INIT_STATUS_ALREADY_INITIALIZED; - - file = filename? fopen(filename, "w+b") : stdout; - - if(file == 0) { - encoder->protected_->state = FLAC__STREAM_ENCODER_IO_ERROR; - return FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR; - } - - return init_FILE_internal_(encoder, file, progress_callback, client_data, is_ogg); -} - -FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_file( - FLAC__StreamEncoder *encoder, - const char *filename, - FLAC__StreamEncoderProgressCallback progress_callback, - void *client_data -) -{ - return init_file_internal_(encoder, filename, progress_callback, client_data, /*is_ogg=*/false); -} - -FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_file( - FLAC__StreamEncoder *encoder, - const char *filename, - FLAC__StreamEncoderProgressCallback progress_callback, - void *client_data -) -{ - return init_file_internal_(encoder, filename, progress_callback, client_data, /*is_ogg=*/true); -} - -FLAC_API FLAC__bool FLAC__stream_encoder_finish(FLAC__StreamEncoder *encoder) -{ - FLAC__bool error = false; - - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - - if(encoder->protected_->state == FLAC__STREAM_ENCODER_UNINITIALIZED) - return true; - - if(encoder->protected_->state == FLAC__STREAM_ENCODER_OK && !encoder->private_->is_being_deleted) { - if(encoder->private_->current_sample_number != 0) { - const FLAC__bool is_fractional_block = encoder->protected_->blocksize != encoder->private_->current_sample_number; - encoder->protected_->blocksize = encoder->private_->current_sample_number; - if(!process_frame_(encoder, is_fractional_block, /*is_last_block=*/true)) - error = true; - } - } - - if(encoder->protected_->do_md5) - FLAC__MD5Final(encoder->private_->streaminfo.data.stream_info.md5sum, &encoder->private_->md5context); - - if(!encoder->private_->is_being_deleted) { - if(encoder->protected_->state == FLAC__STREAM_ENCODER_OK) { - if(encoder->private_->seek_callback) { -#if FLAC__HAS_OGG - if(encoder->private_->is_ogg) - update_ogg_metadata_(encoder); - else -#endif - update_metadata_(encoder); - - /* check if an error occurred while updating metadata */ - if(encoder->protected_->state != FLAC__STREAM_ENCODER_OK) - error = true; - } - if(encoder->private_->metadata_callback) - encoder->private_->metadata_callback(encoder, &encoder->private_->streaminfo, encoder->private_->client_data); - } - - if(encoder->protected_->verify && 0 != encoder->private_->verify.decoder && !FLAC__stream_decoder_finish(encoder->private_->verify.decoder)) { - if(!error) - encoder->protected_->state = FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA; - error = true; - } - } - - if(0 != encoder->private_->file) { - if(encoder->private_->file != stdout) - fclose(encoder->private_->file); - encoder->private_->file = 0; - } - -#if FLAC__HAS_OGG - if(encoder->private_->is_ogg) - FLAC__ogg_encoder_aspect_finish(&encoder->protected_->ogg_encoder_aspect); -#endif - - free_(encoder); - set_defaults_(encoder); - - if(!error) - encoder->protected_->state = FLAC__STREAM_ENCODER_UNINITIALIZED; - - return !error; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_ogg_serial_number(FLAC__StreamEncoder *encoder, long value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; -#if FLAC__HAS_OGG - /* can't check encoder->private_->is_ogg since that's not set until init time */ - FLAC__ogg_encoder_aspect_set_serial_number(&encoder->protected_->ogg_encoder_aspect, value); - return true; -#else - (void)value; - return false; -#endif -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_verify(FLAC__StreamEncoder *encoder, FLAC__bool value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; -#ifndef FLAC__MANDATORY_VERIFY_WHILE_ENCODING - encoder->protected_->verify = value; -#endif - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_streamable_subset(FLAC__StreamEncoder *encoder, FLAC__bool value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - encoder->protected_->streamable_subset = value; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_do_md5(FLAC__StreamEncoder *encoder, FLAC__bool value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - encoder->protected_->do_md5 = value; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_channels(FLAC__StreamEncoder *encoder, unsigned value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - encoder->protected_->channels = value; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_bits_per_sample(FLAC__StreamEncoder *encoder, unsigned value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - encoder->protected_->bits_per_sample = value; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_sample_rate(FLAC__StreamEncoder *encoder, unsigned value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - encoder->protected_->sample_rate = value; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_compression_level(FLAC__StreamEncoder *encoder, unsigned value) -{ - FLAC__bool ok = true; - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - if(value >= sizeof(compression_levels_)/sizeof(compression_levels_[0])) - value = sizeof(compression_levels_)/sizeof(compression_levels_[0]) - 1; - ok &= FLAC__stream_encoder_set_do_mid_side_stereo (encoder, compression_levels_[value].do_mid_side_stereo); - ok &= FLAC__stream_encoder_set_loose_mid_side_stereo (encoder, compression_levels_[value].loose_mid_side_stereo); -#ifndef FLAC__INTEGER_ONLY_LIBRARY -#if 0 - /* was: */ - ok &= FLAC__stream_encoder_set_apodization (encoder, compression_levels_[value].apodization); - /* but it's too hard to specify the string in a locale-specific way */ -#else - encoder->protected_->num_apodizations = 1; - encoder->protected_->apodizations[0].type = FLAC__APODIZATION_TUKEY; - encoder->protected_->apodizations[0].parameters.tukey.p = 0.5; -#endif -#endif - ok &= FLAC__stream_encoder_set_max_lpc_order (encoder, compression_levels_[value].max_lpc_order); - ok &= FLAC__stream_encoder_set_qlp_coeff_precision (encoder, compression_levels_[value].qlp_coeff_precision); - ok &= FLAC__stream_encoder_set_do_qlp_coeff_prec_search (encoder, compression_levels_[value].do_qlp_coeff_prec_search); - ok &= FLAC__stream_encoder_set_do_escape_coding (encoder, compression_levels_[value].do_escape_coding); - ok &= FLAC__stream_encoder_set_do_exhaustive_model_search (encoder, compression_levels_[value].do_exhaustive_model_search); - ok &= FLAC__stream_encoder_set_min_residual_partition_order(encoder, compression_levels_[value].min_residual_partition_order); - ok &= FLAC__stream_encoder_set_max_residual_partition_order(encoder, compression_levels_[value].max_residual_partition_order); - ok &= FLAC__stream_encoder_set_rice_parameter_search_dist (encoder, compression_levels_[value].rice_parameter_search_dist); - return ok; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_blocksize(FLAC__StreamEncoder *encoder, unsigned value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - encoder->protected_->blocksize = value; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_do_mid_side_stereo(FLAC__StreamEncoder *encoder, FLAC__bool value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - encoder->protected_->do_mid_side_stereo = value; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_loose_mid_side_stereo(FLAC__StreamEncoder *encoder, FLAC__bool value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - encoder->protected_->loose_mid_side_stereo = value; - return true; -} - -/*@@@@add to tests*/ -FLAC_API FLAC__bool FLAC__stream_encoder_set_apodization(FLAC__StreamEncoder *encoder, const char *specification) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - FLAC__ASSERT(0 != specification); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; -#ifdef FLAC__INTEGER_ONLY_LIBRARY - (void)specification; /* silently ignore since we haven't integerized; will always use a rectangular window */ -#else - encoder->protected_->num_apodizations = 0; - while(1) { - const char *s = strchr(specification, ';'); - const size_t n = s? (size_t)(s - specification) : strlen(specification); - if (n==8 && 0 == strncmp("bartlett" , specification, n)) - encoder->protected_->apodizations[encoder->protected_->num_apodizations++].type = FLAC__APODIZATION_BARTLETT; - else if(n==13 && 0 == strncmp("bartlett_hann", specification, n)) - encoder->protected_->apodizations[encoder->protected_->num_apodizations++].type = FLAC__APODIZATION_BARTLETT_HANN; - else if(n==8 && 0 == strncmp("blackman" , specification, n)) - encoder->protected_->apodizations[encoder->protected_->num_apodizations++].type = FLAC__APODIZATION_BLACKMAN; - else if(n==26 && 0 == strncmp("blackman_harris_4term_92db", specification, n)) - encoder->protected_->apodizations[encoder->protected_->num_apodizations++].type = FLAC__APODIZATION_BLACKMAN_HARRIS_4TERM_92DB_SIDELOBE; - else if(n==6 && 0 == strncmp("connes" , specification, n)) - encoder->protected_->apodizations[encoder->protected_->num_apodizations++].type = FLAC__APODIZATION_CONNES; - else if(n==7 && 0 == strncmp("flattop" , specification, n)) - encoder->protected_->apodizations[encoder->protected_->num_apodizations++].type = FLAC__APODIZATION_FLATTOP; - else if(n>7 && 0 == strncmp("gauss(" , specification, 6)) { - FLAC__real stddev = (FLAC__real)strtod(specification+6, 0); - if (stddev > 0.0 && stddev <= 0.5) { - encoder->protected_->apodizations[encoder->protected_->num_apodizations].parameters.gauss.stddev = stddev; - encoder->protected_->apodizations[encoder->protected_->num_apodizations++].type = FLAC__APODIZATION_GAUSS; - } - } - else if(n==7 && 0 == strncmp("hamming" , specification, n)) - encoder->protected_->apodizations[encoder->protected_->num_apodizations++].type = FLAC__APODIZATION_HAMMING; - else if(n==4 && 0 == strncmp("hann" , specification, n)) - encoder->protected_->apodizations[encoder->protected_->num_apodizations++].type = FLAC__APODIZATION_HANN; - else if(n==13 && 0 == strncmp("kaiser_bessel", specification, n)) - encoder->protected_->apodizations[encoder->protected_->num_apodizations++].type = FLAC__APODIZATION_KAISER_BESSEL; - else if(n==7 && 0 == strncmp("nuttall" , specification, n)) - encoder->protected_->apodizations[encoder->protected_->num_apodizations++].type = FLAC__APODIZATION_NUTTALL; - else if(n==9 && 0 == strncmp("rectangle" , specification, n)) - encoder->protected_->apodizations[encoder->protected_->num_apodizations++].type = FLAC__APODIZATION_RECTANGLE; - else if(n==8 && 0 == strncmp("triangle" , specification, n)) - encoder->protected_->apodizations[encoder->protected_->num_apodizations++].type = FLAC__APODIZATION_TRIANGLE; - else if(n>7 && 0 == strncmp("tukey(" , specification, 6)) { - FLAC__real p = (FLAC__real)strtod(specification+6, 0); - if (p >= 0.0 && p <= 1.0) { - encoder->protected_->apodizations[encoder->protected_->num_apodizations].parameters.tukey.p = p; - encoder->protected_->apodizations[encoder->protected_->num_apodizations++].type = FLAC__APODIZATION_TUKEY; - } - } - else if(n==5 && 0 == strncmp("welch" , specification, n)) - encoder->protected_->apodizations[encoder->protected_->num_apodizations++].type = FLAC__APODIZATION_WELCH; - if (encoder->protected_->num_apodizations == 32) - break; - if (s) - specification = s+1; - else - break; - } - if(encoder->protected_->num_apodizations == 0) { - encoder->protected_->num_apodizations = 1; - encoder->protected_->apodizations[0].type = FLAC__APODIZATION_TUKEY; - encoder->protected_->apodizations[0].parameters.tukey.p = 0.5; - } -#endif - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_max_lpc_order(FLAC__StreamEncoder *encoder, unsigned value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - encoder->protected_->max_lpc_order = value; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_qlp_coeff_precision(FLAC__StreamEncoder *encoder, unsigned value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - encoder->protected_->qlp_coeff_precision = value; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_do_qlp_coeff_prec_search(FLAC__StreamEncoder *encoder, FLAC__bool value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - encoder->protected_->do_qlp_coeff_prec_search = value; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_do_escape_coding(FLAC__StreamEncoder *encoder, FLAC__bool value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; -#if 0 - /*@@@ deprecated: */ - encoder->protected_->do_escape_coding = value; -#else - (void)value; -#endif - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_do_exhaustive_model_search(FLAC__StreamEncoder *encoder, FLAC__bool value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - encoder->protected_->do_exhaustive_model_search = value; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_min_residual_partition_order(FLAC__StreamEncoder *encoder, unsigned value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - encoder->protected_->min_residual_partition_order = value; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_max_residual_partition_order(FLAC__StreamEncoder *encoder, unsigned value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - encoder->protected_->max_residual_partition_order = value; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_rice_parameter_search_dist(FLAC__StreamEncoder *encoder, unsigned value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; -#if 0 - /*@@@ deprecated: */ - encoder->protected_->rice_parameter_search_dist = value; -#else - (void)value; -#endif - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_total_samples_estimate(FLAC__StreamEncoder *encoder, FLAC__uint64 value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - encoder->protected_->total_samples_estimate = value; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_set_metadata(FLAC__StreamEncoder *encoder, FLAC__StreamMetadata **metadata, unsigned num_blocks) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - if(0 == metadata) - num_blocks = 0; - if(0 == num_blocks) - metadata = 0; - /* realloc() does not do exactly what we want so... */ - if(encoder->protected_->metadata) { - free(encoder->protected_->metadata); - encoder->protected_->metadata = 0; - encoder->protected_->num_metadata_blocks = 0; - } - if(num_blocks) { - FLAC__StreamMetadata **m; - if(0 == (m = (FLAC__StreamMetadata**)safe_malloc_mul_2op_(sizeof(m[0]), /*times*/num_blocks))) - return false; - memcpy(m, metadata, sizeof(m[0]) * num_blocks); - encoder->protected_->metadata = m; - encoder->protected_->num_metadata_blocks = num_blocks; - } -#if FLAC__HAS_OGG - if(!FLAC__ogg_encoder_aspect_set_num_metadata(&encoder->protected_->ogg_encoder_aspect, num_blocks)) - return false; -#endif - return true; -} - -/* - * These three functions are not static, but not publically exposed in - * include/FLAC/ either. They are used by the test suite. - */ -FLAC_API FLAC__bool FLAC__stream_encoder_disable_constant_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - encoder->private_->disable_constant_subframes = value; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_disable_fixed_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - encoder->private_->disable_fixed_subframes = value; - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_disable_verbatim_subframes(FLAC__StreamEncoder *encoder, FLAC__bool value) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_UNINITIALIZED) - return false; - encoder->private_->disable_verbatim_subframes = value; - return true; -} - -FLAC_API FLAC__StreamEncoderState FLAC__stream_encoder_get_state(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - return encoder->protected_->state; -} - -FLAC_API FLAC__StreamDecoderState FLAC__stream_encoder_get_verify_decoder_state(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->verify) - return FLAC__stream_decoder_get_state(encoder->private_->verify.decoder); - else - return FLAC__STREAM_DECODER_UNINITIALIZED; -} - -FLAC_API const char *FLAC__stream_encoder_get_resolved_state_string(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR) - return FLAC__StreamEncoderStateString[encoder->protected_->state]; - else - return FLAC__stream_decoder_get_resolved_state_string(encoder->private_->verify.decoder); -} - -FLAC_API void FLAC__stream_encoder_get_verify_decoder_error_stats(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - if(0 != absolute_sample) - *absolute_sample = encoder->private_->verify.error_stats.absolute_sample; - if(0 != frame_number) - *frame_number = encoder->private_->verify.error_stats.frame_number; - if(0 != channel) - *channel = encoder->private_->verify.error_stats.channel; - if(0 != sample) - *sample = encoder->private_->verify.error_stats.sample; - if(0 != expected) - *expected = encoder->private_->verify.error_stats.expected; - if(0 != got) - *got = encoder->private_->verify.error_stats.got; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_get_verify(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - return encoder->protected_->verify; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_get_streamable_subset(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - return encoder->protected_->streamable_subset; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_get_do_md5(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - return encoder->protected_->do_md5; -} - -FLAC_API unsigned FLAC__stream_encoder_get_channels(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - return encoder->protected_->channels; -} - -FLAC_API unsigned FLAC__stream_encoder_get_bits_per_sample(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - return encoder->protected_->bits_per_sample; -} - -FLAC_API unsigned FLAC__stream_encoder_get_sample_rate(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - return encoder->protected_->sample_rate; -} - -FLAC_API unsigned FLAC__stream_encoder_get_blocksize(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - return encoder->protected_->blocksize; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_get_do_mid_side_stereo(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - return encoder->protected_->do_mid_side_stereo; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_get_loose_mid_side_stereo(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - return encoder->protected_->loose_mid_side_stereo; -} - -FLAC_API unsigned FLAC__stream_encoder_get_max_lpc_order(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - return encoder->protected_->max_lpc_order; -} - -FLAC_API unsigned FLAC__stream_encoder_get_qlp_coeff_precision(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - return encoder->protected_->qlp_coeff_precision; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_get_do_qlp_coeff_prec_search(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - return encoder->protected_->do_qlp_coeff_prec_search; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_get_do_escape_coding(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - return encoder->protected_->do_escape_coding; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_get_do_exhaustive_model_search(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - return encoder->protected_->do_exhaustive_model_search; -} - -FLAC_API unsigned FLAC__stream_encoder_get_min_residual_partition_order(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - return encoder->protected_->min_residual_partition_order; -} - -FLAC_API unsigned FLAC__stream_encoder_get_max_residual_partition_order(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - return encoder->protected_->max_residual_partition_order; -} - -FLAC_API unsigned FLAC__stream_encoder_get_rice_parameter_search_dist(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - return encoder->protected_->rice_parameter_search_dist; -} - -FLAC_API FLAC__uint64 FLAC__stream_encoder_get_total_samples_estimate(const FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - return encoder->protected_->total_samples_estimate; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, const FLAC__int32 * const buffer[], unsigned samples) -{ - unsigned i, j = 0, channel; - const unsigned channels = encoder->protected_->channels, blocksize = encoder->protected_->blocksize; - - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - FLAC__ASSERT(encoder->protected_->state == FLAC__STREAM_ENCODER_OK); - - do { - const unsigned n = min(blocksize+OVERREAD_-encoder->private_->current_sample_number, samples-j); - - if(encoder->protected_->verify) - append_to_verify_fifo_(&encoder->private_->verify.input_fifo, buffer, j, channels, n); - - for(channel = 0; channel < channels; channel++) - memcpy(&encoder->private_->integer_signal[channel][encoder->private_->current_sample_number], &buffer[channel][j], sizeof(buffer[channel][0]) * n); - - if(encoder->protected_->do_mid_side_stereo) { - FLAC__ASSERT(channels == 2); - /* "i <= blocksize" to overread 1 sample; see comment in OVERREAD_ decl */ - for(i = encoder->private_->current_sample_number; i <= blocksize && j < samples; i++, j++) { - encoder->private_->integer_signal_mid_side[1][i] = buffer[0][j] - buffer[1][j]; - encoder->private_->integer_signal_mid_side[0][i] = (buffer[0][j] + buffer[1][j]) >> 1; /* NOTE: not the same as 'mid = (buffer[0][j] + buffer[1][j]) / 2' ! */ - } - } - else - j += n; - - encoder->private_->current_sample_number += n; - - /* we only process if we have a full block + 1 extra sample; final block is always handled by FLAC__stream_encoder_finish() */ - if(encoder->private_->current_sample_number > blocksize) { - FLAC__ASSERT(encoder->private_->current_sample_number == blocksize+OVERREAD_); - FLAC__ASSERT(OVERREAD_ == 1); /* assert we only overread 1 sample which simplifies the rest of the code below */ - if(!process_frame_(encoder, /*is_fractional_block=*/false, /*is_last_block=*/false)) - return false; - /* move unprocessed overread samples to beginnings of arrays */ - for(channel = 0; channel < channels; channel++) - encoder->private_->integer_signal[channel][0] = encoder->private_->integer_signal[channel][blocksize]; - if(encoder->protected_->do_mid_side_stereo) { - encoder->private_->integer_signal_mid_side[0][0] = encoder->private_->integer_signal_mid_side[0][blocksize]; - encoder->private_->integer_signal_mid_side[1][0] = encoder->private_->integer_signal_mid_side[1][blocksize]; - } - encoder->private_->current_sample_number = 1; - } - } while(j < samples); - - return true; -} - -FLAC_API FLAC__bool FLAC__stream_encoder_process_interleaved(FLAC__StreamEncoder *encoder, const FLAC__int32 buffer[], unsigned samples) -{ - unsigned i, j, k, channel; - FLAC__int32 x, mid, side; - const unsigned channels = encoder->protected_->channels, blocksize = encoder->protected_->blocksize; - - FLAC__ASSERT(0 != encoder); - FLAC__ASSERT(0 != encoder->private_); - FLAC__ASSERT(0 != encoder->protected_); - FLAC__ASSERT(encoder->protected_->state == FLAC__STREAM_ENCODER_OK); - - j = k = 0; - /* - * we have several flavors of the same basic loop, optimized for - * different conditions: - */ - if(encoder->protected_->do_mid_side_stereo && channels == 2) { - /* - * stereo coding: unroll channel loop - */ - do { - if(encoder->protected_->verify) - append_to_verify_fifo_interleaved_(&encoder->private_->verify.input_fifo, buffer, j, channels, min(blocksize+OVERREAD_-encoder->private_->current_sample_number, samples-j)); - - /* "i <= blocksize" to overread 1 sample; see comment in OVERREAD_ decl */ - for(i = encoder->private_->current_sample_number; i <= blocksize && j < samples; i++, j++) { - encoder->private_->integer_signal[0][i] = mid = side = buffer[k++]; - x = buffer[k++]; - encoder->private_->integer_signal[1][i] = x; - mid += x; - side -= x; - mid >>= 1; /* NOTE: not the same as 'mid = (left + right) / 2' ! */ - encoder->private_->integer_signal_mid_side[1][i] = side; - encoder->private_->integer_signal_mid_side[0][i] = mid; - } - encoder->private_->current_sample_number = i; - /* we only process if we have a full block + 1 extra sample; final block is always handled by FLAC__stream_encoder_finish() */ - if(i > blocksize) { - if(!process_frame_(encoder, /*is_fractional_block=*/false, /*is_last_block=*/false)) - return false; - /* move unprocessed overread samples to beginnings of arrays */ - FLAC__ASSERT(i == blocksize+OVERREAD_); - FLAC__ASSERT(OVERREAD_ == 1); /* assert we only overread 1 sample which simplifies the rest of the code below */ - encoder->private_->integer_signal[0][0] = encoder->private_->integer_signal[0][blocksize]; - encoder->private_->integer_signal[1][0] = encoder->private_->integer_signal[1][blocksize]; - encoder->private_->integer_signal_mid_side[0][0] = encoder->private_->integer_signal_mid_side[0][blocksize]; - encoder->private_->integer_signal_mid_side[1][0] = encoder->private_->integer_signal_mid_side[1][blocksize]; - encoder->private_->current_sample_number = 1; - } - } while(j < samples); - } - else { - /* - * independent channel coding: buffer each channel in inner loop - */ - do { - if(encoder->protected_->verify) - append_to_verify_fifo_interleaved_(&encoder->private_->verify.input_fifo, buffer, j, channels, min(blocksize+OVERREAD_-encoder->private_->current_sample_number, samples-j)); - - /* "i <= blocksize" to overread 1 sample; see comment in OVERREAD_ decl */ - for(i = encoder->private_->current_sample_number; i <= blocksize && j < samples; i++, j++) { - for(channel = 0; channel < channels; channel++) - encoder->private_->integer_signal[channel][i] = buffer[k++]; - } - encoder->private_->current_sample_number = i; - /* we only process if we have a full block + 1 extra sample; final block is always handled by FLAC__stream_encoder_finish() */ - if(i > blocksize) { - if(!process_frame_(encoder, /*is_fractional_block=*/false, /*is_last_block=*/false)) - return false; - /* move unprocessed overread samples to beginnings of arrays */ - FLAC__ASSERT(i == blocksize+OVERREAD_); - FLAC__ASSERT(OVERREAD_ == 1); /* assert we only overread 1 sample which simplifies the rest of the code below */ - for(channel = 0; channel < channels; channel++) - encoder->private_->integer_signal[channel][0] = encoder->private_->integer_signal[channel][blocksize]; - encoder->private_->current_sample_number = 1; - } - } while(j < samples); - } - - return true; -} - -/*********************************************************************** - * - * Private class methods - * - ***********************************************************************/ - -void set_defaults_(FLAC__StreamEncoder *encoder) -{ - FLAC__ASSERT(0 != encoder); - -#ifdef FLAC__MANDATORY_VERIFY_WHILE_ENCODING - encoder->protected_->verify = true; -#else - encoder->protected_->verify = false; -#endif - encoder->protected_->streamable_subset = true; - encoder->protected_->do_md5 = true; - encoder->protected_->do_mid_side_stereo = false; - encoder->protected_->loose_mid_side_stereo = false; - encoder->protected_->channels = 2; - encoder->protected_->bits_per_sample = 16; - encoder->protected_->sample_rate = 44100; - encoder->protected_->blocksize = 0; -#ifndef FLAC__INTEGER_ONLY_LIBRARY - encoder->protected_->num_apodizations = 1; - encoder->protected_->apodizations[0].type = FLAC__APODIZATION_TUKEY; - encoder->protected_->apodizations[0].parameters.tukey.p = 0.5; -#endif - encoder->protected_->max_lpc_order = 0; - encoder->protected_->qlp_coeff_precision = 0; - encoder->protected_->do_qlp_coeff_prec_search = false; - encoder->protected_->do_exhaustive_model_search = false; - encoder->protected_->do_escape_coding = false; - encoder->protected_->min_residual_partition_order = 0; - encoder->protected_->max_residual_partition_order = 0; - encoder->protected_->rice_parameter_search_dist = 0; - encoder->protected_->total_samples_estimate = 0; - encoder->protected_->metadata = 0; - encoder->protected_->num_metadata_blocks = 0; - - encoder->private_->seek_table = 0; - encoder->private_->disable_constant_subframes = false; - encoder->private_->disable_fixed_subframes = false; - encoder->private_->disable_verbatim_subframes = false; -#if FLAC__HAS_OGG - encoder->private_->is_ogg = false; -#endif - encoder->private_->read_callback = 0; - encoder->private_->write_callback = 0; - encoder->private_->seek_callback = 0; - encoder->private_->tell_callback = 0; - encoder->private_->metadata_callback = 0; - encoder->private_->progress_callback = 0; - encoder->private_->client_data = 0; - -#if FLAC__HAS_OGG - FLAC__ogg_encoder_aspect_set_defaults(&encoder->protected_->ogg_encoder_aspect); -#endif -} - -void free_(FLAC__StreamEncoder *encoder) -{ - unsigned i, channel; - - FLAC__ASSERT(0 != encoder); - if(encoder->protected_->metadata) { - free(encoder->protected_->metadata); - encoder->protected_->metadata = 0; - encoder->protected_->num_metadata_blocks = 0; - } - for(i = 0; i < encoder->protected_->channels; i++) { - if(0 != encoder->private_->integer_signal_unaligned[i]) { - free(encoder->private_->integer_signal_unaligned[i]); - encoder->private_->integer_signal_unaligned[i] = 0; - } -#ifndef FLAC__INTEGER_ONLY_LIBRARY - if(0 != encoder->private_->real_signal_unaligned[i]) { - free(encoder->private_->real_signal_unaligned[i]); - encoder->private_->real_signal_unaligned[i] = 0; - } -#endif - } - for(i = 0; i < 2; i++) { - if(0 != encoder->private_->integer_signal_mid_side_unaligned[i]) { - free(encoder->private_->integer_signal_mid_side_unaligned[i]); - encoder->private_->integer_signal_mid_side_unaligned[i] = 0; - } -#ifndef FLAC__INTEGER_ONLY_LIBRARY - if(0 != encoder->private_->real_signal_mid_side_unaligned[i]) { - free(encoder->private_->real_signal_mid_side_unaligned[i]); - encoder->private_->real_signal_mid_side_unaligned[i] = 0; - } -#endif - } -#ifndef FLAC__INTEGER_ONLY_LIBRARY - for(i = 0; i < encoder->protected_->num_apodizations; i++) { - if(0 != encoder->private_->window_unaligned[i]) { - free(encoder->private_->window_unaligned[i]); - encoder->private_->window_unaligned[i] = 0; - } - } - if(0 != encoder->private_->windowed_signal_unaligned) { - free(encoder->private_->windowed_signal_unaligned); - encoder->private_->windowed_signal_unaligned = 0; - } -#endif - for(channel = 0; channel < encoder->protected_->channels; channel++) { - for(i = 0; i < 2; i++) { - if(0 != encoder->private_->residual_workspace_unaligned[channel][i]) { - free(encoder->private_->residual_workspace_unaligned[channel][i]); - encoder->private_->residual_workspace_unaligned[channel][i] = 0; - } - } - } - for(channel = 0; channel < 2; channel++) { - for(i = 0; i < 2; i++) { - if(0 != encoder->private_->residual_workspace_mid_side_unaligned[channel][i]) { - free(encoder->private_->residual_workspace_mid_side_unaligned[channel][i]); - encoder->private_->residual_workspace_mid_side_unaligned[channel][i] = 0; - } - } - } - if(0 != encoder->private_->abs_residual_partition_sums_unaligned) { - free(encoder->private_->abs_residual_partition_sums_unaligned); - encoder->private_->abs_residual_partition_sums_unaligned = 0; - } - if(0 != encoder->private_->raw_bits_per_partition_unaligned) { - free(encoder->private_->raw_bits_per_partition_unaligned); - encoder->private_->raw_bits_per_partition_unaligned = 0; - } - if(encoder->protected_->verify) { - for(i = 0; i < encoder->protected_->channels; i++) { - if(0 != encoder->private_->verify.input_fifo.data[i]) { - free(encoder->private_->verify.input_fifo.data[i]); - encoder->private_->verify.input_fifo.data[i] = 0; - } - } - } - FLAC__bitwriter_free(encoder->private_->frame); -} - -FLAC__bool resize_buffers_(FLAC__StreamEncoder *encoder, unsigned new_blocksize) -{ - FLAC__bool ok; - unsigned i, channel; - - FLAC__ASSERT(new_blocksize > 0); - FLAC__ASSERT(encoder->protected_->state == FLAC__STREAM_ENCODER_OK); - FLAC__ASSERT(encoder->private_->current_sample_number == 0); - - /* To avoid excessive malloc'ing, we only grow the buffer; no shrinking. */ - if(new_blocksize <= encoder->private_->input_capacity) - return true; - - ok = true; - - /* WATCHOUT: FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32_mmx() - * requires that the input arrays (in our case the integer signals) - * have a buffer of up to 3 zeroes in front (at negative indices) for - * alignment purposes; we use 4 in front to keep the data well-aligned. - */ - - for(i = 0; ok && i < encoder->protected_->channels; i++) { - ok = ok && FLAC__memory_alloc_aligned_int32_array(new_blocksize+4+OVERREAD_, &encoder->private_->integer_signal_unaligned[i], &encoder->private_->integer_signal[i]); - memset(encoder->private_->integer_signal[i], 0, sizeof(FLAC__int32)*4); - encoder->private_->integer_signal[i] += 4; -#ifndef FLAC__INTEGER_ONLY_LIBRARY -#if 0 /* @@@ currently unused */ - if(encoder->protected_->max_lpc_order > 0) - ok = ok && FLAC__memory_alloc_aligned_real_array(new_blocksize+OVERREAD_, &encoder->private_->real_signal_unaligned[i], &encoder->private_->real_signal[i]); -#endif -#endif - } - for(i = 0; ok && i < 2; i++) { - ok = ok && FLAC__memory_alloc_aligned_int32_array(new_blocksize+4+OVERREAD_, &encoder->private_->integer_signal_mid_side_unaligned[i], &encoder->private_->integer_signal_mid_side[i]); - memset(encoder->private_->integer_signal_mid_side[i], 0, sizeof(FLAC__int32)*4); - encoder->private_->integer_signal_mid_side[i] += 4; -#ifndef FLAC__INTEGER_ONLY_LIBRARY -#if 0 /* @@@ currently unused */ - if(encoder->protected_->max_lpc_order > 0) - ok = ok && FLAC__memory_alloc_aligned_real_array(new_blocksize+OVERREAD_, &encoder->private_->real_signal_mid_side_unaligned[i], &encoder->private_->real_signal_mid_side[i]); -#endif -#endif - } -#ifndef FLAC__INTEGER_ONLY_LIBRARY - if(ok && encoder->protected_->max_lpc_order > 0) { - for(i = 0; ok && i < encoder->protected_->num_apodizations; i++) - ok = ok && FLAC__memory_alloc_aligned_real_array(new_blocksize, &encoder->private_->window_unaligned[i], &encoder->private_->window[i]); - ok = ok && FLAC__memory_alloc_aligned_real_array(new_blocksize, &encoder->private_->windowed_signal_unaligned, &encoder->private_->windowed_signal); - } -#endif - for(channel = 0; ok && channel < encoder->protected_->channels; channel++) { - for(i = 0; ok && i < 2; i++) { - ok = ok && FLAC__memory_alloc_aligned_int32_array(new_blocksize, &encoder->private_->residual_workspace_unaligned[channel][i], &encoder->private_->residual_workspace[channel][i]); - } - } - for(channel = 0; ok && channel < 2; channel++) { - for(i = 0; ok && i < 2; i++) { - ok = ok && FLAC__memory_alloc_aligned_int32_array(new_blocksize, &encoder->private_->residual_workspace_mid_side_unaligned[channel][i], &encoder->private_->residual_workspace_mid_side[channel][i]); - } - } - /* the *2 is an approximation to the series 1 + 1/2 + 1/4 + ... that sums tree occupies in a flat array */ - /*@@@ new_blocksize*2 is too pessimistic, but to fix, we need smarter logic because a smaller new_blocksize can actually increase the # of partitions; would require moving this out into a separate function, then checking its capacity against the need of the current blocksize&min/max_partition_order (and maybe predictor order) */ - ok = ok && FLAC__memory_alloc_aligned_uint64_array(new_blocksize * 2, &encoder->private_->abs_residual_partition_sums_unaligned, &encoder->private_->abs_residual_partition_sums); - if(encoder->protected_->do_escape_coding) - ok = ok && FLAC__memory_alloc_aligned_unsigned_array(new_blocksize * 2, &encoder->private_->raw_bits_per_partition_unaligned, &encoder->private_->raw_bits_per_partition); - - /* now adjust the windows if the blocksize has changed */ -#ifndef FLAC__INTEGER_ONLY_LIBRARY - if(ok && new_blocksize != encoder->private_->input_capacity && encoder->protected_->max_lpc_order > 0) { - for(i = 0; ok && i < encoder->protected_->num_apodizations; i++) { - switch(encoder->protected_->apodizations[i].type) { - case FLAC__APODIZATION_BARTLETT: - FLAC__window_bartlett(encoder->private_->window[i], new_blocksize); - break; - case FLAC__APODIZATION_BARTLETT_HANN: - FLAC__window_bartlett_hann(encoder->private_->window[i], new_blocksize); - break; - case FLAC__APODIZATION_BLACKMAN: - FLAC__window_blackman(encoder->private_->window[i], new_blocksize); - break; - case FLAC__APODIZATION_BLACKMAN_HARRIS_4TERM_92DB_SIDELOBE: - FLAC__window_blackman_harris_4term_92db_sidelobe(encoder->private_->window[i], new_blocksize); - break; - case FLAC__APODIZATION_CONNES: - FLAC__window_connes(encoder->private_->window[i], new_blocksize); - break; - case FLAC__APODIZATION_FLATTOP: - FLAC__window_flattop(encoder->private_->window[i], new_blocksize); - break; - case FLAC__APODIZATION_GAUSS: - FLAC__window_gauss(encoder->private_->window[i], new_blocksize, encoder->protected_->apodizations[i].parameters.gauss.stddev); - break; - case FLAC__APODIZATION_HAMMING: - FLAC__window_hamming(encoder->private_->window[i], new_blocksize); - break; - case FLAC__APODIZATION_HANN: - FLAC__window_hann(encoder->private_->window[i], new_blocksize); - break; - case FLAC__APODIZATION_KAISER_BESSEL: - FLAC__window_kaiser_bessel(encoder->private_->window[i], new_blocksize); - break; - case FLAC__APODIZATION_NUTTALL: - FLAC__window_nuttall(encoder->private_->window[i], new_blocksize); - break; - case FLAC__APODIZATION_RECTANGLE: - FLAC__window_rectangle(encoder->private_->window[i], new_blocksize); - break; - case FLAC__APODIZATION_TRIANGLE: - FLAC__window_triangle(encoder->private_->window[i], new_blocksize); - break; - case FLAC__APODIZATION_TUKEY: - FLAC__window_tukey(encoder->private_->window[i], new_blocksize, encoder->protected_->apodizations[i].parameters.tukey.p); - break; - case FLAC__APODIZATION_WELCH: - FLAC__window_welch(encoder->private_->window[i], new_blocksize); - break; - default: - FLAC__ASSERT(0); - /* double protection */ - FLAC__window_hann(encoder->private_->window[i], new_blocksize); - break; - } - } - } -#endif - - if(ok) - encoder->private_->input_capacity = new_blocksize; - else - encoder->protected_->state = FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR; - - return ok; -} - -FLAC__bool write_bitbuffer_(FLAC__StreamEncoder *encoder, unsigned samples, FLAC__bool is_last_block) -{ - const FLAC__byte *buffer; - size_t bytes; - - FLAC__ASSERT(FLAC__bitwriter_is_byte_aligned(encoder->private_->frame)); - - if(!FLAC__bitwriter_get_buffer(encoder->private_->frame, &buffer, &bytes)) { - encoder->protected_->state = FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR; - return false; - } - - if(encoder->protected_->verify) { - encoder->private_->verify.output.data = buffer; - encoder->private_->verify.output.bytes = bytes; - if(encoder->private_->verify.state_hint == ENCODER_IN_MAGIC) { - encoder->private_->verify.needs_magic_hack = true; - } - else { - if(!FLAC__stream_decoder_process_single(encoder->private_->verify.decoder)) { - FLAC__bitwriter_release_buffer(encoder->private_->frame); - FLAC__bitwriter_clear(encoder->private_->frame); - if(encoder->protected_->state != FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA) - encoder->protected_->state = FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR; - return false; - } - } - } - - if(write_frame_(encoder, buffer, bytes, samples, is_last_block) != FLAC__STREAM_ENCODER_WRITE_STATUS_OK) { - FLAC__bitwriter_release_buffer(encoder->private_->frame); - FLAC__bitwriter_clear(encoder->private_->frame); - encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; - return false; - } - - FLAC__bitwriter_release_buffer(encoder->private_->frame); - FLAC__bitwriter_clear(encoder->private_->frame); - - if(samples > 0) { - encoder->private_->streaminfo.data.stream_info.min_framesize = min(bytes, encoder->private_->streaminfo.data.stream_info.min_framesize); - encoder->private_->streaminfo.data.stream_info.max_framesize = max(bytes, encoder->private_->streaminfo.data.stream_info.max_framesize); - } - - return true; -} - -FLAC__StreamEncoderWriteStatus write_frame_(FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, FLAC__bool is_last_block) -{ - FLAC__StreamEncoderWriteStatus status; - FLAC__uint64 output_position = 0; - - /* FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED just means we didn't get the offset; no error */ - if(encoder->private_->tell_callback && encoder->private_->tell_callback(encoder, &output_position, encoder->private_->client_data) == FLAC__STREAM_ENCODER_TELL_STATUS_ERROR) { - encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; - return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR; - } - - /* - * Watch for the STREAMINFO block and first SEEKTABLE block to go by and store their offsets. - */ - if(samples == 0) { - FLAC__MetadataType type = (buffer[0] & 0x7f); - if(type == FLAC__METADATA_TYPE_STREAMINFO) - encoder->protected_->streaminfo_offset = output_position; - else if(type == FLAC__METADATA_TYPE_SEEKTABLE && encoder->protected_->seektable_offset == 0) - encoder->protected_->seektable_offset = output_position; - } - - /* - * Mark the current seek point if hit (if audio_offset == 0 that - * means we're still writing metadata and haven't hit the first - * frame yet) - */ - if(0 != encoder->private_->seek_table && encoder->protected_->audio_offset > 0 && encoder->private_->seek_table->num_points > 0) { - const unsigned blocksize = FLAC__stream_encoder_get_blocksize(encoder); - const FLAC__uint64 frame_first_sample = encoder->private_->samples_written; - const FLAC__uint64 frame_last_sample = frame_first_sample + (FLAC__uint64)blocksize - 1; - FLAC__uint64 test_sample; - unsigned i; - for(i = encoder->private_->first_seekpoint_to_check; i < encoder->private_->seek_table->num_points; i++) { - test_sample = encoder->private_->seek_table->points[i].sample_number; - if(test_sample > frame_last_sample) { - break; - } - else if(test_sample >= frame_first_sample) { - encoder->private_->seek_table->points[i].sample_number = frame_first_sample; - encoder->private_->seek_table->points[i].stream_offset = output_position - encoder->protected_->audio_offset; - encoder->private_->seek_table->points[i].frame_samples = blocksize; - encoder->private_->first_seekpoint_to_check++; - /* DO NOT: "break;" and here's why: - * The seektable template may contain more than one target - * sample for any given frame; we will keep looping, generating - * duplicate seekpoints for them, and we'll clean it up later, - * just before writing the seektable back to the metadata. - */ - } - else { - encoder->private_->first_seekpoint_to_check++; - } - } - } - -#if FLAC__HAS_OGG - if(encoder->private_->is_ogg) { - status = FLAC__ogg_encoder_aspect_write_callback_wrapper( - &encoder->protected_->ogg_encoder_aspect, - buffer, - bytes, - samples, - encoder->private_->current_frame_number, - is_last_block, - (FLAC__OggEncoderAspectWriteCallbackProxy)encoder->private_->write_callback, - encoder, - encoder->private_->client_data - ); - } - else -#endif - status = encoder->private_->write_callback(encoder, buffer, bytes, samples, encoder->private_->current_frame_number, encoder->private_->client_data); - - if(status == FLAC__STREAM_ENCODER_WRITE_STATUS_OK) { - encoder->private_->bytes_written += bytes; - encoder->private_->samples_written += samples; - /* we keep a high watermark on the number of frames written because - * when the encoder goes back to write metadata, 'current_frame' - * will drop back to 0. - */ - encoder->private_->frames_written = max(encoder->private_->frames_written, encoder->private_->current_frame_number+1); - } - else - encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; - - return status; -} - -/* Gets called when the encoding process has finished so that we can update the STREAMINFO and SEEKTABLE blocks. */ -void update_metadata_(const FLAC__StreamEncoder *encoder) -{ - FLAC__byte b[max(6, FLAC__STREAM_METADATA_SEEKPOINT_LENGTH)]; - const FLAC__StreamMetadata *metadata = &encoder->private_->streaminfo; - const FLAC__uint64 samples = metadata->data.stream_info.total_samples; - const unsigned min_framesize = metadata->data.stream_info.min_framesize; - const unsigned max_framesize = metadata->data.stream_info.max_framesize; - const unsigned bps = metadata->data.stream_info.bits_per_sample; - FLAC__StreamEncoderSeekStatus seek_status; - - FLAC__ASSERT(metadata->type == FLAC__METADATA_TYPE_STREAMINFO); - - /* All this is based on intimate knowledge of the stream header - * layout, but a change to the header format that would break this - * would also break all streams encoded in the previous format. - */ - - /* - * Write MD5 signature - */ - { - const unsigned md5_offset = - FLAC__STREAM_METADATA_HEADER_LENGTH + - ( - FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_SAMPLE_RATE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN + - FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN - ) / 8; - - if((seek_status = encoder->private_->seek_callback(encoder, encoder->protected_->streaminfo_offset + md5_offset, encoder->private_->client_data)) != FLAC__STREAM_ENCODER_SEEK_STATUS_OK) { - if(seek_status == FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR) - encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; - return; - } - if(encoder->private_->write_callback(encoder, metadata->data.stream_info.md5sum, 16, 0, 0, encoder->private_->client_data) != FLAC__STREAM_ENCODER_WRITE_STATUS_OK) { - encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; - return; - } - } - - /* - * Write total samples - */ - { - const unsigned total_samples_byte_offset = - FLAC__STREAM_METADATA_HEADER_LENGTH + - ( - FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_SAMPLE_RATE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN + - FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN - - 4 - ) / 8; - - b[0] = ((FLAC__byte)(bps-1) << 4) | (FLAC__byte)((samples >> 32) & 0x0F); - b[1] = (FLAC__byte)((samples >> 24) & 0xFF); - b[2] = (FLAC__byte)((samples >> 16) & 0xFF); - b[3] = (FLAC__byte)((samples >> 8) & 0xFF); - b[4] = (FLAC__byte)(samples & 0xFF); - if((seek_status = encoder->private_->seek_callback(encoder, encoder->protected_->streaminfo_offset + total_samples_byte_offset, encoder->private_->client_data)) != FLAC__STREAM_ENCODER_SEEK_STATUS_OK) { - if(seek_status == FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR) - encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; - return; - } - if(encoder->private_->write_callback(encoder, b, 5, 0, 0, encoder->private_->client_data) != FLAC__STREAM_ENCODER_WRITE_STATUS_OK) { - encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; - return; - } - } - - /* - * Write min/max framesize - */ - { - const unsigned min_framesize_offset = - FLAC__STREAM_METADATA_HEADER_LENGTH + - ( - FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN - ) / 8; - - b[0] = (FLAC__byte)((min_framesize >> 16) & 0xFF); - b[1] = (FLAC__byte)((min_framesize >> 8) & 0xFF); - b[2] = (FLAC__byte)(min_framesize & 0xFF); - b[3] = (FLAC__byte)((max_framesize >> 16) & 0xFF); - b[4] = (FLAC__byte)((max_framesize >> 8) & 0xFF); - b[5] = (FLAC__byte)(max_framesize & 0xFF); - if((seek_status = encoder->private_->seek_callback(encoder, encoder->protected_->streaminfo_offset + min_framesize_offset, encoder->private_->client_data)) != FLAC__STREAM_ENCODER_SEEK_STATUS_OK) { - if(seek_status == FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR) - encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; - return; - } - if(encoder->private_->write_callback(encoder, b, 6, 0, 0, encoder->private_->client_data) != FLAC__STREAM_ENCODER_WRITE_STATUS_OK) { - encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; - return; - } - } - - /* - * Write seektable - */ - if(0 != encoder->private_->seek_table && encoder->private_->seek_table->num_points > 0 && encoder->protected_->seektable_offset > 0) { - unsigned i; - - FLAC__format_seektable_sort(encoder->private_->seek_table); - - FLAC__ASSERT(FLAC__format_seektable_is_legal(encoder->private_->seek_table)); - - if((seek_status = encoder->private_->seek_callback(encoder, encoder->protected_->seektable_offset + FLAC__STREAM_METADATA_HEADER_LENGTH, encoder->private_->client_data)) != FLAC__STREAM_ENCODER_SEEK_STATUS_OK) { - if(seek_status == FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR) - encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; - return; - } - - for(i = 0; i < encoder->private_->seek_table->num_points; i++) { - FLAC__uint64 xx; - unsigned x; - xx = encoder->private_->seek_table->points[i].sample_number; - b[7] = (FLAC__byte)xx; xx >>= 8; - b[6] = (FLAC__byte)xx; xx >>= 8; - b[5] = (FLAC__byte)xx; xx >>= 8; - b[4] = (FLAC__byte)xx; xx >>= 8; - b[3] = (FLAC__byte)xx; xx >>= 8; - b[2] = (FLAC__byte)xx; xx >>= 8; - b[1] = (FLAC__byte)xx; xx >>= 8; - b[0] = (FLAC__byte)xx; xx >>= 8; - xx = encoder->private_->seek_table->points[i].stream_offset; - b[15] = (FLAC__byte)xx; xx >>= 8; - b[14] = (FLAC__byte)xx; xx >>= 8; - b[13] = (FLAC__byte)xx; xx >>= 8; - b[12] = (FLAC__byte)xx; xx >>= 8; - b[11] = (FLAC__byte)xx; xx >>= 8; - b[10] = (FLAC__byte)xx; xx >>= 8; - b[9] = (FLAC__byte)xx; xx >>= 8; - b[8] = (FLAC__byte)xx; xx >>= 8; - x = encoder->private_->seek_table->points[i].frame_samples; - b[17] = (FLAC__byte)x; x >>= 8; - b[16] = (FLAC__byte)x; x >>= 8; - if(encoder->private_->write_callback(encoder, b, 18, 0, 0, encoder->private_->client_data) != FLAC__STREAM_ENCODER_WRITE_STATUS_OK) { - encoder->protected_->state = FLAC__STREAM_ENCODER_CLIENT_ERROR; - return; - } - } - } -} - -#if FLAC__HAS_OGG -/* Gets called when the encoding process has finished so that we can update the STREAMINFO and SEEKTABLE blocks. */ -void update_ogg_metadata_(FLAC__StreamEncoder *encoder) -{ - /* the # of bytes in the 1st packet that precede the STREAMINFO */ - static const unsigned FIRST_OGG_PACKET_STREAMINFO_PREFIX_LENGTH = - FLAC__OGG_MAPPING_PACKET_TYPE_LENGTH + - FLAC__OGG_MAPPING_MAGIC_LENGTH + - FLAC__OGG_MAPPING_VERSION_MAJOR_LENGTH + - FLAC__OGG_MAPPING_VERSION_MINOR_LENGTH + - FLAC__OGG_MAPPING_NUM_HEADERS_LENGTH + - FLAC__STREAM_SYNC_LENGTH - ; - FLAC__byte b[max(6, FLAC__STREAM_METADATA_SEEKPOINT_LENGTH)]; - const FLAC__StreamMetadata *metadata = &encoder->private_->streaminfo; - const FLAC__uint64 samples = metadata->data.stream_info.total_samples; - const unsigned min_framesize = metadata->data.stream_info.min_framesize; - const unsigned max_framesize = metadata->data.stream_info.max_framesize; - ogg_page page; - - FLAC__ASSERT(metadata->type == FLAC__METADATA_TYPE_STREAMINFO); - FLAC__ASSERT(0 != encoder->private_->seek_callback); - - /* Pre-check that client supports seeking, since we don't want the - * ogg_helper code to ever have to deal with this condition. - */ - if(encoder->private_->seek_callback(encoder, 0, encoder->private_->client_data) == FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED) - return; - - /* All this is based on intimate knowledge of the stream header - * layout, but a change to the header format that would break this - * would also break all streams encoded in the previous format. - */ - - /** - ** Write STREAMINFO stats - **/ - simple_ogg_page__init(&page); - if(!simple_ogg_page__get_at(encoder, encoder->protected_->streaminfo_offset, &page, encoder->private_->seek_callback, encoder->private_->read_callback, encoder->private_->client_data)) { - simple_ogg_page__clear(&page); - return; /* state already set */ - } - - /* - * Write MD5 signature - */ - { - const unsigned md5_offset = - FIRST_OGG_PACKET_STREAMINFO_PREFIX_LENGTH + - FLAC__STREAM_METADATA_HEADER_LENGTH + - ( - FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_SAMPLE_RATE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN + - FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN - ) / 8; - - if(md5_offset + 16 > (unsigned)page.body_len) { - encoder->protected_->state = FLAC__STREAM_ENCODER_OGG_ERROR; - simple_ogg_page__clear(&page); - return; - } - memcpy(page.body + md5_offset, metadata->data.stream_info.md5sum, 16); - } - - /* - * Write total samples - */ - { - const unsigned total_samples_byte_offset = - FIRST_OGG_PACKET_STREAMINFO_PREFIX_LENGTH + - FLAC__STREAM_METADATA_HEADER_LENGTH + - ( - FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_SAMPLE_RATE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN + - FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN - - 4 - ) / 8; - - if(total_samples_byte_offset + 5 > (unsigned)page.body_len) { - encoder->protected_->state = FLAC__STREAM_ENCODER_OGG_ERROR; - simple_ogg_page__clear(&page); - return; - } - b[0] = (FLAC__byte)page.body[total_samples_byte_offset] & 0xF0; - b[0] |= (FLAC__byte)((samples >> 32) & 0x0F); - b[1] = (FLAC__byte)((samples >> 24) & 0xFF); - b[2] = (FLAC__byte)((samples >> 16) & 0xFF); - b[3] = (FLAC__byte)((samples >> 8) & 0xFF); - b[4] = (FLAC__byte)(samples & 0xFF); - memcpy(page.body + total_samples_byte_offset, b, 5); - } - - /* - * Write min/max framesize - */ - { - const unsigned min_framesize_offset = - FIRST_OGG_PACKET_STREAMINFO_PREFIX_LENGTH + - FLAC__STREAM_METADATA_HEADER_LENGTH + - ( - FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN + - FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN - ) / 8; - - if(min_framesize_offset + 6 > (unsigned)page.body_len) { - encoder->protected_->state = FLAC__STREAM_ENCODER_OGG_ERROR; - simple_ogg_page__clear(&page); - return; - } - b[0] = (FLAC__byte)((min_framesize >> 16) & 0xFF); - b[1] = (FLAC__byte)((min_framesize >> 8) & 0xFF); - b[2] = (FLAC__byte)(min_framesize & 0xFF); - b[3] = (FLAC__byte)((max_framesize >> 16) & 0xFF); - b[4] = (FLAC__byte)((max_framesize >> 8) & 0xFF); - b[5] = (FLAC__byte)(max_framesize & 0xFF); - memcpy(page.body + min_framesize_offset, b, 6); - } - if(!simple_ogg_page__set_at(encoder, encoder->protected_->streaminfo_offset, &page, encoder->private_->seek_callback, encoder->private_->write_callback, encoder->private_->client_data)) { - simple_ogg_page__clear(&page); - return; /* state already set */ - } - simple_ogg_page__clear(&page); - - /* - * Write seektable - */ - if(0 != encoder->private_->seek_table && encoder->private_->seek_table->num_points > 0 && encoder->protected_->seektable_offset > 0) { - unsigned i; - FLAC__byte *p; - - FLAC__format_seektable_sort(encoder->private_->seek_table); - - FLAC__ASSERT(FLAC__format_seektable_is_legal(encoder->private_->seek_table)); - - simple_ogg_page__init(&page); - if(!simple_ogg_page__get_at(encoder, encoder->protected_->seektable_offset, &page, encoder->private_->seek_callback, encoder->private_->read_callback, encoder->private_->client_data)) { - simple_ogg_page__clear(&page); - return; /* state already set */ - } - - if((FLAC__STREAM_METADATA_HEADER_LENGTH + 18*encoder->private_->seek_table->num_points) != (unsigned)page.body_len) { - encoder->protected_->state = FLAC__STREAM_ENCODER_OGG_ERROR; - simple_ogg_page__clear(&page); - return; - } - - for(i = 0, p = page.body + FLAC__STREAM_METADATA_HEADER_LENGTH; i < encoder->private_->seek_table->num_points; i++, p += 18) { - FLAC__uint64 xx; - unsigned x; - xx = encoder->private_->seek_table->points[i].sample_number; - b[7] = (FLAC__byte)xx; xx >>= 8; - b[6] = (FLAC__byte)xx; xx >>= 8; - b[5] = (FLAC__byte)xx; xx >>= 8; - b[4] = (FLAC__byte)xx; xx >>= 8; - b[3] = (FLAC__byte)xx; xx >>= 8; - b[2] = (FLAC__byte)xx; xx >>= 8; - b[1] = (FLAC__byte)xx; xx >>= 8; - b[0] = (FLAC__byte)xx; xx >>= 8; - xx = encoder->private_->seek_table->points[i].stream_offset; - b[15] = (FLAC__byte)xx; xx >>= 8; - b[14] = (FLAC__byte)xx; xx >>= 8; - b[13] = (FLAC__byte)xx; xx >>= 8; - b[12] = (FLAC__byte)xx; xx >>= 8; - b[11] = (FLAC__byte)xx; xx >>= 8; - b[10] = (FLAC__byte)xx; xx >>= 8; - b[9] = (FLAC__byte)xx; xx >>= 8; - b[8] = (FLAC__byte)xx; xx >>= 8; - x = encoder->private_->seek_table->points[i].frame_samples; - b[17] = (FLAC__byte)x; x >>= 8; - b[16] = (FLAC__byte)x; x >>= 8; - memcpy(p, b, 18); - } - - if(!simple_ogg_page__set_at(encoder, encoder->protected_->seektable_offset, &page, encoder->private_->seek_callback, encoder->private_->write_callback, encoder->private_->client_data)) { - simple_ogg_page__clear(&page); - return; /* state already set */ - } - simple_ogg_page__clear(&page); - } -} -#endif - -FLAC__bool process_frame_(FLAC__StreamEncoder *encoder, FLAC__bool is_fractional_block, FLAC__bool is_last_block) -{ - FLAC__uint16 crc; - FLAC__ASSERT(encoder->protected_->state == FLAC__STREAM_ENCODER_OK); - - /* - * Accumulate raw signal to the MD5 signature - */ - if(encoder->protected_->do_md5 && !FLAC__MD5Accumulate(&encoder->private_->md5context, (const FLAC__int32 * const *)encoder->private_->integer_signal, encoder->protected_->channels, encoder->protected_->blocksize, (encoder->protected_->bits_per_sample+7) / 8)) { - encoder->protected_->state = FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR; - return false; - } - - /* - * Process the frame header and subframes into the frame bitbuffer - */ - if(!process_subframes_(encoder, is_fractional_block)) { - /* the above function sets the state for us in case of an error */ - return false; - } - - /* - * Zero-pad the frame to a byte_boundary - */ - if(!FLAC__bitwriter_zero_pad_to_byte_boundary(encoder->private_->frame)) { - encoder->protected_->state = FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR; - return false; - } - - /* - * CRC-16 the whole thing - */ - FLAC__ASSERT(FLAC__bitwriter_is_byte_aligned(encoder->private_->frame)); - if( - !FLAC__bitwriter_get_write_crc16(encoder->private_->frame, &crc) || - !FLAC__bitwriter_write_raw_uint32(encoder->private_->frame, crc, FLAC__FRAME_FOOTER_CRC_LEN) - ) { - encoder->protected_->state = FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR; - return false; - } - - /* - * Write it - */ - if(!write_bitbuffer_(encoder, encoder->protected_->blocksize, is_last_block)) { - /* the above function sets the state for us in case of an error */ - return false; - } - - /* - * Get ready for the next frame - */ - encoder->private_->current_sample_number = 0; - encoder->private_->current_frame_number++; - encoder->private_->streaminfo.data.stream_info.total_samples += (FLAC__uint64)encoder->protected_->blocksize; - - return true; -} - -FLAC__bool process_subframes_(FLAC__StreamEncoder *encoder, FLAC__bool is_fractional_block) -{ - FLAC__FrameHeader frame_header; - unsigned channel, min_partition_order = encoder->protected_->min_residual_partition_order, max_partition_order; - FLAC__bool do_independent, do_mid_side; - - /* - * Calculate the min,max Rice partition orders - */ - if(is_fractional_block) { - max_partition_order = 0; - } - else { - max_partition_order = FLAC__format_get_max_rice_partition_order_from_blocksize(encoder->protected_->blocksize); - max_partition_order = min(max_partition_order, encoder->protected_->max_residual_partition_order); - } - min_partition_order = min(min_partition_order, max_partition_order); - - /* - * Setup the frame - */ - frame_header.blocksize = encoder->protected_->blocksize; - frame_header.sample_rate = encoder->protected_->sample_rate; - frame_header.channels = encoder->protected_->channels; - frame_header.channel_assignment = FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT; /* the default unless the encoder determines otherwise */ - frame_header.bits_per_sample = encoder->protected_->bits_per_sample; - frame_header.number_type = FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER; - frame_header.number.frame_number = encoder->private_->current_frame_number; - - /* - * Figure out what channel assignments to try - */ - if(encoder->protected_->do_mid_side_stereo) { - if(encoder->protected_->loose_mid_side_stereo) { - if(encoder->private_->loose_mid_side_stereo_frame_count == 0) { - do_independent = true; - do_mid_side = true; - } - else { - do_independent = (encoder->private_->last_channel_assignment == FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT); - do_mid_side = !do_independent; - } - } - else { - do_independent = true; - do_mid_side = true; - } - } - else { - do_independent = true; - do_mid_side = false; - } - - FLAC__ASSERT(do_independent || do_mid_side); - - /* - * Check for wasted bits; set effective bps for each subframe - */ - if(do_independent) { - for(channel = 0; channel < encoder->protected_->channels; channel++) { - const unsigned w = get_wasted_bits_(encoder->private_->integer_signal[channel], encoder->protected_->blocksize); - encoder->private_->subframe_workspace[channel][0].wasted_bits = encoder->private_->subframe_workspace[channel][1].wasted_bits = w; - encoder->private_->subframe_bps[channel] = encoder->protected_->bits_per_sample - w; - } - } - if(do_mid_side) { - FLAC__ASSERT(encoder->protected_->channels == 2); - for(channel = 0; channel < 2; channel++) { - const unsigned w = get_wasted_bits_(encoder->private_->integer_signal_mid_side[channel], encoder->protected_->blocksize); - encoder->private_->subframe_workspace_mid_side[channel][0].wasted_bits = encoder->private_->subframe_workspace_mid_side[channel][1].wasted_bits = w; - encoder->private_->subframe_bps_mid_side[channel] = encoder->protected_->bits_per_sample - w + (channel==0? 0:1); - } - } - - /* - * First do a normal encoding pass of each independent channel - */ - if(do_independent) { - for(channel = 0; channel < encoder->protected_->channels; channel++) { - if(! - process_subframe_( - encoder, - min_partition_order, - max_partition_order, - &frame_header, - encoder->private_->subframe_bps[channel], - encoder->private_->integer_signal[channel], - encoder->private_->subframe_workspace_ptr[channel], - encoder->private_->partitioned_rice_contents_workspace_ptr[channel], - encoder->private_->residual_workspace[channel], - encoder->private_->best_subframe+channel, - encoder->private_->best_subframe_bits+channel - ) - ) - return false; - } - } - - /* - * Now do mid and side channels if requested - */ - if(do_mid_side) { - FLAC__ASSERT(encoder->protected_->channels == 2); - - for(channel = 0; channel < 2; channel++) { - if(! - process_subframe_( - encoder, - min_partition_order, - max_partition_order, - &frame_header, - encoder->private_->subframe_bps_mid_side[channel], - encoder->private_->integer_signal_mid_side[channel], - encoder->private_->subframe_workspace_ptr_mid_side[channel], - encoder->private_->partitioned_rice_contents_workspace_ptr_mid_side[channel], - encoder->private_->residual_workspace_mid_side[channel], - encoder->private_->best_subframe_mid_side+channel, - encoder->private_->best_subframe_bits_mid_side+channel - ) - ) - return false; - } - } - - /* - * Compose the frame bitbuffer - */ - if(do_mid_side) { - unsigned left_bps = 0, right_bps = 0; /* initialized only to prevent superfluous compiler warning */ - FLAC__Subframe *left_subframe = 0, *right_subframe = 0; /* initialized only to prevent superfluous compiler warning */ - FLAC__ChannelAssignment channel_assignment; - - FLAC__ASSERT(encoder->protected_->channels == 2); - - if(encoder->protected_->loose_mid_side_stereo && encoder->private_->loose_mid_side_stereo_frame_count > 0) { - channel_assignment = (encoder->private_->last_channel_assignment == FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT? FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT : FLAC__CHANNEL_ASSIGNMENT_MID_SIDE); - } - else { - unsigned bits[4]; /* WATCHOUT - indexed by FLAC__ChannelAssignment */ - unsigned min_bits; - int ca; - - FLAC__ASSERT(FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT == 0); - FLAC__ASSERT(FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE == 1); - FLAC__ASSERT(FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE == 2); - FLAC__ASSERT(FLAC__CHANNEL_ASSIGNMENT_MID_SIDE == 3); - FLAC__ASSERT(do_independent && do_mid_side); - - /* We have to figure out which channel assignent results in the smallest frame */ - bits[FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT] = encoder->private_->best_subframe_bits [0] + encoder->private_->best_subframe_bits [1]; - bits[FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE ] = encoder->private_->best_subframe_bits [0] + encoder->private_->best_subframe_bits_mid_side[1]; - bits[FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE ] = encoder->private_->best_subframe_bits [1] + encoder->private_->best_subframe_bits_mid_side[1]; - bits[FLAC__CHANNEL_ASSIGNMENT_MID_SIDE ] = encoder->private_->best_subframe_bits_mid_side[0] + encoder->private_->best_subframe_bits_mid_side[1]; - - channel_assignment = FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT; - min_bits = bits[channel_assignment]; - for(ca = 1; ca <= 3; ca++) { - if(bits[ca] < min_bits) { - min_bits = bits[ca]; - channel_assignment = (FLAC__ChannelAssignment)ca; - } - } - } - - frame_header.channel_assignment = channel_assignment; - - if(!FLAC__frame_add_header(&frame_header, encoder->private_->frame)) { - encoder->protected_->state = FLAC__STREAM_ENCODER_FRAMING_ERROR; - return false; - } - - switch(channel_assignment) { - case FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT: - left_subframe = &encoder->private_->subframe_workspace [0][encoder->private_->best_subframe [0]]; - right_subframe = &encoder->private_->subframe_workspace [1][encoder->private_->best_subframe [1]]; - break; - case FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE: - left_subframe = &encoder->private_->subframe_workspace [0][encoder->private_->best_subframe [0]]; - right_subframe = &encoder->private_->subframe_workspace_mid_side[1][encoder->private_->best_subframe_mid_side[1]]; - break; - case FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE: - left_subframe = &encoder->private_->subframe_workspace_mid_side[1][encoder->private_->best_subframe_mid_side[1]]; - right_subframe = &encoder->private_->subframe_workspace [1][encoder->private_->best_subframe [1]]; - break; - case FLAC__CHANNEL_ASSIGNMENT_MID_SIDE: - left_subframe = &encoder->private_->subframe_workspace_mid_side[0][encoder->private_->best_subframe_mid_side[0]]; - right_subframe = &encoder->private_->subframe_workspace_mid_side[1][encoder->private_->best_subframe_mid_side[1]]; - break; - default: - FLAC__ASSERT(0); - } - - switch(channel_assignment) { - case FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT: - left_bps = encoder->private_->subframe_bps [0]; - right_bps = encoder->private_->subframe_bps [1]; - break; - case FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE: - left_bps = encoder->private_->subframe_bps [0]; - right_bps = encoder->private_->subframe_bps_mid_side[1]; - break; - case FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE: - left_bps = encoder->private_->subframe_bps_mid_side[1]; - right_bps = encoder->private_->subframe_bps [1]; - break; - case FLAC__CHANNEL_ASSIGNMENT_MID_SIDE: - left_bps = encoder->private_->subframe_bps_mid_side[0]; - right_bps = encoder->private_->subframe_bps_mid_side[1]; - break; - default: - FLAC__ASSERT(0); - } - - /* note that encoder_add_subframe_ sets the state for us in case of an error */ - if(!add_subframe_(encoder, frame_header.blocksize, left_bps , left_subframe , encoder->private_->frame)) - return false; - if(!add_subframe_(encoder, frame_header.blocksize, right_bps, right_subframe, encoder->private_->frame)) - return false; - } - else { - if(!FLAC__frame_add_header(&frame_header, encoder->private_->frame)) { - encoder->protected_->state = FLAC__STREAM_ENCODER_FRAMING_ERROR; - return false; - } - - for(channel = 0; channel < encoder->protected_->channels; channel++) { - if(!add_subframe_(encoder, frame_header.blocksize, encoder->private_->subframe_bps[channel], &encoder->private_->subframe_workspace[channel][encoder->private_->best_subframe[channel]], encoder->private_->frame)) { - /* the above function sets the state for us in case of an error */ - return false; - } - } - } - - if(encoder->protected_->loose_mid_side_stereo) { - encoder->private_->loose_mid_side_stereo_frame_count++; - if(encoder->private_->loose_mid_side_stereo_frame_count >= encoder->private_->loose_mid_side_stereo_frames) - encoder->private_->loose_mid_side_stereo_frame_count = 0; - } - - encoder->private_->last_channel_assignment = frame_header.channel_assignment; - - return true; -} - -FLAC__bool process_subframe_( - FLAC__StreamEncoder *encoder, - unsigned min_partition_order, - unsigned max_partition_order, - const FLAC__FrameHeader *frame_header, - unsigned subframe_bps, - const FLAC__int32 integer_signal[], - FLAC__Subframe *subframe[2], - FLAC__EntropyCodingMethod_PartitionedRiceContents *partitioned_rice_contents[2], - FLAC__int32 *residual[2], - unsigned *best_subframe, - unsigned *best_bits -) -{ -#ifndef FLAC__INTEGER_ONLY_LIBRARY - FLAC__float fixed_residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]; -#else - FLAC__fixedpoint fixed_residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]; -#endif -#ifndef FLAC__INTEGER_ONLY_LIBRARY - FLAC__double lpc_residual_bits_per_sample; - FLAC__real autoc[FLAC__MAX_LPC_ORDER+1]; /* WATCHOUT: the size is important even though encoder->protected_->max_lpc_order might be less; some asm routines need all the space */ - FLAC__double lpc_error[FLAC__MAX_LPC_ORDER]; - unsigned min_lpc_order, max_lpc_order, lpc_order; - unsigned min_qlp_coeff_precision, max_qlp_coeff_precision, qlp_coeff_precision; -#endif - unsigned min_fixed_order, max_fixed_order, guess_fixed_order, fixed_order; - unsigned rice_parameter; - unsigned _candidate_bits, _best_bits; - unsigned _best_subframe; - /* only use RICE2 partitions if stream bps > 16 */ - const unsigned rice_parameter_limit = FLAC__stream_encoder_get_bits_per_sample(encoder) > 16? FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_ESCAPE_PARAMETER : FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER; - - FLAC__ASSERT(frame_header->blocksize > 0); - - /* verbatim subframe is the baseline against which we measure other compressed subframes */ - _best_subframe = 0; - if(encoder->private_->disable_verbatim_subframes && frame_header->blocksize >= FLAC__MAX_FIXED_ORDER) - _best_bits = UINT_MAX; - else - _best_bits = evaluate_verbatim_subframe_(encoder, integer_signal, frame_header->blocksize, subframe_bps, subframe[_best_subframe]); - - if(frame_header->blocksize >= FLAC__MAX_FIXED_ORDER) { - unsigned signal_is_constant = false; - guess_fixed_order = encoder->private_->local_fixed_compute_best_predictor(integer_signal+FLAC__MAX_FIXED_ORDER, frame_header->blocksize-FLAC__MAX_FIXED_ORDER, fixed_residual_bits_per_sample); - /* check for constant subframe */ - if( - !encoder->private_->disable_constant_subframes && -#ifndef FLAC__INTEGER_ONLY_LIBRARY - fixed_residual_bits_per_sample[1] == 0.0 -#else - fixed_residual_bits_per_sample[1] == FLAC__FP_ZERO -#endif - ) { - /* the above means it's possible all samples are the same value; now double-check it: */ - unsigned i; - signal_is_constant = true; - for(i = 1; i < frame_header->blocksize; i++) { - if(integer_signal[0] != integer_signal[i]) { - signal_is_constant = false; - break; - } - } - } - if(signal_is_constant) { - _candidate_bits = evaluate_constant_subframe_(encoder, integer_signal[0], frame_header->blocksize, subframe_bps, subframe[!_best_subframe]); - if(_candidate_bits < _best_bits) { - _best_subframe = !_best_subframe; - _best_bits = _candidate_bits; - } - } - else { - if(!encoder->private_->disable_fixed_subframes || (encoder->protected_->max_lpc_order == 0 && _best_bits == UINT_MAX)) { - /* encode fixed */ - if(encoder->protected_->do_exhaustive_model_search) { - min_fixed_order = 0; - max_fixed_order = FLAC__MAX_FIXED_ORDER; - } - else { - min_fixed_order = max_fixed_order = guess_fixed_order; - } - if(max_fixed_order >= frame_header->blocksize) - max_fixed_order = frame_header->blocksize - 1; - for(fixed_order = min_fixed_order; fixed_order <= max_fixed_order; fixed_order++) { -#ifndef FLAC__INTEGER_ONLY_LIBRARY - if(fixed_residual_bits_per_sample[fixed_order] >= (FLAC__float)subframe_bps) - continue; /* don't even try */ - rice_parameter = (fixed_residual_bits_per_sample[fixed_order] > 0.0)? (unsigned)(fixed_residual_bits_per_sample[fixed_order]+0.5) : 0; /* 0.5 is for rounding */ -#else - if(FLAC__fixedpoint_trunc(fixed_residual_bits_per_sample[fixed_order]) >= (int)subframe_bps) - continue; /* don't even try */ - rice_parameter = (fixed_residual_bits_per_sample[fixed_order] > FLAC__FP_ZERO)? (unsigned)FLAC__fixedpoint_trunc(fixed_residual_bits_per_sample[fixed_order]+FLAC__FP_ONE_HALF) : 0; /* 0.5 is for rounding */ -#endif - rice_parameter++; /* to account for the signed->unsigned conversion during rice coding */ - if(rice_parameter >= rice_parameter_limit) { -#ifdef DEBUG_VERBOSE - fprintf(stderr, "clipping rice_parameter (%u -> %u) @0\n", rice_parameter, rice_parameter_limit - 1); -#endif - rice_parameter = rice_parameter_limit - 1; - } - _candidate_bits = - evaluate_fixed_subframe_( - encoder, - integer_signal, - residual[!_best_subframe], - encoder->private_->abs_residual_partition_sums, - encoder->private_->raw_bits_per_partition, - frame_header->blocksize, - subframe_bps, - fixed_order, - rice_parameter, - rice_parameter_limit, - min_partition_order, - max_partition_order, - encoder->protected_->do_escape_coding, - encoder->protected_->rice_parameter_search_dist, - subframe[!_best_subframe], - partitioned_rice_contents[!_best_subframe] - ); - if(_candidate_bits < _best_bits) { - _best_subframe = !_best_subframe; - _best_bits = _candidate_bits; - } - } - } - -#ifndef FLAC__INTEGER_ONLY_LIBRARY - /* encode lpc */ - if(encoder->protected_->max_lpc_order > 0) { - if(encoder->protected_->max_lpc_order >= frame_header->blocksize) - max_lpc_order = frame_header->blocksize-1; - else - max_lpc_order = encoder->protected_->max_lpc_order; - if(max_lpc_order > 0) { - unsigned a; - for (a = 0; a < encoder->protected_->num_apodizations; a++) { - FLAC__lpc_window_data(integer_signal, encoder->private_->window[a], encoder->private_->windowed_signal, frame_header->blocksize); - encoder->private_->local_lpc_compute_autocorrelation(encoder->private_->windowed_signal, frame_header->blocksize, max_lpc_order+1, autoc); - /* if autoc[0] == 0.0, the signal is constant and we usually won't get here, but it can happen */ - if(autoc[0] != 0.0) { - FLAC__lpc_compute_lp_coefficients(autoc, &max_lpc_order, encoder->private_->lp_coeff, lpc_error); - if(encoder->protected_->do_exhaustive_model_search) { - min_lpc_order = 1; - } - else { - const unsigned guess_lpc_order = - FLAC__lpc_compute_best_order( - lpc_error, - max_lpc_order, - frame_header->blocksize, - subframe_bps + ( - encoder->protected_->do_qlp_coeff_prec_search? - FLAC__MIN_QLP_COEFF_PRECISION : /* have to guess; use the min possible size to avoid accidentally favoring lower orders */ - encoder->protected_->qlp_coeff_precision - ) - ); - min_lpc_order = max_lpc_order = guess_lpc_order; - } - if(max_lpc_order >= frame_header->blocksize) - max_lpc_order = frame_header->blocksize - 1; - for(lpc_order = min_lpc_order; lpc_order <= max_lpc_order; lpc_order++) { - lpc_residual_bits_per_sample = FLAC__lpc_compute_expected_bits_per_residual_sample(lpc_error[lpc_order-1], frame_header->blocksize-lpc_order); - if(lpc_residual_bits_per_sample >= (FLAC__double)subframe_bps) - continue; /* don't even try */ - rice_parameter = (lpc_residual_bits_per_sample > 0.0)? (unsigned)(lpc_residual_bits_per_sample+0.5) : 0; /* 0.5 is for rounding */ - rice_parameter++; /* to account for the signed->unsigned conversion during rice coding */ - if(rice_parameter >= rice_parameter_limit) { -#ifdef DEBUG_VERBOSE - fprintf(stderr, "clipping rice_parameter (%u -> %u) @1\n", rice_parameter, rice_parameter_limit - 1); -#endif - rice_parameter = rice_parameter_limit - 1; - } - if(encoder->protected_->do_qlp_coeff_prec_search) { - min_qlp_coeff_precision = FLAC__MIN_QLP_COEFF_PRECISION; - /* try to ensure a 32-bit datapath throughout for 16bps(+1bps for side channel) or less */ - if(subframe_bps <= 17) { - max_qlp_coeff_precision = min(32 - subframe_bps - lpc_order, FLAC__MAX_QLP_COEFF_PRECISION); - max_qlp_coeff_precision = max(max_qlp_coeff_precision, min_qlp_coeff_precision); - } - else - max_qlp_coeff_precision = FLAC__MAX_QLP_COEFF_PRECISION; - } - else { - min_qlp_coeff_precision = max_qlp_coeff_precision = encoder->protected_->qlp_coeff_precision; - } - for(qlp_coeff_precision = min_qlp_coeff_precision; qlp_coeff_precision <= max_qlp_coeff_precision; qlp_coeff_precision++) { - _candidate_bits = - evaluate_lpc_subframe_( - encoder, - integer_signal, - residual[!_best_subframe], - encoder->private_->abs_residual_partition_sums, - encoder->private_->raw_bits_per_partition, - encoder->private_->lp_coeff[lpc_order-1], - frame_header->blocksize, - subframe_bps, - lpc_order, - qlp_coeff_precision, - rice_parameter, - rice_parameter_limit, - min_partition_order, - max_partition_order, - encoder->protected_->do_escape_coding, - encoder->protected_->rice_parameter_search_dist, - subframe[!_best_subframe], - partitioned_rice_contents[!_best_subframe] - ); - if(_candidate_bits > 0) { /* if == 0, there was a problem quantizing the lpcoeffs */ - if(_candidate_bits < _best_bits) { - _best_subframe = !_best_subframe; - _best_bits = _candidate_bits; - } - } - } - } - } - } - } - } -#endif /* !defined FLAC__INTEGER_ONLY_LIBRARY */ - } - } - - /* under rare circumstances this can happen when all but lpc subframe types are disabled: */ - if(_best_bits == UINT_MAX) { - FLAC__ASSERT(_best_subframe == 0); - _best_bits = evaluate_verbatim_subframe_(encoder, integer_signal, frame_header->blocksize, subframe_bps, subframe[_best_subframe]); - } - - *best_subframe = _best_subframe; - *best_bits = _best_bits; - - return true; -} - -FLAC__bool add_subframe_( - FLAC__StreamEncoder *encoder, - unsigned blocksize, - unsigned subframe_bps, - const FLAC__Subframe *subframe, - FLAC__BitWriter *frame -) -{ - switch(subframe->type) { - case FLAC__SUBFRAME_TYPE_CONSTANT: - if(!FLAC__subframe_add_constant(&(subframe->data.constant), subframe_bps, subframe->wasted_bits, frame)) { - encoder->protected_->state = FLAC__STREAM_ENCODER_FRAMING_ERROR; - return false; - } - break; - case FLAC__SUBFRAME_TYPE_FIXED: - if(!FLAC__subframe_add_fixed(&(subframe->data.fixed), blocksize - subframe->data.fixed.order, subframe_bps, subframe->wasted_bits, frame)) { - encoder->protected_->state = FLAC__STREAM_ENCODER_FRAMING_ERROR; - return false; - } - break; - case FLAC__SUBFRAME_TYPE_LPC: - if(!FLAC__subframe_add_lpc(&(subframe->data.lpc), blocksize - subframe->data.lpc.order, subframe_bps, subframe->wasted_bits, frame)) { - encoder->protected_->state = FLAC__STREAM_ENCODER_FRAMING_ERROR; - return false; - } - break; - case FLAC__SUBFRAME_TYPE_VERBATIM: - if(!FLAC__subframe_add_verbatim(&(subframe->data.verbatim), blocksize, subframe_bps, subframe->wasted_bits, frame)) { - encoder->protected_->state = FLAC__STREAM_ENCODER_FRAMING_ERROR; - return false; - } - break; - default: - FLAC__ASSERT(0); - } - - return true; -} - -#define SPOTCHECK_ESTIMATE 0 -#if SPOTCHECK_ESTIMATE -static void spotcheck_subframe_estimate_( - FLAC__StreamEncoder *encoder, - unsigned blocksize, - unsigned subframe_bps, - const FLAC__Subframe *subframe, - unsigned estimate -) -{ - FLAC__bool ret; - FLAC__BitWriter *frame = FLAC__bitwriter_new(); - if(frame == 0) { - fprintf(stderr, "EST: can't allocate frame\n"); - return; - } - if(!FLAC__bitwriter_init(frame)) { - fprintf(stderr, "EST: can't init frame\n"); - return; - } - ret = add_subframe_(encoder, blocksize, subframe_bps, subframe, frame); - FLAC__ASSERT(ret); - { - const unsigned actual = FLAC__bitwriter_get_input_bits_unconsumed(frame); - if(estimate != actual) - fprintf(stderr, "EST: bad, frame#%u sub#%%d type=%8s est=%u, actual=%u, delta=%d\n", encoder->private_->current_frame_number, FLAC__SubframeTypeString[subframe->type], estimate, actual, (int)actual-(int)estimate); - } - FLAC__bitwriter_delete(frame); -} -#endif - -unsigned evaluate_constant_subframe_( - FLAC__StreamEncoder *encoder, - const FLAC__int32 signal, - unsigned blocksize, - unsigned subframe_bps, - FLAC__Subframe *subframe -) -{ - unsigned estimate; - subframe->type = FLAC__SUBFRAME_TYPE_CONSTANT; - subframe->data.constant.value = signal; - - estimate = FLAC__SUBFRAME_ZERO_PAD_LEN + FLAC__SUBFRAME_TYPE_LEN + FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN + subframe->wasted_bits + subframe_bps; - -#if SPOTCHECK_ESTIMATE - spotcheck_subframe_estimate_(encoder, blocksize, subframe_bps, subframe, estimate); -#else - (void)encoder, (void)blocksize; -#endif - - return estimate; -} - -unsigned evaluate_fixed_subframe_( - FLAC__StreamEncoder *encoder, - const FLAC__int32 signal[], - FLAC__int32 residual[], - FLAC__uint64 abs_residual_partition_sums[], - unsigned raw_bits_per_partition[], - unsigned blocksize, - unsigned subframe_bps, - unsigned order, - unsigned rice_parameter, - unsigned rice_parameter_limit, - unsigned min_partition_order, - unsigned max_partition_order, - FLAC__bool do_escape_coding, - unsigned rice_parameter_search_dist, - FLAC__Subframe *subframe, - FLAC__EntropyCodingMethod_PartitionedRiceContents *partitioned_rice_contents -) -{ - unsigned i, residual_bits, estimate; - const unsigned residual_samples = blocksize - order; - - FLAC__fixed_compute_residual(signal+order, residual_samples, order, residual); - - subframe->type = FLAC__SUBFRAME_TYPE_FIXED; - - subframe->data.fixed.entropy_coding_method.type = FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE; - subframe->data.fixed.entropy_coding_method.data.partitioned_rice.contents = partitioned_rice_contents; - subframe->data.fixed.residual = residual; - - residual_bits = - find_best_partition_order_( - encoder->private_, - residual, - abs_residual_partition_sums, - raw_bits_per_partition, - residual_samples, - order, - rice_parameter, - rice_parameter_limit, - min_partition_order, - max_partition_order, - subframe_bps, - do_escape_coding, - rice_parameter_search_dist, - &subframe->data.fixed.entropy_coding_method - ); - - subframe->data.fixed.order = order; - for(i = 0; i < order; i++) - subframe->data.fixed.warmup[i] = signal[i]; - - estimate = FLAC__SUBFRAME_ZERO_PAD_LEN + FLAC__SUBFRAME_TYPE_LEN + FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN + subframe->wasted_bits + (order * subframe_bps) + residual_bits; - -#if SPOTCHECK_ESTIMATE - spotcheck_subframe_estimate_(encoder, blocksize, subframe_bps, subframe, estimate); -#endif - - return estimate; -} - -#ifndef FLAC__INTEGER_ONLY_LIBRARY -unsigned evaluate_lpc_subframe_( - FLAC__StreamEncoder *encoder, - const FLAC__int32 signal[], - FLAC__int32 residual[], - FLAC__uint64 abs_residual_partition_sums[], - unsigned raw_bits_per_partition[], - const FLAC__real lp_coeff[], - unsigned blocksize, - unsigned subframe_bps, - unsigned order, - unsigned qlp_coeff_precision, - unsigned rice_parameter, - unsigned rice_parameter_limit, - unsigned min_partition_order, - unsigned max_partition_order, - FLAC__bool do_escape_coding, - unsigned rice_parameter_search_dist, - FLAC__Subframe *subframe, - FLAC__EntropyCodingMethod_PartitionedRiceContents *partitioned_rice_contents -) -{ - FLAC__int32 qlp_coeff[FLAC__MAX_LPC_ORDER]; - unsigned i, residual_bits, estimate; - int quantization, ret; - const unsigned residual_samples = blocksize - order; - - /* try to keep qlp coeff precision such that only 32-bit math is required for decode of <=16bps streams */ - if(subframe_bps <= 16) { - FLAC__ASSERT(order > 0); - FLAC__ASSERT(order <= FLAC__MAX_LPC_ORDER); - qlp_coeff_precision = min(qlp_coeff_precision, 32 - subframe_bps - FLAC__bitmath_ilog2(order)); - } - - ret = FLAC__lpc_quantize_coefficients(lp_coeff, order, qlp_coeff_precision, qlp_coeff, &quantization); - if(ret != 0) - return 0; /* this is a hack to indicate to the caller that we can't do lp at this order on this subframe */ - - if(subframe_bps + qlp_coeff_precision + FLAC__bitmath_ilog2(order) <= 32) - if(subframe_bps <= 16 && qlp_coeff_precision <= 16) - encoder->private_->local_lpc_compute_residual_from_qlp_coefficients_16bit(signal+order, residual_samples, qlp_coeff, order, quantization, residual); - else - encoder->private_->local_lpc_compute_residual_from_qlp_coefficients(signal+order, residual_samples, qlp_coeff, order, quantization, residual); - else - encoder->private_->local_lpc_compute_residual_from_qlp_coefficients_64bit(signal+order, residual_samples, qlp_coeff, order, quantization, residual); - - subframe->type = FLAC__SUBFRAME_TYPE_LPC; - - subframe->data.lpc.entropy_coding_method.type = FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE; - subframe->data.lpc.entropy_coding_method.data.partitioned_rice.contents = partitioned_rice_contents; - subframe->data.lpc.residual = residual; - - residual_bits = - find_best_partition_order_( - encoder->private_, - residual, - abs_residual_partition_sums, - raw_bits_per_partition, - residual_samples, - order, - rice_parameter, - rice_parameter_limit, - min_partition_order, - max_partition_order, - subframe_bps, - do_escape_coding, - rice_parameter_search_dist, - &subframe->data.lpc.entropy_coding_method - ); - - subframe->data.lpc.order = order; - subframe->data.lpc.qlp_coeff_precision = qlp_coeff_precision; - subframe->data.lpc.quantization_level = quantization; - memcpy(subframe->data.lpc.qlp_coeff, qlp_coeff, sizeof(FLAC__int32)*FLAC__MAX_LPC_ORDER); - for(i = 0; i < order; i++) - subframe->data.lpc.warmup[i] = signal[i]; - - estimate = FLAC__SUBFRAME_ZERO_PAD_LEN + FLAC__SUBFRAME_TYPE_LEN + FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN + subframe->wasted_bits + FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN + FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN + (order * (qlp_coeff_precision + subframe_bps)) + residual_bits; - -#if SPOTCHECK_ESTIMATE - spotcheck_subframe_estimate_(encoder, blocksize, subframe_bps, subframe, estimate); -#endif - - return estimate; -} -#endif - -unsigned evaluate_verbatim_subframe_( - FLAC__StreamEncoder *encoder, - const FLAC__int32 signal[], - unsigned blocksize, - unsigned subframe_bps, - FLAC__Subframe *subframe -) -{ - unsigned estimate; - - subframe->type = FLAC__SUBFRAME_TYPE_VERBATIM; - - subframe->data.verbatim.data = signal; - - estimate = FLAC__SUBFRAME_ZERO_PAD_LEN + FLAC__SUBFRAME_TYPE_LEN + FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN + subframe->wasted_bits + (blocksize * subframe_bps); - -#if SPOTCHECK_ESTIMATE - spotcheck_subframe_estimate_(encoder, blocksize, subframe_bps, subframe, estimate); -#else - (void)encoder; -#endif - - return estimate; -} - -unsigned find_best_partition_order_( - FLAC__StreamEncoderPrivate *private_, - const FLAC__int32 residual[], - FLAC__uint64 abs_residual_partition_sums[], - unsigned raw_bits_per_partition[], - unsigned residual_samples, - unsigned predictor_order, - unsigned rice_parameter, - unsigned rice_parameter_limit, - unsigned min_partition_order, - unsigned max_partition_order, - unsigned bps, - FLAC__bool do_escape_coding, - unsigned rice_parameter_search_dist, - FLAC__EntropyCodingMethod *best_ecm -) -{ - unsigned residual_bits, best_residual_bits = 0; - unsigned best_parameters_index = 0; - unsigned best_partition_order = 0; - const unsigned blocksize = residual_samples + predictor_order; - - max_partition_order = FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order(max_partition_order, blocksize, predictor_order); - min_partition_order = min(min_partition_order, max_partition_order); - - precompute_partition_info_sums_(residual, abs_residual_partition_sums, residual_samples, predictor_order, min_partition_order, max_partition_order, bps); - - if(do_escape_coding) - precompute_partition_info_escapes_(residual, raw_bits_per_partition, residual_samples, predictor_order, min_partition_order, max_partition_order); - - { - int partition_order; - unsigned sum; - - for(partition_order = (int)max_partition_order, sum = 0; partition_order >= (int)min_partition_order; partition_order--) { - if(! - set_partitioned_rice_( -#ifdef EXACT_RICE_BITS_CALCULATION - residual, -#endif - abs_residual_partition_sums+sum, - raw_bits_per_partition+sum, - residual_samples, - predictor_order, - rice_parameter, - rice_parameter_limit, - rice_parameter_search_dist, - (unsigned)partition_order, - do_escape_coding, - &private_->partitioned_rice_contents_extra[!best_parameters_index], - &residual_bits - ) - ) - { - FLAC__ASSERT(best_residual_bits != 0); - break; - } - sum += 1u << partition_order; - if(best_residual_bits == 0 || residual_bits < best_residual_bits) { - best_residual_bits = residual_bits; - best_parameters_index = !best_parameters_index; - best_partition_order = partition_order; - } - } - } - - best_ecm->data.partitioned_rice.order = best_partition_order; - - { - /* - * We are allowed to de-const the pointer based on our special - * knowledge; it is const to the outside world. - */ - FLAC__EntropyCodingMethod_PartitionedRiceContents* prc = (FLAC__EntropyCodingMethod_PartitionedRiceContents*)best_ecm->data.partitioned_rice.contents; - unsigned partition; - - /* save best parameters and raw_bits */ - FLAC__format_entropy_coding_method_partitioned_rice_contents_ensure_size(prc, max(6, best_partition_order)); - memcpy(prc->parameters, private_->partitioned_rice_contents_extra[best_parameters_index].parameters, sizeof(unsigned)*((unsigned long long)1<<(best_partition_order))); - if(do_escape_coding) - memcpy(prc->raw_bits, private_->partitioned_rice_contents_extra[best_parameters_index].raw_bits, sizeof(unsigned)*((unsigned long long)1<<(best_partition_order))); - /* - * Now need to check if the type should be changed to - * FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2 based on the - * size of the rice parameters. - */ - for(partition = 0; partition < (1u<<best_partition_order); partition++) { - if(prc->parameters[partition] >= FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER) { - best_ecm->type = FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2; - break; - } - } - } - - return best_residual_bits; -} - -#if defined(FLAC__CPU_IA32) && !defined FLAC__NO_ASM && defined FLAC__HAS_NASM -extern void precompute_partition_info_sums_32bit_asm_ia32_( - const FLAC__int32 residual[], - FLAC__uint64 abs_residual_partition_sums[], - unsigned blocksize, - unsigned predictor_order, - unsigned min_partition_order, - unsigned max_partition_order -); -#endif - -void precompute_partition_info_sums_( - const FLAC__int32 residual[], - FLAC__uint64 abs_residual_partition_sums[], - unsigned residual_samples, - unsigned predictor_order, - unsigned min_partition_order, - unsigned max_partition_order, - unsigned bps -) -{ - const unsigned default_partition_samples = (residual_samples + predictor_order) >> max_partition_order; - unsigned partitions = 1u << max_partition_order; - - FLAC__ASSERT(default_partition_samples > predictor_order); - -#if defined(FLAC__CPU_IA32) && !defined FLAC__NO_ASM && defined FLAC__HAS_NASM - /* slightly pessimistic but still catches all common cases */ - /* WATCHOUT: "+ bps" is an assumption that the average residual magnitude will not be more than "bps" bits */ - if(FLAC__bitmath_ilog2(default_partition_samples) + bps < 32) { - precompute_partition_info_sums_32bit_asm_ia32_(residual, abs_residual_partition_sums, residual_samples + predictor_order, predictor_order, min_partition_order, max_partition_order); - return; - } -#endif - - /* first do max_partition_order */ - { - unsigned partition, residual_sample, end = (unsigned)(-(int)predictor_order); - /* slightly pessimistic but still catches all common cases */ - /* WATCHOUT: "+ bps" is an assumption that the average residual magnitude will not be more than "bps" bits */ - if(FLAC__bitmath_ilog2(default_partition_samples) + bps < 32) { - FLAC__uint32 abs_residual_partition_sum; - - for(partition = residual_sample = 0; partition < partitions; partition++) { - end += default_partition_samples; - abs_residual_partition_sum = 0; - for( ; residual_sample < end; residual_sample++) - abs_residual_partition_sum += abs(residual[residual_sample]); /* abs(INT_MIN) is undefined, but if the residual is INT_MIN we have bigger problems */ - abs_residual_partition_sums[partition] = abs_residual_partition_sum; - } - } - else { /* have to pessimistically use 64 bits for accumulator */ - FLAC__uint64 abs_residual_partition_sum; - - for(partition = residual_sample = 0; partition < partitions; partition++) { - end += default_partition_samples; - abs_residual_partition_sum = 0; - for( ; residual_sample < end; residual_sample++) - abs_residual_partition_sum += abs(residual[residual_sample]); /* abs(INT_MIN) is undefined, but if the residual is INT_MIN we have bigger problems */ - abs_residual_partition_sums[partition] = abs_residual_partition_sum; - } - } - } - - /* now merge partitions for lower orders */ - { - unsigned from_partition = 0, to_partition = partitions; - int partition_order; - for(partition_order = (int)max_partition_order - 1; partition_order >= (int)min_partition_order; partition_order--) { - unsigned i; - partitions >>= 1; - for(i = 0; i < partitions; i++) { - abs_residual_partition_sums[to_partition++] = - abs_residual_partition_sums[from_partition ] + - abs_residual_partition_sums[from_partition+1]; - from_partition += 2; - } - } - } -} - -void precompute_partition_info_escapes_( - const FLAC__int32 residual[], - unsigned raw_bits_per_partition[], - unsigned residual_samples, - unsigned predictor_order, - unsigned min_partition_order, - unsigned max_partition_order -) -{ - int partition_order; - unsigned from_partition, to_partition = 0; - const unsigned blocksize = residual_samples + predictor_order; - - /* first do max_partition_order */ - for(partition_order = (int)max_partition_order; partition_order >= 0; partition_order--) { - FLAC__int32 r; - FLAC__uint32 rmax; - unsigned partition, partition_sample, partition_samples, residual_sample; - const unsigned partitions = 1u << partition_order; - const unsigned default_partition_samples = blocksize >> partition_order; - - FLAC__ASSERT(default_partition_samples > predictor_order); - - for(partition = residual_sample = 0; partition < partitions; partition++) { - partition_samples = default_partition_samples; - if(partition == 0) - partition_samples -= predictor_order; - rmax = 0; - for(partition_sample = 0; partition_sample < partition_samples; partition_sample++) { - r = residual[residual_sample++]; - /* OPT: maybe faster: rmax |= r ^ (r>>31) */ - if(r < 0) - rmax |= ~r; - else - rmax |= r; - } - /* now we know all residual values are in the range [-rmax-1,rmax] */ - raw_bits_per_partition[partition] = rmax? FLAC__bitmath_ilog2(rmax) + 2 : 1; - } - to_partition = partitions; - break; /*@@@ yuck, should remove the 'for' loop instead */ - } - - /* now merge partitions for lower orders */ - for(from_partition = 0, --partition_order; partition_order >= (int)min_partition_order; partition_order--) { - unsigned m; - unsigned i; - const unsigned partitions = 1u << partition_order; - for(i = 0; i < partitions; i++) { - m = raw_bits_per_partition[from_partition]; - from_partition++; - raw_bits_per_partition[to_partition] = max(m, raw_bits_per_partition[from_partition]); - from_partition++; - to_partition++; - } - } -} - -#ifdef EXACT_RICE_BITS_CALCULATION -static FLaC__INLINE unsigned count_rice_bits_in_partition_( - const unsigned rice_parameter, - const unsigned partition_samples, - const FLAC__int32 *residual -) -{ - unsigned i, partition_bits = - FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN + /* actually could end up being FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN but err on side of 16bps */ - (1+rice_parameter) * partition_samples /* 1 for unary stop bit + rice_parameter for the binary portion */ - ; - for(i = 0; i < partition_samples; i++) - partition_bits += ( (FLAC__uint32)((residual[i]<<1)^(residual[i]>>31)) >> rice_parameter ); - return partition_bits; -} -#else -static FLaC__INLINE unsigned count_rice_bits_in_partition_( - const unsigned rice_parameter, - const unsigned partition_samples, - const FLAC__uint64 abs_residual_partition_sum -) -{ - return - FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN + /* actually could end up being FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN but err on side of 16bps */ - (1+rice_parameter) * partition_samples + /* 1 for unary stop bit + rice_parameter for the binary portion */ - ( - rice_parameter? - (unsigned)(abs_residual_partition_sum >> (rice_parameter-1)) /* rice_parameter-1 because the real coder sign-folds instead of using a sign bit */ - : (unsigned)(abs_residual_partition_sum << 1) /* can't shift by negative number, so reverse */ - ) - - (partition_samples >> 1) - /* -(partition_samples>>1) to subtract out extra contributions to the abs_residual_partition_sum. - * The actual number of bits used is closer to the sum(for all i in the partition) of abs(residual[i])>>(rice_parameter-1) - * By using the abs_residual_partition sum, we also add in bits in the LSBs that would normally be shifted out. - * So the subtraction term tries to guess how many extra bits were contributed. - * If the LSBs are randomly distributed, this should average to 0.5 extra bits per sample. - */ - ; -} -#endif - -FLAC__bool set_partitioned_rice_( -#ifdef EXACT_RICE_BITS_CALCULATION - const FLAC__int32 residual[], -#endif - const FLAC__uint64 abs_residual_partition_sums[], - const unsigned raw_bits_per_partition[], - const unsigned residual_samples, - const unsigned predictor_order, - const unsigned suggested_rice_parameter, - const unsigned rice_parameter_limit, - const unsigned rice_parameter_search_dist, - const unsigned partition_order, - const FLAC__bool search_for_escapes, - FLAC__EntropyCodingMethod_PartitionedRiceContents *partitioned_rice_contents, - unsigned *bits -) -{ - unsigned rice_parameter, partition_bits; - unsigned best_partition_bits, best_rice_parameter = 0; - unsigned bits_ = FLAC__ENTROPY_CODING_METHOD_TYPE_LEN + FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN; - unsigned *parameters, *raw_bits; -#ifdef ENABLE_RICE_PARAMETER_SEARCH - unsigned min_rice_parameter, max_rice_parameter; -#else - (void)rice_parameter_search_dist; -#endif - - FLAC__ASSERT(suggested_rice_parameter < FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_ESCAPE_PARAMETER); - FLAC__ASSERT(rice_parameter_limit <= FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_ESCAPE_PARAMETER); - - FLAC__format_entropy_coding_method_partitioned_rice_contents_ensure_size(partitioned_rice_contents, max(6, partition_order)); - parameters = partitioned_rice_contents->parameters; - raw_bits = partitioned_rice_contents->raw_bits; - - if(partition_order == 0) { - best_partition_bits = (unsigned)(-1); -#ifdef ENABLE_RICE_PARAMETER_SEARCH - if(rice_parameter_search_dist) { - if(suggested_rice_parameter < rice_parameter_search_dist) - min_rice_parameter = 0; - else - min_rice_parameter = suggested_rice_parameter - rice_parameter_search_dist; - max_rice_parameter = suggested_rice_parameter + rice_parameter_search_dist; - if(max_rice_parameter >= rice_parameter_limit) { -#ifdef DEBUG_VERBOSE - fprintf(stderr, "clipping rice_parameter (%u -> %u) @5\n", max_rice_parameter, rice_parameter_limit - 1); -#endif - max_rice_parameter = rice_parameter_limit - 1; - } - } - else - min_rice_parameter = max_rice_parameter = suggested_rice_parameter; - - for(rice_parameter = min_rice_parameter; rice_parameter <= max_rice_parameter; rice_parameter++) { -#else - rice_parameter = suggested_rice_parameter; -#endif -#ifdef EXACT_RICE_BITS_CALCULATION - partition_bits = count_rice_bits_in_partition_(rice_parameter, residual_samples, residual); -#else - partition_bits = count_rice_bits_in_partition_(rice_parameter, residual_samples, abs_residual_partition_sums[0]); -#endif - if(partition_bits < best_partition_bits) { - best_rice_parameter = rice_parameter; - best_partition_bits = partition_bits; - } -#ifdef ENABLE_RICE_PARAMETER_SEARCH - } -#endif - if(search_for_escapes) { - partition_bits = FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN + FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_RAW_LEN + raw_bits_per_partition[0] * residual_samples; - if(partition_bits <= best_partition_bits) { - raw_bits[0] = raw_bits_per_partition[0]; - best_rice_parameter = 0; /* will be converted to appropriate escape parameter later */ - best_partition_bits = partition_bits; - } - else - raw_bits[0] = 0; - } - parameters[0] = best_rice_parameter; - bits_ += best_partition_bits; - } - else { - unsigned partition, residual_sample; - unsigned partition_samples; - FLAC__uint64 mean, k; - const unsigned partitions = 1u << partition_order; - for(partition = residual_sample = 0; partition < partitions; partition++) { - partition_samples = (residual_samples+predictor_order) >> partition_order; - if(partition == 0) { - if(partition_samples <= predictor_order) - return false; - else - partition_samples -= predictor_order; - } - mean = abs_residual_partition_sums[partition]; - /* we are basically calculating the size in bits of the - * average residual magnitude in the partition: - * rice_parameter = floor(log2(mean/partition_samples)) - * 'mean' is not a good name for the variable, it is - * actually the sum of magnitudes of all residual values - * in the partition, so the actual mean is - * mean/partition_samples - */ - for(rice_parameter = 0, k = partition_samples; k < mean; rice_parameter++, k <<= 1) - ; - if(rice_parameter >= rice_parameter_limit) { -#ifdef DEBUG_VERBOSE - fprintf(stderr, "clipping rice_parameter (%u -> %u) @6\n", rice_parameter, rice_parameter_limit - 1); -#endif - rice_parameter = rice_parameter_limit - 1; - } - - best_partition_bits = (unsigned)(-1); -#ifdef ENABLE_RICE_PARAMETER_SEARCH - if(rice_parameter_search_dist) { - if(rice_parameter < rice_parameter_search_dist) - min_rice_parameter = 0; - else - min_rice_parameter = rice_parameter - rice_parameter_search_dist; - max_rice_parameter = rice_parameter + rice_parameter_search_dist; - if(max_rice_parameter >= rice_parameter_limit) { -#ifdef DEBUG_VERBOSE - fprintf(stderr, "clipping rice_parameter (%u -> %u) @7\n", max_rice_parameter, rice_parameter_limit - 1); -#endif - max_rice_parameter = rice_parameter_limit - 1; - } - } - else - min_rice_parameter = max_rice_parameter = rice_parameter; - - for(rice_parameter = min_rice_parameter; rice_parameter <= max_rice_parameter; rice_parameter++) { -#endif -#ifdef EXACT_RICE_BITS_CALCULATION - partition_bits = count_rice_bits_in_partition_(rice_parameter, partition_samples, residual+residual_sample); -#else - partition_bits = count_rice_bits_in_partition_(rice_parameter, partition_samples, abs_residual_partition_sums[partition]); -#endif - if(partition_bits < best_partition_bits) { - best_rice_parameter = rice_parameter; - best_partition_bits = partition_bits; - } -#ifdef ENABLE_RICE_PARAMETER_SEARCH - } -#endif - if(search_for_escapes) { - partition_bits = FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN + FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_RAW_LEN + raw_bits_per_partition[partition] * partition_samples; - if(partition_bits <= best_partition_bits) { - raw_bits[partition] = raw_bits_per_partition[partition]; - best_rice_parameter = 0; /* will be converted to appropriate escape parameter later */ - best_partition_bits = partition_bits; - } - else - raw_bits[partition] = 0; - } - parameters[partition] = best_rice_parameter; - bits_ += best_partition_bits; - residual_sample += partition_samples; - } - } - - *bits = bits_; - return true; -} - -unsigned get_wasted_bits_(FLAC__int32 signal[], unsigned samples) -{ - unsigned i, shift; - FLAC__int32 x = 0; - - for(i = 0; i < samples && !(x&1); i++) - x |= signal[i]; - - if(x == 0) { - shift = 0; - } - else { - for(shift = 0; !(x&1); shift++) - x >>= 1; - } - - if(shift > 0) { - for(i = 0; i < samples; i++) - signal[i] >>= shift; - } - - return shift; -} - -void append_to_verify_fifo_(verify_input_fifo *fifo, const FLAC__int32 * const input[], unsigned input_offset, unsigned channels, unsigned wide_samples) -{ - unsigned channel; - - for(channel = 0; channel < channels; channel++) - memcpy(&fifo->data[channel][fifo->tail], &input[channel][input_offset], sizeof(FLAC__int32) * wide_samples); - - fifo->tail += wide_samples; - - FLAC__ASSERT(fifo->tail <= fifo->size); -} - -void append_to_verify_fifo_interleaved_(verify_input_fifo *fifo, const FLAC__int32 input[], unsigned input_offset, unsigned channels, unsigned wide_samples) -{ - unsigned channel; - unsigned sample, wide_sample; - unsigned tail = fifo->tail; - - sample = input_offset * channels; - for(wide_sample = 0; wide_sample < wide_samples; wide_sample++) { - for(channel = 0; channel < channels; channel++) - fifo->data[channel][tail] = input[sample++]; - tail++; - } - fifo->tail = tail; - - FLAC__ASSERT(fifo->tail <= fifo->size); -} - -FLAC__StreamDecoderReadStatus verify_read_callback_(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data) -{ - FLAC__StreamEncoder *encoder = (FLAC__StreamEncoder*)client_data; - const size_t encoded_bytes = encoder->private_->verify.output.bytes; - (void)decoder; - - if(encoder->private_->verify.needs_magic_hack) { - FLAC__ASSERT(*bytes >= FLAC__STREAM_SYNC_LENGTH); - *bytes = FLAC__STREAM_SYNC_LENGTH; - memcpy(buffer, FLAC__STREAM_SYNC_STRING, *bytes); - encoder->private_->verify.needs_magic_hack = false; - } - else { - if(encoded_bytes == 0) { - /* - * If we get here, a FIFO underflow has occurred, - * which means there is a bug somewhere. - */ - FLAC__ASSERT(0); - return FLAC__STREAM_DECODER_READ_STATUS_ABORT; - } - else if(encoded_bytes < *bytes) - *bytes = encoded_bytes; - memcpy(buffer, encoder->private_->verify.output.data, *bytes); - encoder->private_->verify.output.data += *bytes; - encoder->private_->verify.output.bytes -= *bytes; - } - - return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; -} - -FLAC__StreamDecoderWriteStatus verify_write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data) -{ - FLAC__StreamEncoder *encoder = (FLAC__StreamEncoder *)client_data; - unsigned channel; - const unsigned channels = frame->header.channels; - const unsigned blocksize = frame->header.blocksize; - const unsigned bytes_per_block = sizeof(FLAC__int32) * blocksize; - - (void)decoder; - - for(channel = 0; channel < channels; channel++) { - if(0 != memcmp(buffer[channel], encoder->private_->verify.input_fifo.data[channel], bytes_per_block)) { - unsigned i, sample = 0; - FLAC__int32 expect = 0, got = 0; - - for(i = 0; i < blocksize; i++) { - if(buffer[channel][i] != encoder->private_->verify.input_fifo.data[channel][i]) { - sample = i; - expect = (FLAC__int32)encoder->private_->verify.input_fifo.data[channel][i]; - got = (FLAC__int32)buffer[channel][i]; - break; - } - } - FLAC__ASSERT(i < blocksize); - FLAC__ASSERT(frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER); - encoder->private_->verify.error_stats.absolute_sample = frame->header.number.sample_number + sample; - encoder->private_->verify.error_stats.frame_number = (unsigned)(frame->header.number.sample_number / blocksize); - encoder->private_->verify.error_stats.channel = channel; - encoder->private_->verify.error_stats.sample = sample; - encoder->private_->verify.error_stats.expected = expect; - encoder->private_->verify.error_stats.got = got; - encoder->protected_->state = FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA; - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - } - } - /* dequeue the frame from the fifo */ - encoder->private_->verify.input_fifo.tail -= blocksize; - FLAC__ASSERT(encoder->private_->verify.input_fifo.tail <= OVERREAD_); - for(channel = 0; channel < channels; channel++) - memmove(&encoder->private_->verify.input_fifo.data[channel][0], &encoder->private_->verify.input_fifo.data[channel][blocksize], encoder->private_->verify.input_fifo.tail * sizeof(encoder->private_->verify.input_fifo.data[0][0])); - return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; -} - -void verify_metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) -{ - (void)decoder, (void)metadata, (void)client_data; -} - -void verify_error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) -{ - FLAC__StreamEncoder *encoder = (FLAC__StreamEncoder*)client_data; - (void)decoder, (void)status; - encoder->protected_->state = FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR; -} - -FLAC__StreamEncoderReadStatus file_read_callback_(const FLAC__StreamEncoder *encoder, FLAC__byte buffer[], size_t *bytes, void *client_data) -{ - (void)client_data; - - *bytes = fread(buffer, 1, *bytes, encoder->private_->file); - if (*bytes == 0) { - if (feof(encoder->private_->file)) - return FLAC__STREAM_ENCODER_READ_STATUS_END_OF_STREAM; - else if (ferror(encoder->private_->file)) - return FLAC__STREAM_ENCODER_READ_STATUS_ABORT; - } - return FLAC__STREAM_ENCODER_READ_STATUS_CONTINUE; -} - -FLAC__StreamEncoderSeekStatus file_seek_callback_(const FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data) -{ - (void)client_data; - - if(fseeko(encoder->private_->file, (off_t)absolute_byte_offset, SEEK_SET) < 0) - return FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR; - else - return FLAC__STREAM_ENCODER_SEEK_STATUS_OK; -} - -FLAC__StreamEncoderTellStatus file_tell_callback_(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data) -{ - off_t offset; - - (void)client_data; - - offset = ftello(encoder->private_->file); - - if(offset < 0) { - return FLAC__STREAM_ENCODER_TELL_STATUS_ERROR; - } - else { - *absolute_byte_offset = (FLAC__uint64)offset; - return FLAC__STREAM_ENCODER_TELL_STATUS_OK; - } -} - -#ifdef FLAC__VALGRIND_TESTING -static size_t local__fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) -{ - size_t ret = fwrite(ptr, size, nmemb, stream); - if(!ferror(stream)) - fflush(stream); - return ret; -} -#else -#define local__fwrite fwrite -#endif - -FLAC__StreamEncoderWriteStatus file_write_callback_(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data) -{ - (void)client_data, (void)current_frame; - - if(local__fwrite(buffer, sizeof(FLAC__byte), bytes, encoder->private_->file) == bytes) { - FLAC__bool call_it = 0 != encoder->private_->progress_callback && ( -#if FLAC__HAS_OGG - /* We would like to be able to use 'samples > 0' in the - * clause here but currently because of the nature of our - * Ogg writing implementation, 'samples' is always 0 (see - * ogg_encoder_aspect.c). The downside is extra progress - * callbacks. - */ - encoder->private_->is_ogg? true : -#endif - samples > 0 - ); - if(call_it) { - /* NOTE: We have to add +bytes, +samples, and +1 to the stats - * because at this point in the callback chain, the stats - * have not been updated. Only after we return and control - * gets back to write_frame_() are the stats updated - */ - encoder->private_->progress_callback(encoder, encoder->private_->bytes_written+bytes, encoder->private_->samples_written+samples, encoder->private_->frames_written+(samples?1:0), encoder->private_->total_frames_estimate, encoder->private_->client_data); - } - return FLAC__STREAM_ENCODER_WRITE_STATUS_OK; - } - else - return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR; -} - -/* - * This will forcibly set stdout to binary mode (for OSes that require it) - */ -FILE *get_binary_stdout_(void) -{ - /* if something breaks here it is probably due to the presence or - * absence of an underscore before the identifiers 'setmode', - * 'fileno', and/or 'O_BINARY'; check your system header files. - */ -#if defined _MSC_VER || defined __MINGW32__ - _setmode(_fileno(stdout), _O_BINARY); -#elif defined __CYGWIN__ - /* almost certainly not needed for any modern Cygwin, but let's be safe... */ - setmode(_fileno(stdout), _O_BINARY); -#elif defined __EMX__ - setmode(fileno(stdout), O_BINARY); -#endif - - return stdout; -} diff --git a/3rdparty/libflac/src/libFLAC/stream_encoder_framing.c b/3rdparty/libflac/src/libFLAC/stream_encoder_framing.c deleted file mode 100644 index 621b34c8228..00000000000 --- a/3rdparty/libflac/src/libFLAC/stream_encoder_framing.c +++ /dev/null @@ -1,553 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdio.h> -#include <string.h> /* for strlen() */ -#include "private/stream_encoder_framing.h" -#include "private/crc.h" -#include "FLAC/assert.h" - -#ifdef max -#undef max -#endif -#define max(x,y) ((x)>(y)?(x):(y)) - -static FLAC__bool add_entropy_coding_method_(FLAC__BitWriter *bw, const FLAC__EntropyCodingMethod *method); -static FLAC__bool add_residual_partitioned_rice_(FLAC__BitWriter *bw, const FLAC__int32 residual[], const unsigned residual_samples, const unsigned predictor_order, const unsigned rice_parameters[], const unsigned raw_bits[], const unsigned partition_order, const FLAC__bool is_extended); - -FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__BitWriter *bw) -{ - unsigned i, j; - const unsigned vendor_string_length = (unsigned)strlen(FLAC__VENDOR_STRING); - - if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->is_last, FLAC__STREAM_METADATA_IS_LAST_LEN)) - return false; - - if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->type, FLAC__STREAM_METADATA_TYPE_LEN)) - return false; - - /* - * First, for VORBIS_COMMENTs, adjust the length to reflect our vendor string - */ - i = metadata->length; - if(metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) { - FLAC__ASSERT(metadata->data.vorbis_comment.vendor_string.length == 0 || 0 != metadata->data.vorbis_comment.vendor_string.entry); - i -= metadata->data.vorbis_comment.vendor_string.length; - i += vendor_string_length; - } - FLAC__ASSERT(i < (1u << FLAC__STREAM_METADATA_LENGTH_LEN)); - if(!FLAC__bitwriter_write_raw_uint32(bw, i, FLAC__STREAM_METADATA_LENGTH_LEN)) - return false; - - switch(metadata->type) { - case FLAC__METADATA_TYPE_STREAMINFO: - FLAC__ASSERT(metadata->data.stream_info.min_blocksize < (1u << FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN)); - if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->data.stream_info.min_blocksize, FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN)) - return false; - FLAC__ASSERT(metadata->data.stream_info.max_blocksize < (1u << FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN)); - if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->data.stream_info.max_blocksize, FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN)) - return false; - FLAC__ASSERT(metadata->data.stream_info.min_framesize < (1u << FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN)); - if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->data.stream_info.min_framesize, FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN)) - return false; - FLAC__ASSERT(metadata->data.stream_info.max_framesize < (1u << FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN)); - if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->data.stream_info.max_framesize, FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN)) - return false; - FLAC__ASSERT(FLAC__format_sample_rate_is_valid(metadata->data.stream_info.sample_rate)); - if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->data.stream_info.sample_rate, FLAC__STREAM_METADATA_STREAMINFO_SAMPLE_RATE_LEN)) - return false; - FLAC__ASSERT(metadata->data.stream_info.channels > 0); - FLAC__ASSERT(metadata->data.stream_info.channels <= (1u << FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN)); - if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->data.stream_info.channels-1, FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN)) - return false; - FLAC__ASSERT(metadata->data.stream_info.bits_per_sample > 0); - FLAC__ASSERT(metadata->data.stream_info.bits_per_sample <= (1u << FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN)); - if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->data.stream_info.bits_per_sample-1, FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN)) - return false; - if(!FLAC__bitwriter_write_raw_uint64(bw, metadata->data.stream_info.total_samples, FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN)) - return false; - if(!FLAC__bitwriter_write_byte_block(bw, metadata->data.stream_info.md5sum, 16)) - return false; - break; - case FLAC__METADATA_TYPE_PADDING: - if(!FLAC__bitwriter_write_zeroes(bw, metadata->length * 8)) - return false; - break; - case FLAC__METADATA_TYPE_APPLICATION: - if(!FLAC__bitwriter_write_byte_block(bw, metadata->data.application.id, FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8)) - return false; - if(!FLAC__bitwriter_write_byte_block(bw, metadata->data.application.data, metadata->length - (FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8))) - return false; - break; - case FLAC__METADATA_TYPE_SEEKTABLE: - for(i = 0; i < metadata->data.seek_table.num_points; i++) { - if(!FLAC__bitwriter_write_raw_uint64(bw, metadata->data.seek_table.points[i].sample_number, FLAC__STREAM_METADATA_SEEKPOINT_SAMPLE_NUMBER_LEN)) - return false; - if(!FLAC__bitwriter_write_raw_uint64(bw, metadata->data.seek_table.points[i].stream_offset, FLAC__STREAM_METADATA_SEEKPOINT_STREAM_OFFSET_LEN)) - return false; - if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->data.seek_table.points[i].frame_samples, FLAC__STREAM_METADATA_SEEKPOINT_FRAME_SAMPLES_LEN)) - return false; - } - break; - case FLAC__METADATA_TYPE_VORBIS_COMMENT: - if(!FLAC__bitwriter_write_raw_uint32_little_endian(bw, vendor_string_length)) - return false; - if(!FLAC__bitwriter_write_byte_block(bw, (const FLAC__byte*)FLAC__VENDOR_STRING, vendor_string_length)) - return false; - if(!FLAC__bitwriter_write_raw_uint32_little_endian(bw, metadata->data.vorbis_comment.num_comments)) - return false; - for(i = 0; i < metadata->data.vorbis_comment.num_comments; i++) { - if(!FLAC__bitwriter_write_raw_uint32_little_endian(bw, metadata->data.vorbis_comment.comments[i].length)) - return false; - if(!FLAC__bitwriter_write_byte_block(bw, metadata->data.vorbis_comment.comments[i].entry, metadata->data.vorbis_comment.comments[i].length)) - return false; - } - break; - case FLAC__METADATA_TYPE_CUESHEET: - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN % 8 == 0); - if(!FLAC__bitwriter_write_byte_block(bw, (const FLAC__byte*)metadata->data.cue_sheet.media_catalog_number, FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN/8)) - return false; - if(!FLAC__bitwriter_write_raw_uint64(bw, metadata->data.cue_sheet.lead_in, FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN)) - return false; - if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->data.cue_sheet.is_cd? 1 : 0, FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN)) - return false; - if(!FLAC__bitwriter_write_zeroes(bw, FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN)) - return false; - if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->data.cue_sheet.num_tracks, FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN)) - return false; - for(i = 0; i < metadata->data.cue_sheet.num_tracks; i++) { - const FLAC__StreamMetadata_CueSheet_Track *track = metadata->data.cue_sheet.tracks + i; - - if(!FLAC__bitwriter_write_raw_uint64(bw, track->offset, FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN)) - return false; - if(!FLAC__bitwriter_write_raw_uint32(bw, track->number, FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN)) - return false; - FLAC__ASSERT(FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN % 8 == 0); - if(!FLAC__bitwriter_write_byte_block(bw, (const FLAC__byte*)track->isrc, FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN/8)) - return false; - if(!FLAC__bitwriter_write_raw_uint32(bw, track->type, FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN)) - return false; - if(!FLAC__bitwriter_write_raw_uint32(bw, track->pre_emphasis, FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN)) - return false; - if(!FLAC__bitwriter_write_zeroes(bw, FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN)) - return false; - if(!FLAC__bitwriter_write_raw_uint32(bw, track->num_indices, FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN)) - return false; - for(j = 0; j < track->num_indices; j++) { - const FLAC__StreamMetadata_CueSheet_Index *index = track->indices + j; - - if(!FLAC__bitwriter_write_raw_uint64(bw, index->offset, FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN)) - return false; - if(!FLAC__bitwriter_write_raw_uint32(bw, index->number, FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN)) - return false; - if(!FLAC__bitwriter_write_zeroes(bw, FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN)) - return false; - } - } - break; - case FLAC__METADATA_TYPE_PICTURE: - { - size_t len; - if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->data.picture.type, FLAC__STREAM_METADATA_PICTURE_TYPE_LEN)) - return false; - len = strlen(metadata->data.picture.mime_type); - if(!FLAC__bitwriter_write_raw_uint32(bw, len, FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN)) - return false; - if(!FLAC__bitwriter_write_byte_block(bw, (const FLAC__byte*)metadata->data.picture.mime_type, len)) - return false; - len = strlen((const char *)metadata->data.picture.description); - if(!FLAC__bitwriter_write_raw_uint32(bw, len, FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN)) - return false; - if(!FLAC__bitwriter_write_byte_block(bw, metadata->data.picture.description, len)) - return false; - if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->data.picture.width, FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN)) - return false; - if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->data.picture.height, FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN)) - return false; - if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->data.picture.depth, FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN)) - return false; - if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->data.picture.colors, FLAC__STREAM_METADATA_PICTURE_COLORS_LEN)) - return false; - if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->data.picture.data_length, FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN)) - return false; - if(!FLAC__bitwriter_write_byte_block(bw, metadata->data.picture.data, metadata->data.picture.data_length)) - return false; - } - break; - default: - if(!FLAC__bitwriter_write_byte_block(bw, metadata->data.unknown.data, metadata->length)) - return false; - break; - } - - FLAC__ASSERT(FLAC__bitwriter_is_byte_aligned(bw)); - return true; -} - -FLAC__bool FLAC__frame_add_header(const FLAC__FrameHeader *header, FLAC__BitWriter *bw) -{ - unsigned u, blocksize_hint, sample_rate_hint; - FLAC__byte crc; - - FLAC__ASSERT(FLAC__bitwriter_is_byte_aligned(bw)); - - if(!FLAC__bitwriter_write_raw_uint32(bw, FLAC__FRAME_HEADER_SYNC, FLAC__FRAME_HEADER_SYNC_LEN)) - return false; - - if(!FLAC__bitwriter_write_raw_uint32(bw, 0, FLAC__FRAME_HEADER_RESERVED_LEN)) - return false; - - if(!FLAC__bitwriter_write_raw_uint32(bw, (header->number_type == FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER)? 0 : 1, FLAC__FRAME_HEADER_BLOCKING_STRATEGY_LEN)) - return false; - - FLAC__ASSERT(header->blocksize > 0 && header->blocksize <= FLAC__MAX_BLOCK_SIZE); - /* when this assertion holds true, any legal blocksize can be expressed in the frame header */ - FLAC__ASSERT(FLAC__MAX_BLOCK_SIZE <= 65535u); - blocksize_hint = 0; - switch(header->blocksize) { - case 192: u = 1; break; - case 576: u = 2; break; - case 1152: u = 3; break; - case 2304: u = 4; break; - case 4608: u = 5; break; - case 256: u = 8; break; - case 512: u = 9; break; - case 1024: u = 10; break; - case 2048: u = 11; break; - case 4096: u = 12; break; - case 8192: u = 13; break; - case 16384: u = 14; break; - case 32768: u = 15; break; - default: - if(header->blocksize <= 0x100) - blocksize_hint = u = 6; - else - blocksize_hint = u = 7; - break; - } - if(!FLAC__bitwriter_write_raw_uint32(bw, u, FLAC__FRAME_HEADER_BLOCK_SIZE_LEN)) - return false; - - FLAC__ASSERT(FLAC__format_sample_rate_is_valid(header->sample_rate)); - sample_rate_hint = 0; - switch(header->sample_rate) { - case 88200: u = 1; break; - case 176400: u = 2; break; - case 192000: u = 3; break; - case 8000: u = 4; break; - case 16000: u = 5; break; - case 22050: u = 6; break; - case 24000: u = 7; break; - case 32000: u = 8; break; - case 44100: u = 9; break; - case 48000: u = 10; break; - case 96000: u = 11; break; - default: - if(header->sample_rate <= 255000 && header->sample_rate % 1000 == 0) - sample_rate_hint = u = 12; - else if(header->sample_rate % 10 == 0) - sample_rate_hint = u = 14; - else if(header->sample_rate <= 0xffff) - sample_rate_hint = u = 13; - else - u = 0; - break; - } - if(!FLAC__bitwriter_write_raw_uint32(bw, u, FLAC__FRAME_HEADER_SAMPLE_RATE_LEN)) - return false; - - FLAC__ASSERT(header->channels > 0 && header->channels <= (1u << FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN) && header->channels <= FLAC__MAX_CHANNELS); - switch(header->channel_assignment) { - case FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT: - u = header->channels - 1; - break; - case FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE: - FLAC__ASSERT(header->channels == 2); - u = 8; - break; - case FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE: - FLAC__ASSERT(header->channels == 2); - u = 9; - break; - case FLAC__CHANNEL_ASSIGNMENT_MID_SIDE: - FLAC__ASSERT(header->channels == 2); - u = 10; - break; - default: - FLAC__ASSERT(0); - } - if(!FLAC__bitwriter_write_raw_uint32(bw, u, FLAC__FRAME_HEADER_CHANNEL_ASSIGNMENT_LEN)) - return false; - - FLAC__ASSERT(header->bits_per_sample > 0 && header->bits_per_sample <= (1u << FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN)); - switch(header->bits_per_sample) { - case 8 : u = 1; break; - case 12: u = 2; break; - case 16: u = 4; break; - case 20: u = 5; break; - case 24: u = 6; break; - default: u = 0; break; - } - if(!FLAC__bitwriter_write_raw_uint32(bw, u, FLAC__FRAME_HEADER_BITS_PER_SAMPLE_LEN)) - return false; - - if(!FLAC__bitwriter_write_raw_uint32(bw, 0, FLAC__FRAME_HEADER_ZERO_PAD_LEN)) - return false; - - if(header->number_type == FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER) { - if(!FLAC__bitwriter_write_utf8_uint32(bw, header->number.frame_number)) - return false; - } - else { - if(!FLAC__bitwriter_write_utf8_uint64(bw, header->number.sample_number)) - return false; - } - - if(blocksize_hint) - if(!FLAC__bitwriter_write_raw_uint32(bw, header->blocksize-1, (blocksize_hint==6)? 8:16)) - return false; - - switch(sample_rate_hint) { - case 12: - if(!FLAC__bitwriter_write_raw_uint32(bw, header->sample_rate / 1000, 8)) - return false; - break; - case 13: - if(!FLAC__bitwriter_write_raw_uint32(bw, header->sample_rate, 16)) - return false; - break; - case 14: - if(!FLAC__bitwriter_write_raw_uint32(bw, header->sample_rate / 10, 16)) - return false; - break; - } - - /* write the CRC */ - if(!FLAC__bitwriter_get_write_crc8(bw, &crc)) - return false; - if(!FLAC__bitwriter_write_raw_uint32(bw, crc, FLAC__FRAME_HEADER_CRC_LEN)) - return false; - - return true; -} - -FLAC__bool FLAC__subframe_add_constant(const FLAC__Subframe_Constant *subframe, unsigned subframe_bps, unsigned wasted_bits, FLAC__BitWriter *bw) -{ - FLAC__bool ok; - - ok = - FLAC__bitwriter_write_raw_uint32(bw, FLAC__SUBFRAME_TYPE_CONSTANT_BYTE_ALIGNED_MASK | (wasted_bits? 1:0), FLAC__SUBFRAME_ZERO_PAD_LEN + FLAC__SUBFRAME_TYPE_LEN + FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN) && - (wasted_bits? FLAC__bitwriter_write_unary_unsigned(bw, wasted_bits-1) : true) && - FLAC__bitwriter_write_raw_int32(bw, subframe->value, subframe_bps) - ; - - return ok; -} - -FLAC__bool FLAC__subframe_add_fixed(const FLAC__Subframe_Fixed *subframe, unsigned residual_samples, unsigned subframe_bps, unsigned wasted_bits, FLAC__BitWriter *bw) -{ - unsigned i; - - if(!FLAC__bitwriter_write_raw_uint32(bw, FLAC__SUBFRAME_TYPE_FIXED_BYTE_ALIGNED_MASK | (subframe->order<<1) | (wasted_bits? 1:0), FLAC__SUBFRAME_ZERO_PAD_LEN + FLAC__SUBFRAME_TYPE_LEN + FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN)) - return false; - if(wasted_bits) - if(!FLAC__bitwriter_write_unary_unsigned(bw, wasted_bits-1)) - return false; - - for(i = 0; i < subframe->order; i++) - if(!FLAC__bitwriter_write_raw_int32(bw, subframe->warmup[i], subframe_bps)) - return false; - - if(!add_entropy_coding_method_(bw, &subframe->entropy_coding_method)) - return false; - switch(subframe->entropy_coding_method.type) { - case FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE: - case FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2: - if(!add_residual_partitioned_rice_( - bw, - subframe->residual, - residual_samples, - subframe->order, - subframe->entropy_coding_method.data.partitioned_rice.contents->parameters, - subframe->entropy_coding_method.data.partitioned_rice.contents->raw_bits, - subframe->entropy_coding_method.data.partitioned_rice.order, - /*is_extended=*/subframe->entropy_coding_method.type == FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2 - )) - return false; - break; - default: - FLAC__ASSERT(0); - } - - return true; -} - -FLAC__bool FLAC__subframe_add_lpc(const FLAC__Subframe_LPC *subframe, unsigned residual_samples, unsigned subframe_bps, unsigned wasted_bits, FLAC__BitWriter *bw) -{ - unsigned i; - - if(!FLAC__bitwriter_write_raw_uint32(bw, FLAC__SUBFRAME_TYPE_LPC_BYTE_ALIGNED_MASK | ((subframe->order-1)<<1) | (wasted_bits? 1:0), FLAC__SUBFRAME_ZERO_PAD_LEN + FLAC__SUBFRAME_TYPE_LEN + FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN)) - return false; - if(wasted_bits) - if(!FLAC__bitwriter_write_unary_unsigned(bw, wasted_bits-1)) - return false; - - for(i = 0; i < subframe->order; i++) - if(!FLAC__bitwriter_write_raw_int32(bw, subframe->warmup[i], subframe_bps)) - return false; - - if(!FLAC__bitwriter_write_raw_uint32(bw, subframe->qlp_coeff_precision-1, FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN)) - return false; - if(!FLAC__bitwriter_write_raw_int32(bw, subframe->quantization_level, FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN)) - return false; - for(i = 0; i < subframe->order; i++) - if(!FLAC__bitwriter_write_raw_int32(bw, subframe->qlp_coeff[i], subframe->qlp_coeff_precision)) - return false; - - if(!add_entropy_coding_method_(bw, &subframe->entropy_coding_method)) - return false; - switch(subframe->entropy_coding_method.type) { - case FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE: - case FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2: - if(!add_residual_partitioned_rice_( - bw, - subframe->residual, - residual_samples, - subframe->order, - subframe->entropy_coding_method.data.partitioned_rice.contents->parameters, - subframe->entropy_coding_method.data.partitioned_rice.contents->raw_bits, - subframe->entropy_coding_method.data.partitioned_rice.order, - /*is_extended=*/subframe->entropy_coding_method.type == FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2 - )) - return false; - break; - default: - FLAC__ASSERT(0); - } - - return true; -} - -FLAC__bool FLAC__subframe_add_verbatim(const FLAC__Subframe_Verbatim *subframe, unsigned samples, unsigned subframe_bps, unsigned wasted_bits, FLAC__BitWriter *bw) -{ - unsigned i; - const FLAC__int32 *signal = subframe->data; - - if(!FLAC__bitwriter_write_raw_uint32(bw, FLAC__SUBFRAME_TYPE_VERBATIM_BYTE_ALIGNED_MASK | (wasted_bits? 1:0), FLAC__SUBFRAME_ZERO_PAD_LEN + FLAC__SUBFRAME_TYPE_LEN + FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN)) - return false; - if(wasted_bits) - if(!FLAC__bitwriter_write_unary_unsigned(bw, wasted_bits-1)) - return false; - - for(i = 0; i < samples; i++) - if(!FLAC__bitwriter_write_raw_int32(bw, signal[i], subframe_bps)) - return false; - - return true; -} - -FLAC__bool add_entropy_coding_method_(FLAC__BitWriter *bw, const FLAC__EntropyCodingMethod *method) -{ - if(!FLAC__bitwriter_write_raw_uint32(bw, method->type, FLAC__ENTROPY_CODING_METHOD_TYPE_LEN)) - return false; - switch(method->type) { - case FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE: - case FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2: - if(!FLAC__bitwriter_write_raw_uint32(bw, method->data.partitioned_rice.order, FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN)) - return false; - break; - default: - FLAC__ASSERT(0); - } - return true; -} - -FLAC__bool add_residual_partitioned_rice_(FLAC__BitWriter *bw, const FLAC__int32 residual[], const unsigned residual_samples, const unsigned predictor_order, const unsigned rice_parameters[], const unsigned raw_bits[], const unsigned partition_order, const FLAC__bool is_extended) -{ - const unsigned plen = is_extended? FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN : FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN; - const unsigned pesc = is_extended? FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_ESCAPE_PARAMETER : FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER; - - if(partition_order == 0) { - unsigned i; - - if(raw_bits[0] == 0) { - if(!FLAC__bitwriter_write_raw_uint32(bw, rice_parameters[0], plen)) - return false; - if(!FLAC__bitwriter_write_rice_signed_block(bw, residual, residual_samples, rice_parameters[0])) - return false; - } - else { - FLAC__ASSERT(rice_parameters[0] == 0); - if(!FLAC__bitwriter_write_raw_uint32(bw, pesc, plen)) - return false; - if(!FLAC__bitwriter_write_raw_uint32(bw, raw_bits[0], FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_RAW_LEN)) - return false; - for(i = 0; i < residual_samples; i++) { - if(!FLAC__bitwriter_write_raw_int32(bw, residual[i], raw_bits[0])) - return false; - } - } - return true; - } - else { - unsigned i, j, k = 0, k_last = 0; - unsigned partition_samples; - const unsigned default_partition_samples = (residual_samples+predictor_order) >> partition_order; - for(i = 0; i < (1u<<partition_order); i++) { - partition_samples = default_partition_samples; - if(i == 0) - partition_samples -= predictor_order; - k += partition_samples; - if(raw_bits[i] == 0) { - if(!FLAC__bitwriter_write_raw_uint32(bw, rice_parameters[i], plen)) - return false; - if(!FLAC__bitwriter_write_rice_signed_block(bw, residual+k_last, k-k_last, rice_parameters[i])) - return false; - } - else { - if(!FLAC__bitwriter_write_raw_uint32(bw, pesc, plen)) - return false; - if(!FLAC__bitwriter_write_raw_uint32(bw, raw_bits[i], FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_RAW_LEN)) - return false; - for(j = k_last; j < k; j++) { - if(!FLAC__bitwriter_write_raw_int32(bw, residual[j], raw_bits[i])) - return false; - } - } - k_last = k; - } - return true; - } -} diff --git a/3rdparty/libflac/src/libFLAC/window.c b/3rdparty/libflac/src/libFLAC/window.c deleted file mode 100644 index b35c72efeac..00000000000 --- a/3rdparty/libflac/src/libFLAC/window.c +++ /dev/null @@ -1,225 +0,0 @@ -/* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2006,2007 Josh Coalson - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Xiph.org Foundation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <math.h> -#include "FLAC/assert.h" -#include "FLAC/format.h" -#include "private/window.h" - -#ifndef FLAC__INTEGER_ONLY_LIBRARY - -#ifndef M_PI -/* math.h in VC++ doesn't seem to have this (how Microsoft is that?) */ -#define M_PI 3.14159265358979323846 -#endif - - -void FLAC__window_bartlett(FLAC__real *window, const FLAC__int32 L) -{ - const FLAC__int32 N = L - 1; - FLAC__int32 n; - - if (L & 1) { - for (n = 0; n <= N/2; n++) - window[n] = 2.0f * n / (float)N; - for (; n <= N; n++) - window[n] = 2.0f - 2.0f * n / (float)N; - } - else { - for (n = 0; n <= L/2-1; n++) - window[n] = 2.0f * n / (float)N; - for (; n <= N; n++) - window[n] = 2.0f - 2.0f * (N-n) / (float)N; - } -} - -void FLAC__window_bartlett_hann(FLAC__real *window, const FLAC__int32 L) -{ - const FLAC__int32 N = L - 1; - FLAC__int32 n; - - for (n = 0; n < L; n++) - window[n] = (FLAC__real)(0.62f - 0.48f * fabs((float)n/(float)N+0.5f) + 0.38f * cos(2.0f * M_PI * ((float)n/(float)N+0.5f))); -} - -void FLAC__window_blackman(FLAC__real *window, const FLAC__int32 L) -{ - const FLAC__int32 N = L - 1; - FLAC__int32 n; - - for (n = 0; n < L; n++) - window[n] = (FLAC__real)(0.42f - 0.5f * cos(2.0f * M_PI * n / N) + 0.08f * cos(4.0f * M_PI * n / N)); -} - -/* 4-term -92dB side-lobe */ -void FLAC__window_blackman_harris_4term_92db_sidelobe(FLAC__real *window, const FLAC__int32 L) -{ - const FLAC__int32 N = L - 1; - FLAC__int32 n; - - for (n = 0; n <= N; n++) - window[n] = (FLAC__real)(0.35875f - 0.48829f * cos(2.0f * M_PI * n / N) + 0.14128f * cos(4.0f * M_PI * n / N) - 0.01168f * cos(6.0f * M_PI * n / N)); -} - -void FLAC__window_connes(FLAC__real *window, const FLAC__int32 L) -{ - const FLAC__int32 N = L - 1; - const double N2 = (double)N / 2.; - FLAC__int32 n; - - for (n = 0; n <= N; n++) { - double k = ((double)n - N2) / N2; - k = 1.0f - k * k; - window[n] = (FLAC__real)(k * k); - } -} - -void FLAC__window_flattop(FLAC__real *window, const FLAC__int32 L) -{ - const FLAC__int32 N = L - 1; - FLAC__int32 n; - - for (n = 0; n < L; n++) - window[n] = (FLAC__real)(1.0f - 1.93f * cos(2.0f * M_PI * n / N) + 1.29f * cos(4.0f * M_PI * n / N) - 0.388f * cos(6.0f * M_PI * n / N) + 0.0322f * cos(8.0f * M_PI * n / N)); -} - -void FLAC__window_gauss(FLAC__real *window, const FLAC__int32 L, const FLAC__real stddev) -{ - const FLAC__int32 N = L - 1; - const double N2 = (double)N / 2.; - FLAC__int32 n; - - for (n = 0; n <= N; n++) { - const double k = ((double)n - N2) / (stddev * N2); - window[n] = (FLAC__real)exp(-0.5f * k * k); - } -} - -void FLAC__window_hamming(FLAC__real *window, const FLAC__int32 L) -{ - const FLAC__int32 N = L - 1; - FLAC__int32 n; - - for (n = 0; n < L; n++) - window[n] = (FLAC__real)(0.54f - 0.46f * cos(2.0f * M_PI * n / N)); -} - -void FLAC__window_hann(FLAC__real *window, const FLAC__int32 L) -{ - const FLAC__int32 N = L - 1; - FLAC__int32 n; - - for (n = 0; n < L; n++) - window[n] = (FLAC__real)(0.5f - 0.5f * cos(2.0f * M_PI * n / N)); -} - -void FLAC__window_kaiser_bessel(FLAC__real *window, const FLAC__int32 L) -{ - const FLAC__int32 N = L - 1; - FLAC__int32 n; - - for (n = 0; n < L; n++) - window[n] = (FLAC__real)(0.402f - 0.498f * cos(2.0f * M_PI * n / N) + 0.098f * cos(4.0f * M_PI * n / N) - 0.001f * cos(6.0f * M_PI * n / N)); -} - -void FLAC__window_nuttall(FLAC__real *window, const FLAC__int32 L) -{ - const FLAC__int32 N = L - 1; - FLAC__int32 n; - - for (n = 0; n < L; n++) - window[n] = (FLAC__real)(0.3635819f - 0.4891775f*cos(2.0f*M_PI*n/N) + 0.1365995f*cos(4.0f*M_PI*n/N) - 0.0106411f*cos(6.0f*M_PI*n/N)); -} - -void FLAC__window_rectangle(FLAC__real *window, const FLAC__int32 L) -{ - FLAC__int32 n; - - for (n = 0; n < L; n++) - window[n] = 1.0f; -} - -void FLAC__window_triangle(FLAC__real *window, const FLAC__int32 L) -{ - FLAC__int32 n; - - if (L & 1) { - for (n = 1; n <= L+1/2; n++) - window[n-1] = 2.0f * n / ((float)L + 1.0f); - for (; n <= L; n++) - window[n-1] = - (float)(2 * (L - n + 1)) / ((float)L + 1.0f); - } - else { - for (n = 1; n <= L/2; n++) - window[n-1] = 2.0f * n / (float)L; - for (; n <= L; n++) - window[n-1] = ((float)(2 * (L - n)) + 1.0f) / (float)L; - } -} - -void FLAC__window_tukey(FLAC__real *window, const FLAC__int32 L, const FLAC__real p) -{ - if (p <= 0.0) - FLAC__window_rectangle(window, L); - else if (p >= 1.0) - FLAC__window_hann(window, L); - else { - const FLAC__int32 Np = (FLAC__int32)(p / 2.0f * L) - 1; - FLAC__int32 n; - /* start with rectangle... */ - FLAC__window_rectangle(window, L); - /* ...replace ends with hann */ - if (Np > 0) { - for (n = 0; n <= Np; n++) { - window[n] = (FLAC__real)(0.5f - 0.5f * cos(M_PI * n / Np)); - window[L-Np-1+n] = (FLAC__real)(0.5f - 0.5f * cos(M_PI * (n+Np) / Np)); - } - } - } -} - -void FLAC__window_welch(FLAC__real *window, const FLAC__int32 L) -{ - const FLAC__int32 N = L - 1; - const double N2 = (double)N / 2.; - FLAC__int32 n; - - for (n = 0; n <= N; n++) { - const double k = ((double)n - N2) / N2; - window[n] = (FLAC__real)(1.0f - k * k); - } -} - -#endif /* !defined FLAC__INTEGER_ONLY_LIBRARY */ diff --git a/3rdparty/libflac/src/metaflac/Makefile.am b/3rdparty/libflac/src/metaflac/Makefile.am deleted file mode 100644 index 92aa50bf467..00000000000 --- a/3rdparty/libflac/src/metaflac/Makefile.am +++ /dev/null @@ -1,54 +0,0 @@ -# metaflac - Command-line FLAC metadata editor -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -bin_PROGRAMS = metaflac - -AM_CFLAGS = @OGG_CFLAGS@ - -EXTRA_DIST = \ - Makefile.lite \ - metaflac.dsp \ - metaflac.vcproj - -metaflac_SOURCES = \ - main.c \ - operations.c \ - operations_shorthand_cuesheet.c \ - operations_shorthand_picture.c \ - operations_shorthand_seektable.c \ - operations_shorthand_streaminfo.c \ - operations_shorthand_vorbiscomment.c \ - options.c \ - usage.c \ - utils.c \ - operations.h \ - operations_shorthand.h \ - options.h \ - usage.h \ - utils.h -metaflac_LDFLAGS = - -metaflac_LDADD = \ - $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \ - $(top_builddir)/src/share/getopt/libgetopt.a \ - $(top_builddir)/src/share/utf8/libutf8.la \ - $(top_builddir)/src/libFLAC/libFLAC.la \ - @OGG_LIBS@ \ - @LIBICONV@ \ - @MINGW_WINSOCK_LIBS@ \ - -lm diff --git a/3rdparty/libflac/src/metaflac/Makefile.in b/3rdparty/libflac/src/metaflac/Makefile.in deleted file mode 100644 index 4f6872ed4c9..00000000000 --- a/3rdparty/libflac/src/metaflac/Makefile.in +++ /dev/null @@ -1,585 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# metaflac - Command-line FLAC metadata editor -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -bin_PROGRAMS = metaflac - -AM_CFLAGS = @OGG_CFLAGS@ - -EXTRA_DIST = \ - Makefile.lite \ - metaflac.dsp \ - metaflac.vcproj - - -metaflac_SOURCES = \ - main.c \ - operations.c \ - operations_shorthand_cuesheet.c \ - operations_shorthand_picture.c \ - operations_shorthand_seektable.c \ - operations_shorthand_streaminfo.c \ - operations_shorthand_vorbiscomment.c \ - options.c \ - usage.c \ - utils.c \ - operations.h \ - operations_shorthand.h \ - options.h \ - usage.h \ - utils.h - -metaflac_LDFLAGS = - -metaflac_LDADD = \ - $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \ - $(top_builddir)/src/share/getopt/libgetopt.a \ - $(top_builddir)/src/share/utf8/libutf8.la \ - $(top_builddir)/src/libFLAC/libFLAC.la \ - @OGG_LIBS@ \ - @LIBICONV@ \ - @MINGW_WINSOCK_LIBS@ \ - -lm - -subdir = src/metaflac -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -bin_PROGRAMS = metaflac$(EXEEXT) -PROGRAMS = $(bin_PROGRAMS) - -am_metaflac_OBJECTS = main.$(OBJEXT) operations.$(OBJEXT) \ - operations_shorthand_cuesheet.$(OBJEXT) \ - operations_shorthand_picture.$(OBJEXT) \ - operations_shorthand_seektable.$(OBJEXT) \ - operations_shorthand_streaminfo.$(OBJEXT) \ - operations_shorthand_vorbiscomment.$(OBJEXT) options.$(OBJEXT) \ - usage.$(OBJEXT) utils.$(OBJEXT) -metaflac_OBJECTS = $(am_metaflac_OBJECTS) -metaflac_DEPENDENCIES = $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \ - $(top_builddir)/src/share/getopt/libgetopt.a \ - $(top_builddir)/src/share/utf8/libutf8.la \ - $(top_builddir)/src/libFLAC/libFLAC.la - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/main.Po ./$(DEPDIR)/operations.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/operations_shorthand_cuesheet.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/operations_shorthand_picture.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/operations_shorthand_seektable.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/operations_shorthand_streaminfo.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/operations_shorthand_vorbiscomment.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/options.Po ./$(DEPDIR)/usage.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/utils.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(metaflac_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(metaflac_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/metaflac/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - if test -f $$p \ - || test -f $$p1 \ - ; then \ - f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ - else :; fi; \ - done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ - rm -f $(DESTDIR)$(bindir)/$$f; \ - done - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -metaflac$(EXEEXT): $(metaflac_OBJECTS) $(metaflac_DEPENDENCIES) - @rm -f metaflac$(EXEEXT) - $(LINK) $(metaflac_LDFLAGS) $(metaflac_OBJECTS) $(metaflac_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/operations.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/operations_shorthand_cuesheet.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/operations_shorthand_picture.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/operations_shorthand_seektable.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/operations_shorthand_streaminfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/operations_shorthand_vorbiscomment.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usage.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) - -installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: install-binPROGRAMS - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libtool ctags distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am info info-am install install-am install-binPROGRAMS \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/metaflac/Makefile.lite b/3rdparty/libflac/src/metaflac/Makefile.lite deleted file mode 100644 index 56dba51859b..00000000000 --- a/3rdparty/libflac/src/metaflac/Makefile.lite +++ /dev/null @@ -1,49 +0,0 @@ -# metaflac - Command-line FLAC metadata editor -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# -# GNU makefile -# - -topdir = ../.. -libdir = $(topdir)/obj/$(BUILD)/lib - -PROGRAM_NAME = metaflac - -INCLUDES = -I./include -I$(topdir)/include -I$(OGG_INCLUDE_DIR) - -ifeq ($(DARWIN_BUILD),yes) -EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libFLAC.a $(libdir)/libreplaygain_analysis.a $(libdir)/libgetopt.a $(libdir)/libutf8.a $(OGG_LIB_DIR)/libogg.a -liconv -lm -else -LIBS = -lgrabbag -lFLAC -lreplaygain_analysis -lgetopt -lutf8 -L$(OGG_LIB_DIR) -logg -lm -endif - -SRCS_C = \ - main.c \ - operations.c \ - operations_shorthand_cuesheet.c \ - operations_shorthand_picture.c \ - operations_shorthand_seektable.c \ - operations_shorthand_streaminfo.c \ - operations_shorthand_vorbiscomment.c \ - options.c \ - usage.c \ - utils.c - -include $(topdir)/build/exe.mk - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/3rdparty/libflac/src/metaflac/main.c b/3rdparty/libflac/src/metaflac/main.c deleted file mode 100644 index d2b8145e26e..00000000000 --- a/3rdparty/libflac/src/metaflac/main.c +++ /dev/null @@ -1,48 +0,0 @@ -/* metaflac - Command-line FLAC metadata editor - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "operations.h" -#include "options.h" -#include <locale.h> - -int main(int argc, char *argv[]) -{ - CommandLineOptions options; - int ret = 0; - -#ifdef __EMX__ - _response(&argc, &argv); - _wildcard(&argc, &argv); -#endif - - setlocale(LC_ALL, ""); - init_options(&options); - - if(parse_options(argc, argv, &options)) - ret = !do_operations(&options); - else - ret = 1; - - free_options(&options); - - return ret; -} diff --git a/3rdparty/libflac/src/metaflac/metaflac.dsp b/3rdparty/libflac/src/metaflac/metaflac.dsp deleted file mode 100644 index aa1fbadd2b6..00000000000 --- a/3rdparty/libflac/src/metaflac/metaflac.dsp +++ /dev/null @@ -1,152 +0,0 @@ -# Microsoft Developer Studio Project File - Name="metaflac" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=metaflac - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "metaflac.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "metaflac.mak" CFG="metaflac - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "metaflac - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "metaflac - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "metaflac - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\obj\release\bin" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "." /I "..\..\include" /D "NDEBUG" /D "FLAC__NO_DLL" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\..\obj\release\lib\grabbag_static.lib ..\..\obj\release\lib\libFLAC_static.lib ..\..\obj\release\lib\replaygain_analysis_static.lib ..\..\obj\release\lib\getopt_static.lib ..\..\obj\release\lib\utf8_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "metaflac - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\obj\debug\bin" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "..\..\include" /D "_DEBUG" /D "DEBUG" /D "FLAC__NO_DLL" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\..\obj\debug\lib\grabbag_static.lib ..\..\obj\debug\lib\libFLAC_static.lib ..\..\obj\debug\lib\replaygain_analysis_static.lib ..\..\obj\debug\lib\getopt_static.lib ..\..\obj\debug\lib\utf8_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "metaflac - Win32 Release" -# Name "metaflac - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\main.c -# End Source File -# Begin Source File - -SOURCE=.\operations.c -# End Source File -# Begin Source File - -SOURCE=.\operations_shorthand_cuesheet.c -# End Source File -# Begin Source File - -SOURCE=.\operations_shorthand_picture.c -# End Source File -# Begin Source File - -SOURCE=.\operations_shorthand_seektable.c -# End Source File -# Begin Source File - -SOURCE=.\operations_shorthand_streaminfo.c -# End Source File -# Begin Source File - -SOURCE=.\operations_shorthand_vorbiscomment.c -# End Source File -# Begin Source File - -SOURCE=.\options.c -# End Source File -# Begin Source File - -SOURCE=.\usage.c -# End Source File -# Begin Source File - -SOURCE=.\utils.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\operations.h -# End Source File -# Begin Source File - -SOURCE=.\options.h -# End Source File -# Begin Source File - -SOURCE=.\usage.h -# End Source File -# Begin Source File - -SOURCE=.\utils.h -# End Source File -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/metaflac/metaflac.vcproj b/3rdparty/libflac/src/metaflac/metaflac.vcproj deleted file mode 100644 index 6da60fe6dc9..00000000000 --- a/3rdparty/libflac/src/metaflac/metaflac.vcproj +++ /dev/null @@ -1,256 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="metaflac" - ProjectGUID="{4cefbc87-c215-11db-8314-0800200c9a66}" - RootNamespace="metaflac" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\obj\debug\bin" - IntermediateDirectory="Debug" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".;..\..\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;FLAC__HAS_OGG;FLAC__NO_DLL;DEBUG" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="..\..\obj\release\lib\ogg_static.lib" - LinkIncremental="2" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\obj\release\bin" - IntermediateDirectory="Release" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".;..\..\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__HAS_OGG;FLAC__NO_DLL" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="..\..\obj\release\lib\ogg_static.lib" - LinkIncremental="1" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" - LinkTimeCodeGeneration="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath=".\operations.h" - > - </File> - <File - RelativePath=".\options.h" - > - </File> - <File - RelativePath=".\usage.h" - > - </File> - <File - RelativePath=".\utils.h" - > - </File> - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\main.c" - > - </File> - <File - RelativePath=".\operations.c" - > - </File> - <File - RelativePath=".\operations_shorthand_cuesheet.c" - > - </File> - <File - RelativePath=".\operations_shorthand_picture.c" - > - </File> - <File - RelativePath=".\operations_shorthand_seektable.c" - > - </File> - <File - RelativePath=".\operations_shorthand_streaminfo.c" - > - </File> - <File - RelativePath=".\operations_shorthand_vorbiscomment.c" - > - </File> - <File - RelativePath=".\options.c" - > - </File> - <File - RelativePath=".\usage.c" - > - </File> - <File - RelativePath=".\utils.c" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/metaflac/operations.c b/3rdparty/libflac/src/metaflac/operations.c deleted file mode 100644 index 54774bf69b0..00000000000 --- a/3rdparty/libflac/src/metaflac/operations.c +++ /dev/null @@ -1,682 +0,0 @@ -/* metaflac - Command-line FLAC metadata editor - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "operations.h" -#include "usage.h" -#include "utils.h" -#include "FLAC/assert.h" -#include "FLAC/metadata.h" -#include "share/alloc.h" -#include "share/grabbag.h" -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "operations_shorthand.h" - -static void show_version(void); -static FLAC__bool do_major_operation(const CommandLineOptions *options); -static FLAC__bool do_major_operation_on_file(const char *filename, const CommandLineOptions *options); -static FLAC__bool do_major_operation__list(const char *filename, FLAC__Metadata_Chain *chain, const CommandLineOptions *options); -static FLAC__bool do_major_operation__append(FLAC__Metadata_Chain *chain, const CommandLineOptions *options); -static FLAC__bool do_major_operation__remove(FLAC__Metadata_Chain *chain, const CommandLineOptions *options); -static FLAC__bool do_major_operation__remove_all(FLAC__Metadata_Chain *chain, const CommandLineOptions *options); -static FLAC__bool do_shorthand_operations(const CommandLineOptions *options); -static FLAC__bool do_shorthand_operations_on_file(const char *filename, const CommandLineOptions *options); -static FLAC__bool do_shorthand_operation(const char *filename, FLAC__bool prefix_with_filename, FLAC__Metadata_Chain *chain, const Operation *operation, FLAC__bool *needs_write, FLAC__bool utf8_convert); -static FLAC__bool do_shorthand_operation__add_replay_gain(char **filenames, unsigned num_files, FLAC__bool preserve_modtime); -static FLAC__bool do_shorthand_operation__add_padding(const char *filename, FLAC__Metadata_Chain *chain, unsigned length, FLAC__bool *needs_write); - -static FLAC__bool passes_filter(const CommandLineOptions *options, const FLAC__StreamMetadata *block, unsigned block_number); -static void write_metadata(const char *filename, FLAC__StreamMetadata *block, unsigned block_number, FLAC__bool raw, FLAC__bool hexdump_application); - -/* from operations_shorthand_seektable.c */ -extern FLAC__bool do_shorthand_operation__add_seekpoints(const char *filename, FLAC__Metadata_Chain *chain, const char *specification, FLAC__bool *needs_write); - -/* from operations_shorthand_streaminfo.c */ -extern FLAC__bool do_shorthand_operation__streaminfo(const char *filename, FLAC__bool prefix_with_filename, FLAC__Metadata_Chain *chain, const Operation *operation, FLAC__bool *needs_write); - -/* from operations_shorthand_vorbiscomment.c */ -extern FLAC__bool do_shorthand_operation__vorbis_comment(const char *filename, FLAC__bool prefix_with_filename, FLAC__Metadata_Chain *chain, const Operation *operation, FLAC__bool *needs_write, FLAC__bool raw); - -/* from operations_shorthand_cuesheet.c */ -extern FLAC__bool do_shorthand_operation__cuesheet(const char *filename, FLAC__Metadata_Chain *chain, const Operation *operation, FLAC__bool *needs_write); - -/* from operations_shorthand_picture.c */ -extern FLAC__bool do_shorthand_operation__picture(const char *filename, FLAC__Metadata_Chain *chain, const Operation *operation, FLAC__bool *needs_write); - - -FLAC__bool do_operations(const CommandLineOptions *options) -{ - FLAC__bool ok = true; - - if(options->show_long_help) { - long_usage(0); - } - if(options->show_version) { - show_version(); - } - else if(options->args.checks.num_major_ops > 0) { - FLAC__ASSERT(options->args.checks.num_shorthand_ops == 0); - FLAC__ASSERT(options->args.checks.num_major_ops == 1); - FLAC__ASSERT(options->args.checks.num_major_ops == options->ops.num_operations); - ok = do_major_operation(options); - } - else if(options->args.checks.num_shorthand_ops > 0) { - FLAC__ASSERT(options->args.checks.num_shorthand_ops == options->ops.num_operations); - ok = do_shorthand_operations(options); - } - - return ok; -} - -/* - * local routines - */ - -void show_version(void) -{ - printf("metaflac %s\n", FLAC__VERSION_STRING); -} - -FLAC__bool do_major_operation(const CommandLineOptions *options) -{ - unsigned i; - FLAC__bool ok = true; - - /* to die after first error, v--- add '&& ok' here */ - for(i = 0; i < options->num_files; i++) - ok &= do_major_operation_on_file(options->filenames[i], options); - - return ok; -} - -FLAC__bool do_major_operation_on_file(const char *filename, const CommandLineOptions *options) -{ - FLAC__bool ok = true, needs_write = false, is_ogg = false; - FLAC__Metadata_Chain *chain = FLAC__metadata_chain_new(); - - if(0 == chain) - die("out of memory allocating chain"); - - /*@@@@ lame way of guessing the file type */ - if(strlen(filename) >= 4 && (0 == strcmp(filename+strlen(filename)-4, ".oga") || 0 == strcmp(filename+strlen(filename)-4, ".ogg"))) - is_ogg = true; - - if(! (is_ogg? FLAC__metadata_chain_read_ogg(chain, filename) : FLAC__metadata_chain_read(chain, filename)) ) { - print_error_with_chain_status(chain, "%s: ERROR: reading metadata", filename); - FLAC__metadata_chain_delete(chain); - return false; - } - - switch(options->ops.operations[0].type) { - case OP__LIST: - ok = do_major_operation__list(options->prefix_with_filename? filename : 0, chain, options); - break; - case OP__APPEND: - ok = do_major_operation__append(chain, options); - needs_write = true; - break; - case OP__REMOVE: - ok = do_major_operation__remove(chain, options); - needs_write = true; - break; - case OP__REMOVE_ALL: - ok = do_major_operation__remove_all(chain, options); - needs_write = true; - break; - case OP__MERGE_PADDING: - FLAC__metadata_chain_merge_padding(chain); - needs_write = true; - break; - case OP__SORT_PADDING: - FLAC__metadata_chain_sort_padding(chain); - needs_write = true; - break; - default: - FLAC__ASSERT(0); - return false; - } - - if(ok && needs_write) { - if(options->use_padding) - FLAC__metadata_chain_sort_padding(chain); - ok = FLAC__metadata_chain_write(chain, options->use_padding, options->preserve_modtime); - if(!ok) - print_error_with_chain_status(chain, "%s: ERROR: writing FLAC file", filename); - } - - FLAC__metadata_chain_delete(chain); - - return ok; -} - -FLAC__bool do_major_operation__list(const char *filename, FLAC__Metadata_Chain *chain, const CommandLineOptions *options) -{ - FLAC__Metadata_Iterator *iterator = FLAC__metadata_iterator_new(); - FLAC__StreamMetadata *block; - FLAC__bool ok = true; - unsigned block_number; - - if(0 == iterator) - die("out of memory allocating iterator"); - - FLAC__metadata_iterator_init(iterator, chain); - - block_number = 0; - do { - block = FLAC__metadata_iterator_get_block(iterator); - ok &= (0 != block); - if(!ok) - fprintf(stderr, "%s: ERROR: couldn't get block from chain\n", filename); - else if(passes_filter(options, FLAC__metadata_iterator_get_block(iterator), block_number)) - write_metadata(filename, block, block_number, !options->utf8_convert, options->application_data_format_is_hexdump); - block_number++; - } while(ok && FLAC__metadata_iterator_next(iterator)); - - FLAC__metadata_iterator_delete(iterator); - - return ok; -} - -FLAC__bool do_major_operation__append(FLAC__Metadata_Chain *chain, const CommandLineOptions *options) -{ - (void) chain, (void) options; - fprintf(stderr, "ERROR: --append not implemented yet\n"); - return false; -} - -FLAC__bool do_major_operation__remove(FLAC__Metadata_Chain *chain, const CommandLineOptions *options) -{ - FLAC__Metadata_Iterator *iterator = FLAC__metadata_iterator_new(); - FLAC__bool ok = true; - unsigned block_number; - - if(0 == iterator) - die("out of memory allocating iterator"); - - FLAC__metadata_iterator_init(iterator, chain); - - block_number = 0; - while(ok && FLAC__metadata_iterator_next(iterator)) { - block_number++; - if(passes_filter(options, FLAC__metadata_iterator_get_block(iterator), block_number)) { - ok &= FLAC__metadata_iterator_delete_block(iterator, options->use_padding); - if(options->use_padding) - ok &= FLAC__metadata_iterator_next(iterator); - } - } - - FLAC__metadata_iterator_delete(iterator); - - return ok; -} - -FLAC__bool do_major_operation__remove_all(FLAC__Metadata_Chain *chain, const CommandLineOptions *options) -{ - FLAC__Metadata_Iterator *iterator = FLAC__metadata_iterator_new(); - FLAC__bool ok = true; - - if(0 == iterator) - die("out of memory allocating iterator"); - - FLAC__metadata_iterator_init(iterator, chain); - - while(ok && FLAC__metadata_iterator_next(iterator)) { - ok &= FLAC__metadata_iterator_delete_block(iterator, options->use_padding); - if(options->use_padding) - ok &= FLAC__metadata_iterator_next(iterator); - } - - FLAC__metadata_iterator_delete(iterator); - - return ok; -} - -FLAC__bool do_shorthand_operations(const CommandLineOptions *options) -{ - unsigned i; - FLAC__bool ok = true; - - /* to die after first error, v--- add '&& ok' here */ - for(i = 0; i < options->num_files; i++) - ok &= do_shorthand_operations_on_file(options->filenames[i], options); - - /* check if OP__ADD_REPLAY_GAIN requested */ - if(ok && options->num_files > 0) { - for(i = 0; i < options->ops.num_operations; i++) { - if(options->ops.operations[i].type == OP__ADD_REPLAY_GAIN) - ok = do_shorthand_operation__add_replay_gain(options->filenames, options->num_files, options->preserve_modtime); - } - } - - return ok; -} - -FLAC__bool do_shorthand_operations_on_file(const char *filename, const CommandLineOptions *options) -{ - unsigned i; - FLAC__bool ok = true, needs_write = false, use_padding = options->use_padding; - FLAC__Metadata_Chain *chain = FLAC__metadata_chain_new(); - - if(0 == chain) - die("out of memory allocating chain"); - - if(!FLAC__metadata_chain_read(chain, filename)) { - print_error_with_chain_status(chain, "%s: ERROR: reading metadata", filename); - return false; - } - - for(i = 0; i < options->ops.num_operations && ok; i++) { - /* - * Do OP__ADD_SEEKPOINT last to avoid decoding twice if both - * --add-seekpoint and --import-cuesheet-from are used. - */ - if(options->ops.operations[i].type != OP__ADD_SEEKPOINT) - ok &= do_shorthand_operation(filename, options->prefix_with_filename, chain, &options->ops.operations[i], &needs_write, options->utf8_convert); - - /* The following seems counterintuitive but the meaning - * of 'use_padding' is 'try to keep the overall metadata - * to its original size, adding or truncating extra - * padding if necessary' which is why we need to turn it - * off in this case. If we don't, the extra padding block - * will just be truncated. - */ - if(options->ops.operations[i].type == OP__ADD_PADDING) - use_padding = false; - } - - /* - * Do OP__ADD_SEEKPOINT last to avoid decoding twice if both - * --add-seekpoint and --import-cuesheet-from are used. - */ - for(i = 0; i < options->ops.num_operations && ok; i++) { - if(options->ops.operations[i].type == OP__ADD_SEEKPOINT) - ok &= do_shorthand_operation(filename, options->prefix_with_filename, chain, &options->ops.operations[i], &needs_write, options->utf8_convert); - } - - if(ok && needs_write) { - if(use_padding) - FLAC__metadata_chain_sort_padding(chain); - ok = FLAC__metadata_chain_write(chain, use_padding, options->preserve_modtime); - if(!ok) - print_error_with_chain_status(chain, "%s: ERROR: writing FLAC file", filename); - } - - FLAC__metadata_chain_delete(chain); - - return ok; -} - -FLAC__bool do_shorthand_operation(const char *filename, FLAC__bool prefix_with_filename, FLAC__Metadata_Chain *chain, const Operation *operation, FLAC__bool *needs_write, FLAC__bool utf8_convert) -{ - FLAC__bool ok = true; - - switch(operation->type) { - case OP__SHOW_MD5SUM: - case OP__SHOW_MIN_BLOCKSIZE: - case OP__SHOW_MAX_BLOCKSIZE: - case OP__SHOW_MIN_FRAMESIZE: - case OP__SHOW_MAX_FRAMESIZE: - case OP__SHOW_SAMPLE_RATE: - case OP__SHOW_CHANNELS: - case OP__SHOW_BPS: - case OP__SHOW_TOTAL_SAMPLES: - case OP__SET_MD5SUM: - case OP__SET_MIN_BLOCKSIZE: - case OP__SET_MAX_BLOCKSIZE: - case OP__SET_MIN_FRAMESIZE: - case OP__SET_MAX_FRAMESIZE: - case OP__SET_SAMPLE_RATE: - case OP__SET_CHANNELS: - case OP__SET_BPS: - case OP__SET_TOTAL_SAMPLES: - ok = do_shorthand_operation__streaminfo(filename, prefix_with_filename, chain, operation, needs_write); - break; - case OP__SHOW_VC_VENDOR: - case OP__SHOW_VC_FIELD: - case OP__REMOVE_VC_ALL: - case OP__REMOVE_VC_FIELD: - case OP__REMOVE_VC_FIRSTFIELD: - case OP__SET_VC_FIELD: - case OP__IMPORT_VC_FROM: - case OP__EXPORT_VC_TO: - ok = do_shorthand_operation__vorbis_comment(filename, prefix_with_filename, chain, operation, needs_write, !utf8_convert); - break; - case OP__IMPORT_CUESHEET_FROM: - case OP__EXPORT_CUESHEET_TO: - ok = do_shorthand_operation__cuesheet(filename, chain, operation, needs_write); - break; - case OP__IMPORT_PICTURE_FROM: - case OP__EXPORT_PICTURE_TO: - ok = do_shorthand_operation__picture(filename, chain, operation, needs_write); - break; - case OP__ADD_SEEKPOINT: - ok = do_shorthand_operation__add_seekpoints(filename, chain, operation->argument.add_seekpoint.specification, needs_write); - break; - case OP__ADD_REPLAY_GAIN: - /* this command is always executed last */ - ok = true; - break; - case OP__ADD_PADDING: - ok = do_shorthand_operation__add_padding(filename, chain, operation->argument.add_padding.length, needs_write); - break; - default: - ok = false; - FLAC__ASSERT(0); - break; - }; - - return ok; -} - -FLAC__bool do_shorthand_operation__add_replay_gain(char **filenames, unsigned num_files, FLAC__bool preserve_modtime) -{ - FLAC__StreamMetadata streaminfo; - float *title_gains = 0, *title_peaks = 0; - float album_gain, album_peak; - unsigned sample_rate = 0; - unsigned bits_per_sample = 0; - unsigned channels = 0; - unsigned i; - const char *error; - FLAC__bool first = true; - - FLAC__ASSERT(num_files > 0); - - for(i = 0; i < num_files; i++) { - FLAC__ASSERT(0 != filenames[i]); - if(!FLAC__metadata_get_streaminfo(filenames[i], &streaminfo)) { - fprintf(stderr, "%s: ERROR: can't open file or get STREAMINFO block\n", filenames[i]); - return false; - } - if(first) { - first = false; - sample_rate = streaminfo.data.stream_info.sample_rate; - bits_per_sample = streaminfo.data.stream_info.bits_per_sample; - channels = streaminfo.data.stream_info.channels; - } - else { - if(sample_rate != streaminfo.data.stream_info.sample_rate) { - fprintf(stderr, "%s: ERROR: sample rate of %u Hz does not match previous files' %u Hz\n", filenames[i], streaminfo.data.stream_info.sample_rate, sample_rate); - return false; - } - if(bits_per_sample != streaminfo.data.stream_info.bits_per_sample) { - fprintf(stderr, "%s: ERROR: resolution of %u bps does not match previous files' %u bps\n", filenames[i], streaminfo.data.stream_info.bits_per_sample, bits_per_sample); - return false; - } - if(channels != streaminfo.data.stream_info.channels) { - fprintf(stderr, "%s: ERROR: # channels (%u) does not match previous files' (%u)\n", filenames[i], streaminfo.data.stream_info.channels, channels); - return false; - } - } - if(!grabbag__replaygain_is_valid_sample_frequency(sample_rate)) { - fprintf(stderr, "%s: ERROR: sample rate of %u Hz is not supported\n", filenames[i], sample_rate); - return false; - } - if(channels != 1 && channels != 2) { - fprintf(stderr, "%s: ERROR: # of channels (%u) is not supported, must be 1 or 2\n", filenames[i], channels); - return false; - } - } - FLAC__ASSERT(bits_per_sample >= FLAC__MIN_BITS_PER_SAMPLE && bits_per_sample <= FLAC__MAX_BITS_PER_SAMPLE); - - if(!grabbag__replaygain_init(sample_rate)) { - FLAC__ASSERT(0); - /* double protection */ - fprintf(stderr, "internal error\n"); - return false; - } - - if( - 0 == (title_gains = (float*)safe_malloc_mul_2op_(sizeof(float), /*times*/num_files)) || - 0 == (title_peaks = (float*)safe_malloc_mul_2op_(sizeof(float), /*times*/num_files)) - ) - die("out of memory allocating space for title gains/peaks"); - - for(i = 0; i < num_files; i++) { - if(0 != (error = grabbag__replaygain_analyze_file(filenames[i], title_gains+i, title_peaks+i))) { - fprintf(stderr, "%s: ERROR: during analysis (%s)\n", filenames[i], error); - free(title_gains); - free(title_peaks); - return false; - } - } - grabbag__replaygain_get_album(&album_gain, &album_peak); - - for(i = 0; i < num_files; i++) { - if(0 != (error = grabbag__replaygain_store_to_file(filenames[i], album_gain, album_peak, title_gains[i], title_peaks[i], preserve_modtime))) { - fprintf(stderr, "%s: ERROR: writing tags (%s)\n", filenames[i], error); - free(title_gains); - free(title_peaks); - return false; - } - } - - free(title_gains); - free(title_peaks); - return true; -} - -FLAC__bool do_shorthand_operation__add_padding(const char *filename, FLAC__Metadata_Chain *chain, unsigned length, FLAC__bool *needs_write) -{ - FLAC__StreamMetadata *padding = 0; - FLAC__Metadata_Iterator *iterator = FLAC__metadata_iterator_new(); - - if(0 == iterator) - die("out of memory allocating iterator"); - - FLAC__metadata_iterator_init(iterator, chain); - - while(FLAC__metadata_iterator_next(iterator)) - ; - - padding = FLAC__metadata_object_new(FLAC__METADATA_TYPE_PADDING); - if(0 == padding) - die("out of memory allocating PADDING block"); - - padding->length = length; - - if(!FLAC__metadata_iterator_insert_block_after(iterator, padding)) { - print_error_with_chain_status(chain, "%s: ERROR: adding new PADDING block to metadata", filename); - FLAC__metadata_object_delete(padding); - FLAC__metadata_iterator_delete(iterator); - return false; - } - - FLAC__metadata_iterator_delete(iterator); - *needs_write = true; - return true; -} - -FLAC__bool passes_filter(const CommandLineOptions *options, const FLAC__StreamMetadata *block, unsigned block_number) -{ - unsigned i, j; - FLAC__bool matches_number = false, matches_type = false; - FLAC__bool has_block_number_arg = false; - - for(i = 0; i < options->args.num_arguments; i++) { - if(options->args.arguments[i].type == ARG__BLOCK_TYPE || options->args.arguments[i].type == ARG__EXCEPT_BLOCK_TYPE) { - for(j = 0; j < options->args.arguments[i].value.block_type.num_entries; j++) { - if(options->args.arguments[i].value.block_type.entries[j].type == block->type) { - if(block->type != FLAC__METADATA_TYPE_APPLICATION || !options->args.arguments[i].value.block_type.entries[j].filter_application_by_id || 0 == memcmp(options->args.arguments[i].value.block_type.entries[j].application_id, block->data.application.id, FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8)) - matches_type = true; - } - } - } - else if(options->args.arguments[i].type == ARG__BLOCK_NUMBER) { - has_block_number_arg = true; - for(j = 0; j < options->args.arguments[i].value.block_number.num_entries; j++) { - if(options->args.arguments[i].value.block_number.entries[j] == block_number) - matches_number = true; - } - } - } - - if(!has_block_number_arg) - matches_number = true; - - if(options->args.checks.has_block_type) { - FLAC__ASSERT(!options->args.checks.has_except_block_type); - } - else if(options->args.checks.has_except_block_type) - matches_type = !matches_type; - else - matches_type = true; - - return matches_number && matches_type; -} - -void write_metadata(const char *filename, FLAC__StreamMetadata *block, unsigned block_number, FLAC__bool raw, FLAC__bool hexdump_application) -{ - unsigned i, j; - -/*@@@ yuck, should do this with a varargs function or something: */ -#define PPR if(filename)printf("%s:",filename); - PPR; printf("METADATA block #%u\n", block_number); - PPR; printf(" type: %u (%s)\n", (unsigned)block->type, block->type < FLAC__METADATA_TYPE_UNDEFINED? FLAC__MetadataTypeString[block->type] : "UNKNOWN"); - PPR; printf(" is last: %s\n", block->is_last? "true":"false"); - PPR; printf(" length: %u\n", block->length); - - switch(block->type) { - case FLAC__METADATA_TYPE_STREAMINFO: - PPR; printf(" minimum blocksize: %u samples\n", block->data.stream_info.min_blocksize); - PPR; printf(" maximum blocksize: %u samples\n", block->data.stream_info.max_blocksize); - PPR; printf(" minimum framesize: %u bytes\n", block->data.stream_info.min_framesize); - PPR; printf(" maximum framesize: %u bytes\n", block->data.stream_info.max_framesize); - PPR; printf(" sample_rate: %u Hz\n", block->data.stream_info.sample_rate); - PPR; printf(" channels: %u\n", block->data.stream_info.channels); - PPR; printf(" bits-per-sample: %u\n", block->data.stream_info.bits_per_sample); -#ifdef _MSC_VER - PPR; printf(" total samples: %I64u\n", block->data.stream_info.total_samples); -#else - PPR; printf(" total samples: %llu\n", (unsigned long long)block->data.stream_info.total_samples); -#endif - PPR; printf(" MD5 signature: "); - for(i = 0; i < 16; i++) { - printf("%02x", (unsigned)block->data.stream_info.md5sum[i]); - } - printf("\n"); - break; - case FLAC__METADATA_TYPE_PADDING: - /* nothing to print */ - break; - case FLAC__METADATA_TYPE_APPLICATION: - PPR; printf(" application ID: "); - for(i = 0; i < 4; i++) - printf("%02x", block->data.application.id[i]); - printf("\n"); - PPR; printf(" data contents:\n"); - if(0 != block->data.application.data) { - if(hexdump_application) - hexdump(filename, block->data.application.data, block->length - FLAC__STREAM_METADATA_HEADER_LENGTH, " "); - else - (void) local_fwrite(block->data.application.data, 1, block->length - FLAC__STREAM_METADATA_HEADER_LENGTH, stdout); - } - break; - case FLAC__METADATA_TYPE_SEEKTABLE: - PPR; printf(" seek points: %u\n", block->data.seek_table.num_points); - for(i = 0; i < block->data.seek_table.num_points; i++) { - if(block->data.seek_table.points[i].sample_number != FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER) { -#ifdef _MSC_VER - PPR; printf(" point %u: sample_number=%I64u, stream_offset=%I64u, frame_samples=%u\n", i, block->data.seek_table.points[i].sample_number, block->data.seek_table.points[i].stream_offset, block->data.seek_table.points[i].frame_samples); -#else - PPR; printf(" point %u: sample_number=%llu, stream_offset=%llu, frame_samples=%u\n", i, (unsigned long long)block->data.seek_table.points[i].sample_number, (unsigned long long)block->data.seek_table.points[i].stream_offset, block->data.seek_table.points[i].frame_samples); -#endif - } - else { - PPR; printf(" point %u: PLACEHOLDER\n", i); - } - } - break; - case FLAC__METADATA_TYPE_VORBIS_COMMENT: - PPR; printf(" vendor string: "); - write_vc_field(0, &block->data.vorbis_comment.vendor_string, raw, stdout); - PPR; printf(" comments: %u\n", block->data.vorbis_comment.num_comments); - for(i = 0; i < block->data.vorbis_comment.num_comments; i++) { - PPR; printf(" comment[%u]: ", i); - write_vc_field(0, &block->data.vorbis_comment.comments[i], raw, stdout); - } - break; - case FLAC__METADATA_TYPE_CUESHEET: - PPR; printf(" media catalog number: %s\n", block->data.cue_sheet.media_catalog_number); -#ifdef _MSC_VER - PPR; printf(" lead-in: %I64u\n", block->data.cue_sheet.lead_in); -#else - PPR; printf(" lead-in: %llu\n", (unsigned long long)block->data.cue_sheet.lead_in); -#endif - PPR; printf(" is CD: %s\n", block->data.cue_sheet.is_cd? "true":"false"); - PPR; printf(" number of tracks: %u\n", block->data.cue_sheet.num_tracks); - for(i = 0; i < block->data.cue_sheet.num_tracks; i++) { - const FLAC__StreamMetadata_CueSheet_Track *track = block->data.cue_sheet.tracks+i; - const FLAC__bool is_last = (i == block->data.cue_sheet.num_tracks-1); - const FLAC__bool is_leadout = is_last && track->num_indices == 0; - PPR; printf(" track[%u]\n", i); -#ifdef _MSC_VER - PPR; printf(" offset: %I64u\n", track->offset); -#else - PPR; printf(" offset: %llu\n", (unsigned long long)track->offset); -#endif - if(is_last) { - PPR; printf(" number: %u (%s)\n", (unsigned)track->number, is_leadout? "LEAD-OUT" : "INVALID"); - } - else { - PPR; printf(" number: %u\n", (unsigned)track->number); - } - if(!is_leadout) { - PPR; printf(" ISRC: %s\n", track->isrc); - PPR; printf(" type: %s\n", track->type == 1? "DATA" : "AUDIO"); - PPR; printf(" pre-emphasis: %s\n", track->pre_emphasis? "true":"false"); - PPR; printf(" number of index points: %u\n", track->num_indices); - for(j = 0; j < track->num_indices; j++) { - const FLAC__StreamMetadata_CueSheet_Index *index = track->indices+j; - PPR; printf(" index[%u]\n", j); -#ifdef _MSC_VER - PPR; printf(" offset: %I64u\n", index->offset); -#else - PPR; printf(" offset: %llu\n", (unsigned long long)index->offset); -#endif - PPR; printf(" number: %u\n", (unsigned)index->number); - } - } - } - break; - case FLAC__METADATA_TYPE_PICTURE: - PPR; printf(" type: %u (%s)\n", block->data.picture.type, block->data.picture.type < FLAC__STREAM_METADATA_PICTURE_TYPE_UNDEFINED? FLAC__StreamMetadata_Picture_TypeString[block->data.picture.type] : "UNDEFINED"); - PPR; printf(" MIME type: %s\n", block->data.picture.mime_type); - PPR; printf(" description: %s\n", block->data.picture.description); - PPR; printf(" width: %u\n", (unsigned)block->data.picture.width); - PPR; printf(" height: %u\n", (unsigned)block->data.picture.height); - PPR; printf(" depth: %u\n", (unsigned)block->data.picture.depth); - PPR; printf(" colors: %u%s\n", (unsigned)block->data.picture.colors, block->data.picture.colors? "" : " (unindexed)"); - PPR; printf(" data length: %u\n", (unsigned)block->data.picture.data_length); - PPR; printf(" data:\n"); - if(0 != block->data.picture.data) - hexdump(filename, block->data.picture.data, block->data.picture.data_length, " "); - break; - default: - PPR; printf(" data contents:\n"); - if(0 != block->data.unknown.data) - hexdump(filename, block->data.unknown.data, block->length, " "); - break; - } -#undef PPR -} diff --git a/3rdparty/libflac/src/metaflac/operations.h b/3rdparty/libflac/src/metaflac/operations.h deleted file mode 100644 index b5144a36be5..00000000000 --- a/3rdparty/libflac/src/metaflac/operations.h +++ /dev/null @@ -1,26 +0,0 @@ -/* metaflac - Command-line FLAC metadata editor - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef metaflac__operations_h -#define metaflac__operations_h - -#include "options.h" - -FLAC__bool do_operations(const CommandLineOptions *options); - -#endif diff --git a/3rdparty/libflac/src/metaflac/operations_shorthand.h b/3rdparty/libflac/src/metaflac/operations_shorthand.h deleted file mode 100644 index 112c079b0a6..00000000000 --- a/3rdparty/libflac/src/metaflac/operations_shorthand.h +++ /dev/null @@ -1,25 +0,0 @@ -/* metaflac - Command-line FLAC metadata editor - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include "options.h" - -FLAC__bool do_shorthand_operation__picture(const char *filename, FLAC__Metadata_Chain *chain, const Operation *operation, FLAC__bool *needs_write); -FLAC__bool do_shorthand_operation__cuesheet(const char *filename, FLAC__Metadata_Chain *chain, const Operation *operation, FLAC__bool *needs_write); -FLAC__bool do_shorthand_operation__add_seekpoints(const char *filename, FLAC__Metadata_Chain *chain, const char *specification, FLAC__bool *needs_write); -FLAC__bool do_shorthand_operation__streaminfo(const char *filename, FLAC__bool prefix_with_filename, FLAC__Metadata_Chain *chain, const Operation *operation, FLAC__bool *needs_write); -FLAC__bool do_shorthand_operation__vorbis_comment(const char *filename, FLAC__bool prefix_with_filename, FLAC__Metadata_Chain *chain, const Operation *operation, FLAC__bool *needs_write, FLAC__bool raw); diff --git a/3rdparty/libflac/src/metaflac/operations_shorthand_cuesheet.c b/3rdparty/libflac/src/metaflac/operations_shorthand_cuesheet.c deleted file mode 100644 index 14912c11931..00000000000 --- a/3rdparty/libflac/src/metaflac/operations_shorthand_cuesheet.c +++ /dev/null @@ -1,217 +0,0 @@ -/* metaflac - Command-line FLAC metadata editor - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <errno.h> -#include <stdio.h> /* for snprintf() */ -#include <string.h> -#include "options.h" -#include "utils.h" -#include "FLAC/assert.h" -#include "share/grabbag.h" -#include "operations_shorthand.h" - -static FLAC__bool import_cs_from(const char *filename, FLAC__StreamMetadata **cuesheet, const char *cs_filename, FLAC__bool *needs_write, FLAC__uint64 lead_out_offset, FLAC__bool is_cdda, Argument_AddSeekpoint *add_seekpoint_link); -static FLAC__bool export_cs_to(const char *filename, const FLAC__StreamMetadata *cuesheet, const char *cs_filename); - -FLAC__bool do_shorthand_operation__cuesheet(const char *filename, FLAC__Metadata_Chain *chain, const Operation *operation, FLAC__bool *needs_write) -{ - FLAC__bool ok = true; - FLAC__StreamMetadata *cuesheet = 0; - FLAC__Metadata_Iterator *iterator = FLAC__metadata_iterator_new(); - FLAC__uint64 lead_out_offset = 0; - FLAC__bool is_cdda = false; - - if(0 == iterator) - die("out of memory allocating iterator"); - - FLAC__metadata_iterator_init(iterator, chain); - - do { - FLAC__StreamMetadata *block = FLAC__metadata_iterator_get_block(iterator); - if(block->type == FLAC__METADATA_TYPE_STREAMINFO) { - lead_out_offset = block->data.stream_info.total_samples; - if(lead_out_offset == 0) { - fprintf(stderr, "%s: ERROR: FLAC file must have total_samples set in STREAMINFO in order to import/export cuesheet\n", filename); - FLAC__metadata_iterator_delete(iterator); - return false; - } - is_cdda = (block->data.stream_info.channels == 1 || block->data.stream_info.channels == 2) && (block->data.stream_info.bits_per_sample == 16) && (block->data.stream_info.sample_rate == 44100); - } - else if(block->type == FLAC__METADATA_TYPE_CUESHEET) - cuesheet = block; - } while(FLAC__metadata_iterator_next(iterator)); - - if(lead_out_offset == 0) { - fprintf(stderr, "%s: ERROR: FLAC stream has no STREAMINFO block\n", filename); - FLAC__metadata_iterator_delete(iterator); - return false; - } - - switch(operation->type) { - case OP__IMPORT_CUESHEET_FROM: - if(0 != cuesheet) { - fprintf(stderr, "%s: ERROR: FLAC file already has CUESHEET block\n", filename); - ok = false; - } - else { - ok = import_cs_from(filename, &cuesheet, operation->argument.import_cuesheet_from.filename, needs_write, lead_out_offset, is_cdda, operation->argument.import_cuesheet_from.add_seekpoint_link); - if(ok) { - /* append CUESHEET block */ - while(FLAC__metadata_iterator_next(iterator)) - ; - if(!FLAC__metadata_iterator_insert_block_after(iterator, cuesheet)) { - print_error_with_chain_status(chain, "%s: ERROR: adding new CUESHEET block to metadata", filename); - FLAC__metadata_object_delete(cuesheet); - ok = false; - } - } - } - break; - case OP__EXPORT_CUESHEET_TO: - if(0 == cuesheet) { - fprintf(stderr, "%s: ERROR: FLAC file has no CUESHEET block\n", filename); - ok = false; - } - else - ok = export_cs_to(filename, cuesheet, operation->argument.filename.value); - break; - default: - ok = false; - FLAC__ASSERT(0); - break; - }; - - FLAC__metadata_iterator_delete(iterator); - return ok; -} - -/* - * local routines - */ - -FLAC__bool import_cs_from(const char *filename, FLAC__StreamMetadata **cuesheet, const char *cs_filename, FLAC__bool *needs_write, FLAC__uint64 lead_out_offset, FLAC__bool is_cdda, Argument_AddSeekpoint *add_seekpoint_link) -{ - FILE *f; - const char *error_message; - char **seekpoint_specification = add_seekpoint_link? &(add_seekpoint_link->specification) : 0; - unsigned last_line_read; - - if(0 == cs_filename || strlen(cs_filename) == 0) { - fprintf(stderr, "%s: ERROR: empty import file name\n", filename); - return false; - } - if(0 == strcmp(cs_filename, "-")) - f = stdin; - else - f = fopen(cs_filename, "r"); - - if(0 == f) { - fprintf(stderr, "%s: ERROR: can't open import file %s: %s\n", filename, cs_filename, strerror(errno)); - return false; - } - - *cuesheet = grabbag__cuesheet_parse(f, &error_message, &last_line_read, is_cdda, lead_out_offset); - - if(f != stdin) - fclose(f); - - if(0 == *cuesheet) { - fprintf(stderr, "%s: ERROR: while parsing cuesheet \"%s\" on line %u: %s\n", filename, cs_filename, last_line_read, error_message); - return false; - } - - if(!FLAC__format_cuesheet_is_legal(&(*cuesheet)->data.cue_sheet, /*check_cd_da_subset=*/false, &error_message)) { - fprintf(stderr, "%s: ERROR parsing cuesheet \"%s\": %s\n", filename, cs_filename, error_message); - return false; - } - - /* if we're expecting CDDA, warn about non-compliance */ - if(is_cdda && !FLAC__format_cuesheet_is_legal(&(*cuesheet)->data.cue_sheet, /*check_cd_da_subset=*/true, &error_message)) { - fprintf(stderr, "%s: WARNING cuesheet \"%s\" is not audio CD compliant: %s\n", filename, cs_filename, error_message); - (*cuesheet)->data.cue_sheet.is_cd = false; - } - - /* add seekpoints for each index point if required */ - if(0 != seekpoint_specification) { - char spec[128]; - unsigned track, index; - const FLAC__StreamMetadata_CueSheet *cs = &(*cuesheet)->data.cue_sheet; - if(0 == *seekpoint_specification) - *seekpoint_specification = local_strdup(""); - for(track = 0; track < cs->num_tracks; track++) { - const FLAC__StreamMetadata_CueSheet_Track *tr = cs->tracks+track; - for(index = 0; index < tr->num_indices; index++) { -#ifdef _MSC_VER - sprintf(spec, "%I64u;", tr->offset + tr->indices[index].offset); -#else - sprintf(spec, "%llu;", (unsigned long long)(tr->offset + tr->indices[index].offset)); -#endif - local_strcat(seekpoint_specification, spec); - } - } - } - - *needs_write = true; - return true; -} - -FLAC__bool export_cs_to(const char *filename, const FLAC__StreamMetadata *cuesheet, const char *cs_filename) -{ - FILE *f; - char *ref = 0; - size_t reflen; - - if(0 == cs_filename || strlen(cs_filename) == 0) { - fprintf(stderr, "%s: ERROR: empty export file name\n", filename); - return false; - } - if(0 == strcmp(cs_filename, "-")) - f = stdout; - else - f = fopen(cs_filename, "w"); - - if(0 == f) { - fprintf(stderr, "%s: ERROR: can't open export file %s: %s\n", filename, cs_filename, strerror(errno)); - return false; - } - - reflen = strlen(filename) + 7 + 1; - if(0 == (ref = malloc(reflen))) { - fprintf(stderr, "%s: ERROR: allocating memory\n", filename); - return false; - } - -#if defined _MSC_VER || defined __MINGW32__ - _snprintf(ref, reflen, "\"%s\" FLAC", filename); -#else - snprintf(ref, reflen, "\"%s\" FLAC", filename); -#endif - - grabbag__cuesheet_emit(f, cuesheet, ref); - - free(ref); - - if(f != stdout) - fclose(f); - - return true; -} diff --git a/3rdparty/libflac/src/metaflac/operations_shorthand_picture.c b/3rdparty/libflac/src/metaflac/operations_shorthand_picture.c deleted file mode 100644 index 9045aaeb6cf..00000000000 --- a/3rdparty/libflac/src/metaflac/operations_shorthand_picture.c +++ /dev/null @@ -1,173 +0,0 @@ -/* metaflac - Command-line FLAC metadata editor - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <errno.h> -#include <string.h> -#include "options.h" -#include "utils.h" -#include "FLAC/assert.h" -#include "share/grabbag.h" /* for grabbag__picture_parse_specification() etc */ - -#include "operations_shorthand.h" - -static FLAC__bool import_pic_from(const char *filename, FLAC__StreamMetadata **picture, const char *specification, FLAC__bool *needs_write); -static FLAC__bool export_pic_to(const char *filename, const FLAC__StreamMetadata *picture, const char *pic_filename); - -FLAC__bool do_shorthand_operation__picture(const char *filename, FLAC__Metadata_Chain *chain, const Operation *operation, FLAC__bool *needs_write) -{ - FLAC__bool ok = true, has_type1 = false, has_type2 = false; - FLAC__StreamMetadata *picture = 0; - FLAC__Metadata_Iterator *iterator = FLAC__metadata_iterator_new(); - - if(0 == iterator) - die("out of memory allocating iterator"); - - FLAC__metadata_iterator_init(iterator, chain); - - switch(operation->type) { - case OP__IMPORT_PICTURE_FROM: - ok = import_pic_from(filename, &picture, operation->argument.specification.value, needs_write); - if(ok) { - /* append PICTURE block */ - while(FLAC__metadata_iterator_next(iterator)) - ; - if(!FLAC__metadata_iterator_insert_block_after(iterator, picture)) { - print_error_with_chain_status(chain, "%s: ERROR: adding new PICTURE block to metadata", filename); - FLAC__metadata_object_delete(picture); - ok = false; - } - } - if(ok) { - /* check global PICTURE constraints (max 1 block each of type=1 and type=2) */ - while(FLAC__metadata_iterator_prev(iterator)) - ; - do { - FLAC__StreamMetadata *block = FLAC__metadata_iterator_get_block(iterator); - if(block->type == FLAC__METADATA_TYPE_PICTURE) { - if(block->data.picture.type == FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD) { - if(has_type1) { - print_error_with_chain_status(chain, "%s: ERROR: FLAC stream can only have one 32x32 standard icon (type=1) PICTURE block", filename); - ok = false; - } - has_type1 = true; - } - else if(block->data.picture.type == FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON) { - if(has_type2) { - print_error_with_chain_status(chain, "%s: ERROR: FLAC stream can only have one icon (type=2) PICTURE block", filename); - ok = false; - } - has_type2 = true; - } - } - } while(FLAC__metadata_iterator_next(iterator)); - } - break; - case OP__EXPORT_PICTURE_TO: - { - const Argument_BlockNumber *a = operation->argument.export_picture_to.block_number_link; - int block_number = (a && a->num_entries > 0)? (int)a->entries[0] : -1; - unsigned i = 0; - do { - FLAC__StreamMetadata *block = FLAC__metadata_iterator_get_block(iterator); - if(block->type == FLAC__METADATA_TYPE_PICTURE && (block_number < 0 || i == (unsigned)block_number)) - picture = block; - i++; - } while(FLAC__metadata_iterator_next(iterator) && 0 == picture); - if(0 == picture) { - if(block_number < 0) - fprintf(stderr, "%s: ERROR: FLAC file has no PICTURE block\n", filename); - else - fprintf(stderr, "%s: ERROR: FLAC file has no PICTURE block at block #%d\n", filename, block_number); - ok = false; - } - else - ok = export_pic_to(filename, picture, operation->argument.filename.value); - } - break; - default: - ok = false; - FLAC__ASSERT(0); - break; - }; - - FLAC__metadata_iterator_delete(iterator); - return ok; -} - -/* - * local routines - */ - -FLAC__bool import_pic_from(const char *filename, FLAC__StreamMetadata **picture, const char *specification, FLAC__bool *needs_write) -{ - const char *error_message; - - if(0 == specification || strlen(specification) == 0) { - fprintf(stderr, "%s: ERROR: empty picture specification\n", filename); - return false; - } - - *picture = grabbag__picture_parse_specification(specification, &error_message); - - if(0 == *picture) { - fprintf(stderr, "%s: ERROR: while parsing picture specification \"%s\": %s\n", filename, specification, error_message); - return false; - } - - if(!FLAC__format_picture_is_legal(&(*picture)->data.picture, &error_message)) { - fprintf(stderr, "%s: ERROR: new PICTURE block for \"%s\" is illegal: %s\n", filename, specification, error_message); - return false; - } - - *needs_write = true; - return true; -} - -FLAC__bool export_pic_to(const char *filename, const FLAC__StreamMetadata *picture, const char *pic_filename) -{ - FILE *f; - const FLAC__uint32 len = picture->data.picture.data_length; - - if(0 == pic_filename || strlen(pic_filename) == 0) { - fprintf(stderr, "%s: ERROR: empty export file name\n", filename); - return false; - } - if(0 == strcmp(pic_filename, "-")) - f = grabbag__file_get_binary_stdout(); - else - f = fopen(pic_filename, "wb"); - - if(0 == f) { - fprintf(stderr, "%s: ERROR: can't open export file %s: %s\n", filename, pic_filename, strerror(errno)); - return false; - } - - if(fwrite(picture->data.picture.data, 1, len, f) != len) { - fprintf(stderr, "%s: ERROR: writing PICTURE data to file\n", filename); - return false; - } - - if(f != stdout) - fclose(f); - - return true; -} diff --git a/3rdparty/libflac/src/metaflac/operations_shorthand_seektable.c b/3rdparty/libflac/src/metaflac/operations_shorthand_seektable.c deleted file mode 100644 index 4f4fb5d9f64..00000000000 --- a/3rdparty/libflac/src/metaflac/operations_shorthand_seektable.c +++ /dev/null @@ -1,217 +0,0 @@ -/* metaflac - Command-line FLAC metadata editor - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "utils.h" -#include "FLAC/assert.h" -#include "FLAC/stream_decoder.h" -#include "FLAC/metadata.h" -#include "share/grabbag.h" -#include "operations_shorthand.h" - -static FLAC__bool populate_seekpoint_values(const char *filename, FLAC__StreamMetadata *block, FLAC__bool *needs_write); - -FLAC__bool do_shorthand_operation__add_seekpoints(const char *filename, FLAC__Metadata_Chain *chain, const char *specification, FLAC__bool *needs_write) -{ - FLAC__bool ok = true, found_seektable_block = false; - FLAC__StreamMetadata *block = 0; - FLAC__Metadata_Iterator *iterator = FLAC__metadata_iterator_new(); - FLAC__uint64 total_samples = 0; - unsigned sample_rate = 0; - - if(0 == iterator) - die("out of memory allocating iterator"); - - FLAC__metadata_iterator_init(iterator, chain); - - do { - block = FLAC__metadata_iterator_get_block(iterator); - if(block->type == FLAC__METADATA_TYPE_STREAMINFO) { - sample_rate = block->data.stream_info.sample_rate; - total_samples = block->data.stream_info.total_samples; - } - else if(block->type == FLAC__METADATA_TYPE_SEEKTABLE) - found_seektable_block = true; - } while(!found_seektable_block && FLAC__metadata_iterator_next(iterator)); - - if(total_samples == 0) { - fprintf(stderr, "%s: ERROR: cannot add seekpoints because STREAMINFO block does not specify total_samples\n", filename); - return false; - } - - if(!found_seektable_block) { - /* create a new block */ - block = FLAC__metadata_object_new(FLAC__METADATA_TYPE_SEEKTABLE); - if(0 == block) - die("out of memory allocating SEEKTABLE block"); - while(FLAC__metadata_iterator_prev(iterator)) - ; - if(!FLAC__metadata_iterator_insert_block_after(iterator, block)) { - print_error_with_chain_status(chain, "%s: ERROR: adding new SEEKTABLE block to metadata", filename); - FLAC__metadata_object_delete(block); - return false; - } - /* iterator is left pointing to new block */ - FLAC__ASSERT(FLAC__metadata_iterator_get_block(iterator) == block); - } - - FLAC__metadata_iterator_delete(iterator); - - FLAC__ASSERT(0 != block); - FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_SEEKTABLE); - - if(!grabbag__seektable_convert_specification_to_template(specification, /*only_explicit_placeholders=*/false, total_samples, sample_rate, block, /*spec_has_real_points=*/0)) { - fprintf(stderr, "%s: ERROR (internal) preparing seektable with seekpoints\n", filename); - return false; - } - - ok = populate_seekpoint_values(filename, block, needs_write); - - if(ok) - (void) FLAC__format_seektable_sort(&block->data.seek_table); - - return ok; -} - -/* - * local routines - */ - -typedef struct { - FLAC__StreamMetadata_SeekTable *seektable_template; - FLAC__uint64 samples_written; - FLAC__uint64 audio_offset, last_offset; - unsigned first_seekpoint_to_check; - FLAC__bool error_occurred; - FLAC__StreamDecoderErrorStatus error_status; -} ClientData; - -static FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data) -{ - ClientData *cd = (ClientData*)client_data; - - (void)buffer; - FLAC__ASSERT(0 != cd); - - if(!cd->error_occurred) { - const unsigned blocksize = frame->header.blocksize; - const FLAC__uint64 frame_first_sample = cd->samples_written; - const FLAC__uint64 frame_last_sample = frame_first_sample + (FLAC__uint64)blocksize - 1; - FLAC__uint64 test_sample; - unsigned i; - for(i = cd->first_seekpoint_to_check; i < cd->seektable_template->num_points; i++) { - test_sample = cd->seektable_template->points[i].sample_number; - if(test_sample > frame_last_sample) { - break; - } - else if(test_sample >= frame_first_sample) { - cd->seektable_template->points[i].sample_number = frame_first_sample; - cd->seektable_template->points[i].stream_offset = cd->last_offset - cd->audio_offset; - cd->seektable_template->points[i].frame_samples = blocksize; - cd->first_seekpoint_to_check++; - /* DO NOT: "break;" and here's why: - * The seektable template may contain more than one target - * sample for any given frame; we will keep looping, generating - * duplicate seekpoints for them, and we'll clean it up later, - * just before writing the seektable back to the metadata. - */ - } - else { - cd->first_seekpoint_to_check++; - } - } - cd->samples_written += blocksize; - if(!FLAC__stream_decoder_get_decode_position(decoder, &cd->last_offset)) - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; - } - else - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; -} - -static void error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) -{ - ClientData *cd = (ClientData*)client_data; - - (void)decoder; - FLAC__ASSERT(0 != cd); - - if(!cd->error_occurred) { /* don't let multiple errors overwrite the first one */ - cd->error_occurred = true; - cd->error_status = status; - } -} - -FLAC__bool populate_seekpoint_values(const char *filename, FLAC__StreamMetadata *block, FLAC__bool *needs_write) -{ - FLAC__StreamDecoder *decoder; - ClientData client_data; - FLAC__bool ok = true; - - FLAC__ASSERT(0 != block); - FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_SEEKTABLE); - - client_data.seektable_template = &block->data.seek_table; - client_data.samples_written = 0; - /* client_data.audio_offset must be determined later */ - client_data.first_seekpoint_to_check = 0; - client_data.error_occurred = false; - - decoder = FLAC__stream_decoder_new(); - - if(0 == decoder) { - fprintf(stderr, "%s: ERROR (--add-seekpoint) creating the decoder instance\n", filename); - return false; - } - - FLAC__stream_decoder_set_md5_checking(decoder, false); - FLAC__stream_decoder_set_metadata_ignore_all(decoder); - - if(FLAC__stream_decoder_init_file(decoder, filename, write_callback_, /*metadata_callback=*/0, error_callback_, &client_data) != FLAC__STREAM_DECODER_INIT_STATUS_OK) { - fprintf(stderr, "%s: ERROR (--add-seekpoint) initializing the decoder instance (%s)\n", filename, FLAC__stream_decoder_get_resolved_state_string(decoder)); - ok = false; - } - - if(ok && !FLAC__stream_decoder_process_until_end_of_metadata(decoder)) { - fprintf(stderr, "%s: ERROR (--add-seekpoint) decoding file (%s)\n", filename, FLAC__stream_decoder_get_resolved_state_string(decoder)); - ok = false; - } - - if(ok && !FLAC__stream_decoder_get_decode_position(decoder, &client_data.audio_offset)) { - fprintf(stderr, "%s: ERROR (--add-seekpoint) decoding file\n", filename); - ok = false; - } - client_data.last_offset = client_data.audio_offset; - - if(ok && !FLAC__stream_decoder_process_until_end_of_stream(decoder)) { - fprintf(stderr, "%s: ERROR (--add-seekpoint) decoding file (%s)\n", filename, FLAC__stream_decoder_get_resolved_state_string(decoder)); - ok = false; - } - - if(ok && client_data.error_occurred) { - fprintf(stderr, "%s: ERROR (--add-seekpoint) decoding file (%u:%s)\n", filename, (unsigned)client_data.error_status, FLAC__StreamDecoderErrorStatusString[client_data.error_status]); - ok = false; - } - - *needs_write = true; - FLAC__stream_decoder_delete(decoder); - return ok; -} diff --git a/3rdparty/libflac/src/metaflac/operations_shorthand_streaminfo.c b/3rdparty/libflac/src/metaflac/operations_shorthand_streaminfo.c deleted file mode 100644 index b4593f50e24..00000000000 --- a/3rdparty/libflac/src/metaflac/operations_shorthand_streaminfo.c +++ /dev/null @@ -1,129 +0,0 @@ -/* metaflac - Command-line FLAC metadata editor - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "options.h" -#include "utils.h" -#include "FLAC/assert.h" -#include "FLAC/metadata.h" -#include <string.h> -#include "operations_shorthand.h" - -FLAC__bool do_shorthand_operation__streaminfo(const char *filename, FLAC__bool prefix_with_filename, FLAC__Metadata_Chain *chain, const Operation *operation, FLAC__bool *needs_write) -{ - unsigned i; - FLAC__bool ok = true; - FLAC__StreamMetadata *block; - FLAC__Metadata_Iterator *iterator = FLAC__metadata_iterator_new(); - - if(0 == iterator) - die("out of memory allocating iterator"); - - FLAC__metadata_iterator_init(iterator, chain); - - block = FLAC__metadata_iterator_get_block(iterator); - - FLAC__ASSERT(0 != block); - FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_STREAMINFO); - - if(prefix_with_filename) - printf("%s:", filename); - - switch(operation->type) { - case OP__SHOW_MD5SUM: - for(i = 0; i < 16; i++) - printf("%02x", block->data.stream_info.md5sum[i]); - printf("\n"); - break; - case OP__SHOW_MIN_BLOCKSIZE: - printf("%u\n", block->data.stream_info.min_blocksize); - break; - case OP__SHOW_MAX_BLOCKSIZE: - printf("%u\n", block->data.stream_info.max_blocksize); - break; - case OP__SHOW_MIN_FRAMESIZE: - printf("%u\n", block->data.stream_info.min_framesize); - break; - case OP__SHOW_MAX_FRAMESIZE: - printf("%u\n", block->data.stream_info.max_framesize); - break; - case OP__SHOW_SAMPLE_RATE: - printf("%u\n", block->data.stream_info.sample_rate); - break; - case OP__SHOW_CHANNELS: - printf("%u\n", block->data.stream_info.channels); - break; - case OP__SHOW_BPS: - printf("%u\n", block->data.stream_info.bits_per_sample); - break; - case OP__SHOW_TOTAL_SAMPLES: -#ifdef _MSC_VER - printf("%I64u\n", block->data.stream_info.total_samples); -#else - printf("%llu\n", (unsigned long long)block->data.stream_info.total_samples); -#endif - break; - case OP__SET_MD5SUM: - memcpy(block->data.stream_info.md5sum, operation->argument.streaminfo_md5.value, 16); - *needs_write = true; - break; - case OP__SET_MIN_BLOCKSIZE: - block->data.stream_info.min_blocksize = operation->argument.streaminfo_uint32.value; - *needs_write = true; - break; - case OP__SET_MAX_BLOCKSIZE: - block->data.stream_info.max_blocksize = operation->argument.streaminfo_uint32.value; - *needs_write = true; - break; - case OP__SET_MIN_FRAMESIZE: - block->data.stream_info.min_framesize = operation->argument.streaminfo_uint32.value; - *needs_write = true; - break; - case OP__SET_MAX_FRAMESIZE: - block->data.stream_info.max_framesize = operation->argument.streaminfo_uint32.value; - *needs_write = true; - break; - case OP__SET_SAMPLE_RATE: - block->data.stream_info.sample_rate = operation->argument.streaminfo_uint32.value; - *needs_write = true; - break; - case OP__SET_CHANNELS: - block->data.stream_info.channels = operation->argument.streaminfo_uint32.value; - *needs_write = true; - break; - case OP__SET_BPS: - block->data.stream_info.bits_per_sample = operation->argument.streaminfo_uint32.value; - *needs_write = true; - break; - case OP__SET_TOTAL_SAMPLES: - block->data.stream_info.total_samples = operation->argument.streaminfo_uint64.value; - *needs_write = true; - break; - default: - ok = false; - FLAC__ASSERT(0); - break; - }; - - FLAC__metadata_iterator_delete(iterator); - - return ok; -} diff --git a/3rdparty/libflac/src/metaflac/operations_shorthand_vorbiscomment.c b/3rdparty/libflac/src/metaflac/operations_shorthand_vorbiscomment.c deleted file mode 100644 index ba00859b502..00000000000 --- a/3rdparty/libflac/src/metaflac/operations_shorthand_vorbiscomment.c +++ /dev/null @@ -1,368 +0,0 @@ -/* metaflac - Command-line FLAC metadata editor - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "options.h" -#include "utils.h" -#include "FLAC/assert.h" -#include "share/grabbag.h" /* for grabbag__file_get_filesize() */ -#include "share/utf8.h" -#include <errno.h> -#include <stdlib.h> -#include <string.h> -#include "operations_shorthand.h" - -static FLAC__bool remove_vc_all(const char *filename, FLAC__StreamMetadata *block, FLAC__bool *needs_write); -static FLAC__bool remove_vc_field(const char *filename, FLAC__StreamMetadata *block, const char *field_name, FLAC__bool *needs_write); -static FLAC__bool remove_vc_firstfield(const char *filename, FLAC__StreamMetadata *block, const char *field_name, FLAC__bool *needs_write); -static FLAC__bool set_vc_field(const char *filename, FLAC__StreamMetadata *block, const Argument_VcField *field, FLAC__bool *needs_write, FLAC__bool raw); -static FLAC__bool import_vc_from(const char *filename, FLAC__StreamMetadata *block, const Argument_String *vc_filename, FLAC__bool *needs_write, FLAC__bool raw); -static FLAC__bool export_vc_to(const char *filename, FLAC__StreamMetadata *block, const Argument_String *vc_filename, FLAC__bool raw); - -FLAC__bool do_shorthand_operation__vorbis_comment(const char *filename, FLAC__bool prefix_with_filename, FLAC__Metadata_Chain *chain, const Operation *operation, FLAC__bool *needs_write, FLAC__bool raw) -{ - FLAC__bool ok = true, found_vc_block = false; - FLAC__StreamMetadata *block = 0; - FLAC__Metadata_Iterator *iterator = FLAC__metadata_iterator_new(); - - if(0 == iterator) - die("out of memory allocating iterator"); - - FLAC__metadata_iterator_init(iterator, chain); - - do { - block = FLAC__metadata_iterator_get_block(iterator); - if(block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) - found_vc_block = true; - } while(!found_vc_block && FLAC__metadata_iterator_next(iterator)); - - if(!found_vc_block) { - /* create a new block if necessary */ - if(operation->type == OP__SET_VC_FIELD || operation->type == OP__IMPORT_VC_FROM) { - block = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT); - if(0 == block) - die("out of memory allocating VORBIS_COMMENT block"); - while(FLAC__metadata_iterator_next(iterator)) - ; - if(!FLAC__metadata_iterator_insert_block_after(iterator, block)) { - print_error_with_chain_status(chain, "%s: ERROR: adding new VORBIS_COMMENT block to metadata", filename); - return false; - } - /* iterator is left pointing to new block */ - FLAC__ASSERT(FLAC__metadata_iterator_get_block(iterator) == block); - } - else { - FLAC__metadata_iterator_delete(iterator); - return ok; - } - } - - FLAC__ASSERT(0 != block); - FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - - switch(operation->type) { - case OP__SHOW_VC_VENDOR: - write_vc_field(prefix_with_filename? filename : 0, &block->data.vorbis_comment.vendor_string, raw, stdout); - break; - case OP__SHOW_VC_FIELD: - write_vc_fields(prefix_with_filename? filename : 0, operation->argument.vc_field_name.value, block->data.vorbis_comment.comments, block->data.vorbis_comment.num_comments, raw, stdout); - break; - case OP__REMOVE_VC_ALL: - ok = remove_vc_all(filename, block, needs_write); - break; - case OP__REMOVE_VC_FIELD: - ok = remove_vc_field(filename, block, operation->argument.vc_field_name.value, needs_write); - break; - case OP__REMOVE_VC_FIRSTFIELD: - ok = remove_vc_firstfield(filename, block, operation->argument.vc_field_name.value, needs_write); - break; - case OP__SET_VC_FIELD: - ok = set_vc_field(filename, block, &operation->argument.vc_field, needs_write, raw); - break; - case OP__IMPORT_VC_FROM: - ok = import_vc_from(filename, block, &operation->argument.filename, needs_write, raw); - break; - case OP__EXPORT_VC_TO: - ok = export_vc_to(filename, block, &operation->argument.filename, raw); - break; - default: - ok = false; - FLAC__ASSERT(0); - break; - }; - - FLAC__metadata_iterator_delete(iterator); - return ok; -} - -/* - * local routines - */ - -FLAC__bool remove_vc_all(const char *filename, FLAC__StreamMetadata *block, FLAC__bool *needs_write) -{ - FLAC__ASSERT(0 != block); - FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - FLAC__ASSERT(0 != needs_write); - - if(0 != block->data.vorbis_comment.comments) { - FLAC__ASSERT(block->data.vorbis_comment.num_comments > 0); - if(!FLAC__metadata_object_vorbiscomment_resize_comments(block, 0)) { - fprintf(stderr, "%s: ERROR: memory allocation failure\n", filename); - return false; - } - *needs_write = true; - } - else { - FLAC__ASSERT(block->data.vorbis_comment.num_comments == 0); - } - - return true; -} - -FLAC__bool remove_vc_field(const char *filename, FLAC__StreamMetadata *block, const char *field_name, FLAC__bool *needs_write) -{ - int n; - - FLAC__ASSERT(0 != needs_write); - - n = FLAC__metadata_object_vorbiscomment_remove_entries_matching(block, field_name); - - if(n < 0) { - fprintf(stderr, "%s: ERROR: memory allocation failure\n", filename); - return false; - } - else if(n > 0) - *needs_write = true; - - return true; -} - -FLAC__bool remove_vc_firstfield(const char *filename, FLAC__StreamMetadata *block, const char *field_name, FLAC__bool *needs_write) -{ - int n; - - FLAC__ASSERT(0 != needs_write); - - n = FLAC__metadata_object_vorbiscomment_remove_entry_matching(block, field_name); - - if(n < 0) { - fprintf(stderr, "%s: ERROR: memory allocation failure\n", filename); - return false; - } - else if(n > 0) - *needs_write = true; - - return true; -} - -FLAC__bool set_vc_field(const char *filename, FLAC__StreamMetadata *block, const Argument_VcField *field, FLAC__bool *needs_write, FLAC__bool raw) -{ - FLAC__StreamMetadata_VorbisComment_Entry entry; - char *converted; - - FLAC__ASSERT(0 != block); - FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - FLAC__ASSERT(0 != field); - FLAC__ASSERT(0 != needs_write); - - if(field->field_value_from_file) { - /* read the file into 'data' */ - FILE *f = 0; - char *data = 0; - const off_t size = grabbag__file_get_filesize(field->field_value); - if(size < 0) { - fprintf(stderr, "%s: ERROR: can't open file '%s' for '%s' tag value\n", filename, field->field_value, field->field_name); - return false; - } - if(size >= 0x100000) { /* magic arbitrary limit, actual format limit is near 16MB */ - fprintf(stderr, "%s: ERROR: file '%s' for '%s' tag value is too large\n", filename, field->field_value, field->field_name); - return false; - } - if(0 == (data = malloc(size+1))) - die("out of memory allocating tag value"); - data[size] = '\0'; - if(0 == (f = fopen(field->field_value, "rb")) || fread(data, 1, size, f) != (size_t)size) { - fprintf(stderr, "%s: ERROR: while reading file '%s' for '%s' tag value: %s\n", filename, field->field_value, field->field_name, strerror(errno)); - free(data); - if(f) - fclose(f); - return false; - } - fclose(f); - if(strlen(data) != (size_t)size) { - free(data); - fprintf(stderr, "%s: ERROR: file '%s' for '%s' tag value has embedded NULs\n", filename, field->field_value, field->field_name); - return false; - } - - /* move 'data' into 'converted', converting to UTF-8 if necessary */ - if(raw) { - converted = data; - } - else if(utf8_encode(data, &converted) >= 0) { - free(data); - } - else { - free(data); - fprintf(stderr, "%s: ERROR: converting file '%s' contents to UTF-8 for tag value\n", filename, field->field_value); - return false; - } - - /* create and entry and append it */ - if(!FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(&entry, field->field_name, converted)) { - free(converted); - fprintf(stderr, "%s: ERROR: file '%s' for '%s' tag value is not valid UTF-8\n", filename, field->field_value, field->field_name); - return false; - } - free(converted); - if(!FLAC__metadata_object_vorbiscomment_append_comment(block, entry, /*copy=*/false)) { - fprintf(stderr, "%s: ERROR: memory allocation failure\n", filename); - return false; - } - - *needs_write = true; - return true; - } - else { - FLAC__bool needs_free = false; - if(raw) { - entry.entry = (FLAC__byte *)field->field; - } - else if(utf8_encode(field->field, &converted) >= 0) { - entry.entry = (FLAC__byte *)converted; - needs_free = true; - } - else { - fprintf(stderr, "%s: ERROR: converting comment '%s' to UTF-8\n", filename, field->field); - return false; - } - entry.length = strlen((const char *)entry.entry); - if(!FLAC__format_vorbiscomment_entry_is_legal(entry.entry, entry.length)) { - if(needs_free) - free(converted); - /* - * our previous parsing has already established that the field - * name is OK, so it must be the field value - */ - fprintf(stderr, "%s: ERROR: tag value for '%s' is not valid UTF-8\n", filename, field->field_name); - return false; - } - - if(!FLAC__metadata_object_vorbiscomment_append_comment(block, entry, /*copy=*/true)) { - if(needs_free) - free(converted); - fprintf(stderr, "%s: ERROR: memory allocation failure\n", filename); - return false; - } - - *needs_write = true; - if(needs_free) - free(converted); - return true; - } -} - -FLAC__bool import_vc_from(const char *filename, FLAC__StreamMetadata *block, const Argument_String *vc_filename, FLAC__bool *needs_write, FLAC__bool raw) -{ - FILE *f; - char line[65536]; - FLAC__bool ret; - - if(0 == vc_filename->value || strlen(vc_filename->value) == 0) { - fprintf(stderr, "%s: ERROR: empty import file name\n", filename); - return false; - } - if(0 == strcmp(vc_filename->value, "-")) - f = stdin; - else - f = fopen(vc_filename->value, "r"); - - if(0 == f) { - fprintf(stderr, "%s: ERROR: can't open import file %s: %s\n", filename, vc_filename->value, strerror(errno)); - return false; - } - - ret = true; - while(ret && !feof(f)) { - fgets(line, sizeof(line), f); - if(!feof(f)) { - char *p = strchr(line, '\n'); - if(0 == p) { - fprintf(stderr, "%s: ERROR: line too long, aborting\n", vc_filename->value); - ret = false; - } - else { - const char *violation; - Argument_VcField field; - *p = '\0'; - memset(&field, 0, sizeof(Argument_VcField)); - field.field_value_from_file = false; - if(!parse_vorbis_comment_field(line, &field.field, &field.field_name, &field.field_value, &field.field_value_length, &violation)) { - FLAC__ASSERT(0 != violation); - fprintf(stderr, "%s: ERROR: malformed vorbis comment field \"%s\",\n %s\n", vc_filename->value, line, violation); - ret = false; - } - else { - ret = set_vc_field(filename, block, &field, needs_write, raw); - } - if(0 != field.field) - free(field.field); - if(0 != field.field_name) - free(field.field_name); - if(0 != field.field_value) - free(field.field_value); - } - } - }; - - if(f != stdin) - fclose(f); - return ret; -} - -FLAC__bool export_vc_to(const char *filename, FLAC__StreamMetadata *block, const Argument_String *vc_filename, FLAC__bool raw) -{ - FILE *f; - FLAC__bool ret; - - if(0 == vc_filename->value || strlen(vc_filename->value) == 0) { - fprintf(stderr, "%s: ERROR: empty export file name\n", filename); - return false; - } - if(0 == strcmp(vc_filename->value, "-")) - f = stdout; - else - f = fopen(vc_filename->value, "w"); - - if(0 == f) { - fprintf(stderr, "%s: ERROR: can't open export file %s: %s\n", filename, vc_filename->value, strerror(errno)); - return false; - } - - ret = true; - - write_vc_fields(0, 0, block->data.vorbis_comment.comments, block->data.vorbis_comment.num_comments, raw, f); - - if(f != stdout) - fclose(f); - return ret; -} diff --git a/3rdparty/libflac/src/metaflac/options.c b/3rdparty/libflac/src/metaflac/options.c deleted file mode 100644 index 56c441691f5..00000000000 --- a/3rdparty/libflac/src/metaflac/options.c +++ /dev/null @@ -1,1109 +0,0 @@ -/* metaflac - Command-line FLAC metadata editor - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "options.h" -#include "usage.h" -#include "utils.h" -#include "FLAC/assert.h" -#include "share/alloc.h" -#include "share/grabbag/replaygain.h" -#include <ctype.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -/* - share__getopt format struct; note we don't use short options so we just - set the 'val' field to 0 everywhere to indicate a valid option. -*/ -struct share__option long_options_[] = { - /* global options */ - { "preserve-modtime", 0, 0, 0 }, - { "with-filename", 0, 0, 0 }, - { "no-filename", 0, 0, 0 }, - { "no-utf8-convert", 0, 0, 0 }, - { "dont-use-padding", 0, 0, 0 }, - { "no-cued-seekpoints", 0, 0, 0 }, - /* shorthand operations */ - { "show-md5sum", 0, 0, 0 }, - { "show-min-blocksize", 0, 0, 0 }, - { "show-max-blocksize", 0, 0, 0 }, - { "show-min-framesize", 0, 0, 0 }, - { "show-max-framesize", 0, 0, 0 }, - { "show-sample-rate", 0, 0, 0 }, - { "show-channels", 0, 0, 0 }, - { "show-bps", 0, 0, 0 }, - { "show-total-samples", 0, 0, 0 }, - { "set-md5sum", 1, 0, 0 }, /* undocumented */ - { "set-min-blocksize", 1, 0, 0 }, /* undocumented */ - { "set-max-blocksize", 1, 0, 0 }, /* undocumented */ - { "set-min-framesize", 1, 0, 0 }, /* undocumented */ - { "set-max-framesize", 1, 0, 0 }, /* undocumented */ - { "set-sample-rate", 1, 0, 0 }, /* undocumented */ - { "set-channels", 1, 0, 0 }, /* undocumented */ - { "set-bps", 1, 0, 0 }, /* undocumented */ - { "set-total-samples", 1, 0, 0 }, /* undocumented */ /* WATCHOUT: used by test/test_flac.sh on windows */ - { "show-vendor-tag", 0, 0, 0 }, - { "show-tag", 1, 0, 0 }, - { "remove-all-tags", 0, 0, 0 }, - { "remove-tag", 1, 0, 0 }, - { "remove-first-tag", 1, 0, 0 }, - { "set-tag", 1, 0, 0 }, - { "set-tag-from-file", 1, 0, 0 }, - { "import-tags-from", 1, 0, 0 }, - { "export-tags-to", 1, 0, 0 }, - { "import-cuesheet-from", 1, 0, 0 }, - { "export-cuesheet-to", 1, 0, 0 }, - { "import-picture-from", 1, 0, 0 }, - { "export-picture-to", 1, 0, 0 }, - { "add-seekpoint", 1, 0, 0 }, - { "add-replay-gain", 0, 0, 0 }, - { "remove-replay-gain", 0, 0, 0 }, - { "add-padding", 1, 0, 0 }, - /* major operations */ - { "help", 0, 0, 0 }, - { "version", 0, 0, 0 }, - { "list", 0, 0, 0 }, - { "append", 0, 0, 0 }, - { "remove", 0, 0, 0 }, - { "remove-all", 0, 0, 0 }, - { "merge-padding", 0, 0, 0 }, - { "sort-padding", 0, 0, 0 }, - /* major operation arguments */ - { "block-number", 1, 0, 0 }, - { "block-type", 1, 0, 0 }, - { "except-block-type", 1, 0, 0 }, - { "data-format", 1, 0, 0 }, - { "application-data-format", 1, 0, 0 }, - { "from-file", 1, 0, 0 }, - {0, 0, 0, 0} -}; - -static FLAC__bool parse_option(int option_index, const char *option_argument, CommandLineOptions *options); -static void append_new_operation(CommandLineOptions *options, Operation operation); -static void append_new_argument(CommandLineOptions *options, Argument argument); -static Operation *append_major_operation(CommandLineOptions *options, OperationType type); -static Operation *append_shorthand_operation(CommandLineOptions *options, OperationType type); -static Argument *find_argument(CommandLineOptions *options, ArgumentType type); -static Operation *find_shorthand_operation(CommandLineOptions *options, OperationType type); -static Argument *append_argument(CommandLineOptions *options, ArgumentType type); -static FLAC__bool parse_md5(const char *src, FLAC__byte dest[16]); -static FLAC__bool parse_uint32(const char *src, FLAC__uint32 *dest); -static FLAC__bool parse_uint64(const char *src, FLAC__uint64 *dest); -static FLAC__bool parse_string(const char *src, char **dest); -static FLAC__bool parse_vorbis_comment_field_name(const char *field_ref, char **name, const char **violation); -static FLAC__bool parse_add_seekpoint(const char *in, char **out, const char **violation); -static FLAC__bool parse_add_padding(const char *in, unsigned *out); -static FLAC__bool parse_block_number(const char *in, Argument_BlockNumber *out); -static FLAC__bool parse_block_type(const char *in, Argument_BlockType *out); -static FLAC__bool parse_data_format(const char *in, Argument_DataFormat *out); -static FLAC__bool parse_application_data_format(const char *in, FLAC__bool *out); -static void undocumented_warning(const char *opt); - - -void init_options(CommandLineOptions *options) -{ - options->preserve_modtime = false; - - /* '2' is a hack to mean "use default if not forced on command line" */ - FLAC__ASSERT(true != 2); - options->prefix_with_filename = 2; - - options->utf8_convert = true; - options->use_padding = true; - options->cued_seekpoints = true; - options->show_long_help = false; - options->show_version = false; - options->application_data_format_is_hexdump = false; - - options->ops.operations = 0; - options->ops.num_operations = 0; - options->ops.capacity = 0; - - options->args.arguments = 0; - options->args.num_arguments = 0; - options->args.capacity = 0; - - options->args.checks.num_shorthand_ops = 0; - options->args.checks.num_major_ops = 0; - options->args.checks.has_block_type = false; - options->args.checks.has_except_block_type = false; - - options->num_files = 0; - options->filenames = 0; -} - -FLAC__bool parse_options(int argc, char *argv[], CommandLineOptions *options) -{ - int ret; - int option_index = 1; - FLAC__bool had_error = false; - - while ((ret = share__getopt_long(argc, argv, "", long_options_, &option_index)) != -1) { - switch (ret) { - case 0: - had_error |= !parse_option(option_index, share__optarg, options); - break; - case '?': - case ':': - had_error = true; - break; - default: - FLAC__ASSERT(0); - break; - } - } - - if(options->prefix_with_filename == 2) - options->prefix_with_filename = (argc - share__optind > 1); - - if(share__optind >= argc && !options->show_long_help && !options->show_version) { - fprintf(stderr,"ERROR: you must specify at least one FLAC file;\n"); - fprintf(stderr," metaflac cannot be used as a pipe\n"); - had_error = true; - } - - options->num_files = argc - share__optind; - - if(options->num_files > 0) { - unsigned i = 0; - if(0 == (options->filenames = (char**)safe_malloc_mul_2op_(sizeof(char*), /*times*/options->num_files))) - die("out of memory allocating space for file names list"); - while(share__optind < argc) - options->filenames[i++] = local_strdup(argv[share__optind++]); - } - - if(options->args.checks.num_major_ops > 0) { - if(options->args.checks.num_major_ops > 1) { - fprintf(stderr, "ERROR: you may only specify one major operation at a time\n"); - had_error = true; - } - else if(options->args.checks.num_shorthand_ops > 0) { - fprintf(stderr, "ERROR: you may not mix shorthand and major operations\n"); - had_error = true; - } - } - - /* check for only one FLAC file used with certain options */ - if(options->num_files > 1) { - if(0 != find_shorthand_operation(options, OP__IMPORT_CUESHEET_FROM)) { - fprintf(stderr, "ERROR: you may only specify one FLAC file when using '--import-cuesheet-from'\n"); - had_error = true; - } - if(0 != find_shorthand_operation(options, OP__EXPORT_CUESHEET_TO)) { - fprintf(stderr, "ERROR: you may only specify one FLAC file when using '--export-cuesheet-to'\n"); - had_error = true; - } - if(0 != find_shorthand_operation(options, OP__EXPORT_PICTURE_TO)) { - fprintf(stderr, "ERROR: you may only specify one FLAC file when using '--export-picture-to'\n"); - had_error = true; - } - if( - 0 != find_shorthand_operation(options, OP__IMPORT_VC_FROM) && - 0 == strcmp(find_shorthand_operation(options, OP__IMPORT_VC_FROM)->argument.filename.value, "-") - ) { - fprintf(stderr, "ERROR: you may only specify one FLAC file when using '--import-tags-from=-'\n"); - had_error = true; - } - } - - if(options->args.checks.has_block_type && options->args.checks.has_except_block_type) { - fprintf(stderr, "ERROR: you may not specify both '--block-type' and '--except-block-type'\n"); - had_error = true; - } - - if(had_error) - short_usage(0); - - /* - * We need to create an OP__ADD_SEEKPOINT operation if there is - * not one already, and --import-cuesheet-from was specified but - * --no-cued-seekpoints was not: - */ - if(options->cued_seekpoints) { - Operation *op = find_shorthand_operation(options, OP__IMPORT_CUESHEET_FROM); - if(0 != op) { - Operation *op2 = find_shorthand_operation(options, OP__ADD_SEEKPOINT); - if(0 == op2) - op2 = append_shorthand_operation(options, OP__ADD_SEEKPOINT); - op->argument.import_cuesheet_from.add_seekpoint_link = &(op2->argument.add_seekpoint); - } - } - - return !had_error; -} - -void free_options(CommandLineOptions *options) -{ - unsigned i; - Operation *op; - Argument *arg; - - FLAC__ASSERT(0 == options->ops.operations || options->ops.num_operations > 0); - FLAC__ASSERT(0 == options->args.arguments || options->args.num_arguments > 0); - - for(i = 0, op = options->ops.operations; i < options->ops.num_operations; i++, op++) { - switch(op->type) { - case OP__SHOW_VC_FIELD: - case OP__REMOVE_VC_FIELD: - case OP__REMOVE_VC_FIRSTFIELD: - if(0 != op->argument.vc_field_name.value) - free(op->argument.vc_field_name.value); - break; - case OP__SET_VC_FIELD: - if(0 != op->argument.vc_field.field) - free(op->argument.vc_field.field); - if(0 != op->argument.vc_field.field_name) - free(op->argument.vc_field.field_name); - if(0 != op->argument.vc_field.field_value) - free(op->argument.vc_field.field_value); - break; - case OP__IMPORT_VC_FROM: - case OP__EXPORT_VC_TO: - case OP__EXPORT_CUESHEET_TO: - if(0 != op->argument.filename.value) - free(op->argument.filename.value); - break; - case OP__IMPORT_CUESHEET_FROM: - if(0 != op->argument.import_cuesheet_from.filename) - free(op->argument.import_cuesheet_from.filename); - break; - case OP__IMPORT_PICTURE_FROM: - if(0 != op->argument.specification.value) - free(op->argument.specification.value); - break; - case OP__EXPORT_PICTURE_TO: - if(0 != op->argument.export_picture_to.filename) - free(op->argument.export_picture_to.filename); - break; - case OP__ADD_SEEKPOINT: - if(0 != op->argument.add_seekpoint.specification) - free(op->argument.add_seekpoint.specification); - break; - default: - break; - } - } - - for(i = 0, arg = options->args.arguments; i < options->args.num_arguments; i++, arg++) { - switch(arg->type) { - case ARG__BLOCK_NUMBER: - if(0 != arg->value.block_number.entries) - free(arg->value.block_number.entries); - break; - case ARG__BLOCK_TYPE: - case ARG__EXCEPT_BLOCK_TYPE: - if(0 != arg->value.block_type.entries) - free(arg->value.block_type.entries); - break; - case ARG__FROM_FILE: - if(0 != arg->value.from_file.file_name) - free(arg->value.from_file.file_name); - break; - default: - break; - } - } - - if(0 != options->ops.operations) - free(options->ops.operations); - - if(0 != options->args.arguments) - free(options->args.arguments); - - if(0 != options->filenames) { - for(i = 0; i < options->num_files; i++) { - if(0 != options->filenames[i]) - free(options->filenames[i]); - } - free(options->filenames); - } -} - -/* - * local routines - */ - -FLAC__bool parse_option(int option_index, const char *option_argument, CommandLineOptions *options) -{ - const char *opt = long_options_[option_index].name; - Operation *op; - Argument *arg; - FLAC__bool ok = true; - - if(0 == strcmp(opt, "preserve-modtime")) { - options->preserve_modtime = true; - } - else if(0 == strcmp(opt, "with-filename")) { - options->prefix_with_filename = true; - } - else if(0 == strcmp(opt, "no-filename")) { - options->prefix_with_filename = false; - } - else if(0 == strcmp(opt, "no-utf8-convert")) { - options->utf8_convert = false; - } - else if(0 == strcmp(opt, "dont-use-padding")) { - options->use_padding = false; - } - else if(0 == strcmp(opt, "no-cued-seekpoints")) { - options->cued_seekpoints = false; - } - else if(0 == strcmp(opt, "show-md5sum")) { - (void) append_shorthand_operation(options, OP__SHOW_MD5SUM); - } - else if(0 == strcmp(opt, "show-min-blocksize")) { - (void) append_shorthand_operation(options, OP__SHOW_MIN_BLOCKSIZE); - } - else if(0 == strcmp(opt, "show-max-blocksize")) { - (void) append_shorthand_operation(options, OP__SHOW_MAX_BLOCKSIZE); - } - else if(0 == strcmp(opt, "show-min-framesize")) { - (void) append_shorthand_operation(options, OP__SHOW_MIN_FRAMESIZE); - } - else if(0 == strcmp(opt, "show-max-framesize")) { - (void) append_shorthand_operation(options, OP__SHOW_MAX_FRAMESIZE); - } - else if(0 == strcmp(opt, "show-sample-rate")) { - (void) append_shorthand_operation(options, OP__SHOW_SAMPLE_RATE); - } - else if(0 == strcmp(opt, "show-channels")) { - (void) append_shorthand_operation(options, OP__SHOW_CHANNELS); - } - else if(0 == strcmp(opt, "show-bps")) { - (void) append_shorthand_operation(options, OP__SHOW_BPS); - } - else if(0 == strcmp(opt, "show-total-samples")) { - (void) append_shorthand_operation(options, OP__SHOW_TOTAL_SAMPLES); - } - else if(0 == strcmp(opt, "set-md5sum")) { - op = append_shorthand_operation(options, OP__SET_MD5SUM); - FLAC__ASSERT(0 != option_argument); - if(!parse_md5(option_argument, op->argument.streaminfo_md5.value)) { - fprintf(stderr, "ERROR (--%s): bad MD5 sum\n", opt); - ok = false; - } - else - undocumented_warning(opt); - } - else if(0 == strcmp(opt, "set-min-blocksize")) { - op = append_shorthand_operation(options, OP__SET_MIN_BLOCKSIZE); - if(!parse_uint32(option_argument, &(op->argument.streaminfo_uint32.value)) || op->argument.streaminfo_uint32.value < FLAC__MIN_BLOCK_SIZE || op->argument.streaminfo_uint32.value > FLAC__MAX_BLOCK_SIZE) { - fprintf(stderr, "ERROR (--%s): value must be >= %u and <= %u\n", opt, FLAC__MIN_BLOCK_SIZE, FLAC__MAX_BLOCK_SIZE); - ok = false; - } - else - undocumented_warning(opt); - } - else if(0 == strcmp(opt, "set-max-blocksize")) { - op = append_shorthand_operation(options, OP__SET_MAX_BLOCKSIZE); - if(!parse_uint32(option_argument, &(op->argument.streaminfo_uint32.value)) || op->argument.streaminfo_uint32.value < FLAC__MIN_BLOCK_SIZE || op->argument.streaminfo_uint32.value > FLAC__MAX_BLOCK_SIZE) { - fprintf(stderr, "ERROR (--%s): value must be >= %u and <= %u\n", opt, FLAC__MIN_BLOCK_SIZE, FLAC__MAX_BLOCK_SIZE); - ok = false; - } - else - undocumented_warning(opt); - } - else if(0 == strcmp(opt, "set-min-framesize")) { - op = append_shorthand_operation(options, OP__SET_MIN_FRAMESIZE); - if(!parse_uint32(option_argument, &(op->argument.streaminfo_uint32.value)) || op->argument.streaminfo_uint32.value >= (1u<<FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN)) { - fprintf(stderr, "ERROR (--%s): value must be a %u-bit unsigned integer\n", opt, FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN); - ok = false; - } - else - undocumented_warning(opt); - } - else if(0 == strcmp(opt, "set-max-framesize")) { - op = append_shorthand_operation(options, OP__SET_MAX_FRAMESIZE); - if(!parse_uint32(option_argument, &(op->argument.streaminfo_uint32.value)) || op->argument.streaminfo_uint32.value >= (1u<<FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN)) { - fprintf(stderr, "ERROR (--%s): value must be a %u-bit unsigned integer\n", opt, FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN); - ok = false; - } - else - undocumented_warning(opt); - } - else if(0 == strcmp(opt, "set-sample-rate")) { - op = append_shorthand_operation(options, OP__SET_SAMPLE_RATE); - if(!parse_uint32(option_argument, &(op->argument.streaminfo_uint32.value)) || !FLAC__format_sample_rate_is_valid(op->argument.streaminfo_uint32.value)) { - fprintf(stderr, "ERROR (--%s): invalid sample rate\n", opt); - ok = false; - } - else - undocumented_warning(opt); - } - else if(0 == strcmp(opt, "set-channels")) { - op = append_shorthand_operation(options, OP__SET_CHANNELS); - if(!parse_uint32(option_argument, &(op->argument.streaminfo_uint32.value)) || op->argument.streaminfo_uint32.value > FLAC__MAX_CHANNELS) { - fprintf(stderr, "ERROR (--%s): value must be > 0 and <= %u\n", opt, FLAC__MAX_CHANNELS); - ok = false; - } - else - undocumented_warning(opt); - } - else if(0 == strcmp(opt, "set-bps")) { - op = append_shorthand_operation(options, OP__SET_BPS); - if(!parse_uint32(option_argument, &(op->argument.streaminfo_uint32.value)) || op->argument.streaminfo_uint32.value < FLAC__MIN_BITS_PER_SAMPLE || op->argument.streaminfo_uint32.value > FLAC__MAX_BITS_PER_SAMPLE) { - fprintf(stderr, "ERROR (--%s): value must be >= %u and <= %u\n", opt, FLAC__MIN_BITS_PER_SAMPLE, FLAC__MAX_BITS_PER_SAMPLE); - ok = false; - } - else - undocumented_warning(opt); - } - else if(0 == strcmp(opt, "set-total-samples")) { - op = append_shorthand_operation(options, OP__SET_TOTAL_SAMPLES); - if(!parse_uint64(option_argument, &(op->argument.streaminfo_uint64.value)) || op->argument.streaminfo_uint64.value >= (((FLAC__uint64)1)<<FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN)) { - fprintf(stderr, "ERROR (--%s): value must be a %u-bit unsigned integer\n", opt, FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN); - ok = false; - } - else - undocumented_warning(opt); - } - else if(0 == strcmp(opt, "show-vendor-tag")) { - (void) append_shorthand_operation(options, OP__SHOW_VC_VENDOR); - } - else if(0 == strcmp(opt, "show-tag")) { - const char *violation; - op = append_shorthand_operation(options, OP__SHOW_VC_FIELD); - FLAC__ASSERT(0 != option_argument); - if(!parse_vorbis_comment_field_name(option_argument, &(op->argument.vc_field_name.value), &violation)) { - FLAC__ASSERT(0 != violation); - fprintf(stderr, "ERROR (--%s): malformed vorbis comment field name \"%s\",\n %s\n", opt, option_argument, violation); - ok = false; - } - } - else if(0 == strcmp(opt, "remove-all-tags")) { - (void) append_shorthand_operation(options, OP__REMOVE_VC_ALL); - } - else if(0 == strcmp(opt, "remove-tag")) { - const char *violation; - op = append_shorthand_operation(options, OP__REMOVE_VC_FIELD); - FLAC__ASSERT(0 != option_argument); - if(!parse_vorbis_comment_field_name(option_argument, &(op->argument.vc_field_name.value), &violation)) { - FLAC__ASSERT(0 != violation); - fprintf(stderr, "ERROR (--%s): malformed vorbis comment field name \"%s\",\n %s\n", opt, option_argument, violation); - ok = false; - } - } - else if(0 == strcmp(opt, "remove-first-tag")) { - const char *violation; - op = append_shorthand_operation(options, OP__REMOVE_VC_FIRSTFIELD); - FLAC__ASSERT(0 != option_argument); - if(!parse_vorbis_comment_field_name(option_argument, &(op->argument.vc_field_name.value), &violation)) { - FLAC__ASSERT(0 != violation); - fprintf(stderr, "ERROR (--%s): malformed vorbis comment field name \"%s\",\n %s\n", opt, option_argument, violation); - ok = false; - } - } - else if(0 == strcmp(opt, "set-tag")) { - const char *violation; - op = append_shorthand_operation(options, OP__SET_VC_FIELD); - FLAC__ASSERT(0 != option_argument); - op->argument.vc_field.field_value_from_file = false; - if(!parse_vorbis_comment_field(option_argument, &(op->argument.vc_field.field), &(op->argument.vc_field.field_name), &(op->argument.vc_field.field_value), &(op->argument.vc_field.field_value_length), &violation)) { - FLAC__ASSERT(0 != violation); - fprintf(stderr, "ERROR (--%s): malformed vorbis comment field \"%s\",\n %s\n", opt, option_argument, violation); - ok = false; - } - } - else if(0 == strcmp(opt, "set-tag-from-file")) { - const char *violation; - op = append_shorthand_operation(options, OP__SET_VC_FIELD); - FLAC__ASSERT(0 != option_argument); - op->argument.vc_field.field_value_from_file = true; - if(!parse_vorbis_comment_field(option_argument, &(op->argument.vc_field.field), &(op->argument.vc_field.field_name), &(op->argument.vc_field.field_value), &(op->argument.vc_field.field_value_length), &violation)) { - FLAC__ASSERT(0 != violation); - fprintf(stderr, "ERROR (--%s): malformed vorbis comment field \"%s\",\n %s\n", opt, option_argument, violation); - ok = false; - } - } - else if(0 == strcmp(opt, "import-tags-from")) { - op = append_shorthand_operation(options, OP__IMPORT_VC_FROM); - FLAC__ASSERT(0 != option_argument); - if(!parse_string(option_argument, &(op->argument.filename.value))) { - fprintf(stderr, "ERROR (--%s): missing filename\n", opt); - ok = false; - } - } - else if(0 == strcmp(opt, "export-tags-to")) { - op = append_shorthand_operation(options, OP__EXPORT_VC_TO); - FLAC__ASSERT(0 != option_argument); - if(!parse_string(option_argument, &(op->argument.filename.value))) { - fprintf(stderr, "ERROR (--%s): missing filename\n", opt); - ok = false; - } - } - else if(0 == strcmp(opt, "import-cuesheet-from")) { - if(0 != find_shorthand_operation(options, OP__IMPORT_CUESHEET_FROM)) { - fprintf(stderr, "ERROR (--%s): may be specified only once\n", opt); - ok = false; - } - op = append_shorthand_operation(options, OP__IMPORT_CUESHEET_FROM); - FLAC__ASSERT(0 != option_argument); - if(!parse_string(option_argument, &(op->argument.import_cuesheet_from.filename))) { - fprintf(stderr, "ERROR (--%s): missing filename\n", opt); - ok = false; - } - } - else if(0 == strcmp(opt, "export-cuesheet-to")) { - op = append_shorthand_operation(options, OP__EXPORT_CUESHEET_TO); - FLAC__ASSERT(0 != option_argument); - if(!parse_string(option_argument, &(op->argument.filename.value))) { - fprintf(stderr, "ERROR (--%s): missing filename\n", opt); - ok = false; - } - } - else if(0 == strcmp(opt, "import-picture-from")) { - op = append_shorthand_operation(options, OP__IMPORT_PICTURE_FROM); - FLAC__ASSERT(0 != option_argument); - if(!parse_string(option_argument, &(op->argument.specification.value))) { - fprintf(stderr, "ERROR (--%s): missing specification\n", opt); - ok = false; - } - } - else if(0 == strcmp(opt, "export-picture-to")) { - const Argument *arg = find_argument(options, ARG__BLOCK_NUMBER); - op = append_shorthand_operation(options, OP__EXPORT_PICTURE_TO); - FLAC__ASSERT(0 != option_argument); - if(!parse_string(option_argument, &(op->argument.export_picture_to.filename))) { - fprintf(stderr, "ERROR (--%s): missing filename\n", opt); - ok = false; - } - op->argument.export_picture_to.block_number_link = arg? &(arg->value.block_number) : 0; - } - else if(0 == strcmp(opt, "add-seekpoint")) { - const char *violation; - char *spec; - FLAC__ASSERT(0 != option_argument); - if(!parse_add_seekpoint(option_argument, &spec, &violation)) { - FLAC__ASSERT(0 != violation); - fprintf(stderr, "ERROR (--%s): malformed seekpoint specification \"%s\",\n %s\n", opt, option_argument, violation); - ok = false; - } - else { - op = find_shorthand_operation(options, OP__ADD_SEEKPOINT); - if(0 == op) - op = append_shorthand_operation(options, OP__ADD_SEEKPOINT); - local_strcat(&(op->argument.add_seekpoint.specification), spec); - local_strcat(&(op->argument.add_seekpoint.specification), ";"); - free(spec); - } - } - else if(0 == strcmp(opt, "add-replay-gain")) { - (void) append_shorthand_operation(options, OP__ADD_REPLAY_GAIN); - } - else if(0 == strcmp(opt, "remove-replay-gain")) { - const FLAC__byte * const tags[5] = { - GRABBAG__REPLAYGAIN_TAG_REFERENCE_LOUDNESS, - GRABBAG__REPLAYGAIN_TAG_TITLE_GAIN, - GRABBAG__REPLAYGAIN_TAG_TITLE_PEAK, - GRABBAG__REPLAYGAIN_TAG_ALBUM_GAIN, - GRABBAG__REPLAYGAIN_TAG_ALBUM_PEAK - }; - size_t i; - for(i = 0; i < sizeof(tags)/sizeof(tags[0]); i++) { - op = append_shorthand_operation(options, OP__REMOVE_VC_FIELD); - op->argument.vc_field_name.value = local_strdup((const char *)tags[i]); - } - } - else if(0 == strcmp(opt, "add-padding")) { - op = append_shorthand_operation(options, OP__ADD_PADDING); - FLAC__ASSERT(0 != option_argument); - if(!parse_add_padding(option_argument, &(op->argument.add_padding.length))) { - fprintf(stderr, "ERROR (--%s): illegal length \"%s\", length must be >= 0 and < 2^%u\n", opt, option_argument, FLAC__STREAM_METADATA_LENGTH_LEN); - ok = false; - } - } - else if(0 == strcmp(opt, "help")) { - options->show_long_help = true; - } - else if(0 == strcmp(opt, "version")) { - options->show_version = true; - } - else if(0 == strcmp(opt, "list")) { - (void) append_major_operation(options, OP__LIST); - } - else if(0 == strcmp(opt, "append")) { - (void) append_major_operation(options, OP__APPEND); - } - else if(0 == strcmp(opt, "remove")) { - (void) append_major_operation(options, OP__REMOVE); - } - else if(0 == strcmp(opt, "remove-all")) { - (void) append_major_operation(options, OP__REMOVE_ALL); - } - else if(0 == strcmp(opt, "merge-padding")) { - (void) append_major_operation(options, OP__MERGE_PADDING); - } - else if(0 == strcmp(opt, "sort-padding")) { - (void) append_major_operation(options, OP__SORT_PADDING); - } - else if(0 == strcmp(opt, "block-number")) { - arg = append_argument(options, ARG__BLOCK_NUMBER); - FLAC__ASSERT(0 != option_argument); - if(!parse_block_number(option_argument, &(arg->value.block_number))) { - fprintf(stderr, "ERROR: malformed block number specification \"%s\"\n", option_argument); - ok = false; - } - } - else if(0 == strcmp(opt, "block-type")) { - arg = append_argument(options, ARG__BLOCK_TYPE); - FLAC__ASSERT(0 != option_argument); - if(!parse_block_type(option_argument, &(arg->value.block_type))) { - fprintf(stderr, "ERROR (--%s): malformed block type specification \"%s\"\n", opt, option_argument); - ok = false; - } - options->args.checks.has_block_type = true; - } - else if(0 == strcmp(opt, "except-block-type")) { - arg = append_argument(options, ARG__EXCEPT_BLOCK_TYPE); - FLAC__ASSERT(0 != option_argument); - if(!parse_block_type(option_argument, &(arg->value.block_type))) { - fprintf(stderr, "ERROR (--%s): malformed block type specification \"%s\"\n", opt, option_argument); - ok = false; - } - options->args.checks.has_except_block_type = true; - } - else if(0 == strcmp(opt, "data-format")) { - arg = append_argument(options, ARG__DATA_FORMAT); - FLAC__ASSERT(0 != option_argument); - if(!parse_data_format(option_argument, &(arg->value.data_format))) { - fprintf(stderr, "ERROR (--%s): illegal data format \"%s\"\n", opt, option_argument); - ok = false; - } - } - else if(0 == strcmp(opt, "application-data-format")) { - FLAC__ASSERT(0 != option_argument); - if(!parse_application_data_format(option_argument, &(options->application_data_format_is_hexdump))) { - fprintf(stderr, "ERROR (--%s): illegal application data format \"%s\"\n", opt, option_argument); - ok = false; - } - } - else if(0 == strcmp(opt, "from-file")) { - arg = append_argument(options, ARG__FROM_FILE); - FLAC__ASSERT(0 != option_argument); - arg->value.from_file.file_name = local_strdup(option_argument); - } - else { - FLAC__ASSERT(0); - } - - return ok; -} - -void append_new_operation(CommandLineOptions *options, Operation operation) -{ - if(options->ops.capacity == 0) { - options->ops.capacity = 50; - if(0 == (options->ops.operations = (Operation*)malloc(sizeof(Operation) * options->ops.capacity))) - die("out of memory allocating space for option list"); - memset(options->ops.operations, 0, sizeof(Operation) * options->ops.capacity); - } - if(options->ops.capacity <= options->ops.num_operations) { - unsigned original_capacity = options->ops.capacity; - if(options->ops.capacity > SIZE_MAX / 2) /* overflow check */ - die("out of memory allocating space for option list"); - options->ops.capacity *= 2; - if(0 == (options->ops.operations = (Operation*)safe_realloc_mul_2op_(options->ops.operations, sizeof(Operation), /*times*/options->ops.capacity))) - die("out of memory allocating space for option list"); - memset(options->ops.operations + original_capacity, 0, sizeof(Operation) * (options->ops.capacity - original_capacity)); - } - - options->ops.operations[options->ops.num_operations++] = operation; -} - -void append_new_argument(CommandLineOptions *options, Argument argument) -{ - if(options->args.capacity == 0) { - options->args.capacity = 50; - if(0 == (options->args.arguments = (Argument*)malloc(sizeof(Argument) * options->args.capacity))) - die("out of memory allocating space for option list"); - memset(options->args.arguments, 0, sizeof(Argument) * options->args.capacity); - } - if(options->args.capacity <= options->args.num_arguments) { - unsigned original_capacity = options->args.capacity; - if(options->args.capacity > SIZE_MAX / 2) /* overflow check */ - die("out of memory allocating space for option list"); - options->args.capacity *= 2; - if(0 == (options->args.arguments = (Argument*)safe_realloc_mul_2op_(options->args.arguments, sizeof(Argument), /*times*/options->args.capacity))) - die("out of memory allocating space for option list"); - memset(options->args.arguments + original_capacity, 0, sizeof(Argument) * (options->args.capacity - original_capacity)); - } - - options->args.arguments[options->args.num_arguments++] = argument; -} - -Operation *append_major_operation(CommandLineOptions *options, OperationType type) -{ - Operation op; - memset(&op, 0, sizeof(op)); - op.type = type; - append_new_operation(options, op); - options->args.checks.num_major_ops++; - return options->ops.operations + (options->ops.num_operations - 1); -} - -Operation *append_shorthand_operation(CommandLineOptions *options, OperationType type) -{ - Operation op; - memset(&op, 0, sizeof(op)); - op.type = type; - append_new_operation(options, op); - options->args.checks.num_shorthand_ops++; - return options->ops.operations + (options->ops.num_operations - 1); -} - -Argument *find_argument(CommandLineOptions *options, ArgumentType type) -{ - unsigned i; - for(i = 0; i < options->args.num_arguments; i++) - if(options->args.arguments[i].type == type) - return &options->args.arguments[i]; - return 0; -} - -Operation *find_shorthand_operation(CommandLineOptions *options, OperationType type) -{ - unsigned i; - for(i = 0; i < options->ops.num_operations; i++) - if(options->ops.operations[i].type == type) - return &options->ops.operations[i]; - return 0; -} - -Argument *append_argument(CommandLineOptions *options, ArgumentType type) -{ - Argument arg; - memset(&arg, 0, sizeof(arg)); - arg.type = type; - append_new_argument(options, arg); - return options->args.arguments + (options->args.num_arguments - 1); -} - -FLAC__bool parse_md5(const char *src, FLAC__byte dest[16]) -{ - unsigned i, d; - int c; - FLAC__ASSERT(0 != src); - if(strlen(src) != 32) - return false; - /* strtoul() accepts negative numbers which we do not want, so we do it the hard way */ - for(i = 0; i < 16; i++) { - c = (int)(*src++); - if(isdigit(c)) - d = (unsigned)(c - '0'); - else if(c >= 'a' && c <= 'f') - d = (unsigned)(c - 'a') + 10u; - else if(c >= 'A' && c <= 'F') - d = (unsigned)(c - 'A') + 10u; - else - return false; - d <<= 4; - c = (int)(*src++); - if(isdigit(c)) - d |= (unsigned)(c - '0'); - else if(c >= 'a' && c <= 'f') - d |= (unsigned)(c - 'a') + 10u; - else if(c >= 'A' && c <= 'F') - d |= (unsigned)(c - 'A') + 10u; - else - return false; - dest[i] = (FLAC__byte)d; - } - return true; -} - -FLAC__bool parse_uint32(const char *src, FLAC__uint32 *dest) -{ - FLAC__ASSERT(0 != src); - if(strlen(src) == 0 || strspn(src, "0123456789") != strlen(src)) - return false; - *dest = strtoul(src, 0, 10); - return true; -} - -#ifdef _MSC_VER -/* There's no strtoull() in MSVC6 so we just write a specialized one */ -static FLAC__uint64 local__strtoull(const char *src) -{ - FLAC__uint64 ret = 0; - int c; - FLAC__ASSERT(0 != src); - while(0 != (c = *src++)) { - c -= '0'; - if(c >= 0 && c <= 9) - ret = (ret * 10) + c; - else - break; - } - return ret; -} -#endif - -FLAC__bool parse_uint64(const char *src, FLAC__uint64 *dest) -{ - FLAC__ASSERT(0 != src); - if(strlen(src) == 0 || strspn(src, "0123456789") != strlen(src)) - return false; -#ifdef _MSC_VER - *dest = local__strtoull(src); -#else - *dest = strtoull(src, 0, 10); -#endif - return true; -} - -FLAC__bool parse_string(const char *src, char **dest) -{ - if(0 == src || strlen(src) == 0) - return false; - *dest = strdup(src); - return true; -} - -FLAC__bool parse_vorbis_comment_field_name(const char *field_ref, char **name, const char **violation) -{ - static const char * const violations[] = { - "field name contains invalid character" - }; - - char *q, *s; - - s = local_strdup(field_ref); - - for(q = s; *q; q++) { - if(*q < 0x20 || *q > 0x7d || *q == 0x3d) { - free(s); - *violation = violations[0]; - return false; - } - } - - *name = s; - - return true; -} - -FLAC__bool parse_add_seekpoint(const char *in, char **out, const char **violation) -{ - static const char *garbled_ = "garbled specification"; - const unsigned n = strlen(in); - - FLAC__ASSERT(0 != in); - FLAC__ASSERT(0 != out); - - if(n == 0) { - *violation = "specification is empty"; - return false; - } - - if(n > strspn(in, "0123456789.Xsx")) { - *violation = "specification contains invalid character"; - return false; - } - - if(in[n-1] == 'X') { - if(n > 1) { - *violation = garbled_; - return false; - } - } - else if(in[n-1] == 's') { - if(n-1 > strspn(in, "0123456789.")) { - *violation = garbled_; - return false; - } - } - else if(in[n-1] == 'x') { - if(n-1 > strspn(in, "0123456789")) { - *violation = garbled_; - return false; - } - } - else { - if(n > strspn(in, "0123456789")) { - *violation = garbled_; - return false; - } - } - - *out = local_strdup(in); - return true; -} - -FLAC__bool parse_add_padding(const char *in, unsigned *out) -{ - FLAC__ASSERT(0 != in); - FLAC__ASSERT(0 != out); - *out = (unsigned)strtoul(in, 0, 10); - return *out < (1u << FLAC__STREAM_METADATA_LENGTH_LEN); -} - -FLAC__bool parse_block_number(const char *in, Argument_BlockNumber *out) -{ - char *p, *q, *s, *end; - long i; - unsigned entry; - - if(*in == '\0') - return false; - - s = local_strdup(in); - - /* first count the entries */ - for(out->num_entries = 1, p = strchr(s, ','); p; out->num_entries++, p = strchr(++p, ',')) - ; - - /* make space */ - FLAC__ASSERT(out->num_entries > 0); - if(0 == (out->entries = (unsigned*)safe_malloc_mul_2op_(sizeof(unsigned), /*times*/out->num_entries))) - die("out of memory allocating space for option list"); - - /* load 'em up */ - entry = 0; - q = s; - while(q) { - FLAC__ASSERT(entry < out->num_entries); - if(0 != (p = strchr(q, ','))) - *p++ = '\0'; - if(!isdigit((int)(*q)) || (i = strtol(q, &end, 10)) < 0 || *end) { - free(s); - return false; - } - out->entries[entry++] = (unsigned)i; - q = p; - } - FLAC__ASSERT(entry == out->num_entries); - - free(s); - return true; -} - -FLAC__bool parse_block_type(const char *in, Argument_BlockType *out) -{ - char *p, *q, *r, *s; - unsigned entry; - - if(*in == '\0') - return false; - - s = local_strdup(in); - - /* first count the entries */ - for(out->num_entries = 1, p = strchr(s, ','); p; out->num_entries++, p = strchr(++p, ',')) - ; - - /* make space */ - FLAC__ASSERT(out->num_entries > 0); - if(0 == (out->entries = (Argument_BlockTypeEntry*)safe_malloc_mul_2op_(sizeof(Argument_BlockTypeEntry), /*times*/out->num_entries))) - die("out of memory allocating space for option list"); - - /* load 'em up */ - entry = 0; - q = s; - while(q) { - FLAC__ASSERT(entry < out->num_entries); - if(0 != (p = strchr(q, ','))) - *p++ = 0; - r = strchr(q, ':'); - if(r) - *r++ = '\0'; - if(0 != r && 0 != strcmp(q, "APPLICATION")) { - free(s); - return false; - } - if(0 == strcmp(q, "STREAMINFO")) { - out->entries[entry++].type = FLAC__METADATA_TYPE_STREAMINFO; - } - else if(0 == strcmp(q, "PADDING")) { - out->entries[entry++].type = FLAC__METADATA_TYPE_PADDING; - } - else if(0 == strcmp(q, "APPLICATION")) { - out->entries[entry].type = FLAC__METADATA_TYPE_APPLICATION; - out->entries[entry].filter_application_by_id = (0 != r); - if(0 != r) { - if(strlen(r) == 4) { - strcpy(out->entries[entry].application_id, r); - } - else if(strlen(r) == 10 && strncmp(r, "0x", 2) == 0 && strspn(r+2, "0123456789ABCDEFabcdef") == 8) { - FLAC__uint32 x = strtoul(r+2, 0, 16); - out->entries[entry].application_id[3] = (FLAC__byte)(x & 0xff); - out->entries[entry].application_id[2] = (FLAC__byte)((x>>=8) & 0xff); - out->entries[entry].application_id[1] = (FLAC__byte)((x>>=8) & 0xff); - out->entries[entry].application_id[0] = (FLAC__byte)((x>>=8) & 0xff); - } - else { - free(s); - return false; - } - } - entry++; - } - else if(0 == strcmp(q, "SEEKTABLE")) { - out->entries[entry++].type = FLAC__METADATA_TYPE_SEEKTABLE; - } - else if(0 == strcmp(q, "VORBIS_COMMENT")) { - out->entries[entry++].type = FLAC__METADATA_TYPE_VORBIS_COMMENT; - } - else if(0 == strcmp(q, "CUESHEET")) { - out->entries[entry++].type = FLAC__METADATA_TYPE_CUESHEET; - } - else if(0 == strcmp(q, "PICTURE")) { - out->entries[entry++].type = FLAC__METADATA_TYPE_PICTURE; - } - else { - free(s); - return false; - } - q = p; - } - FLAC__ASSERT(entry == out->num_entries); - - free(s); - return true; -} - -FLAC__bool parse_data_format(const char *in, Argument_DataFormat *out) -{ - if(0 == strcmp(in, "binary")) - out->is_binary = true; - else if(0 == strcmp(in, "text")) - out->is_binary = false; - else - return false; - return true; -} - -FLAC__bool parse_application_data_format(const char *in, FLAC__bool *out) -{ - if(0 == strcmp(in, "hexdump")) - *out = true; - else if(0 == strcmp(in, "text")) - *out = false; - else - return false; - return true; -} - -void undocumented_warning(const char *opt) -{ - fprintf(stderr, "WARNING: undocmented option --%s should be used with caution,\n only for repairing a damaged STREAMINFO block\n", opt); -} diff --git a/3rdparty/libflac/src/metaflac/options.h b/3rdparty/libflac/src/metaflac/options.h deleted file mode 100644 index 244a8d01f7b..00000000000 --- a/3rdparty/libflac/src/metaflac/options.h +++ /dev/null @@ -1,215 +0,0 @@ -/* metaflac - Command-line FLAC metadata editor - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef metaflac__options_h -#define metaflac__options_h - -#include "FLAC/format.h" - -#if 0 -/*[JEC] was:#if HAVE_GETOPT_LONG*/ -/*[JEC] see flac/include/share/getopt.h as to why the change */ -# include <getopt.h> -#else -# include "share/getopt.h" -#endif - -extern struct share__option long_options_[]; - -typedef enum { - OP__SHOW_MD5SUM, - OP__SHOW_MIN_BLOCKSIZE, - OP__SHOW_MAX_BLOCKSIZE, - OP__SHOW_MIN_FRAMESIZE, - OP__SHOW_MAX_FRAMESIZE, - OP__SHOW_SAMPLE_RATE, - OP__SHOW_CHANNELS, - OP__SHOW_BPS, - OP__SHOW_TOTAL_SAMPLES, - OP__SET_MD5SUM, - OP__SET_MIN_BLOCKSIZE, - OP__SET_MAX_BLOCKSIZE, - OP__SET_MIN_FRAMESIZE, - OP__SET_MAX_FRAMESIZE, - OP__SET_SAMPLE_RATE, - OP__SET_CHANNELS, - OP__SET_BPS, - OP__SET_TOTAL_SAMPLES, - OP__SHOW_VC_VENDOR, - OP__SHOW_VC_FIELD, - OP__REMOVE_VC_ALL, - OP__REMOVE_VC_FIELD, - OP__REMOVE_VC_FIRSTFIELD, - OP__SET_VC_FIELD, - OP__IMPORT_VC_FROM, - OP__EXPORT_VC_TO, - OP__IMPORT_CUESHEET_FROM, - OP__EXPORT_CUESHEET_TO, - OP__IMPORT_PICTURE_FROM, - OP__EXPORT_PICTURE_TO, - OP__ADD_SEEKPOINT, - OP__ADD_REPLAY_GAIN, - OP__ADD_PADDING, - OP__LIST, - OP__APPEND, - OP__REMOVE, - OP__REMOVE_ALL, - OP__MERGE_PADDING, - OP__SORT_PADDING -} OperationType; - -typedef enum { - ARG__BLOCK_NUMBER, - ARG__BLOCK_TYPE, - ARG__EXCEPT_BLOCK_TYPE, - ARG__DATA_FORMAT, - ARG__FROM_FILE -} ArgumentType; - -typedef struct { - FLAC__byte value[16]; -} Argument_StreaminfoMD5; - -typedef struct { - FLAC__uint32 value; -} Argument_StreaminfoUInt32; - -typedef struct { - FLAC__uint64 value; -} Argument_StreaminfoUInt64; - -typedef struct { - char *value; -} Argument_VcFieldName; - -typedef struct { - char *field; /* the whole field as passed on the command line, i.e. "NAME=VALUE" */ - char *field_name; - /* according to the vorbis spec, field values can contain \0 so simple C strings are not enough here */ - unsigned field_value_length; - char *field_value; - FLAC__bool field_value_from_file; /* true if field_value holds a filename for the value, false for plain value */ -} Argument_VcField; - -typedef struct { - char *value; -} Argument_String; - -typedef struct { - unsigned num_entries; - unsigned *entries; -} Argument_BlockNumber; - -typedef struct { - FLAC__MetadataType type; - char application_id[4]; /* only relevant if type == FLAC__STREAM_METADATA_TYPE_APPLICATION */ - FLAC__bool filter_application_by_id; -} Argument_BlockTypeEntry; - -typedef struct { - unsigned num_entries; - Argument_BlockTypeEntry *entries; -} Argument_BlockType; - -typedef struct { - FLAC__bool is_binary; -} Argument_DataFormat; - -typedef struct { - char *file_name; -} Argument_FromFile; - -typedef struct { - char *specification; -} Argument_AddSeekpoint; - -typedef struct { - char *filename; - Argument_AddSeekpoint *add_seekpoint_link; -} Argument_ImportCuesheetFrom; - -typedef struct { - char *filename; - const Argument_BlockNumber *block_number_link; /* may be NULL to mean 'first PICTURE block' */ -} Argument_ExportPictureTo; - -typedef struct { - unsigned length; -} Argument_AddPadding; - -typedef struct { - OperationType type; - union { - Argument_StreaminfoMD5 streaminfo_md5; - Argument_StreaminfoUInt32 streaminfo_uint32; - Argument_StreaminfoUInt64 streaminfo_uint64; - Argument_VcFieldName vc_field_name; - Argument_VcField vc_field; - Argument_String filename; - Argument_String specification; - Argument_ImportCuesheetFrom import_cuesheet_from; - Argument_ExportPictureTo export_picture_to; - Argument_AddSeekpoint add_seekpoint; - Argument_AddPadding add_padding; - } argument; -} Operation; - -typedef struct { - ArgumentType type; - union { - Argument_BlockNumber block_number; - Argument_BlockType block_type; - Argument_DataFormat data_format; - Argument_FromFile from_file; - } value; -} Argument; - -typedef struct { - FLAC__bool preserve_modtime; - FLAC__bool prefix_with_filename; - FLAC__bool utf8_convert; - FLAC__bool use_padding; - FLAC__bool cued_seekpoints; - FLAC__bool show_long_help; - FLAC__bool show_version; - FLAC__bool application_data_format_is_hexdump; - struct { - Operation *operations; - unsigned num_operations; - unsigned capacity; - } ops; - struct { - struct { - unsigned num_shorthand_ops; - unsigned num_major_ops; - FLAC__bool has_block_type; - FLAC__bool has_except_block_type; - } checks; - Argument *arguments; - unsigned num_arguments; - unsigned capacity; - } args; - unsigned num_files; - char **filenames; -} CommandLineOptions; - -void init_options(CommandLineOptions *options); -FLAC__bool parse_options(int argc, char *argv[], CommandLineOptions *options); -void free_options(CommandLineOptions *options); - -#endif diff --git a/3rdparty/libflac/src/metaflac/usage.c b/3rdparty/libflac/src/metaflac/usage.c deleted file mode 100644 index 02cfaf23e35..00000000000 --- a/3rdparty/libflac/src/metaflac/usage.c +++ /dev/null @@ -1,325 +0,0 @@ -/* metaflac - Command-line FLAC metadata editor - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "usage.h" -#include "FLAC/format.h" -#include <stdarg.h> -#include <stdio.h> - -static void usage_header(FILE *out) -{ - fprintf(out, "==============================================================================\n"); - fprintf(out, "metaflac - Command-line FLAC metadata editor version %s\n", FLAC__VERSION_STRING); - fprintf(out, "Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson\n"); - fprintf(out, "\n"); - fprintf(out, "This program is free software; you can redistribute it and/or\n"); - fprintf(out, "modify it under the terms of the GNU General Public License\n"); - fprintf(out, "as published by the Free Software Foundation; either version 2\n"); - fprintf(out, "of the License, or (at your option) any later version.\n"); - fprintf(out, "\n"); - fprintf(out, "This program is distributed in the hope that it will be useful,\n"); - fprintf(out, "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"); - fprintf(out, "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"); - fprintf(out, "GNU General Public License for more details.\n"); - fprintf(out, "\n"); - fprintf(out, "You should have received a copy of the GNU General Public License\n"); - fprintf(out, "along with this program; if not, write to the Free Software\n"); - fprintf(out, "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"); - fprintf(out, "==============================================================================\n"); -} - -static void usage_summary(FILE *out) -{ - fprintf(out, "Usage:\n"); - fprintf(out, " metaflac [options] [operations] FLACfile [FLACfile ...]\n"); - fprintf(out, "\n"); - fprintf(out, "Use metaflac to list, add, remove, or edit metadata in one or more FLAC files.\n"); - fprintf(out, "You may perform one major operation, or many shorthand operations at a time.\n"); - fprintf(out, "\n"); - fprintf(out, "Options:\n"); - fprintf(out, "--preserve-modtime Preserve the original modification time in spite of edits\n"); - fprintf(out, "--with-filename Prefix each output line with the FLAC file name\n"); - fprintf(out, " (the default if more than one FLAC file is specified)\n"); - fprintf(out, "--no-filename Do not prefix each output line with the FLAC file name\n"); - fprintf(out, " (the default if only one FLAC file is specified)\n"); - fprintf(out, "--no-utf8-convert Do not convert tags from UTF-8 to local charset,\n"); - fprintf(out, " or vice versa. This is useful for scripts, and setting\n"); - fprintf(out, " tags in situations where the locale is wrong.\n"); - fprintf(out, "--dont-use-padding By default metaflac tries to use padding where possible\n"); - fprintf(out, " to avoid rewriting the entire file if the metadata size\n"); - fprintf(out, " changes. Use this option to tell metaflac to not take\n"); - fprintf(out, " advantage of padding this way.\n"); -} - -int short_usage(const char *message, ...) -{ - va_list args; - - if(message) { - va_start(args, message); - - (void) vfprintf(stderr, message, args); - - va_end(args); - - } - usage_header(stderr); - fprintf(stderr, "\n"); - fprintf(stderr, "This is the short help; for full help use 'metaflac --help'\n"); - fprintf(stderr, "\n"); - usage_summary(stderr); - - return message? 1 : 0; -} - -int long_usage(const char *message, ...) -{ - FILE *out = (message? stderr : stdout); - va_list args; - - if(message) { - va_start(args, message); - - (void) vfprintf(stderr, message, args); - - va_end(args); - - } - usage_header(out); - fprintf(out, "\n"); - usage_summary(out); - fprintf(out, "\n"); - fprintf(out, "Shorthand operations:\n"); - fprintf(out, "--show-md5sum Show the MD5 signature from the STREAMINFO block.\n"); - fprintf(out, "--show-min-blocksize Show the minimum block size from the STREAMINFO block.\n"); - fprintf(out, "--show-max-blocksize Show the maximum block size from the STREAMINFO block.\n"); - fprintf(out, "--show-min-framesize Show the minimum frame size from the STREAMINFO block.\n"); - fprintf(out, "--show-max-framesize Show the maximum frame size from the STREAMINFO block.\n"); - fprintf(out, "--show-sample-rate Show the sample rate from the STREAMINFO block.\n"); - fprintf(out, "--show-channels Show the number of channels from the STREAMINFO block.\n"); - fprintf(out, "--show-bps Show the # of bits per sample from the STREAMINFO block.\n"); - fprintf(out, "--show-total-samples Show the total # of samples from the STREAMINFO block.\n"); - fprintf(out, "\n"); - fprintf(out, "--show-vendor-tag Show the vendor string from the VORBIS_COMMENT block.\n"); - fprintf(out, "--show-tag=NAME Show all tags where the the field name matches 'NAME'.\n"); - fprintf(out, "--remove-tag=NAME Remove all tags whose field name is 'NAME'.\n"); - fprintf(out, "--remove-first-tag=NAME Remove first tag whose field name is 'NAME'.\n"); - fprintf(out, "--remove-all-tags Remove all tags, leaving only the vendor string.\n"); - fprintf(out, "--set-tag=FIELD Add a tag. The FIELD must comply with the Vorbis comment\n"); - fprintf(out, " spec, of the form \"NAME=VALUE\". If there is currently\n"); - fprintf(out, " no tag block, one will be created.\n"); - fprintf(out, "--set-tag-from-file=FIELD Like --set-tag, except the VALUE is a filename\n"); - fprintf(out, " whose contents will be read verbatim to set the tag value.\n"); - fprintf(out, " Unless --no-utf8-convert is specified, the contents will\n"); - fprintf(out, " be converted to UTF-8 from the local charset. This can\n"); - fprintf(out, " be used to store a cuesheet in a tag (e.g.\n"); - fprintf(out, " --set-tag-from-file=\"CUESHEET=image.cue\"). Do not try\n"); - fprintf(out, " to store binary data in tag fields! Use APPLICATION\n"); - fprintf(out, " blocks for that.\n"); - fprintf(out, "--import-tags-from=FILE Import tags from a file. Use '-' for stdin. Each line\n"); - fprintf(out, " should be of the form NAME=VALUE. Multi-line comments\n"); - fprintf(out, " are currently not supported. Specify --remove-all-tags\n"); - fprintf(out, " and/or --no-utf8-convert before --import-tags-from if\n"); - fprintf(out, " necessary. If FILE is '-' (stdin), only one FLAC file\n"); - fprintf(out, " may be specified.\n"); - fprintf(out, "--export-tags-to=FILE Export tags to a file. Use '-' for stdout. Each line\n"); - fprintf(out, " will be of the form NAME=VALUE. Specify\n"); - fprintf(out, " --no-utf8-convert if necessary.\n"); - fprintf(out, "--import-cuesheet-from=FILE Import a cuesheet from a file. Use '-' for stdin.\n"); - fprintf(out, " Only one FLAC file may be specified. A seekpoint will be\n"); - fprintf(out, " added for each index point in the cuesheet to the\n"); - fprintf(out, " SEEKTABLE unless --no-cued-seekpoints is specified.\n"); - fprintf(out, "--export-cuesheet-to=FILE Export CUESHEET block to a cuesheet file, suitable\n"); - fprintf(out, " for use by CD authoring software. Use '-' for stdout.\n"); - fprintf(out, " Only one FLAC file may be specified on the command line.\n"); - fprintf(out, "--import-picture-from=FILENAME|SPECIFICATION Import a picture and store it in a\n"); - fprintf(out, " PICTURE block. Either a filename for the picture file or\n"); - fprintf(out, " a more complete specification form can be used. The\n"); - fprintf(out, " SPECIFICATION is a string whose parts are separated by |\n"); - fprintf(out, " characters. Some parts may be left empty to invoke\n"); - fprintf(out, " default values. FILENAME is just shorthand for\n"); - fprintf(out, " \"||||FILENAME\". The format of SPECIFICATION is:\n"); - fprintf(out, " [TYPE]|[MIME-TYPE]|[DESCRIPTION]|[WIDTHxHEIGHTxDEPTH[/COLORS]]|FILE\n"); - fprintf(out, " TYPE is optional; it is a number from one of:\n"); - fprintf(out, " 0: Other\n"); - fprintf(out, " 1: 32x32 pixels 'file icon' (PNG only)\n"); - fprintf(out, " 2: Other file icon\n"); - fprintf(out, " 3: Cover (front)\n"); - fprintf(out, " 4: Cover (back)\n"); - fprintf(out, " 5: Leaflet page\n"); - fprintf(out, " 6: Media (e.g. label side of CD)\n"); - fprintf(out, " 7: Lead artist/lead performer/soloist\n"); - fprintf(out, " 8: Artist/performer\n"); - fprintf(out, " 9: Conductor\n"); - fprintf(out, " 10: Band/Orchestra\n"); - fprintf(out, " 11: Composer\n"); - fprintf(out, " 12: Lyricist/text writer\n"); - fprintf(out, " 13: Recording Location\n"); - fprintf(out, " 14: During recording\n"); - fprintf(out, " 15: During performance\n"); - fprintf(out, " 16: Movie/video screen capture\n"); - fprintf(out, " 17: A bright coloured fish\n"); - fprintf(out, " 18: Illustration\n"); - fprintf(out, " 19: Band/artist logotype\n"); - fprintf(out, " 20: Publisher/Studio logotype\n"); - fprintf(out, " The default is 3 (front cover). There may only be one picture each\n"); - fprintf(out, " of type 1 and 2 in a file.\n"); - fprintf(out, " MIME-TYPE is optional; if left blank, it will be detected from the\n"); - fprintf(out, " file. For best compatibility with players, use pictures with MIME\n"); - fprintf(out, " type image/jpeg or image/png. The MIME type can also be --> to\n"); - fprintf(out, " mean that FILE is actually a URL to an image, though this use is\n"); - fprintf(out, " discouraged.\n"); - fprintf(out, " DESCRIPTION is optional; the default is an empty string\n"); - fprintf(out, " The next part specfies the resolution and color information. If\n"); - fprintf(out, " the MIME-TYPE is image/jpeg, image/png, or image/gif, you can\n"); - fprintf(out, " usually leave this empty and they can be detected from the file.\n"); - fprintf(out, " Otherwise, you must specify the width in pixels, height in pixels,\n"); - fprintf(out, " and color depth in bits-per-pixel. If the image has indexed colors\n"); - fprintf(out, " you should also specify the number of colors used.\n"); - fprintf(out, " FILE is the path to the picture file to be imported, or the URL if\n"); - fprintf(out, " MIME type is -->\n"); - fprintf(out, "--export-picture-to=FILE Export PICTURE block to a file. Use '-' for stdout.\n"); - fprintf(out, " Only one FLAC file may be specified. The first PICTURE\n"); - fprintf(out, " block will be exported unless --export-picture-to is\n"); - fprintf(out, " preceded by a --block-number=# option to specify the exact\n"); - fprintf(out, " metadata block to extract. Note that the block number is\n"); - fprintf(out, " the one shown by --list.\n"); - fprintf(out, "--add-replay-gain Calculates the title and album gains/peaks of the given\n"); - fprintf(out, " FLAC files as if all the files were part of one album,\n"); - fprintf(out, " then stores them in the VORBIS_COMMENT block. The tags\n"); - fprintf(out, " are the same as those used by vorbisgain. Existing\n"); - fprintf(out, " ReplayGain tags will be replaced. If only one FLAC file\n"); - fprintf(out, " is given, the album and title gains will be the same.\n"); - fprintf(out, " Since this operation requires two passes, it is always\n"); - fprintf(out, " executed last, after all other operations have been\n"); - fprintf(out, " completed and written to disk. All FLAC files specified\n"); - fprintf(out, " must have the same resolution, sample rate, and number\n"); - fprintf(out, " of channels. The sample rate must be one of 8, 11.025,\n"); - fprintf(out, " 12, 16, 22.05, 24, 32, 44.1, or 48 kHz.\n"); - fprintf(out, "--remove-replay-gain Removes the ReplayGain tags.\n"); - fprintf(out, "--add-seekpoint={#|X|#x|#s} Add seek points to a SEEKTABLE block\n"); - fprintf(out, " # : a specific sample number for a seek point\n"); - fprintf(out, " X : a placeholder point (always goes at the end of the SEEKTABLE)\n"); - fprintf(out, " #x : # evenly spaced seekpoints, the first being at sample 0\n"); - fprintf(out, " #s : a seekpoint every # seconds; # does not have to be a whole number\n"); - fprintf(out, " If no SEEKTABLE block exists, one will be created. If\n"); - fprintf(out, " one already exists, points will be added to the existing\n"); - fprintf(out, " table, and any duplicates will be turned into placeholder\n"); - fprintf(out, " points. You may use many --add-seekpoint options; the\n"); - fprintf(out, " resulting SEEKTABLE will be the unique-ified union of\n"); - fprintf(out, " all such values. Example: --add-seekpoint=100x\n"); - fprintf(out, " --add-seekpoint=3.5s will add 100 evenly spaced\n"); - fprintf(out, " seekpoints and a seekpoint every 3.5 seconds.\n"); - fprintf(out, "--add-padding=length Add a padding block of the given length (in bytes).\n"); - fprintf(out, " The overall length of the new block will be 4 + length;\n"); - fprintf(out, " the extra 4 bytes is for the metadata block header.\n"); - fprintf(out, "\n"); - fprintf(out, "Major operations:\n"); - fprintf(out, "--version\n"); - fprintf(out, " Show the metaflac version number.\n"); - fprintf(out, "--list\n"); - fprintf(out, " List the contents of one or more metadata blocks to stdout. By default,\n"); - fprintf(out, " all metadata blocks are listed in text format. Use the following options\n"); - fprintf(out, " to change this behavior:\n"); - fprintf(out, "\n"); - fprintf(out, " --block-number=#[,#[...]]\n"); - fprintf(out, " An optional comma-separated list of block numbers to display. The first\n"); - fprintf(out, " block, the STREAMINFO block, is block 0.\n"); - fprintf(out, "\n"); - fprintf(out, " --block-type=type[,type[...]]\n"); - fprintf(out, " --except-block-type=type[,type[...]]\n"); - fprintf(out, " An optional comma-separated list of block types to be included or ignored\n"); - fprintf(out, " with this option. Use only one of --block-type or --except-block-type.\n"); - fprintf(out, " The valid block types are: STREAMINFO, PADDING, APPLICATION, SEEKTABLE,\n"); - fprintf(out, " VORBIS_COMMENT. You may narrow down the types of APPLICATION blocks\n"); - fprintf(out, " displayed as follows:\n"); - fprintf(out, " APPLICATION:abcd The APPLICATION block(s) whose textual repre-\n"); - fprintf(out, " sentation of the 4-byte ID is \"abcd\"\n"); - fprintf(out, " APPLICATION:0xXXXXXXXX The APPLICATION block(s) whose hexadecimal big-\n"); - fprintf(out, " endian representation of the 4-byte ID is\n"); - fprintf(out, " \"0xXXXXXXXX\". For the example \"abcd\" above the\n"); - fprintf(out, " hexadecimal equivalalent is 0x61626364\n"); - fprintf(out, "\n"); - fprintf(out, " NOTE: if both --block-number and --[except-]block-type are specified,\n"); - fprintf(out, " the result is the logical AND of both arguments.\n"); - fprintf(out, "\n"); -#if 0 - /*@@@ not implemented yet */ - fprintf(out, " --data-format=binary|text\n"); - fprintf(out, " By default a human-readable text representation of the data is displayed.\n"); - fprintf(out, " You may specify --data-format=binary to dump the raw binary form of each\n"); - fprintf(out, " metadata block. The output can be read in using a subsequent call to\n"); - fprintf(out, " "metaflac --append --from-file=..."\n"); - fprintf(out, "\n"); -#endif - fprintf(out, " --application-data-format=hexdump|text\n"); - fprintf(out, " If the application block you are displaying contains binary data but your\n"); - fprintf(out, " --data-format=text, you can display a hex dump of the application data\n"); - fprintf(out, " contents instead using --application-data-format=hexdump\n"); - fprintf(out, "\n"); -#if 0 - /*@@@ not implemented yet */ - fprintf(out, "--append\n"); - fprintf(out, " Insert a metadata block from a file. The input file must be in the same\n"); - fprintf(out, " format as generated with --list.\n"); - fprintf(out, "\n"); - fprintf(out, " --block-number=#\n"); - fprintf(out, " Specify the insertion point (defaults to last block). The new block will\n"); - fprintf(out, " be added after the given block number. This prevents the illegal insertion\n"); - fprintf(out, " of a block before the first STREAMINFO block. You may not --append another\n"); - fprintf(out, " STREAMINFO block.\n"); - fprintf(out, "\n"); - fprintf(out, " --from-file=filename\n"); - fprintf(out, " Mandatory 'option' to specify the input file containing the block contents.\n"); - fprintf(out, "\n"); - fprintf(out, " --data-format=binary|text\n"); - fprintf(out, " By default the block contents are assumed to be in binary format. You can\n"); - fprintf(out, " override this by specifying --data-format=text\n"); - fprintf(out, "\n"); -#endif - fprintf(out, "--remove\n"); - fprintf(out, " Remove one or more metadata blocks from the metadata. Unless\n"); - fprintf(out, " --dont-use-padding is specified, the blocks will be replaced with padding.\n"); - fprintf(out, " You may not remove the STREAMINFO block.\n"); - fprintf(out, "\n"); - fprintf(out, " --block-number=#[,#[...]]\n"); - fprintf(out, " --block-type=type[,type[...]]\n"); - fprintf(out, " --except-block-type=type[,type[...]]\n"); - fprintf(out, " See --list above for usage.\n"); - fprintf(out, "\n"); - fprintf(out, " NOTE: if both --block-number and --[except-]block-type are specified,\n"); - fprintf(out, " the result is the logical AND of both arguments.\n"); - fprintf(out, "\n"); - fprintf(out, "--remove-all\n"); - fprintf(out, " Remove all metadata blocks (except the STREAMINFO block) from the\n"); - fprintf(out, " metadata. Unless --dont-use-padding is specified, the blocks will be\n"); - fprintf(out, " replaced with padding.\n"); - fprintf(out, "\n"); - fprintf(out, "--merge-padding\n"); - fprintf(out, " Merge adjacent PADDING blocks into single blocks.\n"); - fprintf(out, "\n"); - fprintf(out, "--sort-padding\n"); - fprintf(out, " Move all PADDING blocks to the end of the metadata and merge them into a\n"); - fprintf(out, " single block.\n"); - - return message? 1 : 0; -} diff --git a/3rdparty/libflac/src/metaflac/usage.h b/3rdparty/libflac/src/metaflac/usage.h deleted file mode 100644 index 8ad091c7120..00000000000 --- a/3rdparty/libflac/src/metaflac/usage.h +++ /dev/null @@ -1,25 +0,0 @@ -/* metaflac - Command-line FLAC metadata editor - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef metaflac__usage_h -#define metaflac__usage_h - -int short_usage(const char *message, ...); -int long_usage(const char *message, ...); - -#endif diff --git a/3rdparty/libflac/src/metaflac/utils.c b/3rdparty/libflac/src/metaflac/utils.c deleted file mode 100644 index cdd823c2074..00000000000 --- a/3rdparty/libflac/src/metaflac/utils.c +++ /dev/null @@ -1,258 +0,0 @@ -/* metaflac - Command-line FLAC metadata editor - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "utils.h" -#include "FLAC/assert.h" -#include "share/alloc.h" -#include "share/utf8.h" -#include <ctype.h> -#include <stdarg.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -void die(const char *message) -{ - FLAC__ASSERT(0 != message); - fprintf(stderr, "ERROR: %s\n", message); - exit(1); -} - -#ifdef FLAC__VALGRIND_TESTING -size_t local_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) -{ - size_t ret = fwrite(ptr, size, nmemb, stream); - if(!ferror(stream)) - fflush(stream); - return ret; -} -#endif - -char *local_strdup(const char *source) -{ - char *ret; - FLAC__ASSERT(0 != source); - if(0 == (ret = strdup(source))) - die("out of memory during strdup()"); - return ret; -} - -void local_strcat(char **dest, const char *source) -{ - size_t ndest, nsource; - - FLAC__ASSERT(0 != dest); - FLAC__ASSERT(0 != source); - - ndest = *dest? strlen(*dest) : 0; - nsource = strlen(source); - - if(nsource == 0) - return; - - *dest = (char*)safe_realloc_add_3op_(*dest, ndest, /*+*/nsource, /*+*/1); - if(0 == *dest) - die("out of memory growing string"); - strcpy((*dest)+ndest, source); -} - -void hexdump(const char *filename, const FLAC__byte *buf, unsigned bytes, const char *indent) -{ - unsigned i, left = bytes; - const FLAC__byte *b = buf; - - for(i = 0; i < bytes; i += 16) { - printf("%s%s%s%08X: " - "%02X %02X %02X %02X %02X %02X %02X %02X " - "%02X %02X %02X %02X %02X %02X %02X %02X " - "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c\n", - filename? filename:"", filename? ":":"", - indent, i, - left > 0? (unsigned char)b[ 0] : 0, - left > 1? (unsigned char)b[ 1] : 0, - left > 2? (unsigned char)b[ 2] : 0, - left > 3? (unsigned char)b[ 3] : 0, - left > 4? (unsigned char)b[ 4] : 0, - left > 5? (unsigned char)b[ 5] : 0, - left > 6? (unsigned char)b[ 6] : 0, - left > 7? (unsigned char)b[ 7] : 0, - left > 8? (unsigned char)b[ 8] : 0, - left > 9? (unsigned char)b[ 9] : 0, - left > 10? (unsigned char)b[10] : 0, - left > 11? (unsigned char)b[11] : 0, - left > 12? (unsigned char)b[12] : 0, - left > 13? (unsigned char)b[13] : 0, - left > 14? (unsigned char)b[14] : 0, - left > 15? (unsigned char)b[15] : 0, - (left > 0) ? (isprint(b[ 0]) ? b[ 0] : '.') : ' ', - (left > 1) ? (isprint(b[ 1]) ? b[ 1] : '.') : ' ', - (left > 2) ? (isprint(b[ 2]) ? b[ 2] : '.') : ' ', - (left > 3) ? (isprint(b[ 3]) ? b[ 3] : '.') : ' ', - (left > 4) ? (isprint(b[ 4]) ? b[ 4] : '.') : ' ', - (left > 5) ? (isprint(b[ 5]) ? b[ 5] : '.') : ' ', - (left > 6) ? (isprint(b[ 6]) ? b[ 6] : '.') : ' ', - (left > 7) ? (isprint(b[ 7]) ? b[ 7] : '.') : ' ', - (left > 8) ? (isprint(b[ 8]) ? b[ 8] : '.') : ' ', - (left > 9) ? (isprint(b[ 9]) ? b[ 9] : '.') : ' ', - (left > 10) ? (isprint(b[10]) ? b[10] : '.') : ' ', - (left > 11) ? (isprint(b[11]) ? b[11] : '.') : ' ', - (left > 12) ? (isprint(b[12]) ? b[12] : '.') : ' ', - (left > 13) ? (isprint(b[13]) ? b[13] : '.') : ' ', - (left > 14) ? (isprint(b[14]) ? b[14] : '.') : ' ', - (left > 15) ? (isprint(b[15]) ? b[15] : '.') : ' ' - ); - left -= 16; - b += 16; - } -} - -void print_error_with_chain_status(FLAC__Metadata_Chain *chain, const char *format, ...) -{ - const FLAC__Metadata_ChainStatus status = FLAC__metadata_chain_status(chain); - va_list args; - - FLAC__ASSERT(0 != format); - - va_start(args, format); - - (void) vfprintf(stderr, format, args); - - va_end(args); - - fprintf(stderr, ", status = \"%s\"\n", FLAC__Metadata_ChainStatusString[status]); - - if(status == FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE) { - fprintf(stderr, "\n" - "The FLAC file could not be opened. Most likely the file does not exist\n" - "or is not readable.\n" - ); - } - else if(status == FLAC__METADATA_CHAIN_STATUS_NOT_A_FLAC_FILE) { - fprintf(stderr, "\n" - "The file does not appear to be a FLAC file.\n" - ); - } - else if(status == FLAC__METADATA_CHAIN_STATUS_NOT_WRITABLE) { - fprintf(stderr, "\n" - "The FLAC file does not have write permissions.\n" - ); - } - else if(status == FLAC__METADATA_CHAIN_STATUS_BAD_METADATA) { - fprintf(stderr, "\n" - "The metadata to be writted does not conform to the FLAC metadata\n" - "specifications.\n" - ); - } - else if(status == FLAC__METADATA_CHAIN_STATUS_READ_ERROR) { - fprintf(stderr, "\n" - "There was an error while reading the FLAC file.\n" - ); - } - else if(status == FLAC__METADATA_CHAIN_STATUS_WRITE_ERROR) { - fprintf(stderr, "\n" - "There was an error while writing FLAC file; most probably the disk is\n" - "full.\n" - ); - } - else if(status == FLAC__METADATA_CHAIN_STATUS_UNLINK_ERROR) { - fprintf(stderr, "\n" - "There was an error removing the temporary FLAC file.\n" - ); - } -} - -FLAC__bool parse_vorbis_comment_field(const char *field_ref, char **field, char **name, char **value, unsigned *length, const char **violation) -{ - static const char * const violations[] = { - "field name contains invalid character", - "field contains no '=' character" - }; - - char *p, *q, *s; - - if(0 != field) - *field = local_strdup(field_ref); - - s = local_strdup(field_ref); - - if(0 == (p = strchr(s, '='))) { - free(s); - *violation = violations[1]; - return false; - } - *p++ = '\0'; - - for(q = s; *q; q++) { - if(*q < 0x20 || *q > 0x7d || *q == 0x3d) { - free(s); - *violation = violations[0]; - return false; - } - } - - *name = local_strdup(s); - *value = local_strdup(p); - *length = strlen(p); - - free(s); - return true; -} - -void write_vc_field(const char *filename, const FLAC__StreamMetadata_VorbisComment_Entry *entry, FLAC__bool raw, FILE *f) -{ - if(0 != entry->entry) { - if(filename) - fprintf(f, "%s:", filename); - - if(!raw) { - /* - * WATCHOUT: comments that contain an embedded null will - * be truncated by utf_decode(). - */ - char *converted; - - if(utf8_decode((const char *)entry->entry, &converted) >= 0) { - (void) local_fwrite(converted, 1, strlen(converted), f); - free(converted); - } - else { - (void) local_fwrite(entry->entry, 1, entry->length, f); - } - } - else { - (void) local_fwrite(entry->entry, 1, entry->length, f); - } - } - - putc('\n', f); -} - -void write_vc_fields(const char *filename, const char *field_name, const FLAC__StreamMetadata_VorbisComment_Entry entry[], unsigned num_entries, FLAC__bool raw, FILE *f) -{ - unsigned i; - const unsigned field_name_length = (0 != field_name)? strlen(field_name) : 0; - - for(i = 0; i < num_entries; i++) { - if(0 == field_name || FLAC__metadata_object_vorbiscomment_entry_matches(entry[i], field_name, field_name_length)) - write_vc_field(filename, entry + i, raw, f); - } -} diff --git a/3rdparty/libflac/src/metaflac/utils.h b/3rdparty/libflac/src/metaflac/utils.h deleted file mode 100644 index 111d10cccdc..00000000000 --- a/3rdparty/libflac/src/metaflac/utils.h +++ /dev/null @@ -1,41 +0,0 @@ -/* metaflac - Command-line FLAC metadata editor - * Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef metaflac__utils_h -#define metaflac__utils_h - -#include "FLAC/metadata.h" -#include <stdio.h> /* for FILE */ - -void die(const char *message); -#ifdef FLAC__VALGRIND_TESTING -size_t local_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream); -#else -#define local_fwrite fwrite -#endif -char *local_strdup(const char *source); -void local_strcat(char **dest, const char *source); -void hexdump(const char *filename, const FLAC__byte *buf, unsigned bytes, const char *indent); -void print_error_with_chain_status(FLAC__Metadata_Chain *chain, const char *format, ...); - -FLAC__bool parse_vorbis_comment_field(const char *field_ref, char **field, char **name, char **value, unsigned *length, const char **violation); - -void write_vc_field(const char *filename, const FLAC__StreamMetadata_VorbisComment_Entry *entry, FLAC__bool raw, FILE *f); -void write_vc_fields(const char *filename, const char *field_name, const FLAC__StreamMetadata_VorbisComment_Entry entry[], unsigned num_entries, FLAC__bool raw, FILE *f); - -#endif diff --git a/3rdparty/libflac/src/monkeys_audio_utilities/Makefile.am b/3rdparty/libflac/src/monkeys_audio_utilities/Makefile.am deleted file mode 100644 index 3cfe69af8a3..00000000000 --- a/3rdparty/libflac/src/monkeys_audio_utilities/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -# FLAC - Free Lossless Audio Codec -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# This file is part the FLAC project. FLAC is comprised of several -# components distributed under difference licenses. The codec libraries -# are distributed under Xiph.Org's BSD-like license (see the file -# COPYING.Xiph in this distribution). All other programs, libraries, and -# plugins are distributed under the GPL (see COPYING.GPL). The documentation -# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the -# FLAC distribution contains at the top the terms under which it may be -# distributed. -# -# Since this particular file is relevant to all components of FLAC, -# it may be distributed under the Xiph.Org license, which is the least -# restrictive of those mentioned above. See the file COPYING.Xiph in this -# distribution. - -SUBDIRS = flac_mac flac_ren diff --git a/3rdparty/libflac/src/monkeys_audio_utilities/Makefile.in b/3rdparty/libflac/src/monkeys_audio_utilities/Makefile.in deleted file mode 100644 index 2444f6c3648..00000000000 --- a/3rdparty/libflac/src/monkeys_audio_utilities/Makefile.in +++ /dev/null @@ -1,520 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# FLAC - Free Lossless Audio Codec -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# This file is part the FLAC project. FLAC is comprised of several -# components distributed under difference licenses. The codec libraries -# are distributed under Xiph.Org's BSD-like license (see the file -# COPYING.Xiph in this distribution). All other programs, libraries, and -# plugins are distributed under the GPL (see COPYING.GPL). The documentation -# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the -# FLAC distribution contains at the top the terms under which it may be -# distributed. -# -# Since this particular file is relevant to all components of FLAC, -# it may be distributed under the Xiph.Org license, which is the least -# restrictive of those mentioned above. See the file COPYING.Xiph in this -# distribution. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -SUBDIRS = flac_mac flac_ren -subdir = src/monkeys_audio_utilities -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = - -RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ - ps-recursive install-info-recursive uninstall-info-recursive \ - all-recursive install-data-recursive install-exec-recursive \ - installdirs-recursive install-recursive uninstall-recursive \ - check-recursive installcheck-recursive -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -DIST_SUBDIRS = $(SUBDIRS) -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/monkeys_audio_utilities/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if (etags --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - else \ - include_option=--include; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: - -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags - -dvi: dvi-recursive - -dvi-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ - clean-generic clean-libtool clean-recursive ctags \ - ctags-recursive distclean distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am \ - dvi-recursive info info-am info-recursive install install-am \ - install-data install-data-am install-data-recursive \ - install-exec install-exec-am install-exec-recursive \ - install-info install-info-am install-info-recursive install-man \ - install-recursive install-strip installcheck installcheck-am \ - installdirs installdirs-am installdirs-recursive \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-libtool mostlyclean-recursive pdf pdf-am \ - pdf-recursive ps ps-am ps-recursive tags tags-recursive \ - uninstall uninstall-am uninstall-info-am \ - uninstall-info-recursive uninstall-recursive - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/monkeys_audio_utilities/flac_mac/Makefile.am b/3rdparty/libflac/src/monkeys_audio_utilities/flac_mac/Makefile.am deleted file mode 100644 index fef6138791c..00000000000 --- a/3rdparty/libflac/src/monkeys_audio_utilities/flac_mac/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -# flac_mac - wedge utility to add FLAC support to Monkey's Audio -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -EXTRA_DIST = \ - flac_mac.dsp \ - flac_mac.vcproj \ - main.c diff --git a/3rdparty/libflac/src/monkeys_audio_utilities/flac_mac/Makefile.in b/3rdparty/libflac/src/monkeys_audio_utilities/flac_mac/Makefile.in deleted file mode 100644 index 15621b356b9..00000000000 --- a/3rdparty/libflac/src/monkeys_audio_utilities/flac_mac/Makefile.in +++ /dev/null @@ -1,375 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# flac_mac - wedge utility to add FLAC support to Monkey's Audio -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -EXTRA_DIST = \ - flac_mac.dsp \ - flac_mac.vcproj \ - main.c - -subdir = src/monkeys_audio_utilities/flac_mac -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/monkeys_audio_utilities/flac_mac/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/monkeys_audio_utilities/flac_mac/flac_mac.dsp b/3rdparty/libflac/src/monkeys_audio_utilities/flac_mac/flac_mac.dsp deleted file mode 100644 index 7c5253a97fa..00000000000 --- a/3rdparty/libflac/src/monkeys_audio_utilities/flac_mac/flac_mac.dsp +++ /dev/null @@ -1,100 +0,0 @@ -# Microsoft Developer Studio Project File - Name="flac_mac" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=flac_mac - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "flac_mac.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "flac_mac.mak" CFG="flac_mac - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "flac_mac - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "flac_mac - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "flac_mac - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\..\obj\release\bin" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "flac_mac - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\..\obj\debug\bin" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "flac_mac - Win32 Release" -# Name "flac_mac - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\main.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/monkeys_audio_utilities/flac_mac/flac_mac.vcproj b/3rdparty/libflac/src/monkeys_audio_utilities/flac_mac/flac_mac.vcproj deleted file mode 100644 index cc65f83294f..00000000000 --- a/3rdparty/libflac/src/monkeys_audio_utilities/flac_mac/flac_mac.vcproj +++ /dev/null @@ -1,200 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="flac_mac" - ProjectGUID="{4cefbc7e-c215-11db-8314-0800200c9a66}" - RootNamespace="flac_mac" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\..\obj\debug\bin" - IntermediateDirectory="Debug" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="2" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\..\obj\release\bin" - IntermediateDirectory="Release" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="1" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" - LinkTimeCodeGeneration="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\main.c" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/monkeys_audio_utilities/flac_mac/main.c b/3rdparty/libflac/src/monkeys_audio_utilities/flac_mac/main.c deleted file mode 100644 index 8e0410386eb..00000000000 --- a/3rdparty/libflac/src/monkeys_audio_utilities/flac_mac/main.c +++ /dev/null @@ -1,208 +0,0 @@ -/* flac_mac - wedge utility to add FLAC support to Monkey's Audio - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -/* - * This program can be used to allow FLAC to masquerade as one of the other - * supported lossless codecs in Monkey's Audio. See the documentation for - * how to do this. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include<stdio.h> -#include<stdlib.h> -#include<string.h> -#include<wtypes.h> -#include<process.h> -#include<winbase.h> - -static int execit(char *prog, char *args); -static int forkit(char *prog, char *args); - -int main(int argc, char *argv[]) -{ - int flac_return_val = 0, opt_arg = 1, from_arg = -1, to_arg = -1, flac_level = 5, i; - char prog[MAX_PATH], cmdline[MAX_PATH*2], from[MAX_PATH], to[MAX_PATH], macdir[MAX_PATH], options[256], *p; - enum { WAVPACK, RKAU, SHORTEN } codec; - - /* get the directory where MAC external codecs reside */ - if(0 != (p = strrchr(argv[0],'\\'))) { - strcpy(macdir, argv[0]); - *(strrchr(macdir,'\\')+1) = '\0'; - } - else { - strcpy(macdir, ""); - } - - /* determine which codec we were called as and parse the options */ - if(p == 0) - p = argv[0]; - else - p++; - if(0 == strnicmp(p, "short", 5)) { - codec = SHORTEN; - } - else if(0 == strnicmp(p, "rkau", 4)) { - codec = RKAU; - if(argv[1][0] == '-' && argv[1][1] == 'l') { - opt_arg = 2; - switch(argv[1][2]) { - case '1': flac_level = 1; break; - case '2': flac_level = 5; break; - case '3': flac_level = 8; break; - } - } - } - else if(0 == strnicmp(p, "wavpack", 7)) { - codec = WAVPACK; - if(argv[1][0] == '-') { - opt_arg = 2; - switch(argv[1][1]) { - case 'f': flac_level = 1; break; - case 'h': flac_level = 8; break; - default: opt_arg = 1; - } - } - } - else { - return -5; - } - - /* figure out which arguments are the source and destination files */ - for(i = 1; i < argc; i++) - if(argv[i][0] != '-') { - from_arg = i++; - break; - } - for( ; i < argc; i++) - if(argv[i][0] != '-') { - to_arg = i++; - break; - } - if(to_arg < 0) - return -4; - - /* build the command to call flac with */ - sprintf(prog, "%sflac.exe", macdir); - sprintf(options, "-%d", flac_level); - for(i = opt_arg; i < argc; i++) - if(argv[i][0] == '-') { - strcat(options, " "); - strcat(options, argv[i]); - } - sprintf(cmdline, "\"%s\" %s -o \"%s\" \"%s\"", prog, options, argv[to_arg], argv[from_arg]); - - flac_return_val = execit(prog, cmdline); - - /* - * Now that flac has finished, we need to fork a process that will rename - * the resulting file with the correct extension once MAC has moved it to - * it's final resting place. - */ - if(0 == flac_return_val) { - /* get the destination directory, if any */ - if(0 != (p = strchr(argv[to_arg],'\\'))) { - strcpy(from, argv[to_arg]); - *(strrchr(from,'\\')+1) = '\0'; - } - else { - strcpy(from, ""); - } - - /* for the full 'from' and 'to' paths for the renamer process */ - p = strrchr(argv[from_arg],'\\'); - strcat(from, p? p+1 : argv[from_arg]); - strcpy(to, from); - if(0 == strchr(from,'.')) - return -3; - switch(codec) { - case SHORTEN: strcpy(strrchr(from,'.'), ".shn"); break; - case WAVPACK: strcpy(strrchr(from,'.'), ".wv"); break; - case RKAU: strcpy(strrchr(from,'.'), ".rka"); break; - } - strcpy(strrchr(to,'.'), ".flac"); - - sprintf(prog, "%sflac_ren.exe", macdir); - sprintf(cmdline, "\"%s\" \"%s\" \"%s\"", prog, from, to); - - flac_return_val = forkit(prog, cmdline); - } - - return flac_return_val; -} - -int execit(char *prog, char *args) -{ - BOOL ok; - STARTUPINFO startup_info; - PROCESS_INFORMATION proc_info; - - GetStartupInfo(&startup_info); - - ok = CreateProcess( - prog, - args, - 0, /*process security attributes*/ - 0, /*thread security attributes*/ - FALSE, - 0, /*dwCreationFlags*/ - 0, /*environment*/ - 0, /*lpCurrentDirectory*/ - &startup_info, - &proc_info - ); - if(ok) { - DWORD dw; - dw = WaitForSingleObject(proc_info.hProcess, INFINITE); - ok = (dw != 0xFFFFFFFF); - CloseHandle(proc_info.hThread); - CloseHandle(proc_info.hProcess); - } - - return ok? 0 : -1; -} - -int forkit(char *prog, char *args) -{ - BOOL ok; - STARTUPINFO startup_info; - PROCESS_INFORMATION proc_info; - - GetStartupInfo(&startup_info); - - ok = CreateProcess( - prog, - args, - 0, /*process security attributes*/ - 0, /*thread security attributes*/ - FALSE, - DETACHED_PROCESS, /*dwCreationFlags*/ - 0, /*environment*/ - 0, /*lpCurrentDirectory*/ - &startup_info, - &proc_info - ); - if(ok) { - CloseHandle(proc_info.hThread); - CloseHandle(proc_info.hProcess); - } - - return ok? 0 : -2; -} diff --git a/3rdparty/libflac/src/monkeys_audio_utilities/flac_ren/Makefile.am b/3rdparty/libflac/src/monkeys_audio_utilities/flac_ren/Makefile.am deleted file mode 100644 index ddb7d2f3f0a..00000000000 --- a/3rdparty/libflac/src/monkeys_audio_utilities/flac_ren/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -# flac_ren - renamer part of utility to add FLAC support to Monkey's Audio -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -EXTRA_DIST = \ - flac_ren.dsp \ - flac_ren.vcproj \ - main.c diff --git a/3rdparty/libflac/src/monkeys_audio_utilities/flac_ren/Makefile.in b/3rdparty/libflac/src/monkeys_audio_utilities/flac_ren/Makefile.in deleted file mode 100644 index 01bd04287e8..00000000000 --- a/3rdparty/libflac/src/monkeys_audio_utilities/flac_ren/Makefile.in +++ /dev/null @@ -1,375 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# flac_ren - renamer part of utility to add FLAC support to Monkey's Audio -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -EXTRA_DIST = \ - flac_ren.dsp \ - flac_ren.vcproj \ - main.c - -subdir = src/monkeys_audio_utilities/flac_ren -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/monkeys_audio_utilities/flac_ren/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/monkeys_audio_utilities/flac_ren/flac_ren.dsp b/3rdparty/libflac/src/monkeys_audio_utilities/flac_ren/flac_ren.dsp deleted file mode 100644 index ea9abb42c57..00000000000 --- a/3rdparty/libflac/src/monkeys_audio_utilities/flac_ren/flac_ren.dsp +++ /dev/null @@ -1,100 +0,0 @@ -# Microsoft Developer Studio Project File - Name="flac_ren" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=flac_ren - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "flac_ren.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "flac_ren.mak" CFG="flac_ren - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "flac_ren - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "flac_ren - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "flac_ren - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\..\obj\release\bin" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "flac_ren - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\..\obj\debug\bin" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "flac_ren - Win32 Release" -# Name "flac_ren - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\main.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/monkeys_audio_utilities/flac_ren/flac_ren.vcproj b/3rdparty/libflac/src/monkeys_audio_utilities/flac_ren/flac_ren.vcproj deleted file mode 100644 index e6f274e5966..00000000000 --- a/3rdparty/libflac/src/monkeys_audio_utilities/flac_ren/flac_ren.vcproj +++ /dev/null @@ -1,200 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="flac_ren" - ProjectGUID="{4cefbc7f-c215-11db-8314-0800200c9a66}" - RootNamespace="flac_ren" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\..\obj\debug\bin" - IntermediateDirectory="Debug" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="2" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\..\obj\release\bin" - IntermediateDirectory="Release" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="1" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" - LinkTimeCodeGeneration="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\main.c" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/monkeys_audio_utilities/flac_ren/main.c b/3rdparty/libflac/src/monkeys_audio_utilities/flac_ren/main.c deleted file mode 100644 index 14667b4c65d..00000000000 --- a/3rdparty/libflac/src/monkeys_audio_utilities/flac_ren/main.c +++ /dev/null @@ -1,39 +0,0 @@ -/* flac_ren - renamer part of utility to add FLAC support to Monkey's Audio - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <io.h> -#include <sys/stat.h> -#include <wtypes.h> -#include <winbase.h> - -int main(int argc, char *argv[]) -{ - struct stat s; - - /* wait till the 'from' file has reached its final destination */ - do { - Sleep(2000); - } while(stat(argv[1], &s) < 0); - - /* now rename it */ - return rename(argv[1], argv[2]); -} diff --git a/3rdparty/libflac/src/plugin_common/Makefile.am b/3rdparty/libflac/src/plugin_common/Makefile.am deleted file mode 100644 index e2915a7c672..00000000000 --- a/3rdparty/libflac/src/plugin_common/Makefile.am +++ /dev/null @@ -1,48 +0,0 @@ -# plugin_common - Routines common to several plugins -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 - -AUTOMAKE_OPTIONS = foreign - -INCLUDES = -I$(top_srcdir)/include - -noinst_LTLIBRARIES = libplugin_common.la - -noinst_HEADERS = \ - all.h \ - charset.h \ - defs.h \ - dither.h \ - replaygain.h \ - tags.h - -libplugin_common_la_SOURCES = \ - charset.c \ - dither.c \ - replaygain.c \ - tags.c - -EXTRA_DIST = \ - Makefile.lite \ - README \ - plugin_common_static.dsp \ - plugin_common_static.vcproj - -debug: - $(MAKE) all CFLAGS="@DEBUG@" - -profile: - $(MAKE) all CFLAGS="@PROFILE@" diff --git a/3rdparty/libflac/src/plugin_common/Makefile.in b/3rdparty/libflac/src/plugin_common/Makefile.in deleted file mode 100644 index 663a3096275..00000000000 --- a/3rdparty/libflac/src/plugin_common/Makefile.in +++ /dev/null @@ -1,539 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# plugin_common - Routines common to several plugins -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -AUTOMAKE_OPTIONS = foreign - -INCLUDES = -I$(top_srcdir)/include - -noinst_LTLIBRARIES = libplugin_common.la - -noinst_HEADERS = \ - all.h \ - charset.h \ - defs.h \ - dither.h \ - replaygain.h \ - tags.h - - -libplugin_common_la_SOURCES = \ - charset.c \ - dither.c \ - replaygain.c \ - tags.c - - -EXTRA_DIST = \ - Makefile.lite \ - README \ - plugin_common_static.dsp \ - plugin_common_static.vcproj - -subdir = src/plugin_common -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) - -libplugin_common_la_LDFLAGS = -libplugin_common_la_LIBADD = -am_libplugin_common_la_OBJECTS = charset.lo dither.lo replaygain.lo \ - tags.lo -libplugin_common_la_OBJECTS = $(am_libplugin_common_la_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/charset.Plo ./$(DEPDIR)/dither.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/replaygain.Plo ./$(DEPDIR)/tags.Plo -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(libplugin_common_la_SOURCES) -HEADERS = $(noinst_HEADERS) - -DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.in \ - Makefile.am -SOURCES = $(libplugin_common_la_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/plugin_common/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" = "$$p" && dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libplugin_common.la: $(libplugin_common_la_OBJECTS) $(libplugin_common_la_DEPENDENCIES) - $(LINK) $(libplugin_common_la_LDFLAGS) $(libplugin_common_la_OBJECTS) $(libplugin_common_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/charset.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dither.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/replaygain.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tags.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(HEADERS) - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am - - -debug: - $(MAKE) all CFLAGS="@DEBUG@" - -profile: - $(MAKE) all CFLAGS="@PROFILE@" -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/plugin_common/Makefile.lite b/3rdparty/libflac/src/plugin_common/Makefile.lite deleted file mode 100644 index 987bae8d05d..00000000000 --- a/3rdparty/libflac/src/plugin_common/Makefile.lite +++ /dev/null @@ -1,36 +0,0 @@ -# plugin_common - Routines common to several plugins -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 - -# -# GNU makefile -# - -topdir = ../.. - -LIB_NAME = libplugin_common -INCLUDES = -I$(topdir)/include -I$(HOME)/local/include -DEFINES = - -SRCS_C = \ - charset.c \ - dither.c \ - replaygain.c \ - tags.c - -include $(topdir)/build/lib.mk - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/3rdparty/libflac/src/plugin_common/README b/3rdparty/libflac/src/plugin_common/README deleted file mode 100644 index 5a3352614d3..00000000000 --- a/3rdparty/libflac/src/plugin_common/README +++ /dev/null @@ -1,2 +0,0 @@ -This directory contains a convenience library of routines that are -common to the plugins. diff --git a/3rdparty/libflac/src/plugin_common/all.h b/3rdparty/libflac/src/plugin_common/all.h deleted file mode 100644 index e987dd088f5..00000000000 --- a/3rdparty/libflac/src/plugin_common/all.h +++ /dev/null @@ -1,26 +0,0 @@ -/* plugin_common - Routines common to several plugins - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 - */ - -#ifndef FLAC__PLUGIN_COMMON__ALL_H -#define FLAC__PLUGIN_COMMON__ALL_H - -#include "charset.h" -#include "dither.h" -#include "tags.h" - -#endif diff --git a/3rdparty/libflac/src/plugin_common/charset.c b/3rdparty/libflac/src/plugin_common/charset.c deleted file mode 100644 index cc826690876..00000000000 --- a/3rdparty/libflac/src/plugin_common/charset.c +++ /dev/null @@ -1,157 +0,0 @@ -/* plugin_common - Routines common to several plugins - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Only slightly modified charset.c from: - * EasyTAG - Tag editor for MP3 and OGG files - * Copyright (C) 1999-2001 Håvard Kvålen <havardk@xmms.org> - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> - -#ifdef HAVE_ICONV -#include <iconv.h> -#endif - -#ifdef HAVE_LANGINFO_CODESET -#include <langinfo.h> -#endif - -#include "charset.h" - - -/************* - * Functions * - *************/ - -char* FLAC_plugin__charset_get_current (void) -{ - char *charset = getenv("CHARSET"); - -#ifdef HAVE_LANGINFO_CODESET - if (!charset) - charset = nl_langinfo(CODESET); -#endif - if (!charset) - charset = "ISO-8859-1"; - - return charset; -} - - -#ifdef HAVE_ICONV -char* FLAC_plugin__charset_convert_string (const char *string, char *from, char *to) -{ - size_t outleft, outsize, length; - iconv_t cd; - char *out, *outptr; - const char *input = string; - - if (!string) - return NULL; - - length = strlen(string); - - if ((cd = iconv_open(to, from)) == (iconv_t)-1) - { -#ifdef DEBUG - fprintf(stderr, "convert_string(): Conversion not supported. Charsets: %s -> %s", from, to); -#endif - return strdup(string); - } - - /* Due to a GLIBC bug, round outbuf_size up to a multiple of 4 */ - /* + 1 for nul in case len == 1 */ - outsize = ((length + 3) & ~3) + 1; - if(outsize < length) /* overflow check */ - return NULL; - out = (char*)malloc(outsize); - outleft = outsize - 1; - outptr = out; - -retry: - if (iconv(cd, (char**)&input, &length, &outptr, &outleft) == (size_t)(-1)) - { - int used; - switch (errno) - { - case E2BIG: - used = outptr - out; - if((outsize - 1) * 2 + 1 <= outsize) { /* overflow check */ - free(out); - return NULL; - } - outsize = (outsize - 1) * 2 + 1; - out = realloc(out, outsize); - outptr = out + used; - outleft = outsize - 1 - used; - goto retry; - case EINVAL: - break; - case EILSEQ: - /* Invalid sequence, try to get the rest of the string */ - input++; - length = strlen(input); - goto retry; - default: -#ifdef DEBUG - fprintf(stderr, "convert_string(): Conversion failed. Inputstring: %s; Error: %s", string, strerror(errno)); -#endif - break; - } - } - *outptr = '\0'; - - iconv_close(cd); - return out; -} -#else -char* FLAC_plugin__charset_convert_string (const char *string, char *from, char *to) -{ - (void)from, (void)to; - if (!string) - return NULL; - return strdup(string); -} -#endif - -#ifdef HAVE_ICONV -int FLAC_plugin__charset_test_conversion (char *from, char *to) -{ - iconv_t cd; - - if ((cd=iconv_open(to,from)) == (iconv_t)-1) - { - /* Conversion not supported */ - return 0; - } - iconv_close(cd); - return 1; -} -#else -int FLAC_plugin__charset_test_conversion (char *from, char *to) -{ - (void)from, (void)to; - return 1; -} -#endif diff --git a/3rdparty/libflac/src/plugin_common/charset.h b/3rdparty/libflac/src/plugin_common/charset.h deleted file mode 100644 index 7ea283818fc..00000000000 --- a/3rdparty/libflac/src/plugin_common/charset.h +++ /dev/null @@ -1,39 +0,0 @@ -/* plugin_common - Routines common to several plugins - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * Only slightly modified charset.h from: - * charset.h - 2001/12/04 - * EasyTAG - Tag editor for MP3 and OGG files - * Copyright (C) 1999-2001 H蛆ard Kvè™±en <havardk@xmms.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - - -#ifndef FLAC__PLUGIN_COMMON__CHARSET_H -#define FLAC__PLUGIN_COMMON__CHARSET_H - - -/************** - * Prototypes * - **************/ - -char *FLAC_plugin__charset_get_current(void); -char *FLAC_plugin__charset_convert_string(const char *string, char *from, char *to); - -/* returns 1 for success, 0 for failure or no iconv */ -int FLAC_plugin__charset_test_conversion(char *from, char *to); - -#endif diff --git a/3rdparty/libflac/src/plugin_common/defs.h b/3rdparty/libflac/src/plugin_common/defs.h deleted file mode 100644 index 0cc9b4b06b5..00000000000 --- a/3rdparty/libflac/src/plugin_common/defs.h +++ /dev/null @@ -1,24 +0,0 @@ -/* plugin_common - Routines common to several plugins - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 - */ - -#ifndef FLAC__PLUGIN_COMMON__DEFS_H -#define FLAC__PLUGIN_COMMON__DEFS_H - -#define FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS 2 - -#endif diff --git a/3rdparty/libflac/src/plugin_common/dither.c b/3rdparty/libflac/src/plugin_common/dither.c deleted file mode 100644 index 538a28029e0..00000000000 --- a/3rdparty/libflac/src/plugin_common/dither.c +++ /dev/null @@ -1,262 +0,0 @@ -/* plugin_common - Routines common to several plugins - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * dithering routine derived from (other GPLed source): - * mad - MPEG audio decoder - * Copyright (C) 2000-2001 Robert Leslie - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "dither.h" -#include "FLAC/assert.h" - -#ifdef max -#undef max -#endif -#define max(a,b) ((a)>(b)?(a):(b)) - -#ifndef FLaC__INLINE -#define FLaC__INLINE -#endif - - -/* 32-bit pseudo-random number generator - * - * @@@ According to Miroslav, this one is poor quality, the one from the - * @@@ original replaygain code is much better - */ -static FLaC__INLINE FLAC__uint32 prng(FLAC__uint32 state) -{ - return (state * 0x0019660dL + 0x3c6ef35fL) & 0xffffffffL; -} - -/* dither routine derived from MAD winamp plugin */ - -typedef struct { - FLAC__int32 error[3]; - FLAC__int32 random; -} dither_state; - -static FLaC__INLINE FLAC__int32 linear_dither(unsigned source_bps, unsigned target_bps, FLAC__int32 sample, dither_state *dither, const FLAC__int32 MIN, const FLAC__int32 MAX) -{ - unsigned scalebits; - FLAC__int32 output, mask, random; - - FLAC__ASSERT(source_bps < 32); - FLAC__ASSERT(target_bps <= 24); - FLAC__ASSERT(target_bps <= source_bps); - - /* noise shape */ - sample += dither->error[0] - dither->error[1] + dither->error[2]; - - dither->error[2] = dither->error[1]; - dither->error[1] = dither->error[0] / 2; - - /* bias */ - output = sample + (1L << (source_bps - target_bps - 1)); - - scalebits = source_bps - target_bps; - mask = (1L << scalebits) - 1; - - /* dither */ - random = (FLAC__int32)prng(dither->random); - output += (random & mask) - (dither->random & mask); - - dither->random = random; - - /* clip */ - if(output > MAX) { - output = MAX; - - if(sample > MAX) - sample = MAX; - } - else if(output < MIN) { - output = MIN; - - if(sample < MIN) - sample = MIN; - } - - /* quantize */ - output &= ~mask; - - /* error feedback */ - dither->error[0] = sample - output; - - /* scale */ - return output >> scalebits; -} - -size_t FLAC__plugin_common__pack_pcm_signed_big_endian(FLAC__byte *data, const FLAC__int32 * const input[], unsigned wide_samples, unsigned channels, unsigned source_bps, unsigned target_bps) -{ - static dither_state dither[FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS]; - FLAC__byte * const start = data; - FLAC__int32 sample; - const FLAC__int32 *input_; - unsigned samples, channel; - const unsigned bytes_per_sample = target_bps / 8; - const unsigned incr = bytes_per_sample * channels; - - FLAC__ASSERT(channels > 0 && channels <= FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS); - FLAC__ASSERT(source_bps < 32); - FLAC__ASSERT(target_bps <= 24); - FLAC__ASSERT(target_bps <= source_bps); - FLAC__ASSERT((source_bps & 7) == 0); - FLAC__ASSERT((target_bps & 7) == 0); - - if(source_bps != target_bps) { - const FLAC__int32 MIN = -(1L << (source_bps - 1)); - const FLAC__int32 MAX = ~MIN; /*(1L << (source_bps-1)) - 1 */ - - for(channel = 0; channel < channels; channel++) { - - samples = wide_samples; - data = start + bytes_per_sample * channel; - input_ = input[channel]; - - while(samples--) { - sample = linear_dither(source_bps, target_bps, *input_++, &dither[channel], MIN, MAX); - - switch(target_bps) { - case 8: - data[0] = sample ^ 0x80; - break; - case 16: - data[0] = (FLAC__byte)(sample >> 8); - data[1] = (FLAC__byte)sample; - break; - case 24: - data[0] = (FLAC__byte)(sample >> 16); - data[1] = (FLAC__byte)(sample >> 8); - data[2] = (FLAC__byte)sample; - break; - } - - data += incr; - } - } - } - else { - for(channel = 0; channel < channels; channel++) { - samples = wide_samples; - data = start + bytes_per_sample * channel; - input_ = input[channel]; - - while(samples--) { - sample = *input_++; - - switch(target_bps) { - case 8: - data[0] = sample ^ 0x80; - break; - case 16: - data[0] = (FLAC__byte)(sample >> 8); - data[1] = (FLAC__byte)sample; - break; - case 24: - data[0] = (FLAC__byte)(sample >> 16); - data[1] = (FLAC__byte)(sample >> 8); - data[2] = (FLAC__byte)sample; - break; - } - - data += incr; - } - } - } - - return wide_samples * channels * (target_bps/8); -} - -size_t FLAC__plugin_common__pack_pcm_signed_little_endian(FLAC__byte *data, const FLAC__int32 * const input[], unsigned wide_samples, unsigned channels, unsigned source_bps, unsigned target_bps) -{ - static dither_state dither[FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS]; - FLAC__byte * const start = data; - FLAC__int32 sample; - const FLAC__int32 *input_; - unsigned samples, channel; - const unsigned bytes_per_sample = target_bps / 8; - const unsigned incr = bytes_per_sample * channels; - - FLAC__ASSERT(channels > 0 && channels <= FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS); - FLAC__ASSERT(source_bps < 32); - FLAC__ASSERT(target_bps <= 24); - FLAC__ASSERT(target_bps <= source_bps); - FLAC__ASSERT((source_bps & 7) == 0); - FLAC__ASSERT((target_bps & 7) == 0); - - if(source_bps != target_bps) { - const FLAC__int32 MIN = -(1L << (source_bps - 1)); - const FLAC__int32 MAX = ~MIN; /*(1L << (source_bps-1)) - 1 */ - - for(channel = 0; channel < channels; channel++) { - - samples = wide_samples; - data = start + bytes_per_sample * channel; - input_ = input[channel]; - - while(samples--) { - sample = linear_dither(source_bps, target_bps, *input_++, &dither[channel], MIN, MAX); - - switch(target_bps) { - case 8: - data[0] = sample ^ 0x80; - break; - case 24: - data[2] = (FLAC__byte)(sample >> 16); - /* fall through */ - case 16: - data[1] = (FLAC__byte)(sample >> 8); - data[0] = (FLAC__byte)sample; - } - - data += incr; - } - } - } - else { - for(channel = 0; channel < channels; channel++) { - samples = wide_samples; - data = start + bytes_per_sample * channel; - input_ = input[channel]; - - while(samples--) { - sample = *input_++; - - switch(target_bps) { - case 8: - data[0] = sample ^ 0x80; - break; - case 24: - data[2] = (FLAC__byte)(sample >> 16); - /* fall through */ - case 16: - data[1] = (FLAC__byte)(sample >> 8); - data[0] = (FLAC__byte)sample; - } - - data += incr; - } - } - } - - return wide_samples * channels * (target_bps/8); -} diff --git a/3rdparty/libflac/src/plugin_common/dither.h b/3rdparty/libflac/src/plugin_common/dither.h deleted file mode 100644 index ad94bae194a..00000000000 --- a/3rdparty/libflac/src/plugin_common/dither.h +++ /dev/null @@ -1,29 +0,0 @@ -/* plugin_common - Routines common to several plugins - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 - */ - -#ifndef FLAC__PLUGIN_COMMON__DITHER_H -#define FLAC__PLUGIN_COMMON__DITHER_H - -#include <stdlib.h> /* for size_t */ -#include "defs.h" /* buy FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS for the caller */ -#include "FLAC/ordinals.h" - -size_t FLAC__plugin_common__pack_pcm_signed_big_endian(FLAC__byte *data, const FLAC__int32 * const input[], unsigned wide_samples, unsigned channels, unsigned source_bps, unsigned target_bps); -size_t FLAC__plugin_common__pack_pcm_signed_little_endian(FLAC__byte *data, const FLAC__int32 * const input[], unsigned wide_samples, unsigned channels, unsigned source_bps, unsigned target_bps); - -#endif diff --git a/3rdparty/libflac/src/plugin_common/plugin_common_static.dsp b/3rdparty/libflac/src/plugin_common/plugin_common_static.dsp deleted file mode 100644 index ae9b2bce61e..00000000000 --- a/3rdparty/libflac/src/plugin_common/plugin_common_static.dsp +++ /dev/null @@ -1,128 +0,0 @@ -# Microsoft Developer Studio Project File - Name="plugin_common_static" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=plugin_common_static - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "plugin_common_static.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "plugin_common_static.mak" CFG="plugin_common_static - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "plugin_common_static - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "plugin_common_static - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "plugin_common" -# PROP Scc_LocalPath "..\.." -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "plugin_common_static - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\obj\release\lib" -# PROP Intermediate_Dir "Release_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /WX /GX /Ox /Og /Oi /Os /Op /I ".\include" /I "..\..\include" /D "FLAC__NO_DLL" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /nodefaultlib - -!ELSEIF "$(CFG)" == "plugin_common_static - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\obj\debug\lib" -# PROP Intermediate_Dir "Debug_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\include" /I "..\..\include" /D "FLAC__NO_DLL" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /nodefaultlib - -!ENDIF - -# Begin Target - -# Name "plugin_common_static - Win32 Release" -# Name "plugin_common_static - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp" -# Begin Source File - -SOURCE=.\charset.c -# End Source File -# Begin Source File - -SOURCE=.\dither.c -# End Source File -# Begin Source File - -SOURCE=.\replaygain.c -# End Source File -# Begin Source File - -SOURCE=.\tags.c -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\all.h -# End Source File -# Begin Source File - -SOURCE=.\charset.h -# End Source File -# Begin Source File - -SOURCE=.\dither.h -# End Source File -# Begin Source File - -SOURCE=.\replaygain.h -# End Source File -# Begin Source File - -SOURCE=.\tags.h -# End Source File -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/plugin_common/plugin_common_static.vcproj b/3rdparty/libflac/src/plugin_common/plugin_common_static.vcproj deleted file mode 100644 index ee64d2593aa..00000000000 --- a/3rdparty/libflac/src/plugin_common/plugin_common_static.vcproj +++ /dev/null @@ -1,209 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="plugin_common_static" - ProjectGUID="{4cefbc88-c215-11db-8314-0800200c9a66}" - RootNamespace="plugin_common_static" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\obj\debug\lib" - IntermediateDirectory="Debug_static" - ConfigurationType="4" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".\include;..\..\include" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;FLAC__NO_DLL;DEBUG" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\..\obj\debug\lib\$(ProjectName).lib" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\obj\release\lib" - IntermediateDirectory="Release_static" - ConfigurationType="4" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".\include;..\..\include" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__NO_DLL" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\..\..\obj\release\lib\$(ProjectName).lib" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath=".\all.h" - > - </File> - <File - RelativePath=".\charset.h" - > - </File> - <File - RelativePath=".\defs.h" - > - </File> - <File - RelativePath=".\dither.h" - > - </File> - <File - RelativePath=".\replaygain.h" - > - </File> - <File - RelativePath=".\tags.h" - > - </File> - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\charset.c" - > - </File> - <File - RelativePath=".\dither.c" - > - </File> - <File - RelativePath=".\replaygain.c" - > - </File> - <File - RelativePath=".\tags.c" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/plugin_common/replaygain.c b/3rdparty/libflac/src/plugin_common/replaygain.c deleted file mode 100644 index 5ad59c8305c..00000000000 --- a/3rdparty/libflac/src/plugin_common/replaygain.c +++ /dev/null @@ -1,64 +0,0 @@ -/* plugin_common - Routines common to several plugins - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * Copyright (C) 2003 Philip Jägenstedt - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "replaygain.h" -#include "FLAC/ordinals.h" -#include "FLAC/metadata.h" -#include "share/grabbag.h" - -FLAC__bool FLAC_plugin__replaygain_get_from_file(const char *filename, - double *reference, FLAC__bool *reference_set, - double *track_gain, FLAC__bool *track_gain_set, - double *album_gain, FLAC__bool *album_gain_set, - double *track_peak, FLAC__bool *track_peak_set, - double *album_peak, FLAC__bool *album_peak_set) -{ - FLAC__Metadata_SimpleIterator *iterator = FLAC__metadata_simple_iterator_new(); - FLAC__bool ret = false; - - *track_gain_set = *album_gain_set = *track_peak_set = *album_peak_set = false; - - if(0 != iterator) { - if(FLAC__metadata_simple_iterator_init(iterator, filename, /*read_only=*/true, /*preserve_file_stats=*/true)) { - FLAC__bool got_vorbis_comments = false; - ret = true; - do { - if(FLAC__metadata_simple_iterator_get_block_type(iterator) == FLAC__METADATA_TYPE_VORBIS_COMMENT) { - FLAC__StreamMetadata *block = FLAC__metadata_simple_iterator_get_block(iterator); - if(0 != block) { - if(grabbag__replaygain_load_from_vorbiscomment(block, /*album_mode=*/false, /*strict=*/true, reference, track_gain, track_peak)) { - *reference_set = *track_gain_set = *track_peak_set = true; - } - if(grabbag__replaygain_load_from_vorbiscomment(block, /*album_mode=*/true, /*strict=*/true, reference, album_gain, album_peak)) { - *reference_set = *album_gain_set = *album_peak_set = true; - } - FLAC__metadata_object_delete(block); - got_vorbis_comments = true; - } - } - } while (!got_vorbis_comments && FLAC__metadata_simple_iterator_next(iterator)); - } - FLAC__metadata_simple_iterator_delete(iterator); - } - return ret; -} diff --git a/3rdparty/libflac/src/plugin_common/replaygain.h b/3rdparty/libflac/src/plugin_common/replaygain.h deleted file mode 100644 index 528312ecc9c..00000000000 --- a/3rdparty/libflac/src/plugin_common/replaygain.h +++ /dev/null @@ -1,32 +0,0 @@ -/* plugin_common - Routines common to several plugins - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * Copyright (C) 2003 Philip Jägenstedt - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef FLAC__PLUGIN_COMMON__REPLAYGAIN_H -#define FLAC__PLUGIN_COMMON__REPLAYGAIN_H - -#include "FLAC/ordinals.h" - -FLAC__bool FLAC_plugin__replaygain_get_from_file(const char *filename, - double *reference, FLAC__bool *reference_set, - double *track_gain, FLAC__bool *track_gain_set, - double *album_gain, FLAC__bool *album_gain_set, - double *track_peak, FLAC__bool *track_peak_set, - double *album_peak, FLAC__bool *album_peak_set); - -#endif diff --git a/3rdparty/libflac/src/plugin_common/tags.c b/3rdparty/libflac/src/plugin_common/tags.c deleted file mode 100644 index befc8484fd2..00000000000 --- a/3rdparty/libflac/src/plugin_common/tags.c +++ /dev/null @@ -1,358 +0,0 @@ -/* plugin_common - Routines common to several plugins - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> - -#include "tags.h" -#include "FLAC/assert.h" -#include "FLAC/metadata.h" -#include "share/alloc.h" - -#ifndef FLaC__INLINE -#define FLaC__INLINE -#endif - - -static FLaC__INLINE size_t local__wide_strlen(const FLAC__uint16 *s) -{ - size_t n = 0; - while(*s++) - n++; - return n; -} - -/* - * also disallows non-shortest-form encodings, c.f. - * http://www.unicode.org/versions/corrigendum1.html - * and a more clear explanation at the end of this section: - * http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - */ -static FLaC__INLINE size_t local__utf8len(const FLAC__byte *utf8) -{ - FLAC__ASSERT(0 != utf8); - if ((utf8[0] & 0x80) == 0) { - return 1; - } - else if ((utf8[0] & 0xE0) == 0xC0 && (utf8[1] & 0xC0) == 0x80) { - if ((utf8[0] & 0xFE) == 0xC0) /* overlong sequence check */ - return 0; - return 2; - } - else if ((utf8[0] & 0xF0) == 0xE0 && (utf8[1] & 0xC0) == 0x80 && (utf8[2] & 0xC0) == 0x80) { - if (utf8[0] == 0xE0 && (utf8[1] & 0xE0) == 0x80) /* overlong sequence check */ - return 0; - /* illegal surrogates check (U+D800...U+DFFF and U+FFFE...U+FFFF) */ - if (utf8[0] == 0xED && (utf8[1] & 0xE0) == 0xA0) /* D800-DFFF */ - return 0; - if (utf8[0] == 0xEF && utf8[1] == 0xBF && (utf8[2] & 0xFE) == 0xBE) /* FFFE-FFFF */ - return 0; - return 3; - } - else if ((utf8[0] & 0xF8) == 0xF0 && (utf8[1] & 0xC0) == 0x80 && (utf8[2] & 0xC0) == 0x80 && (utf8[3] & 0xC0) == 0x80) { - if (utf8[0] == 0xF0 && (utf8[1] & 0xF0) == 0x80) /* overlong sequence check */ - return 0; - return 4; - } - else if ((utf8[0] & 0xFC) == 0xF8 && (utf8[1] & 0xC0) == 0x80 && (utf8[2] & 0xC0) == 0x80 && (utf8[3] & 0xC0) == 0x80 && (utf8[4] & 0xC0) == 0x80) { - if (utf8[0] == 0xF8 && (utf8[1] & 0xF8) == 0x80) /* overlong sequence check */ - return 0; - return 5; - } - else if ((utf8[0] & 0xFE) == 0xFC && (utf8[1] & 0xC0) == 0x80 && (utf8[2] & 0xC0) == 0x80 && (utf8[3] & 0xC0) == 0x80 && (utf8[4] & 0xC0) == 0x80 && (utf8[5] & 0xC0) == 0x80) { - if (utf8[0] == 0xFC && (utf8[1] & 0xFC) == 0x80) /* overlong sequence check */ - return 0; - return 6; - } - else { - return 0; - } -} - - -static FLaC__INLINE size_t local__utf8_to_ucs2(const FLAC__byte *utf8, FLAC__uint16 *ucs2) -{ - const size_t len = local__utf8len(utf8); - - FLAC__ASSERT(0 != ucs2); - - if (len == 1) - *ucs2 = *utf8; - else if (len == 2) - *ucs2 = (*utf8 & 0x3F)<<6 | (*(utf8+1) & 0x3F); - else if (len == 3) - *ucs2 = (*utf8 & 0x1F)<<12 | (*(utf8+1) & 0x3F)<<6 | (*(utf8+2) & 0x3F); - else - *ucs2 = '?'; - - return len; -} - -static FLAC__uint16 *local__convert_utf8_to_ucs2(const char *src, unsigned length) -{ - FLAC__uint16 *out; - size_t chars = 0; - - FLAC__ASSERT(0 != src); - - /* calculate length */ - { - const unsigned char *s, *end; - for (s=(const unsigned char *)src, end=s+length; s<end; chars++) { - const unsigned n = local__utf8len(s); - if (n == 0) - return 0; - s += n; - } - FLAC__ASSERT(s == end); - } - - /* allocate */ - out = (FLAC__uint16*)safe_malloc_mul_2op_(chars, /*times*/sizeof(FLAC__uint16)); - if (0 == out) { - FLAC__ASSERT(0); - return 0; - } - - /* convert */ - { - const unsigned char *s = (const unsigned char *)src; - FLAC__uint16 *u = out; - for ( ; chars; chars--) - s += local__utf8_to_ucs2(s, u++); - } - - return out; -} - -static FLaC__INLINE size_t local__ucs2len(FLAC__uint16 ucs2) -{ - if (ucs2 < 0x0080) - return 1; - else if (ucs2 < 0x0800) - return 2; - else - return 3; -} - -static FLaC__INLINE size_t local__ucs2_to_utf8(FLAC__uint16 ucs2, FLAC__byte *utf8) -{ - if (ucs2 < 0x080) { - utf8[0] = (FLAC__byte)ucs2; - return 1; - } - else if (ucs2 < 0x800) { - utf8[0] = 0xc0 | (ucs2 >> 6); - utf8[1] = 0x80 | (ucs2 & 0x3f); - return 2; - } - else { - utf8[0] = 0xe0 | (ucs2 >> 12); - utf8[1] = 0x80 | ((ucs2 >> 6) & 0x3f); - utf8[2] = 0x80 | (ucs2 & 0x3f); - return 3; - } -} - -static char *local__convert_ucs2_to_utf8(const FLAC__uint16 *src, unsigned length) -{ - char *out; - size_t len = 0, n; - - FLAC__ASSERT(0 != src); - - /* calculate length */ - { - unsigned i; - for (i = 0; i < length; i++) { - n = local__ucs2len(src[i]); - if(len + n < len) /* overflow check */ - return 0; - len += n; - } - } - - /* allocate */ - out = (char*)safe_malloc_mul_2op_(len, /*times*/sizeof(char)); - if (0 == out) - return 0; - - /* convert */ - { - unsigned char *u = (unsigned char *)out; - for ( ; *src; src++) - u += local__ucs2_to_utf8(*src, u); - local__ucs2_to_utf8(*src, u); - } - - return out; -} - - -FLAC__bool FLAC_plugin__tags_get(const char *filename, FLAC__StreamMetadata **tags) -{ - if(!FLAC__metadata_get_tags(filename, tags)) - if(0 == (*tags = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT))) - return false; - return true; -} - -FLAC__bool FLAC_plugin__tags_set(const char *filename, const FLAC__StreamMetadata *tags) -{ - FLAC__Metadata_Chain *chain; - FLAC__Metadata_Iterator *iterator; - FLAC__StreamMetadata *block; - FLAC__bool got_vorbis_comments = false; - FLAC__bool ok; - - if(0 == (chain = FLAC__metadata_chain_new())) - return false; - - if(!FLAC__metadata_chain_read(chain, filename)) { - FLAC__metadata_chain_delete(chain); - return false; - } - - if(0 == (iterator = FLAC__metadata_iterator_new())) { - FLAC__metadata_chain_delete(chain); - return false; - } - - FLAC__metadata_iterator_init(iterator, chain); - - do { - if(FLAC__metadata_iterator_get_block_type(iterator) == FLAC__METADATA_TYPE_VORBIS_COMMENT) - got_vorbis_comments = true; - } while(!got_vorbis_comments && FLAC__metadata_iterator_next(iterator)); - - if(0 == (block = FLAC__metadata_object_clone(tags))) { - FLAC__metadata_chain_delete(chain); - FLAC__metadata_iterator_delete(iterator); - return false; - } - - if(got_vorbis_comments) - ok = FLAC__metadata_iterator_set_block(iterator, block); - else - ok = FLAC__metadata_iterator_insert_block_after(iterator, block); - - FLAC__metadata_iterator_delete(iterator); - - if(ok) { - FLAC__metadata_chain_sort_padding(chain); - ok = FLAC__metadata_chain_write(chain, /*use_padding=*/true, /*preserve_file_stats=*/true); - } - - FLAC__metadata_chain_delete(chain); - - return ok; -} - -void FLAC_plugin__tags_destroy(FLAC__StreamMetadata **tags) -{ - FLAC__metadata_object_delete(*tags); - *tags = 0; -} - -const char *FLAC_plugin__tags_get_tag_utf8(const FLAC__StreamMetadata *tags, const char *name) -{ - const int i = FLAC__metadata_object_vorbiscomment_find_entry_from(tags, /*offset=*/0, name); - return (i < 0? 0 : strchr((const char *)tags->data.vorbis_comment.comments[i].entry, '=')+1); -} - -FLAC__uint16 *FLAC_plugin__tags_get_tag_ucs2(const FLAC__StreamMetadata *tags, const char *name) -{ - const char *utf8 = FLAC_plugin__tags_get_tag_utf8(tags, name); - if(0 == utf8) - return 0; - return local__convert_utf8_to_ucs2(utf8, strlen(utf8)+1); /* +1 for terminating null */ -} - -int FLAC_plugin__tags_delete_tag(FLAC__StreamMetadata *tags, const char *name) -{ - return FLAC__metadata_object_vorbiscomment_remove_entries_matching(tags, name); -} - -int FLAC_plugin__tags_delete_all(FLAC__StreamMetadata *tags) -{ - int n = (int)tags->data.vorbis_comment.num_comments; - if(n > 0) { - if(!FLAC__metadata_object_vorbiscomment_resize_comments(tags, 0)) - n = -1; - } - return n; -} - -FLAC__bool FLAC_plugin__tags_add_tag_utf8(FLAC__StreamMetadata *tags, const char *name, const char *value, const char *separator) -{ - int i; - - FLAC__ASSERT(0 != tags); - FLAC__ASSERT(0 != name); - FLAC__ASSERT(0 != value); - - if(separator && (i = FLAC__metadata_object_vorbiscomment_find_entry_from(tags, /*offset=*/0, name)) >= 0) { - FLAC__StreamMetadata_VorbisComment_Entry *entry = tags->data.vorbis_comment.comments+i; - const size_t value_len = strlen(value); - const size_t separator_len = strlen(separator); - FLAC__byte *new_entry; - if(0 == (new_entry = (FLAC__byte*)safe_realloc_add_4op_(entry->entry, entry->length, /*+*/value_len, /*+*/separator_len, /*+*/1))) - return false; - memcpy(new_entry+entry->length, separator, separator_len); - entry->length += separator_len; - memcpy(new_entry+entry->length, value, value_len); - entry->length += value_len; - new_entry[entry->length] = '\0'; - entry->entry = new_entry; - } - else { - FLAC__StreamMetadata_VorbisComment_Entry entry; - if(!FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(&entry, name, value)) - return false; - FLAC__metadata_object_vorbiscomment_append_comment(tags, entry, /*copy=*/false); - } - return true; -} - -FLAC__bool FLAC_plugin__tags_set_tag_ucs2(FLAC__StreamMetadata *tags, const char *name, const FLAC__uint16 *value, FLAC__bool replace_all) -{ - FLAC__StreamMetadata_VorbisComment_Entry entry; - - FLAC__ASSERT(0 != tags); - FLAC__ASSERT(0 != name); - FLAC__ASSERT(0 != value); - - { - char *utf8 = local__convert_ucs2_to_utf8(value, local__wide_strlen(value)+1); /* +1 for the terminating null */ - if(0 == utf8) - return false; - if(!FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(&entry, name, utf8)) { - free(utf8); - return false; - } - free(utf8); - } - if(!FLAC__metadata_object_vorbiscomment_replace_comment(tags, entry, replace_all, /*copy=*/false)) - return false; - return true; -} diff --git a/3rdparty/libflac/src/plugin_common/tags.h b/3rdparty/libflac/src/plugin_common/tags.h deleted file mode 100644 index 78887674762..00000000000 --- a/3rdparty/libflac/src/plugin_common/tags.h +++ /dev/null @@ -1,74 +0,0 @@ -/* plugin_common - Routines common to several plugins - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 - */ - -#ifndef FLAC__PLUGIN_COMMON__TAGS_H -#define FLAC__PLUGIN_COMMON__TAGS_H - -#include "FLAC/format.h" - -FLAC__bool FLAC_plugin__tags_get(const char *filename, FLAC__StreamMetadata **tags); -FLAC__bool FLAC_plugin__tags_set(const char *filename, const FLAC__StreamMetadata *tags); - -/* - * Deletes the tags object and sets '*tags' to NULL. - */ -void FLAC_plugin__tags_destroy(FLAC__StreamMetadata **tags); - -/* - * Gets the value (in UTF-8) of the first tag with the given name (NULL if no - * such tag exists). - */ -const char *FLAC_plugin__tags_get_tag_utf8(const FLAC__StreamMetadata *tags, const char *name); - -/* - * Gets the value (in UCS-2) of the first tag with the given name (NULL if no - * such tag exists). - * - * NOTE: the returned string is malloc()ed and must be free()d by the caller. - */ -FLAC__uint16 *FLAC_plugin__tags_get_tag_ucs2(const FLAC__StreamMetadata *tags, const char *name); - -/* - * Removes all tags with the given 'name'. Returns the number of tags removed, - * or -1 on memory allocation error. - */ -int FLAC_plugin__tags_delete_tag(FLAC__StreamMetadata *tags, const char *name); - -/* - * Removes all tags. Returns the number of tags removed, or -1 on memory - * allocation error. - */ -int FLAC_plugin__tags_delete_all(FLAC__StreamMetadata *tags); - -/* - * Adds a "name=value" tag to the tags. 'value' must be in UTF-8. If - * 'separator' is non-NULL and 'tags' already contains a tag for 'name', the - * first such tag's value is appended with separator, then value. - */ -FLAC__bool FLAC_plugin__tags_add_tag_utf8(FLAC__StreamMetadata *tags, const char *name, const char *value, const char *separator); - -/* - * Adds a "name=value" tag to the tags. 'value' must be in UCS-2. If 'tags' - * already contains a tag or tags for 'name', then they will be replaced - * according to 'replace_all': if 'replace_all' is false, only the first such - * tag will be replaced; if true, all matching tags will be replaced by the one - * new tag. - */ -FLAC__bool FLAC_plugin__tags_set_tag_ucs2(FLAC__StreamMetadata *tags, const char *name, const FLAC__uint16 *value, FLAC__bool replace_all); - -#endif diff --git a/3rdparty/libflac/src/plugin_winamp2/Makefile.am b/3rdparty/libflac/src/plugin_winamp2/Makefile.am deleted file mode 100644 index 401d4d5f7e6..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/Makefile.am +++ /dev/null @@ -1,33 +0,0 @@ -# in_flac - Winamp2 FLAC input plugin -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 - -SUBDIRS = include - -EXTRA_DIST = \ - configure.h \ - configure.c \ - in_flac.c \ - in_flac.dsp \ - in_flac.vcproj \ - infobox.c \ - infobox.h \ - playback.c \ - playback.h \ - resource.h \ - resource.rc \ - tagz.cpp \ - tagz.h diff --git a/3rdparty/libflac/src/plugin_winamp2/Makefile.in b/3rdparty/libflac/src/plugin_winamp2/Makefile.in deleted file mode 100644 index c08f7944c24..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/Makefile.in +++ /dev/null @@ -1,536 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# in_flac - Winamp2 FLAC input plugin -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -SUBDIRS = include - -EXTRA_DIST = \ - configure.h \ - configure.c \ - in_flac.c \ - in_flac.dsp \ - in_flac.vcproj \ - infobox.c \ - infobox.h \ - playback.c \ - playback.h \ - resource.h \ - resource.rc \ - tagz.cpp \ - tagz.h - -subdir = src/plugin_winamp2 -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = - -RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ - ps-recursive install-info-recursive uninstall-info-recursive \ - all-recursive install-data-recursive install-exec-recursive \ - installdirs-recursive install-recursive uninstall-recursive \ - check-recursive installcheck-recursive -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -DIST_SUBDIRS = $(SUBDIRS) -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/plugin_winamp2/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if (etags --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - else \ - include_option=--include; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: - -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags - -dvi: dvi-recursive - -dvi-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ - clean-generic clean-libtool clean-recursive ctags \ - ctags-recursive distclean distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am \ - dvi-recursive info info-am info-recursive install install-am \ - install-data install-data-am install-data-recursive \ - install-exec install-exec-am install-exec-recursive \ - install-info install-info-am install-info-recursive install-man \ - install-recursive install-strip installcheck installcheck-am \ - installdirs installdirs-am installdirs-recursive \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-libtool mostlyclean-recursive pdf pdf-am \ - pdf-recursive ps ps-am ps-recursive tags tags-recursive \ - uninstall uninstall-am uninstall-info-am \ - uninstall-info-recursive uninstall-recursive - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/plugin_winamp2/configure.c b/3rdparty/libflac/src/plugin_winamp2/configure.c deleted file mode 100644 index dee0709bee6..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/configure.c +++ /dev/null @@ -1,428 +0,0 @@ -/* in_flac - Winamp2 FLAC input plugin - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <windows.h> -#include <commctrl.h> -#include <stdio.h> -#include "configure.h" -#include "tagz.h" -#include "resource.h" -#include "share/alloc.h" - - -static char buffer[256]; -static char ini_name[MAX_PATH]; - -/* - * Read/write config - */ - -#define RI(x, def) (x = GetPrivateProfileInt("FLAC", #x, def, ini_name)) -#define WI(x) WritePrivateProfileString("FLAC", #x, itoa(x, buffer, 10), ini_name) -#define RS(x, n, def) GetPrivateProfileString("FLAC", #x, def, x, n, ini_name) -#define WS(x) WritePrivateProfileString("FLAC", #x, x, ini_name) - -static const char default_format[] = "[%artist% - ]$if2(%title%,%filename%)"; -static const char default_sep[] = ", "; - -static wchar_t *convert_ansi_to_wide_(const char *src) -{ - int len; - wchar_t *dest; - - FLAC__ASSERT(0 != src); - - len = strlen(src) + 1; - /* copy */ - dest = safe_malloc_mul_2op_(len, /*times*/sizeof(wchar_t)); - if (dest) mbstowcs(dest, src, len); - return dest; -} - -void InitConfig() -{ - char *p; - - GetModuleFileName(NULL, ini_name, sizeof(ini_name)); - p = strrchr(ini_name, '.'); - if (!p) p = ini_name + strlen(ini_name); - strcpy(p, ".ini"); - - flac_cfg.title.tag_format_w = NULL; -} - -void ReadConfig() -{ - RS(flac_cfg.title.tag_format, sizeof(flac_cfg.title.tag_format), default_format); - if (flac_cfg.title.tag_format_w) - free(flac_cfg.title.tag_format_w); - flac_cfg.title.tag_format_w = convert_ansi_to_wide_(flac_cfg.title.tag_format); - /* @@@ FIXME: trailing spaces */ - RS(flac_cfg.title.sep, sizeof(flac_cfg.title.sep), default_sep); - RI(flac_cfg.tag.reserve_space, 1); - - RI(flac_cfg.display.show_bps, 1); - RI(flac_cfg.output.misc.stop_err, 0); - RI(flac_cfg.output.replaygain.enable, 1); - RI(flac_cfg.output.replaygain.album_mode, 0); - RI(flac_cfg.output.replaygain.hard_limit, 0); - RI(flac_cfg.output.replaygain.preamp, 0); - RI(flac_cfg.output.resolution.normal.dither_24_to_16, 0); - RI(flac_cfg.output.resolution.replaygain.dither, 0); - RI(flac_cfg.output.resolution.replaygain.noise_shaping, 1); - RI(flac_cfg.output.resolution.replaygain.bps_out, 16); -} - -void WriteConfig() -{ - WS(flac_cfg.title.tag_format); - WI(flac_cfg.tag.reserve_space); - WS(flac_cfg.title.sep); - - WI(flac_cfg.display.show_bps); - WI(flac_cfg.output.misc.stop_err); - WI(flac_cfg.output.replaygain.enable); - WI(flac_cfg.output.replaygain.album_mode); - WI(flac_cfg.output.replaygain.hard_limit); - WI(flac_cfg.output.replaygain.preamp); - WI(flac_cfg.output.resolution.normal.dither_24_to_16); - WI(flac_cfg.output.resolution.replaygain.dither); - WI(flac_cfg.output.resolution.replaygain.noise_shaping); - WI(flac_cfg.output.resolution.replaygain.bps_out); -} - -/* - * Dialog - */ - -#define PREAMP_RANGE 24 - -#define Check(x,y) CheckDlgButton(hwnd, x, y ? BST_CHECKED : BST_UNCHECKED) -#define GetCheck(x) (IsDlgButtonChecked(hwnd, x)==BST_CHECKED) -#define GetSel(x) SendDlgItemMessage(hwnd, x, CB_GETCURSEL, 0, 0) -#define GetPos(x) SendDlgItemMessage(hwnd, x, TBM_GETPOS, 0, 0) -#define Enable(x,y) EnableWindow(GetDlgItem(hwnd, x), y) - -static INT_PTR CALLBACK GeneralProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) - { - /* init */ - case WM_INITDIALOG: - SendDlgItemMessage(hwnd, IDC_TITLE, EM_LIMITTEXT, 255, 0); - SendDlgItemMessage(hwnd, IDC_SEP, EM_LIMITTEXT, 15, 0); - - SetDlgItemText(hwnd, IDC_TITLE, flac_cfg.title.tag_format); - SetDlgItemText(hwnd, IDC_SEP, flac_cfg.title.sep); - Check(IDC_ID3V1, 0); -/*! Check(IDC_RESERVE, flac_cfg.tag.reserve_space); */ - Check(IDC_BPS, flac_cfg.display.show_bps); - Check(IDC_ERRORS, flac_cfg.output.misc.stop_err); - return TRUE; - /* commands */ - case WM_COMMAND: - switch (LOWORD(wParam)) - { - /* ok */ - case IDOK: - GetDlgItemText(hwnd, IDC_TITLE, flac_cfg.title.tag_format, sizeof(flac_cfg.title.tag_format)); - if (flac_cfg.title.tag_format_w) - free(flac_cfg.title.tag_format_w); - GetDlgItemText(hwnd, IDC_SEP, flac_cfg.title.sep, sizeof(flac_cfg.title.sep)); - flac_cfg.title.tag_format_w = convert_ansi_to_wide_(flac_cfg.title.tag_format); - -/*! flac_cfg.tag.reserve_space = GetCheck(IDC_RESERVE); */ - flac_cfg.display.show_bps = GetCheck(IDC_BPS); - flac_cfg.output.misc.stop_err = GetCheck(IDC_ERRORS); - break; - /* reset */ - case IDC_RESET: - Check(IDC_ID3V1, 0); - Check(IDC_RESERVE, 1); - Check(IDC_BPS, 1); - Check(IDC_ERRORS, 0); - /* fall throught */ - /* default */ - case IDC_TAGZ_DEFAULT: - SetDlgItemText(hwnd, IDC_TITLE, default_format); - break; - /* help */ - case IDC_TAGZ_HELP: - MessageBox(hwnd, tagz_manual, "Help", 0); - break; - } - break; - } - - return 0; -} - - -static void UpdatePreamp(HWND hwnd, HWND hamp) -{ - int pos = SendMessage(hamp, TBM_GETPOS, 0, 0) - PREAMP_RANGE; - sprintf(buffer, "%d dB", pos); - SetDlgItemText(hwnd, IDC_PA, buffer); -} - -static void UpdateRG(HWND hwnd) -{ - int on = GetCheck(IDC_ENABLE); - Enable(IDC_ALBUM, on); - Enable(IDC_LIMITER, on); - Enable(IDC_PREAMP, on); - Enable(IDC_PA, on); -} - -static void UpdateDither(HWND hwnd) -{ - int on = GetCheck(IDC_DITHERRG); - Enable(IDC_SHAPE, on); -} - -static INT_PTR CALLBACK OutputProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) - { - /* init */ - case WM_INITDIALOG: - Check(IDC_ENABLE, flac_cfg.output.replaygain.enable); - Check(IDC_ALBUM, flac_cfg.output.replaygain.album_mode); - Check(IDC_LIMITER, flac_cfg.output.replaygain.hard_limit); - Check(IDC_DITHER, flac_cfg.output.resolution.normal.dither_24_to_16); - Check(IDC_DITHERRG, flac_cfg.output.resolution.replaygain.dither); - /* prepare preamp slider */ - { - HWND hamp = GetDlgItem(hwnd, IDC_PREAMP); - SendMessage(hamp, TBM_SETRANGE, 1, MAKELONG(0, PREAMP_RANGE*2)); - SendMessage(hamp, TBM_SETPOS, 1, flac_cfg.output.replaygain.preamp+PREAMP_RANGE); - UpdatePreamp(hwnd, hamp); - } - /* fill comboboxes */ - { - HWND hlist = GetDlgItem(hwnd, IDC_TO); - SendMessage(hlist, CB_ADDSTRING, 0, (LPARAM)"16 bps"); - SendMessage(hlist, CB_ADDSTRING, 0, (LPARAM)"24 bps"); - SendMessage(hlist, CB_SETCURSEL, flac_cfg.output.resolution.replaygain.bps_out/8 - 2, 0); - - hlist = GetDlgItem(hwnd, IDC_SHAPE); - SendMessage(hlist, CB_ADDSTRING, 0, (LPARAM)"None"); - SendMessage(hlist, CB_ADDSTRING, 0, (LPARAM)"Low"); - SendMessage(hlist, CB_ADDSTRING, 0, (LPARAM)"Medium"); - SendMessage(hlist, CB_ADDSTRING, 0, (LPARAM)"High"); - SendMessage(hlist, CB_SETCURSEL, flac_cfg.output.resolution.replaygain.noise_shaping, 0); - } - UpdateRG(hwnd); - UpdateDither(hwnd); - return TRUE; - /* commands */ - case WM_COMMAND: - switch (LOWORD(wParam)) - { - /* ok */ - case IDOK: - flac_cfg.output.replaygain.enable = GetCheck(IDC_ENABLE); - flac_cfg.output.replaygain.album_mode = GetCheck(IDC_ALBUM); - flac_cfg.output.replaygain.hard_limit = GetCheck(IDC_LIMITER); - flac_cfg.output.replaygain.preamp = GetPos(IDC_PREAMP) - PREAMP_RANGE; - flac_cfg.output.resolution.normal.dither_24_to_16 = GetCheck(IDC_DITHER); - flac_cfg.output.resolution.replaygain.dither = GetCheck(IDC_DITHERRG); - flac_cfg.output.resolution.replaygain.noise_shaping = GetSel(IDC_SHAPE); - flac_cfg.output.resolution.replaygain.bps_out = (GetSel(IDC_TO)+2)*8; - break; - /* reset */ - case IDC_RESET: - Check(IDC_ENABLE, 1); - Check(IDC_ALBUM, 0); - Check(IDC_LIMITER, 0); - Check(IDC_DITHER, 0); - Check(IDC_DITHERRG, 0); - - SendDlgItemMessage(hwnd, IDC_PREAMP, TBM_SETPOS, 1, PREAMP_RANGE); - SendDlgItemMessage(hwnd, IDC_TO, CB_SETCURSEL, 0, 0); - SendDlgItemMessage(hwnd, IDC_SHAPE, CB_SETCURSEL, 1, 0); - - UpdatePreamp(hwnd, GetDlgItem(hwnd, IDC_PREAMP)); - UpdateRG(hwnd); - UpdateDither(hwnd); - break; - /* active check-boxes */ - case IDC_ENABLE: - UpdateRG(hwnd); - break; - case IDC_DITHERRG: - UpdateDither(hwnd); - break; - } - break; - /* scroller */ - case WM_HSCROLL: - if (GetDlgCtrlID((HWND)lParam)==IDC_PREAMP) - UpdatePreamp(hwnd, (HWND)lParam); - return 0; - } - - return 0; -} - -#define NUM_PAGES 2 - -typedef struct -{ - HWND htab; - HWND hdlg; - RECT r; - HWND all[NUM_PAGES]; -} LOCALDATA; - -static void ScreenToClientRect(HWND hwnd, RECT *rect) -{ - POINT pt = { rect->left, rect->top }; - ScreenToClient(hwnd, &pt); - rect->left = pt.x; - rect->top = pt.y; - - pt.x = rect->right; - pt.y = rect->bottom; - ScreenToClient(hwnd, &pt); - rect->right = pt.x; - rect->bottom = pt.y; -} - -static void SendCommand(HWND hwnd, int command) -{ - LOCALDATA *data = (LOCALDATA*)GetWindowLong(hwnd, GWL_USERDATA); - SendMessage(data->hdlg, WM_COMMAND, command, 0); -} - -static void BroadcastCommand(HWND hwnd, int command) -{ - LOCALDATA *data = (LOCALDATA*)GetWindowLong(hwnd, GWL_USERDATA); - int i; - - for (i=0; i<NUM_PAGES; i++) - SendMessage(data->all[i], WM_COMMAND, command, 0); -} - -static void OnSelChange(HWND hwnd) -{ - LOCALDATA *data = (LOCALDATA*)GetWindowLong(hwnd, GWL_USERDATA); - int index = TabCtrl_GetCurSel(data->htab); - if (index < 0) return; - /* hide previous */ - if (data->hdlg) - ShowWindow(data->hdlg, SW_HIDE); - /* display */ - data->hdlg = data->all[index]; - SetWindowPos(data->hdlg, HWND_TOP, data->r.left, data->r.top, data->r.right-data->r.left, data->r.bottom-data->r.top, SWP_SHOWWINDOW); - SetFocus(hwnd); -} - -static INT_PTR CALLBACK DialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - static activePage = 0; - - switch (msg) - { - /* init */ - case WM_INITDIALOG: - { - LOCALDATA *data = LocalAlloc(LPTR, sizeof(LOCALDATA)); - HINSTANCE inst = (HINSTANCE)lParam; - TCITEM item; - - /* init */ - SetWindowLong(hwnd, GWL_USERDATA, (LONG)data); - data->htab = GetDlgItem(hwnd, IDC_TABS); - data->hdlg = NULL; - /* add pages */ - item.mask = TCIF_TEXT; - data->all[0] = CreateDialog(inst, MAKEINTRESOURCE(IDD_CONFIG_GENERAL), hwnd, GeneralProc); - item.pszText = "General"; - TabCtrl_InsertItem(data->htab, 0, &item); - - data->all[1] = CreateDialog(inst, MAKEINTRESOURCE(IDD_CONFIG_OUTPUT), hwnd, OutputProc); - item.pszText = "Output"; - TabCtrl_InsertItem(data->htab, 1, &item); - /* get rect (after adding pages) */ - GetWindowRect(data->htab, &data->r); - ScreenToClientRect(hwnd, &data->r); - TabCtrl_AdjustRect(data->htab, 0, &data->r); - /* simulate item change */ - TabCtrl_SetCurSel(data->htab, activePage); - OnSelChange(hwnd); - } - return TRUE; - /* destory */ - case WM_DESTROY: - { - LOCALDATA *data = (LOCALDATA*)GetWindowLong(hwnd, GWL_USERDATA); - int i; - - activePage = TabCtrl_GetCurSel(data->htab); - - for (i=0; i<NUM_PAGES; i++) - DestroyWindow(data->all[i]); - - LocalFree(data); - } - break; - /* commands */ - case WM_COMMAND: - switch (LOWORD(wParam)) - { - /* ok/cancel */ - case IDOK: - BroadcastCommand(hwnd, IDOK); - /* fall through */ - case IDCANCEL: - EndDialog(hwnd, LOWORD(wParam)); - return TRUE; - case IDC_RESET: - SendCommand(hwnd, IDC_RESET); - break; - } - break; - /* notification */ - case WM_NOTIFY: - if (LOWORD(wParam) == IDC_TABS) - { - NMHDR *hdr = (NMHDR*)lParam; - - switch (hdr->code) - { - case TCN_SELCHANGE: - OnSelChange(hwnd); - break; - } - } - break; - } - - return 0; -} - - -int DoConfig(HINSTANCE inst, HWND parent) -{ - return DialogBoxParam(inst, MAKEINTRESOURCE(IDD_CONFIG), parent, DialogProc, (LONG)inst) == IDOK; -} diff --git a/3rdparty/libflac/src/plugin_winamp2/configure.h b/3rdparty/libflac/src/plugin_winamp2/configure.h deleted file mode 100644 index 5c051aff73e..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/configure.h +++ /dev/null @@ -1,49 +0,0 @@ -/* in_flac - Winamp2 FLAC input plugin - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 "playback.h" - -/* - * common stuff - */ - -typedef struct { - struct { - char tag_format[256]; - char sep[16]; - WCHAR *tag_format_w; - } title; - struct { - BOOL reserve_space; - } tag; - struct { - FLAC__bool show_bps; - } display; - output_config_t output; -} flac_config_t; - -extern flac_config_t flac_cfg; - -/* - * prototypes - */ - -void InitConfig(); -void ReadConfig(); -void WriteConfig(); -int DoConfig(HINSTANCE inst, HWND parent); diff --git a/3rdparty/libflac/src/plugin_winamp2/in_flac.c b/3rdparty/libflac/src/plugin_winamp2/in_flac.c deleted file mode 100644 index dc3fc5480af..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/in_flac.c +++ /dev/null @@ -1,443 +0,0 @@ -/* in_flac - Winamp2 FLAC input plugin - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <windows.h> -#include <limits.h> /* for INT_MAX */ -#include <stdio.h> - -#include "share/alloc.h" -#include "winamp2/in2.h" -#include "configure.h" -#include "infobox.h" -#include "tagz.h" - -#define PLUGIN_VERSION "1.2.1" - -static In_Module mod_; /* the input module (declared near the bottom of this file) */ -static char lastfn_[MAX_PATH]; /* currently playing file (used for getting info on the current file) */ -flac_config_t flac_cfg; - -static stream_data_struct stream_data_; -static int paused; -static FLAC__StreamDecoder *decoder_; -static char sample_buffer_[SAMPLES_PER_WRITE * FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS * (24/8) * 2]; -/* (24/8) for max bytes per sample, and 2 for DSPs */ - -static HANDLE thread_handle = NULL; /* the handle to the decode thread */ -static DWORD WINAPI DecodeThread(void *b); /* the decode thread procedure */ - -/* - * init/quit - */ - -static void init() -{ - decoder_ = FLAC__stream_decoder_new(); - strcpy(lastfn_, ""); - - InitConfig(); - ReadConfig(); - InitInfobox(); -} - -static void quit() -{ - WriteConfig(); - DeinitInfobox(); - FLAC_plugin__decoder_delete(decoder_); - decoder_ = 0; -} - -/* - * open/close - */ - -static int isourfile(char *fn) { return 0; } - -static int play(char *fn) -{ - LONGLONG filesize; - DWORD thread_id; - int maxlatency; - /* checks */ - if (decoder_ == 0) return 1; - if (!(filesize = FileSize(fn))) return -1; - /* init decoder */ - if (!FLAC_plugin__decoder_init(decoder_, fn, filesize, &stream_data_, &flac_cfg.output)) - return 1; - strcpy(lastfn_, fn); - /* open output */ - maxlatency = mod_.outMod->Open(stream_data_.sample_rate, stream_data_.channels, stream_data_.output_bits_per_sample, -1, -1); - if (maxlatency < 0) - { - FLAC_plugin__decoder_finish(decoder_); - return 1; - } - /* set defaults */ - mod_.outMod->SetVolume(-666); - mod_.outMod->SetPan(0); - /* initialize vis stuff */ - mod_.SAVSAInit(maxlatency, stream_data_.sample_rate); - mod_.VSASetInfo(stream_data_.sample_rate, stream_data_.channels); - /* set info */ - mod_.SetInfo(stream_data_.average_bps, stream_data_.sample_rate/1000, stream_data_.channels, 1); - /* start playing thread */ - paused = 0; - thread_handle = CreateThread(NULL, 0, DecodeThread, NULL, 0, &thread_id); - if (!thread_handle) return 1; - - return 0; -} - -static void stop() -{ - if (thread_handle) - { - stream_data_.is_playing = false; - if (WaitForSingleObject(thread_handle, 2000) == WAIT_TIMEOUT) - { - FLAC_plugin__show_error("Error while stopping decoding thread."); - TerminateThread(thread_handle, 0); - } - CloseHandle(thread_handle); - thread_handle = NULL; - } - - FLAC_plugin__decoder_finish(decoder_); - mod_.outMod->Close(); - mod_.SAVSADeInit(); -} - -/* - * play control - */ - -static void pause() -{ - paused = 1; - mod_.outMod->Pause(1); -} - -static void unpause() -{ - paused = 0; - mod_.outMod->Pause(0); -} - -static int ispaused() -{ - return paused; -} - -static int getlength() -{ - return stream_data_.length_in_msec; -} - -static int getoutputtime() -{ - return mod_.outMod->GetOutputTime(); -} - -static void setoutputtime(int time_in_ms) -{ - stream_data_.seek_to = time_in_ms; -} - -static void setvolume(int volume) -{ - mod_.outMod->SetVolume(volume); -} - -static void setpan(int pan) -{ - mod_.outMod->SetPan(pan); -} - -static void eq_set(int on, char data[10], int preamp) {} - -/* - * playing loop - */ - -static void do_vis(char *data, int nch, int resolution, int position, unsigned samples) -{ - static char vis_buffer[SAMPLES_PER_WRITE * FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS]; - char *ptr; - int size, count; - - /* - * Winamp visuals may have problems accepting sample sizes larger than - * 16 bits, so we reduce the sample size here if necessary. - */ - - switch(resolution) { - case 32: - case 24: - size = resolution / 8; - count = samples * nch; - data += size - 1; - - ptr = vis_buffer; - while(count--) { - *ptr++ = data[0] ^ 0x80; - data += size; - } - - data = vis_buffer; - resolution = 8; - /* fall through */ - case 16: - case 8: - mod_.SAAddPCMData(data, nch, resolution, position); - mod_.VSAAddPCMData(data, nch, resolution, position); - } -} - -static DWORD WINAPI DecodeThread(void *unused) -{ - const unsigned channels = stream_data_.channels; - const unsigned bits_per_sample = stream_data_.bits_per_sample; - const unsigned target_bps = stream_data_.output_bits_per_sample; - const unsigned sample_rate = stream_data_.sample_rate; - const unsigned fact = channels * (target_bps/8); - - while (stream_data_.is_playing) - { - /* seek needed */ - if (stream_data_.seek_to != -1) - { - const int pos = FLAC_plugin__seek(decoder_, &stream_data_); - if (pos != -1) mod_.outMod->Flush(pos); - } - /* stream ended */ - else if (stream_data_.eof) - { - if (!mod_.outMod->IsPlaying()) - { - PostMessage(mod_.hMainWindow, WM_WA_MPEG_EOF, 0, 0); - return 0; - } - Sleep(10); - } - /* decode */ - else - { - /* decode samples */ - int bytes = FLAC_plugin__decode(decoder_, &stream_data_, sample_buffer_); - const int n = bytes / fact; - /* visualization */ - do_vis(sample_buffer_, channels, target_bps, mod_.outMod->GetWrittenTime(), n); - /* dsp */ - if (mod_.dsp_isactive()) - bytes = mod_.dsp_dosamples((short*)sample_buffer_, n, target_bps, channels, sample_rate) * fact; - /* output */ - while (mod_.outMod->CanWrite()<bytes && stream_data_.is_playing && stream_data_.seek_to==-1) - Sleep(20); - if (stream_data_.is_playing && stream_data_.seek_to==-1) - mod_.outMod->Write(sample_buffer_, bytes); - /* show bitrate */ - if (flac_cfg.display.show_bps) - { - const int rate = FLAC_plugin__get_rate(mod_.outMod->GetWrittenTime(), mod_.outMod->GetOutputTime(), &stream_data_); - if (rate) mod_.SetInfo(rate/1000, stream_data_.sample_rate/1000, stream_data_.channels, 1); - } - } - } - - return 0; -} - -/* - * title formatting - */ - -static T_CHAR *get_tag(const T_CHAR *tag, void *param) -{ - FLAC__StreamMetadata *tags = (FLAC__StreamMetadata*)param; - char *tagname, *p; - T_CHAR *val; - - if (!tag) - return 0; - /* Vorbis comment names must be ASCII, so convert 'tag' first */ - tagname = safe_malloc_add_2op_(wcslen(tag), /*+*/1); - for(p=tagname;*tag;) { - if(*tag > 0x7d) { - free(tagname); - return 0; - } - else - *p++ = (char)(*tag++); - } - *p++ = '\0'; - /* now get it */ - val = FLAC_plugin__tags_get_tag_ucs2(tags, tagname); - free(tagname); - /* some "user friendly cheavats" */ - if (!val) - { - if (!wcsicmp(tag, L"ARTIST")) - { - val = FLAC_plugin__tags_get_tag_ucs2(tags, "PERFORMER"); - if (!val) val = FLAC_plugin__tags_get_tag_ucs2(tags, "COMPOSER"); - } - else if (!wcsicmp(tag, L"YEAR") || !wcsicmp(tag, L"DATE")) - { - val = FLAC_plugin__tags_get_tag_ucs2(tags, "YEAR_RECORDED"); - if (!val) val = FLAC_plugin__tags_get_tag_ucs2(tags, "YEAR_PERFORMED"); - } - } - - return val; -} - -static void free_tag(T_CHAR *tag, void *param) -{ - (void)param; - free(tag); -} - -static void format_title(const char *filename, WCHAR *title, unsigned max_size) -{ - FLAC__StreamMetadata *tags; - - ReadTags(filename, &tags, /*forDisplay=*/true); - - tagz_format(flac_cfg.title.tag_format_w, get_tag, free_tag, tags, title, max_size); - - FLAC_plugin__tags_destroy(&tags); -} - -static void getfileinfo(char *filename, char *title, int *length_in_msec) -{ - FLAC__StreamMetadata streaminfo; - - if (!filename || !*filename) { - filename = lastfn_; - if (length_in_msec) { - *length_in_msec = stream_data_.length_in_msec; - length_in_msec = 0; /* force skip in following code */ - } - } - - if (!FLAC__metadata_get_streaminfo(filename, &streaminfo)) { - if (length_in_msec) - *length_in_msec = -1; - return; - } - - if (title) { - static WCHAR buffer[400]; - format_title(filename, buffer, 400); - WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, buffer, -1, title, 400, NULL, NULL); - } - - if (length_in_msec) { - /* with VC++ you have to spoon feed it the casting from uint64->int64->double */ - FLAC__uint64 l = (FLAC__uint64)((double)(FLAC__int64)streaminfo.data.stream_info.total_samples / (double)streaminfo.data.stream_info.sample_rate * 1000.0 + 0.5); - if (l > INT_MAX) - l = INT_MAX; - *length_in_msec = (int)l; - } -} - -/* - * interface - */ - -void FLAC_plugin__show_error(const char *message,...) -{ - char foo[512]; - va_list args; - va_start(args, message); - vsprintf(foo, message, args); - va_end(args); - MessageBox(mod_.hMainWindow, foo, "FLAC Plug-in Error", MB_ICONSTOP); -} - -static void about(HWND hwndParent) -{ - MessageBox(hwndParent, "Winamp2 FLAC Plugin v"PLUGIN_VERSION"\nby Josh Coalson and X-Fixer\n\nuses libFLAC "VERSION"\nSee http://flac.sourceforge.net/\n", "About FLAC Plugin", MB_ICONINFORMATION); -} - -static void config(HWND hwndParent) -{ - if (DoConfig(mod_.hDllInstance, hwndParent)) - WriteConfig(); -} - -static int infobox(char *fn, HWND hwnd) -{ - DoInfoBox(mod_.hDllInstance, hwnd, fn); - return 0; -} - -/* - * exported stuff - */ - -static In_Module mod_ = -{ - IN_VER, - "FLAC Decoder v" PLUGIN_VERSION, - 0, /* hMainWindow */ - 0, /* hDllInstance */ - "FLAC\0FLAC Audio File (*.FLAC)\0", - 1, /* is_seekable */ - 1, /* uses output */ - config, - about, - init, - quit, - getfileinfo, - infobox, - isourfile, - play, - pause, - unpause, - ispaused, - stop, - - getlength, - getoutputtime, - setoutputtime, - - setvolume, - setpan, - - 0,0,0,0,0,0,0,0,0, /* vis stuff */ - 0,0, /* dsp */ - eq_set, - NULL, /* setinfo */ - 0 /* out_mod */ -}; - -__declspec(dllexport) In_Module *winampGetInModule2() -{ - return &mod_; -} - -BOOL WINAPI _DllMainCRTStartup(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) -{ - return TRUE; -} diff --git a/3rdparty/libflac/src/plugin_winamp2/in_flac.dsp b/3rdparty/libflac/src/plugin_winamp2/in_flac.dsp deleted file mode 100644 index fa49abb7ef0..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/in_flac.dsp +++ /dev/null @@ -1,154 +0,0 @@ -# Microsoft Developer Studio Project File - Name="in_flac" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=in_flac - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "in_flac.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "in_flac.mak" CFG="in_flac - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "in_flac - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "in_flac - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "$/Studio/in_flac" -# PROP Scc_LocalPath "." -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "in_flac - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "in_flac_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /WX /GX /Ox /Og /Oi /Os /Op /Gf /Gy /I "include" /I ".." /I "..\..\include" /D "NDEBUG" /D VERSION=\"1.2.1\" /D "in_flac_EXPORTS" /D "FLAC__NO_DLL" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TAGZ_UNICODE" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 plugin_common_static.lib grabbag_static.lib libFLAC_static.lib replaygain_analysis_static.lib replaygain_synthesis_static.lib kernel32.lib user32.lib /nologo /dll /machine:I386 /out:"../../obj/release/bin/in_flac.dll" /libpath:"../../obj/release/lib" ..\..\obj\release\lib\ogg_static.lib /opt:nowin98 -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "in_flac - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "in_flac_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "include" /I ".." /I "..\..\include" /D "_DEBUG" /D "DEBUG" /D "REAL_STDIO" /D VERSION=\"1.2.1\" /D "in_flac_EXPORTS" /D "FLAC__NO_DLL" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TAGZ_UNICODE" /YX /FD /GZ /c -# SUBTRACT CPP /WX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 plugin_common_static.lib grabbag_static.lib libFLAC_static.lib replaygain_analysis_static.lib replaygain_synthesis_static.lib kernel32.lib user32.lib /nologo /dll /debug /machine:I386 /out:"../../obj/debug/bin/in_flac.dll" /pdbtype:sept /libpath:"../../obj/debug/lib" ..\..\obj\release\lib\ogg_static.lib -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "in_flac - Win32 Release" -# Name "in_flac - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Group "Winamp2 SDK" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\winamp2\in2.h -# End Source File -# Begin Source File - -SOURCE=.\include\winamp2\out.h -# End Source File -# End Group -# Begin Source File - -SOURCE=.\configure.c -# End Source File -# Begin Source File - -SOURCE=.\configure.h -# End Source File -# Begin Source File - -SOURCE=.\in_flac.c -# End Source File -# Begin Source File - -SOURCE=.\infobox.c -# End Source File -# Begin Source File - -SOURCE=.\infobox.h -# End Source File -# Begin Source File - -SOURCE=.\playback.c -# End Source File -# Begin Source File - -SOURCE=.\playback.h -# End Source File -# Begin Source File - -SOURCE=.\resource.h -# End Source File -# Begin Source File - -SOURCE=.\resource.rc -# End Source File -# Begin Source File - -SOURCE=.\tagz.cpp -# End Source File -# Begin Source File - -SOURCE=.\tagz.h -# End Source File -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/plugin_winamp2/in_flac.vcproj b/3rdparty/libflac/src/plugin_winamp2/in_flac.vcproj deleted file mode 100644 index 553451c7b30..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/in_flac.vcproj +++ /dev/null @@ -1,259 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="in_flac" - ProjectGUID="{4cefbc82-c215-11db-8314-0800200c9a66}" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\obj\debug\lib" - IntermediateDirectory="Debug_dynamic" - ConfigurationType="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".\include;..;..\..\include" - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;IN_FLAC_EXPORTS;FLAC__NO_DLL;VERSION=\"1.2.0\";TAGZ_UNICODE;DEBUG" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - AdditionalIncludeDirectories=""C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include"" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="..\..\obj\release\lib\ogg_static.lib user32.lib" - LinkIncremental="2" - AdditionalLibraryDirectories="C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Lib" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="2" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\obj\release\lib" - IntermediateDirectory="Release_dynamic" - ConfigurationType="2" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".\include;..;..\..\include" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IN_FLAC_EXPORTS;FLAC__NO_DLL;VERSION=\"1.2.0\";TAGZ_UNICODE" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - AdditionalIncludeDirectories=""C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include"" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="..\..\obj\release\lib\ogg_static.lib user32.lib" - LinkIncremental="1" - AdditionalLibraryDirectories="C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Lib" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="2" - OptimizeReferences="2" - EnableCOMDATFolding="2" - LinkTimeCodeGeneration="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath=".\configure.h" - > - </File> - <File - RelativePath=".\include\winamp2\in2.h" - > - </File> - <File - RelativePath=".\infobox.h" - > - </File> - <File - RelativePath=".\include\winamp2\out.h" - > - </File> - <File - RelativePath=".\playback.h" - > - </File> - <File - RelativePath=".\resource.h" - > - </File> - <File - RelativePath=".\tagz.h" - > - </File> - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" - UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" - > - <File - RelativePath=".\resource.rc" - > - </File> - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\configure.c" - > - </File> - <File - RelativePath=".\in_flac.c" - > - </File> - <File - RelativePath=".\infobox.c" - > - </File> - <File - RelativePath=".\playback.c" - > - </File> - <File - RelativePath=".\tagz.cpp" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/plugin_winamp2/include/Makefile.am b/3rdparty/libflac/src/plugin_winamp2/include/Makefile.am deleted file mode 100644 index ea96623b482..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/include/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -# in_flac - Winamp2 FLAC input plugin -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 - -SUBDIRS = winamp2 diff --git a/3rdparty/libflac/src/plugin_winamp2/include/Makefile.in b/3rdparty/libflac/src/plugin_winamp2/include/Makefile.in deleted file mode 100644 index 832ec5257d3..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/include/Makefile.in +++ /dev/null @@ -1,520 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# in_flac - Winamp2 FLAC input plugin -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -SUBDIRS = winamp2 -subdir = src/plugin_winamp2/include -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = - -RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ - ps-recursive install-info-recursive uninstall-info-recursive \ - all-recursive install-data-recursive install-exec-recursive \ - installdirs-recursive install-recursive uninstall-recursive \ - check-recursive installcheck-recursive -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -DIST_SUBDIRS = $(SUBDIRS) -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/plugin_winamp2/include/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if (etags --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - else \ - include_option=--include; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: - -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags - -dvi: dvi-recursive - -dvi-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ - clean-generic clean-libtool clean-recursive ctags \ - ctags-recursive distclean distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am \ - dvi-recursive info info-am info-recursive install install-am \ - install-data install-data-am install-data-recursive \ - install-exec install-exec-am install-exec-recursive \ - install-info install-info-am install-info-recursive install-man \ - install-recursive install-strip installcheck installcheck-am \ - installdirs installdirs-am installdirs-recursive \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-libtool mostlyclean-recursive pdf pdf-am \ - pdf-recursive ps ps-am ps-recursive tags tags-recursive \ - uninstall uninstall-am uninstall-info-am \ - uninstall-info-recursive uninstall-recursive - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/plugin_winamp2/include/winamp2/Makefile.am b/3rdparty/libflac/src/plugin_winamp2/include/winamp2/Makefile.am deleted file mode 100644 index 8153ed8bc81..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/include/winamp2/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ -# in_flac - Winamp2 FLAC input plugin -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 - -EXTRA_DIST = \ - in2.h \ - out.h diff --git a/3rdparty/libflac/src/plugin_winamp2/include/winamp2/Makefile.in b/3rdparty/libflac/src/plugin_winamp2/include/winamp2/Makefile.in deleted file mode 100644 index a9082bde301..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/include/winamp2/Makefile.in +++ /dev/null @@ -1,374 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# in_flac - Winamp2 FLAC input plugin -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -EXTRA_DIST = \ - in2.h \ - out.h - -subdir = src/plugin_winamp2/include/winamp2 -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/plugin_winamp2/include/winamp2/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/plugin_winamp2/include/winamp2/in2.h b/3rdparty/libflac/src/plugin_winamp2/include/winamp2/in2.h deleted file mode 100644 index 130ec496915..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/include/winamp2/in2.h +++ /dev/null @@ -1,107 +0,0 @@ -/* Standard Winamp input-plugin header - */ - -#include "out.h" - -/* post this to the main window at end of file (after playback as stopped) */ -#define WM_WA_MPEG_EOF (WM_USER + 2) - -// note: exported symbol is now winampGetInModule2. - -#define IN_VER 0x100 - -typedef struct -{ - int version; // module type (IN_VER) - char *description; // description of module, with version string - - HWND hMainWindow; // winamp's main window (filled in by winamp) - HINSTANCE hDllInstance; // DLL instance handle (Also filled in by winamp) - - char *FileExtensions; // "mp3\0Layer 3 MPEG\0mp2\0Layer 2 MPEG\0mpg\0Layer 1 MPEG\0" - // May be altered from Config, so the user can select what they want - - int is_seekable; // is this stream seekable? - int UsesOutputPlug; // does this plug-in use the output plug-ins? (musn't ever change, ever :) - - void (*Config)(HWND hwndParent); // configuration dialog - void (*About)(HWND hwndParent); // about dialog - - void (*Init)(); // called at program init - void (*Quit)(); // called at program quit - - void (*GetFileInfo)(char *file, char *title, int *length_in_ms); // if file == NULL, current playing is used - int (*InfoBox)(char *file, HWND hwndParent); - - int (*IsOurFile)(char *fn); // called before extension checks, to allow detection of mms://, etc - // playback stuff - int (*Play)(char *fn); // return zero on success, -1 on file-not-found, some other value on other (stopping winamp) error - void (*Pause)(); // pause stream - void (*UnPause)(); // unpause stream - int (*IsPaused)(); // ispaused? return 1 if paused, 0 if not - void (*Stop)(); // stop (unload) stream - - // time stuff - int (*GetLength)(); // get length in ms - int (*GetOutputTime)(); // returns current output time in ms. (usually returns outMod->GetOutputTime() - void (*SetOutputTime)(int time_in_ms); // seeks to point in stream (in ms). Usually you signal yoru thread to seek, which seeks and calls outMod->Flush().. - - // volume stuff - void (*SetVolume)(int volume); // from 0 to 255.. usually just call outMod->SetVolume - void (*SetPan)(int pan); // from -127 to 127.. usually just call outMod->SetPan - - // in-window builtin vis stuff - - void (*SAVSAInit)(int maxlatency_in_ms, int srate); // call once in Play(). maxlatency_in_ms should be the value returned from outMod->Open() - // call after opening audio device with max latency in ms and samplerate - void (*SAVSADeInit)(); // call in Stop() - - - // simple vis supplying mode - void (*SAAddPCMData)(void *PCMData, int nch, int bps, int timestamp); - // sets the spec data directly from PCM data - // quick and easy way to get vis working :) - // needs at least 576 samples :) - - // advanced vis supplying mode, only use if you're cool. Use SAAddPCMData for most stuff. - int (*SAGetMode)(); // gets csa (the current type (4=ws,2=osc,1=spec)) - // use when calling SAAdd() - void (*SAAdd)(void *data, int timestamp, int csa); // sets the spec data, filled in by winamp - - - // vis stuff (plug-in) - // simple vis supplying mode - void (*VSAAddPCMData)(void *PCMData, int nch, int bps, int timestamp); // sets the vis data directly from PCM data - // quick and easy way to get vis working :) - // needs at least 576 samples :) - - // advanced vis supplying mode, only use if you're cool. Use VSAAddPCMData for most stuff. - int (*VSAGetMode)(int *specNch, int *waveNch); // use to figure out what to give to VSAAdd - void (*VSAAdd)(void *data, int timestamp); // filled in by winamp, called by plug-in - - - // call this in Play() to tell the vis plug-ins the current output params. - void (*VSASetInfo)(int nch, int srate); - - - // dsp plug-in processing: - // (filled in by winamp, called by input plug) - - // returns 1 if active (which means that the number of samples returned by dsp_dosamples - // could be greater than went in.. Use it to estimate if you'll have enough room in the - // output buffer - int (*dsp_isactive)(); - - // returns number of samples to output. This can be as much as twice numsamples. - // be sure to allocate enough buffer for samples, then. - int (*dsp_dosamples)(short int *samples, int numsamples, int bps, int nch, int srate); - - - // eq stuff - void (*EQSet)(int on, char data[10], int preamp); // 0-64 each, 31 is +0, 0 is +12, 63 is -12. Do nothing to ignore. - - // info setting (filled in by winamp) - void (*SetInfo)(int bitrate, int srate, int stereo, int synched); // if -1, changes ignored? :) - - Out_Module *outMod; // filled in by winamp, optionally used :) -} In_Module; diff --git a/3rdparty/libflac/src/plugin_winamp2/include/winamp2/out.h b/3rdparty/libflac/src/plugin_winamp2/include/winamp2/out.h deleted file mode 100644 index e8ad41270a5..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/include/winamp2/out.h +++ /dev/null @@ -1,55 +0,0 @@ -/* Standard Winamp output-plugin header - */ - -#define OUT_VER 0x10 - -typedef struct -{ - int version; // module version (OUT_VER) - char *description; // description of module, with version string - int id; // module id. each input module gets its own. non-nullsoft modules should - // be >= 65536. - - HWND hMainWindow; // winamp's main window (filled in by winamp) - HINSTANCE hDllInstance; // DLL instance handle (filled in by winamp) - - void (*Config)(HWND hwndParent); // configuration dialog - void (*About)(HWND hwndParent); // about dialog - - void (*Init)(); // called when loaded - void (*Quit)(); // called when unloaded - - int (*Open)(int samplerate, int numchannels, int bitspersamp, int bufferlenms, int prebufferms); - // returns >=0 on success, <0 on failure - // NOTENOTENOTE: bufferlenms and prebufferms are ignored in most if not all output plug-ins. - // ... so don't expect the max latency returned to be what you asked for. - // returns max latency in ms (0 for diskwriters, etc) - // bufferlenms and prebufferms must be in ms. 0 to use defaults. - // prebufferms must be <= bufferlenms - - void (*Close)(); // close the ol' output device. - - int (*Write)(char *buf, int len); - // 0 on success. Len == bytes to write (<= 8192 always). buf is straight audio data. - // 1 returns not able to write (yet). Non-blocking, always. - - int (*CanWrite)(); // returns number of bytes possible to write at a given time. - // Never will decrease unless you call Write (or Close, heh) - - int (*IsPlaying)(); // non0 if output is still going or if data in buffers waiting to be - // written (i.e. closing while IsPlaying() returns 1 would truncate the song - - int (*Pause)(int pause); // returns previous pause state - - void (*SetVolume)(int volume); // volume is 0-255 - void (*SetPan)(int pan); // pan is -128 to 128 - - void (*Flush)(int t); // flushes buffers and restarts output at time t (in ms) - // (used for seeking) - - int (*GetOutputTime)(); // returns played time in MS - int (*GetWrittenTime)(); // returns time written in MS (used for synching up vis stuff) - -} Out_Module; - - diff --git a/3rdparty/libflac/src/plugin_winamp2/infobox.c b/3rdparty/libflac/src/plugin_winamp2/infobox.c deleted file mode 100644 index 00dc5e6fa44..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/infobox.c +++ /dev/null @@ -1,459 +0,0 @@ -/* in_flac - Winamp2 FLAC input plugin - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <windows.h> -#include <stdio.h> -#include "FLAC/all.h" -#include "share/alloc.h" -#include "plugin_common/all.h" -#include "infobox.h" -#include "configure.h" -#include "resource.h" - - -typedef struct -{ - char filename[MAX_PATH]; - FLAC__StreamMetadata *tags; -} LOCALDATA; - -static char buffer[8192]; -static char *genres = NULL; -static DWORD genresSize = 0, genresCount = 0; -static BOOL genresChanged = FALSE, isNT; - -static const char infoTitle[] = "FLAC File Info"; - -/* - * Genres - */ - -/* TODO: write genres in utf-8 ? */ - -static __inline int GetGenresFileName(char *buffer, int size) -{ - char *c; - - if (!GetModuleFileName(NULL, buffer, size)) - return 0; - c = strrchr(buffer, '\\'); - if (!c) return 0; - strcpy(c+1, "genres.txt"); - - return 1; -} - -static void LoadGenres() -{ - HANDLE hFile; - DWORD spam; - char *c; - - FLAC__ASSERT(0 != genres); - - if (!GetGenresFileName(buffer, sizeof(buffer))) return; - /* load file */ - hFile = CreateFile(buffer, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (hFile == INVALID_HANDLE_VALUE) return; - genresSize = GetFileSize(hFile, 0); - if (genresSize && (genres = (char*)safe_malloc_add_2op_(genresSize, /*+*/2))) - { - if (!ReadFile(hFile, genres, genresSize, &spam, NULL) || spam!=genresSize) - { - free(genres); - genres = NULL; - } - else - { - genres[genresSize] = 0; - genres[genresSize+1] = 0; - /* replace newlines */ - genresChanged = FALSE; - genresCount = 1; - - for (c=genres; *c; c++) - { - if (*c == 10) - { - *c = 0; - if (*(c+1)) - genresCount++; - else genresSize--; - } - } - } - } - - CloseHandle(hFile); -} - -static void SaveGenres(HWND hlist) -{ - HANDLE hFile; - DWORD spam; - int i, count, len; - - if (!GetGenresFileName(buffer, sizeof(buffer))) return; - /* write file */ - hFile = CreateFile(buffer, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if (hFile == INVALID_HANDLE_VALUE) return; - - count = SendMessage(hlist, CB_GETCOUNT, 0, 0); - for (i=0; i<count; i++) - { - SendMessage(hlist, CB_GETLBTEXT, i, (LPARAM)buffer); - len = strlen(buffer); - if (i != count-1) - { - buffer[len] = 10; - len++; - } - WriteFile(hFile, buffer, len, &spam, NULL); - } - - CloseHandle(hFile); -} - -static void AddGenre(HWND hwnd, const char *genre) -{ - HWND hgen = GetDlgItem(hwnd, IDC_GENRE); - - if (SendMessage(hgen, CB_FINDSTRINGEXACT, -1, (LPARAM)genre) == CB_ERR) - { - genresChanged = TRUE; - SendMessage(hgen, CB_ADDSTRING, 0, (LPARAM)genre); - } -} - -static void InitGenres(HWND hwnd) -{ - HWND hgen = GetDlgItem(hwnd, IDC_GENRE); - char *c; - - /* set text length limit to 64 chars */ - SendMessage(hgen, CB_LIMITTEXT, 64, 0); - /* try to load genres */ - if (!genres) - LoadGenres(hgen); - /* add the to list */ - if (genres) - { - SendMessage(hgen, CB_INITSTORAGE, genresCount, genresSize); - - for (c = genres; *c; c += strlen(c)+1) - SendMessage(hgen, CB_ADDSTRING, 0, (LPARAM)c); - } -} - -static void DeinitGenres(HWND hwnd, BOOL final) -{ - if (genresChanged && hwnd) - { - SaveGenres(GetDlgItem(hwnd, IDC_GENRE)); - genresChanged = FALSE; - final = TRUE; - } - if (final) - { - free(genres); - genres = 0; - } -} - -static wchar_t *AnsiToWide(const char *src) -{ - int len; - wchar_t *dest; - - FLAC__ASSERT(0 != src); - - len = strlen(src) + 1; - /* copy */ - dest = (wchar_t*)safe_malloc_mul_2op_(len, /*times*/sizeof(wchar_t)); - if (dest) mbstowcs(dest, src, len); - return dest; -} - -/* - * Infobox helpers - */ - -#define SetText(x,y) ucs2 = FLAC_plugin__tags_get_tag_ucs2(data->tags, y); \ - WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, ucs2, -1, buffer, sizeof(buffer), NULL, NULL); \ - if(ucs2) free(ucs2); \ - SetDlgItemText(hwnd, x, buffer) - -#define GetText(x,y) GetDlgItemText(hwnd, x, buffer, sizeof(buffer)); \ - if (*buffer) { ucs2 = AnsiToWide(buffer); FLAC_plugin__tags_set_tag_ucs2(data->tags, y, ucs2, /*replace_all=*/false); free(ucs2); } \ - else FLAC_plugin__tags_delete_tag(data->tags, y) - -#define SetTextW(x,y) ucs2 = FLAC_plugin__tags_get_tag_ucs2(data->tags, y); \ - SetDlgItemTextW(hwnd, x, ucs2); \ - free(ucs2) - -#define GetTextW(x,y) GetDlgItemTextW(hwnd, x, (WCHAR*)buffer, sizeof(buffer)/2); \ - if (*(WCHAR*)buffer) FLAC_plugin__tags_set_tag_ucs2(data->tags, y, (WCHAR*)buffer, /*replace_all=*/false); \ - else FLAC_plugin__tags_delete_tag(data->tags, y) - - -static BOOL InitInfoboxInfo(HWND hwnd, const char *file) -{ - LOCALDATA *data = LocalAlloc(LPTR, sizeof(LOCALDATA)); - wchar_t *ucs2; - FLAC__StreamMetadata streaminfo; - DWORD length, bps, ratio, rg; - LONGLONG filesize; - - SetWindowLong(hwnd, GWL_USERDATA, (LONG)data); - /* file name */ - strncpy(data->filename, file, sizeof(data->filename)); - SetDlgItemText(hwnd, IDC_NAME, file); - /* stream data and vorbis comment */ - filesize = FileSize(file); - if (!filesize) return FALSE; - if (!FLAC__metadata_get_streaminfo(file, &streaminfo)) - return FALSE; - ReadTags(file, &data->tags, false); - - length = (DWORD)(streaminfo.data.stream_info.total_samples / streaminfo.data.stream_info.sample_rate); - bps = (DWORD)(filesize / (125*streaminfo.data.stream_info.total_samples/streaminfo.data.stream_info.sample_rate)); - ratio = bps*1000000 / (streaminfo.data.stream_info.sample_rate*streaminfo.data.stream_info.channels*streaminfo.data.stream_info.bits_per_sample); - rg = FLAC_plugin__tags_get_tag_utf8(data->tags, "REPLAYGAIN_TRACK_GAIN") ? 1 : 0; - rg |= FLAC_plugin__tags_get_tag_utf8(data->tags, "REPLAYGAIN_ALBUM_GAIN") ? 2 : 0; - - sprintf(buffer, "Sample rate: %d Hz\nChannels: %d\nBits per sample: %d\nMin block size: %d\nMax block size: %d\n" - "File size: %I64d bytes\nTotal samples: %I64d\nLength: %d:%02d\nAvg. bitrate: %d\nCompression ratio: %d.%d%%\n" - "ReplayGain: %s\n", - streaminfo.data.stream_info.sample_rate, streaminfo.data.stream_info.channels, streaminfo.data.stream_info.bits_per_sample, - streaminfo.data.stream_info.min_blocksize, streaminfo.data.stream_info.max_blocksize, filesize, streaminfo.data.stream_info.total_samples, - length/60, length%60, bps, ratio/10, ratio%10, - rg==3 ? "track gain\nReplayGain: album gain" : rg==2 ? "album gain" : rg==1 ? "track gain" : "not present"); - - SetDlgItemText(hwnd, IDC_INFO, buffer); - /* tag */ - if (isNT) - { - SetTextW(IDC_TITLE, "TITLE"); - SetTextW(IDC_ARTIST, "ARTIST"); - SetTextW(IDC_ALBUM, "ALBUM"); - SetTextW(IDC_COMMENT, "COMMENT"); - SetTextW(IDC_YEAR, "DATE"); - SetTextW(IDC_TRACK, "TRACKNUMBER"); - SetTextW(IDC_GENRE, "GENRE"); - } - else - { - SetText(IDC_TITLE, "TITLE"); - SetText(IDC_ARTIST, "ARTIST"); - SetText(IDC_ALBUM, "ALBUM"); - SetText(IDC_COMMENT, "COMMENT"); - SetText(IDC_YEAR, "DATE"); - SetText(IDC_TRACK, "TRACKNUMBER"); - SetText(IDC_GENRE, "GENRE"); - } - - return TRUE; -} - -static void __inline SetTag(HWND hwnd, const char *filename, FLAC__StreamMetadata *tags) -{ - strcpy(buffer, infoTitle); - - if (FLAC_plugin__tags_set(filename, tags)) - strcat(buffer, " [Updated]"); - else strcat(buffer, " [Failed]"); - - SetWindowText(hwnd, buffer); -} - -static void UpdateTag(HWND hwnd) -{ - LOCALDATA *data = (LOCALDATA*)GetWindowLong(hwnd, GWL_USERDATA); - wchar_t *ucs2; - - /* get fields */ - if (isNT) - { - GetTextW(IDC_TITLE, "TITLE"); - GetTextW(IDC_ARTIST, "ARTIST"); - GetTextW(IDC_ALBUM, "ALBUM"); - GetTextW(IDC_COMMENT, "COMMENT"); - GetTextW(IDC_YEAR, "DATE"); - GetTextW(IDC_TRACK, "TRACKNUMBER"); - GetTextW(IDC_GENRE, "GENRE"); - - ucs2 = FLAC_plugin__tags_get_tag_ucs2(data->tags, "GENRE"); - WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, ucs2, -1, buffer, sizeof(buffer), NULL, NULL); - free(ucs2); - } - else - { - GetText(IDC_TITLE, "TITLE"); - GetText(IDC_ARTIST, "ARTIST"); - GetText(IDC_ALBUM, "ALBUM"); - GetText(IDC_COMMENT, "COMMENT"); - GetText(IDC_YEAR, "DATE"); - GetText(IDC_TRACK, "TRACKNUMBER"); - GetText(IDC_GENRE, "GENRE"); - } - - /* update genres list (buffer should contain genre) */ - if (buffer[0]) AddGenre(hwnd, buffer); - - /* write tag */ - SetTag(hwnd, data->filename, data->tags); -} - -static void RemoveTag(HWND hwnd) -{ - LOCALDATA *data = (LOCALDATA*)GetWindowLong(hwnd, GWL_USERDATA); - FLAC_plugin__tags_delete_all(data->tags); - - SetDlgItemText(hwnd, IDC_TITLE, ""); - SetDlgItemText(hwnd, IDC_ARTIST, ""); - SetDlgItemText(hwnd, IDC_ALBUM, ""); - SetDlgItemText(hwnd, IDC_COMMENT, ""); - SetDlgItemText(hwnd, IDC_YEAR, ""); - SetDlgItemText(hwnd, IDC_TRACK, ""); - SetDlgItemText(hwnd, IDC_GENRE, ""); - - SetTag(hwnd, data->filename, data->tags); -} - - -static INT_PTR CALLBACK InfoProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) - { - /* init */ - case WM_INITDIALOG: - SetWindowText(hwnd, infoTitle); - InitGenres(hwnd); - /* init fields */ - if (!InitInfoboxInfo(hwnd, (const char*)lParam)) - PostMessage(hwnd, WM_CLOSE, 0, 0); - return TRUE; - /* destroy */ - case WM_DESTROY: - { - LOCALDATA *data = (LOCALDATA*)GetWindowLong(hwnd, GWL_USERDATA); - FLAC_plugin__tags_destroy(&data->tags); - LocalFree(data); - DeinitGenres(hwnd, FALSE); - } - break; - /* commands */ - case WM_COMMAND: - switch (LOWORD(wParam)) - { - /* ok/cancel */ - case IDOK: - case IDCANCEL: - EndDialog(hwnd, LOWORD(wParam)); - return TRUE; - /* save */ - case IDC_UPDATE: - UpdateTag(hwnd); - break; - /* remove */ - case IDC_REMOVE: - RemoveTag(hwnd); - break; - } - break; - } - - return 0; -} - -/* - * Helpers - */ - -ULONGLONG FileSize(const char *fileName) -{ - LARGE_INTEGER res; - HANDLE hFile = CreateFile(fileName, 0, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - - if (hFile == INVALID_HANDLE_VALUE) return 0; - res.LowPart = GetFileSize(hFile, &res.HighPart); - CloseHandle(hFile); - return res.QuadPart; -} - -static __inline char *GetFileName(const char *fullname) -{ - const char *c = fullname + strlen(fullname) - 1; - - while (c > fullname) - { - if (*c=='\\' || *c=='/') - { - c++; - break; - } - c--; - } - - return (char*)c; -} - -void ReadTags(const char *fileName, FLAC__StreamMetadata **tags, BOOL forDisplay) -{ - if(FLAC_plugin__tags_get(fileName, tags)) { - - /* add file name */ - if (forDisplay) - { - char *c; - wchar_t *ucs2; - ucs2 = AnsiToWide(fileName); - FLAC_plugin__tags_set_tag_ucs2(*tags, "filepath", ucs2, /*replace_all=*/true); - free(ucs2); - - strcpy(buffer, GetFileName(fileName)); - if (c = strrchr(buffer, '.')) *c = 0; - ucs2 = AnsiToWide(buffer); - FLAC_plugin__tags_set_tag_ucs2(*tags, "filename", ucs2, /*replace_all=*/true); - free(ucs2); - } - } -} - -/* - * Front-end - */ - -void InitInfobox() -{ - isNT = !(GetVersion() & 0x80000000); -} - -void DeinitInfobox() -{ - DeinitGenres(NULL, true); -} - -void DoInfoBox(HINSTANCE inst, HWND hwnd, const char *filename) -{ - DialogBoxParam(inst, MAKEINTRESOURCE(IDD_INFOBOX), hwnd, InfoProc, (LONG)filename); -} diff --git a/3rdparty/libflac/src/plugin_winamp2/infobox.h b/3rdparty/libflac/src/plugin_winamp2/infobox.h deleted file mode 100644 index dc71490ce76..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/infobox.h +++ /dev/null @@ -1,28 +0,0 @@ -/* in_flac - Winamp2 FLAC input plugin - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 - */ - -/* - * prototypes - */ - -ULONGLONG FileSize(const char *fileName); -void ReadTags(const char *fileName, FLAC__StreamMetadata **tags, BOOL forDisplay); - -void InitInfobox(); -void DeinitInfobox(); -void DoInfoBox(HINSTANCE inst, HWND hwnd, const char *filename); diff --git a/3rdparty/libflac/src/plugin_winamp2/playback.c b/3rdparty/libflac/src/plugin_winamp2/playback.c deleted file mode 100644 index 99de9e63f89..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/playback.c +++ /dev/null @@ -1,307 +0,0 @@ -/* in_flac - Winamp2 FLAC input plugin - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <limits.h> /* for INT_MAX */ -#include <stdlib.h> -#include <string.h> /* for memmove() */ -#include "playback.h" -#include "share/grabbag.h" - - -static FLAC__int32 reservoir_[FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS][FLAC__MAX_BLOCK_SIZE * 2/*for overflow*/]; -static FLAC__int32 *reservoir__[FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS] = { reservoir_[0], reservoir_[1] }; /*@@@ kind of a hard-coded hack */ -static unsigned wide_samples_in_reservoir_; -static output_config_t cfg; /* local copy */ - -static unsigned bh_index_last_w, bh_index_last_o, written_time_last; -static FLAC__int64 decode_position, decode_position_last; - -/* - * callbacks - */ - -static FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data) -{ - stream_data_struct *stream_data = (stream_data_struct*)client_data; - const unsigned channels = stream_data->channels, wide_samples = frame->header.blocksize; - unsigned channel; - - (void)decoder; - - if (stream_data->abort_flag) - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - - for (channel = 0; channel < channels; channel++) - memcpy(&reservoir_[channel][wide_samples_in_reservoir_], buffer[channel], sizeof(buffer[0][0]) * wide_samples); - - wide_samples_in_reservoir_ += wide_samples; - - return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; -} - -static void metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) -{ - stream_data_struct *stream_data = (stream_data_struct*)client_data; - (void)decoder; - - if (metadata->type == FLAC__METADATA_TYPE_STREAMINFO) - { - stream_data->total_samples = metadata->data.stream_info.total_samples; - stream_data->bits_per_sample = metadata->data.stream_info.bits_per_sample; - stream_data->channels = metadata->data.stream_info.channels; - stream_data->sample_rate = metadata->data.stream_info.sample_rate; - - if (stream_data->bits_per_sample!=8 && stream_data->bits_per_sample!=16 && stream_data->bits_per_sample!=24) - { - FLAC_plugin__show_error("This plugin can only handle 8/16/24-bit samples."); - stream_data->abort_flag = true; - return; - } - - { - /* with VC++ you have to spoon feed it the casting from uint64->int64->double */ - FLAC__uint64 l = (FLAC__uint64)((double)(FLAC__int64)stream_data->total_samples / (double)stream_data->sample_rate * 1000.0 + 0.5); - if (l > INT_MAX) - l = INT_MAX; - stream_data->length_in_msec = (int)l; - } - } - else if (metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) - { - double reference, gain, peak; - if (grabbag__replaygain_load_from_vorbiscomment(metadata, cfg.replaygain.album_mode, /*strict=*/false, &reference, &gain, &peak)) - { - stream_data->has_replaygain = true; - stream_data->replay_scale = grabbag__replaygain_compute_scale_factor(peak, gain, (double)cfg.replaygain.preamp, !cfg.replaygain.hard_limit); - } - } -} - -static void error_callback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) -{ - stream_data_struct *stream_data = (stream_data_struct*)client_data; - (void)decoder; - - if (cfg.misc.stop_err || status!=FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC) - stream_data->abort_flag = true; -} - -/* - * init/delete - */ - -FLAC__bool FLAC_plugin__decoder_init(FLAC__StreamDecoder *decoder, const char *filename, FLAC__int64 filesize, stream_data_struct *stream_data, output_config_t *config) -{ - FLAC__StreamDecoderInitStatus init_status; - - FLAC__ASSERT(decoder); - FLAC_plugin__decoder_finish(decoder); - /* init decoder */ - FLAC__stream_decoder_set_md5_checking(decoder, false); - FLAC__stream_decoder_set_metadata_ignore_all(decoder); - FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_STREAMINFO); - FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT); - - if ((init_status = FLAC__stream_decoder_init_file(decoder, filename, write_callback, metadata_callback, error_callback, /*client_data=*/stream_data)) != FLAC__STREAM_DECODER_INIT_STATUS_OK) - { - FLAC_plugin__show_error("Error while initializing decoder (%s [%s]).", FLAC__StreamDecoderInitStatusString[init_status], FLAC__stream_decoder_get_resolved_state_string(decoder)); - return false; - } - /* process */ - cfg = *config; - wide_samples_in_reservoir_ = 0; - stream_data->is_playing = false; - stream_data->abort_flag = false; - stream_data->has_replaygain = false; - - if (!FLAC__stream_decoder_process_until_end_of_metadata(decoder)) - { - FLAC_plugin__show_error("Error while processing metadata (%s).", FLAC__stream_decoder_get_resolved_state_string(decoder)); - return false; - } - /* check results */ - if (stream_data->abort_flag) return false; /* metadata callback already popped up the error dialog */ - /* init replaygain */ - stream_data->output_bits_per_sample = stream_data->has_replaygain && cfg.replaygain.enable ? - cfg.resolution.replaygain.bps_out : - cfg.resolution.normal.dither_24_to_16 ? min(stream_data->bits_per_sample, 16) : stream_data->bits_per_sample; - - if (stream_data->has_replaygain && cfg.replaygain.enable && cfg.resolution.replaygain.dither) - FLAC__replaygain_synthesis__init_dither_context(&stream_data->dither_context, stream_data->bits_per_sample, cfg.resolution.replaygain.noise_shaping); - /* more inits */ - stream_data->eof = false; - stream_data->seek_to = -1; - stream_data->is_playing = true; - stream_data->average_bps = (unsigned)(filesize / (125.*(double)(FLAC__int64)stream_data->total_samples/(double)stream_data->sample_rate)); - - bh_index_last_w = 0; - bh_index_last_o = BITRATE_HIST_SIZE; - decode_position = 0; - decode_position_last = 0; - written_time_last = 0; - - return true; -} - -void FLAC_plugin__decoder_finish(FLAC__StreamDecoder *decoder) -{ - if (decoder && FLAC__stream_decoder_get_state(decoder) != FLAC__STREAM_DECODER_UNINITIALIZED) - (void)FLAC__stream_decoder_finish(decoder); -} - -void FLAC_plugin__decoder_delete(FLAC__StreamDecoder *decoder) -{ - if (decoder) - { - FLAC_plugin__decoder_finish(decoder); - FLAC__stream_decoder_delete(decoder); - } -} - -/* - * decode - */ - -int FLAC_plugin__seek(FLAC__StreamDecoder *decoder, stream_data_struct *stream_data) -{ - int pos; - FLAC__uint64 target_sample = stream_data->total_samples * stream_data->seek_to / stream_data->length_in_msec; - - if (stream_data->total_samples > 0 && target_sample >= stream_data->total_samples && target_sample > 0) - target_sample = stream_data->total_samples - 1; - - /* even if the seek fails we have to reset these so that we don't repeat the seek */ - stream_data->seek_to = -1; - stream_data->eof = false; - wide_samples_in_reservoir_ = 0; - pos = (int)(target_sample*1000 / stream_data->sample_rate); - - if (!FLAC__stream_decoder_seek_absolute(decoder, target_sample)) { - if(FLAC__stream_decoder_get_state(decoder) == FLAC__STREAM_DECODER_SEEK_ERROR) - FLAC__stream_decoder_flush(decoder); - pos = -1; - } - - bh_index_last_o = bh_index_last_w = (pos/BITRATE_HIST_SEGMENT_MSEC) % BITRATE_HIST_SIZE; - if (!FLAC__stream_decoder_get_decode_position(decoder, &decode_position)) - decode_position = 0; - - return pos; -} - -unsigned FLAC_plugin__decode(FLAC__StreamDecoder *decoder, stream_data_struct *stream_data, char *sample_buffer) -{ - /* fill reservoir */ - while (wide_samples_in_reservoir_ < SAMPLES_PER_WRITE) - { - if (FLAC__stream_decoder_get_state(decoder) == FLAC__STREAM_DECODER_END_OF_STREAM) - { - stream_data->eof = true; - break; - } - else if (!FLAC__stream_decoder_process_single(decoder)) - { - FLAC_plugin__show_error("Error while processing frame (%s).", FLAC__stream_decoder_get_resolved_state_string(decoder)); - stream_data->eof = true; - break; - } - if (!FLAC__stream_decoder_get_decode_position(decoder, &decode_position)) - decode_position = 0; - } - /* output samples */ - if (wide_samples_in_reservoir_ > 0) - { - const unsigned n = min(wide_samples_in_reservoir_, SAMPLES_PER_WRITE); - const unsigned channels = stream_data->channels; - unsigned i; - int bytes; - - if (cfg.replaygain.enable && stream_data->has_replaygain) - { - bytes = FLAC__replaygain_synthesis__apply_gain( - sample_buffer, - true, /* little_endian_data_out */ - stream_data->output_bits_per_sample == 8, /* unsigned_data_out */ - reservoir__, - n, - channels, - stream_data->bits_per_sample, - stream_data->output_bits_per_sample, - stream_data->replay_scale, - cfg.replaygain.hard_limit, - cfg.resolution.replaygain.dither, - &stream_data->dither_context - ); - } - else - { - bytes = FLAC__plugin_common__pack_pcm_signed_little_endian( - sample_buffer, - reservoir__, - n, - channels, - stream_data->bits_per_sample, - stream_data->output_bits_per_sample - ); - } - - wide_samples_in_reservoir_ -= n; - for (i = 0; i < channels; i++) - memmove(&reservoir_[i][0], &reservoir_[i][n], sizeof(reservoir_[0][0]) * wide_samples_in_reservoir_); - - return bytes; - } - else - { - stream_data->eof = true; - return 0; - } -} - -int FLAC_plugin__get_rate(unsigned written_time, unsigned output_time, stream_data_struct *stream_data) -{ - static int bitrate_history_[BITRATE_HIST_SIZE]; - unsigned bh_index_w = (written_time/BITRATE_HIST_SEGMENT_MSEC) % BITRATE_HIST_SIZE; - unsigned bh_index_o = (output_time/BITRATE_HIST_SEGMENT_MSEC) % BITRATE_HIST_SIZE; - - /* written bitrate */ - if (bh_index_w != bh_index_last_w) - { - bitrate_history_[(bh_index_w + BITRATE_HIST_SIZE-1)%BITRATE_HIST_SIZE] = - decode_position>decode_position_last && written_time > written_time_last ? - (unsigned)(8000*(decode_position - decode_position_last)/(written_time - written_time_last)) : - stream_data->average_bps; - - bh_index_last_w = bh_index_w; - written_time_last = written_time; - decode_position_last = decode_position; - } - - /* output bitrate */ - if (bh_index_o!=bh_index_last_o && bh_index_o!=bh_index_last_w) - { - bh_index_last_o = bh_index_o; - return bitrate_history_[bh_index_o]; - } - - return 0; -} diff --git a/3rdparty/libflac/src/plugin_winamp2/playback.h b/3rdparty/libflac/src/plugin_winamp2/playback.h deleted file mode 100644 index cf4349cd576..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/playback.h +++ /dev/null @@ -1,92 +0,0 @@ -/* in_flac - Winamp2 FLAC input plugin - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 "FLAC/all.h" -#include "share/replaygain_synthesis.h" -#include "plugin_common/all.h" - -/* - * constants - */ - -#define SAMPLES_PER_WRITE 576 - -#define BITRATE_HIST_SEGMENT_MSEC 500 -#define BITRATE_HIST_SIZE 64 - -/* - * common structures - */ - -typedef struct { - volatile FLAC__bool is_playing; - volatile FLAC__bool abort_flag; - volatile FLAC__bool eof; - volatile int seek_to; - FLAC__uint64 total_samples; - unsigned bits_per_sample; - unsigned output_bits_per_sample; - unsigned channels; - unsigned sample_rate; - int length_in_msec; /* int (instead of FLAC__uint64) only because that's what Winamp uses; seeking won't work right if this maxes out */ - unsigned average_bps; - FLAC__bool has_replaygain; - double replay_scale; - DitherContext dither_context; -} stream_data_struct; - - -typedef struct { - struct { - FLAC__bool enable; - FLAC__bool album_mode; - int preamp; - FLAC__bool hard_limit; - } replaygain; - struct { - struct { - FLAC__bool dither_24_to_16; - } normal; - struct { - FLAC__bool dither; - int noise_shaping; /* value must be one of NoiseShaping enum, see plugin_common/replaygain_synthesis.h */ - int bps_out; - } replaygain; - } resolution; - struct { - FLAC__bool stop_err; - } misc; -} output_config_t; - -/* - * protopytes - */ - -FLAC__bool FLAC_plugin__decoder_init(FLAC__StreamDecoder *decoder, const char *filename, FLAC__int64 filesize, stream_data_struct *stream_data, output_config_t *config); -void FLAC_plugin__decoder_finish(FLAC__StreamDecoder *decoder); -void FLAC_plugin__decoder_delete(FLAC__StreamDecoder *decoder); - -int FLAC_plugin__seek(FLAC__StreamDecoder *decoder, stream_data_struct *stream_data); -unsigned FLAC_plugin__decode(FLAC__StreamDecoder *decoder, stream_data_struct *stream_data, char *sample_buffer); -int FLAC_plugin__get_rate(unsigned written_time, unsigned output_time, stream_data_struct *stream_data); - -/* - * these should be defined in plug-in - */ - -extern void FLAC_plugin__show_error(const char *message,...); diff --git a/3rdparty/libflac/src/plugin_winamp2/resource.h b/3rdparty/libflac/src/plugin_winamp2/resource.h deleted file mode 100644 index 7426359c5ac..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/resource.h +++ /dev/null @@ -1,47 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by resource.rc -// -#define IDC_RESET 3 -#define IDD_CONFIG 101 -#define IDD_CONFIG_GENERAL 103 -#define IDD_CONFIG_OUTPUT 104 -#define IDD_INFOBOX 105 -#define IDC_ENABLE 1000 -#define IDC_ALBUM 1001 -#define IDC_LIMITER 1002 -#define IDC_COMMENT 1002 -#define IDC_PREAMP 1003 -#define IDC_YEAR 1003 -#define IDC_PA 1004 -#define IDC_TRACK 1004 -#define IDC_DITHER 1005 -#define IDC_DITHERRG 1006 -#define IDC_TO 1008 -#define IDC_SHAPE 1009 -#define IDC_TABS 1009 -#define IDC_TITLE 1010 -#define IDC_TAGZ_HELP 1011 -#define IDC_ARTIST 1011 -#define IDC_TAGZ_DEFAULT 1012 -#define IDC_SEP 1013 -#define IDC_NAME 1014 -#define IDC_INFO 1015 -#define IDC_GENRE 1017 -#define IDC_REMOVE 1020 -#define IDC_UPDATE 1021 -#define IDC_ID3V1 1030 -#define IDC_RESERVE 1032 -#define IDC_BPS 1036 -#define IDC_ERRORS 1037 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 106 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1037 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/3rdparty/libflac/src/plugin_winamp2/resource.rc b/3rdparty/libflac/src/plugin_winamp2/resource.rc deleted file mode 100644 index d47fd990e73..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/resource.rc +++ /dev/null @@ -1,236 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Russian resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS) -#ifdef _WIN32 -LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT -#pragma code_page(1251) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_INFOBOX DIALOG DISCARDABLE 0, 0, 292, 148 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -FONT 8, "MS Sans Serif" -BEGIN - EDITTEXT IDC_NAME,3,3,285,12,ES_AUTOHSCROLL | ES_READONLY | NOT - WS_TABSTOP - GROUPBOX " Tag ",IDC_STATIC,3,20,182,104 - RTEXT "&Title",IDC_STATIC,8,32,31,8 - EDITTEXT IDC_TITLE,43,30,137,12,ES_AUTOHSCROLL - RTEXT "&Artist",IDC_STATIC,8,47,31,8 - EDITTEXT IDC_ARTIST,43,45,137,12,ES_AUTOHSCROLL - RTEXT "Albu&m",IDC_STATIC,8,62,31,8 - EDITTEXT IDC_ALBUM,43,60,137,12,ES_AUTOHSCROLL - RTEXT "&Comment",IDC_STATIC,8,77,31,8 - EDITTEXT IDC_COMMENT,43,75,137,12,ES_AUTOHSCROLL - RTEXT "&Date",IDC_STATIC,8,92,31,8 - EDITTEXT IDC_YEAR,43,90,40,12,ES_AUTOHSCROLL - RTEXT "Track &number",IDC_STATIC,90,92,46,8 - EDITTEXT IDC_TRACK,141,90,39,12,ES_AUTOHSCROLL - RTEXT "&Genre",IDC_STATIC,8,107,31,8 - COMBOBOX IDC_GENRE,43,105,137,95,CBS_DROPDOWN | CBS_SORT | - WS_VSCROLL | WS_TABSTOP - GROUPBOX " FLAC Info ",IDC_STATIC,191,20,97,124 - LTEXT "",IDC_INFO,195,30,90,110 - DEFPUSHBUTTON "Close",IDOK,3,130,50,14 - PUSHBUTTON "&Update",IDC_UPDATE,69,130,50,14 - PUSHBUTTON "&Remove",IDC_REMOVE,135,130,50,14 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_INFOBOX, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 285 - TOPMARGIN, 7 - BOTTOMMARGIN, 141 - END -END -#endif // APSTUDIO_INVOKED - -#endif // Russian resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_CONFIG DIALOG DISCARDABLE 0, 0, 237, 212 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "FLAC Configuration" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,75,195,50,14 - PUSHBUTTON "Cancel",IDCANCEL,129,195,50,14 - PUSHBUTTON "Reset",IDC_RESET,183,195,50,14 - CONTROL "Tab1",IDC_TABS,"SysTabControl32",WS_TABSTOP,3,3,230,187 -END - -IDD_CONFIG_GENERAL DIALOG DISCARDABLE 0, 0, 226, 171 -STYLE DS_CONTROL | WS_CHILD -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX " Title Formatting ",IDC_STATIC,2,2,220,58 - LTEXT "&Title",IDC_STATIC,8,17,14,8 - EDITTEXT IDC_TITLE,27,15,188,12,ES_AUTOHSCROLL - PUSHBUTTON "default",IDC_TAGZ_DEFAULT,156,28,30,10 - PUSHBUTTON "help",IDC_TAGZ_HELP,188,28,27,10 - LTEXT "Separate tag values &with",IDC_STATIC,8,43,79,8 - EDITTEXT IDC_SEP,91,41,27,12,ES_AUTOHSCROLL - CONTROL "Read ID3v&1 tags",IDC_ID3V1,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,147,43,70,10 - GROUPBOX " Tag Editor ",IDC_STATIC,2,63,220,30 - CONTROL "Reserve space for &FLAC tags",IDC_RESERVE,"Button", - BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,8,76,125,10 - GROUPBOX " Miscellaneous ",IDC_STATIC,2,96,220,72 - CONTROL "&Show instantaneous bitrate while playing",IDC_BPS,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,8,108,125,10 - CONTROL "Stop on &all errors",IDC_ERRORS,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,8,120,69,10 -END - -IDD_CONFIG_OUTPUT DIALOG DISCARDABLE 0, 0, 224, 171 -STYLE DS_CONTROL | WS_CHILD -FONT 8, "MS Sans Serif" -BEGIN - GROUPBOX " ReplayGain ",IDC_STATIC,2,2,220,57 - CONTROL "&Enable ReplayGain",IDC_ENABLE,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,8,15,77,10 - CONTROL "&Album mode",IDC_ALBUM,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,8,27,55,10 - CONTROL "6dB &hard limiter",IDC_LIMITER,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,123,27,64,10 - LTEXT "&Preamp",IDC_STATIC,8,44,25,8 - CONTROL "Slider1",IDC_PREAMP,"msctls_trackbar32",TBS_NOTICKS | - WS_TABSTOP,36,43,154,12 - RTEXT "",IDC_PA,194,44,21,8 - GROUPBOX " Resolution ",IDC_STATIC,1,62,220,95 - GROUPBOX " Without ReplayGain ",IDC_STATIC,7,71,209,30 - CONTROL "&Dither 24bps to 16bps",IDC_DITHER,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,16,84,85,10 - GROUPBOX " With ReplayGain ",IDC_STATIC,7,104,209,47 - LTEXT "&Output bit depth",IDC_STATIC,16,119,52,8 - COMBOBOX IDC_TO,71,116,39,43,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - CONTROL "E&nable dithering",IDC_DITHERRG,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,16,134,67,10 - LTEXT "Noise &shaping",IDC_STATIC,113,135,46,8 - COMBOBOX IDC_SHAPE,164,132,46,48,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP - LTEXT "Note: changes take effect after restarting playback", - IDC_STATIC,2,160,161,8 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_CONFIG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 230 - TOPMARGIN, 7 - BOTTOMMARGIN, 205 - END - - IDD_CONFIG_GENERAL, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 219 - TOPMARGIN, 7 - BOTTOMMARGIN, 164 - END - - IDD_CONFIG_OUTPUT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 217 - TOPMARGIN, 7 - BOTTOMMARGIN, 164 - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/3rdparty/libflac/src/plugin_winamp2/tagz.cpp b/3rdparty/libflac/src/plugin_winamp2/tagz.cpp deleted file mode 100644 index a2c5a4857e5..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/tagz.cpp +++ /dev/null @@ -1,921 +0,0 @@ -#include <string.h> -#include <stdio.h> -#include <ctype.h> -#include <stdlib.h> -#include "tagz.h" - -#ifdef TAGZ_UNICODE - -#define _TX(X) L##X -#define t_strdup wcsdup -#define t_strlen wcslen -#define t_strnicmp wcsnicmp -#define t_atoi(x) wcstol(x,0,10) -#define t_stricmp wcsicmp -#define t_strstr wcsstr -#define sprintf swprintf - -#else - -#define _TX(X) X -#define t_strdup strdup -#define t_strlen strlen -#define t_strnicmp strnicmp -#define t_atoi atoi -#define t_stricmp stricmp -#define t_strstr strstr - -#endif - -#define TABSIZE(x) (sizeof(x)/sizeof(x[0])) - - -class T_String -{ -private: - T_CHAR * data; - UINT size,used; -public: - T_String() {data=0;size=0;used=0;} - void AddChar(T_CHAR c) - { - if (!data) - { - data=(T_CHAR*)malloc((size=512)*sizeof(T_CHAR)); - used=0; - } - else if (size==used) - { - size<<=1; - data=(T_CHAR*)realloc((char*)data,size*sizeof(T_CHAR)); - } - if (data) data[used++]=c; - } - void AddInt(int i) - { - T_CHAR foo[16]; - sprintf(foo,_TX("%i"),i); - AddString(foo); - } - void AddString(const T_CHAR * z) - { - while(*z) {AddChar(*z);z++;} - } - void AddString(T_String & s) - { - AddString(s.Peek()); - } - ~T_String() - { - if (data) free(data); - } - T_CHAR * GetBuf() - { - if (!data) return ::t_strdup(_TX("")); - T_CHAR * r=(T_CHAR*)realloc(data,(used+1)*sizeof(T_CHAR)); - r[used]=0; - data=0; - return r; - } - T_CHAR operator[](UINT i) - { - if (!data || i>=used) return 0; - else return data[i]; - } - UINT Len() {return data ? used : 0;} - void Reset() - { - if (data) {free(data);data=0;} - } - const T_CHAR * Peek() - { - AddChar(0); - used--; - return data; - } - T_CHAR * strdup() - { - return ::t_strdup(Peek()); - } -}; - - - - -static int separator(T_CHAR x) -{ - if (!x || x==' ') return 1; - if (x=='\'' || x=='_') return 0; -#ifdef TAGZ_UNICODE - return !iswalnum(x); -#else - return !isalnum(x); -#endif -} - -static int sepcmp(T_CHAR* src,T_CHAR* val) -{ - UINT l=t_strlen(val); - return !t_strnicmp(src,val,l) && separator(src[l]); -} - -static char roman_num[]= -{ - 'I','V','X','L','C','D','M' -}; - - -static int is_roman(T_CHAR * ptr)/* could be more smart i think */ -{ - if (ptr[0]==']' && ptr[1]=='[' && separator(ptr[2])) return 1; - while(!separator(*ptr)) - { - UINT n; - bool found=0; - for(n=0;n<TABSIZE(roman_num);n++) - { - if (*ptr==roman_num[n]) {found=1;break;} - } - if (!found) return 0; - ptr++; - } - return 1; -} - -static int need_full(T_CHAR* ptr) -{ - if (is_roman(ptr)) return 1; - if (sepcmp(ptr,_TX("RPG"))) return 1; - while(!separator(*ptr)) - { - if (*ptr<'0' || *ptr>'9') return 0; - ptr++; - } - return 1; -} - -typedef bool (*TEXTFUNC)(UINT n_src,T_CHAR **src,UINT*,T_String &out); - -#define MAKEFUNC(X) static bool X(UINT n_src,T_CHAR ** src,UINT *found_src,T_String &out) - - -MAKEFUNC(If) -{ - if (n_src!=3) return false; - - out.AddString(src[found_src[0] ? 1 : 2]); - return true; -} - -MAKEFUNC(If2) -{ - if (n_src!=2) return false; - - out.AddString(src[found_src[0] ? 0 : 1]); - return true; -} - - -MAKEFUNC(Iflonger) -{ - if (n_src!=4) return false; - - out.AddString(src[(int)t_strlen(src[0])>t_atoi(src[1]) ? 2 : 3]); - return true; -} - -MAKEFUNC(Ifgreater) -{ - if (n_src!=4) return false; - - out.AddString(src[t_atoi(src[0])>t_atoi(src[1]) ? 2 : 3]); - return true; -} - -MAKEFUNC(Upper) -{ - if (n_src!=1) return false; - - T_CHAR * s=src[0]; - - while(*s) - out.AddChar(toupper(*(s++))); - - return true; -} - -MAKEFUNC(Lower) -{ - if (n_src!=1) return false; - - T_CHAR * s=src[0]; - - while(*s) - out.AddChar(tolower(*(s++))); - - return true; -} - -MAKEFUNC(Pad) -{ - if (n_src<2 || n_src>3) return false; - - T_CHAR *fill=_TX(" "); - if (n_src==3 && src[2][0]) - fill = src[2]; - - int num = t_atoi(src[1]); - T_CHAR *p = src[0]; - - while (*p) { out.AddChar(*(p++)); num--; } - - UINT fl = t_strlen(fill); - while (num>0) - out.AddChar(fill[(--num)%fl]); - - return true; -} - -MAKEFUNC(Cut) -{ - if (n_src!=2) return false; - - UINT num = t_atoi(src[1]); - T_CHAR *p = src[0]; - - while (*p && num>0) {out.AddChar(*(p++));num--;} - - return true; -} - -MAKEFUNC(PadCut) -{ - if (n_src<2 || n_src>3) return false; - - T_CHAR *fill = _TX(" "); - if (n_src==3 && src[2][0]) - fill = src[2]; - - int num = t_atoi(src[1]); - T_CHAR *p = src[0]; - - while(*p && num>0) {out.AddChar(*(p++));num--;} - - UINT fl=t_strlen(fill); - while (num>0) - out.AddChar(fill[(--num)%fl]); - - return true; -} - -/* abbr(string) */ -/* abbr(string,len) */ -MAKEFUNC(Abbr) -{ - if (n_src==0 || n_src>2) return false; - - - if (n_src==2 && (int)t_strlen(src[0])<t_atoi(src[1])) - { - out.AddString(src[0]); - return true; - } - - T_CHAR * meta=src[0]; - bool w=0, r=0; - - while(*meta) - { - bool an=!separator(*meta) || *meta==']' || *meta=='['; - - if (w && !an) - w=0; - else if (!w && an) - { - w=1; - r=need_full(meta)?1:0; - out.AddChar(*meta); - } - else if (w && r) - out.AddChar(*meta); - meta++; - } - - return true; -} - - - -MAKEFUNC(Caps) -{ - if (n_src!=1) return false; - - T_CHAR* sp=src[0]; - int sep = 1; - - while(*sp) - { - T_CHAR c=*(sp++); - int s = separator(c); - if (!s && sep) - c=toupper(c); - else if (!sep) c=tolower(c); - sep=s; - out.AddChar(c); - } - - return true; -} - -MAKEFUNC(Caps2) -{ - if (n_src!=1) return false; - - T_CHAR* sp=src[0]; - int sep=1; - - while(*sp) - { - T_CHAR c=*(sp++); - int s = separator(c); - if (!s && sep) - c=toupper(c); - sep=s; - out.AddChar(c); - } - - return true; -} - -MAKEFUNC(Longest) -{ - T_CHAR *ptr=0; - UINT n, m=0; - - for(n=0;n<n_src;n++) - { - UINT l=t_strlen(src[n]); - if (l>m) {m=l;ptr=src[n];} - } - - if (ptr) out.AddString(ptr); - return true; -} - -MAKEFUNC(Shortest) -{ - T_CHAR * ptr=0; - UINT n,m=(UINT)(-1); - - for(n=0;n<n_src;n++) - { - UINT l=t_strlen(src[n]); - if (l<m) {m=l;ptr=src[n];} - } - - if (ptr) out.AddString(ptr); - return true; -} - -MAKEFUNC(Num) -{ - if (n_src!=2) return false; - - T_CHAR tmp[16]; - T_CHAR tmp1[16]; - sprintf(tmp1,_TX("%%0%uu"),t_atoi(src[1])); - sprintf(tmp,tmp1,t_atoi(src[0])); - out.AddString(tmp); - - return true; -} - -MAKEFUNC(Hex) -{ - if (n_src!=2) return false; - - T_CHAR tmp[16]; - T_CHAR tmp1[16]; - sprintf(tmp1,_TX("%%0%ux"),t_atoi(src[1])); - sprintf(tmp,tmp1,t_atoi(src[0])); - out.AddString(tmp); - - return true; -} - -MAKEFUNC(StrChr) -{ - if (n_src!=2) return false; - - T_CHAR * p=src[0]; - T_CHAR s=src[1][0]; - - while (*p && *p!=s) p++; - if (*p==s) - out.AddInt(1+p-src[0]); - else out.AddChar('0'); - - return true; -} - -MAKEFUNC(StrRChr) -{ - if (n_src!=2) return false; - - T_CHAR * p=src[0],*p1=0; - T_CHAR s=src[1][0]; - - while(*p) - { - if (*p==s) p1=p; - p++; - } - - if (p1) - out.AddInt(1+p1-src[0]); - else out.AddChar('0'); - - return true; -} - -MAKEFUNC(StrStr) -{ - if (n_src!=2) return false; - - T_CHAR * p = t_strstr(src[0],src[1]); - - if (p) - out.AddInt(1+p-src[0]); - else out.AddChar('0'); - - return true; -} - -/* substr(string, index) */ -/* substr(string, index, length) */ -MAKEFUNC(SubStr) -{ - if (n_src<2 || n_src>3) return false; - - int n1 = t_atoi(src[1]), n2; - - if (n_src == 3) - n2 = t_atoi(src[2]); - else n2 = n1; - - if (n1 < 1) n1=1; - if (n2 >= n1) - { - n1--; - n2--; - while(n1<=n2 && src[0][n1]) - out.AddChar(src[0][n1++]); - } - - return true; -} - -MAKEFUNC(Len) -{ - if (n_src!=1) return false; - - out.AddInt(t_strlen(src[0])); - return true; -} - -MAKEFUNC(Add) -{ - UINT n; - int s=0; - - for (n=0;n<n_src;n++) - s+=t_atoi(src[n]); - - out.AddInt(s); - - return true; -} - -MAKEFUNC(Sub) -{ - if (n_src==0) return false; - - UINT n; - int s=t_atoi(src[0]); - - for (n=1;n<n_src;n++) - s-=t_atoi(src[n]); - - out.AddInt(s); - - return true; -} - -MAKEFUNC(Mul) -{ - UINT n; - int s=1; - - for(n=0;n<n_src;n++) - s*=t_atoi(src[n]); - - out.AddInt(s); - - return true; -} - -MAKEFUNC(Div) -{ - if (n_src==0) return false; - - UINT n; - int s=t_atoi(src[0]); - - for(n=1;n<n_src;n++) - { - int t=t_atoi(src[n]); - if (t) s/=t; - else t=0; - } - - out.AddInt(s); - - return true; -} - -MAKEFUNC(Mod) -{ - if (n_src==0) return false; - - UINT n; - int s=t_atoi(src[0]); - - for(n=1;n<n_src;n++) - { - int t=t_atoi(src[n]); - if (t) s%=t; - else t=0; - } - - out.AddInt(s); - - return true; -} - -MAKEFUNC(Max) -{ - if (!n_src) return false; - - int m = t_atoi(src[0]); - UINT n; - - for (n=1; n<n_src; n++) - { - int t = t_atoi(src[n]); - if (t > m) m = t; - } - out.AddInt(m); - - return true; -} - -MAKEFUNC(Min) -{ - if (!n_src) return false; - - int m=t_atoi(src[0]); - UINT n; - - for(n=1;n<n_src;n++) - { - int t=t_atoi(src[n]); - if (t<m) m=t; - } - out.AddInt(m); - - return true; -} - -/* replace(string, what_to_replace, replacement) */ -MAKEFUNC(Replace) -{ - if (n_src!=3) return false; - T_CHAR *p = src[0]; - - while (*p) - { - UINT n=0; - - while (src[1][n] && p[n]==src[1][n]) n++; - - if (!src[1][n]) - { - out.AddString(src[2]); - p += n; - } - else out.AddChar(*p++); - } - - return true; -} - -struct -{ - TEXTFUNC func; - const T_CHAR * name; -} -FUNCS[] = -{ - If,_TX("if"), - If2,_TX("if2"), - Upper,_TX("upper"), - Lower,_TX("lower"), - Pad,_TX("pad"), - Cut,_TX("cut"), - PadCut,_TX("padcut"), - Abbr,_TX("abbr"), - Caps,_TX("caps"), - Caps2,_TX("caps2"), - Longest,_TX("longest"), - Shortest,_TX("shortest"), - Iflonger,_TX("iflonger"), - Ifgreater,_TX("ifgreater"), - Num,_TX("num"),Num,_TX("dec"), - Hex,_TX("hex"), - StrChr,_TX("strchr"), - StrChr,_TX("strlchr"), - StrRChr,_TX("strrchr"), - StrStr,_TX("strstr"), - SubStr,_TX("substr"), - Len,_TX("len"), - Add,_TX("add"), - Sub,_TX("sub"), - Mul,_TX("mul"), - Div,_TX("div"), - Mod,_TX("mod"), - Min,_TX("min"), - Max,_TX("max"), - Replace,_TX("replace"), -}; - - -class FMT -{ -private: - T_String str; - T_CHAR * spec; - TAGFUNC f; - TAGFREEFUNC ff; - void * fp; - T_CHAR * org_spec; - int found; - - void Error(T_CHAR *e=0) - { - str.Reset(); - str.AddString(e ? e : _TX("[SYNTAX ERROR IN FORMATTING STRING]")); - found++; /* force displaying */ - } - - T_CHAR * _FMT(T_CHAR * s,UINT *f=0) - { - FMT fmt(this,s); - T_CHAR * c=(T_CHAR*)fmt; - if (f) *f=fmt.found; - found+=fmt.found; - return c; - } - - static bool skipshit(T_CHAR** _p,T_CHAR *bl) - { - T_CHAR * p=*_p; - int bc1=0,bc2=0; - while(*p) - { - if (!bc1 && !bc2 && bl) - { - T_CHAR *z=bl; - while(*z) - { - if (*z==*p) break; - z++; - } - if (*z) break; - } - if (*p=='\'') - { - p++; - while(*p && *p!='\'') p++; - if (!*p) return 0; - } - else if (*p=='(') bc1++; - else if (*p==')') - { - if (--bc1<0) return 0; - } - else if (*p=='[') bc2++; - else if (*p==']') - { - if (--bc2<0) return 0; - } - p++; - } - *_p=p; - return *p && !bc1 && !bc2; - } - - void run() - { - if (!spec) {Error();return;} - while(*spec) - { - if (*spec=='%') - { - spec++; - if (*spec=='%') {str.AddChar('%');spec++;continue;} - T_CHAR* s1=spec+1; - while(*s1 && *s1!='%') s1++; - if (!*s1) {Error();break;} - *s1=0; - T_CHAR * tag=f(spec,fp); - *s1='%'; - /*if (!tag) tag=tag_unknown; */ - if (tag && tag[0]) - { - found++; - str.AddString(tag); - } - else - { - str.AddString(_TX("?")); - } - if (tag && ff) ff(tag,fp); - spec=s1+1; - } - else if (*spec=='$') - { - spec++; - if (*spec=='$') {str.AddChar('$');spec++;continue;} - T_CHAR * s1=spec+1; - while(*s1 && *s1!='(') s1++; - if (!*s1) {Error();break;} - T_CHAR * s2=s1+1; - if (!skipshit(&s2,_TX(")"))) {Error();break;} - if (!*s2) {Error();break;}; - T_CHAR * p=s1+1; - T_CHAR* temp[64]; - UINT temp_f[64]; - UINT nt=0; - T_CHAR * p1=s1+1; - while(p<=s2 && nt<64) - { - if (!skipshit(&p,_TX(",)"))) {Error();return;} - if (p>s2 || (*p!=',' && *p!=')')) {Error(_TX("internal error"));return;} - T_CHAR bk=*p; - *p=0; - temp[nt]=_FMT(p1,&temp_f[nt]); - nt++; - *p=bk;; - p1=p+1; - p++; - } - *s1=0; - UINT n; - - for (n=0; n<TABSIZE(FUNCS); n++) - if (!t_stricmp(spec, FUNCS[n].name)) - break; - - *s1='('; - - if (n != TABSIZE(FUNCS)) - { - if (!FUNCS[n].func(nt, temp, temp_f, str)) - { - Error(_TX("[INVALID $")); - str.AddString(FUNCS[n].name); - str.AddString(_TX(" SYNTAX]")); - return; - } - } - else - { - Error(_TX("[UNKNOWN FUNCTION]")); - return; - } - - for(n=0;n<nt;n++) free(temp[n]); - spec=s2+1; - } - else if (*spec=='\'') - { - spec++; - if (*spec=='\'') {str.AddChar('\'');spec++;continue;} - T_CHAR * s1=spec+1; - while(*s1 && *s1!='\'') s1++; - if (!*s1) {Error();break;} - *s1=0; - str.AddString(spec); - *s1='\''; - spec=s1+1; - } - else if (*spec=='[') - { - spec++; - T_CHAR * s1=spec; - UINT bc=0; - if (!skipshit(&s1,_TX("]"))) {Error();break;} - T_CHAR bk=*s1; - *s1=0; - FMT fmt(this,spec); - fmt.run(); - if (fmt.found) - { - str.AddString(fmt.str); - found+=fmt.found; - } - *s1=bk; - spec=s1+1; - } - else if (*spec == ']') {Error();break;} - else - { - str.AddChar(*spec); - spec++; - } - } - } - - FMT(FMT* base,T_CHAR * _spec) - { - found=0; - org_spec=0; - f=base->f; - ff=base->ff; - fp=base->fp; - spec=_spec; - } -public: - FMT(const T_CHAR * p_spec,TAGFUNC _f,TAGFREEFUNC _ff,void * _fp) - { - found=0; - org_spec=spec=t_strdup(p_spec); - f=_f; - ff=_ff; - fp=_fp; - } - operator T_CHAR*() - { - run(); - return str.GetBuf(); - } - ~FMT() - { - if (org_spec) free(org_spec); - } -}; - -extern "C" -{ - -UINT tagz_format(const T_CHAR * spec,TAGFUNC f,TAGFREEFUNC ff,void *fp,T_CHAR* out,UINT max) -{ - T_CHAR * zz=tagz_format_r(spec,f,ff,fp); - UINT r=0; - while(r<max-1 && zz[r]) - { - out[r]=zz[r]; - r++; - } - out[r]=0; - free(zz); - return r; -} - -T_CHAR * tagz_format_r(const T_CHAR* spec,TAGFUNC f,TAGFREEFUNC ff,void * fp) -{ - return FMT(spec,f,ff,fp); -} - -const char tagz_manual[]="Syntax reference: \n" - "\n" - "* %tagname% - inserts field named <tagname>, eg. \"%artist%\"\n" - "* $abbr(x) - inserts abbreviation of x, eg. \"$abbr(%album%)\" - will convert album name of \"Final Fantasy VI\" to \"FFVI\"\n" - "* $abbr(x,y) - inserts abbreviation of x if x is longer than y characters; otherwise inserts full value of x, eg. \"$abbr(%album%,10)\"\n" - "* $lower(x), $upper(x) - converts x to in lower/uppercase, eg. \"$upper(%title%)\"\n" - "* $num(x,y) - displays x number and pads with zeros up to y characters (useful for track numbers), eg. $num(%tracknumber%,2)\n" - "* $caps(x) - converts first letter in every word of x to uppercase, and all other letters to lowercase, eg. \"blah BLAH\" -> \"Blah Blah\"\n" - "* $caps2(x) - similar to $caps, but leaves uppercase letters as they are, eg. \"blah BLAH\" -> \"Blah BLAH\"\n" - "* $if(A,B,C) - if A contains at least one valid tag, displays B, otherwise displays C; eg. \"$if(%artist%,%artist%,unknown artist)\" will display artist name if present; otherwise will display \"unknown artist\"; note that \"$if(A,A,)\" is equivalent to \"[A]\" (see below)\n" - "* $if2(A,B) - equals to $if(A,A,B)\n" - "* $longest(A,B,C,....) - compares lengths of output strings produced by A,B,C... and displays the longest one, eg. \"$longest(%title%,%comment%)\" will display either title if it's longer than comment; otherwise it will display comment\n" - "* $pad(x,y) - pads x with spaces up to y characters\n" - "* $cut(x,y) - truncates x to y characters\n" - "* $padcut(x,y) - pads x to y characters and truncates to y if longer\n" - "* [ .... ] - displays contents of brackets only if at least one of fields referenced inside has been found, eg. \"%artist% - [%album% / ]%title%\" will hide [] block if album field is not present\n" - "* \' (single quotation mark) - outputs raw text without parsing, eg, \'blah$blah%blah[][]\' will output the contained string and ignore all reserved characters (%,$,[,]) in it; you can use this feature to insert square brackets for an example.\n" - "\n" - "eg. \"[%artist% - ][$abbr(%album%,10)[ %tracknumber%] / ]%title%[ %streamtitle%]\"\n"; - - -} diff --git a/3rdparty/libflac/src/plugin_winamp2/tagz.h b/3rdparty/libflac/src/plugin_winamp2/tagz.h deleted file mode 100644 index f826b7cec8a..00000000000 --- a/3rdparty/libflac/src/plugin_winamp2/tagz.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef UINT -typedef unsigned int UINT; -#endif - -#ifdef TAGZ_UNICODE -#if _MSC_VER <= 1200 -typedef unsigned short T_CHAR; -#else -typedef wchar_t T_CHAR; -#endif -#else -#define T_CHAR char -#endif - -typedef T_CHAR* (*TAGFUNC)(const T_CHAR *tag,void *p); /* return 0 if not found */ -typedef void (*TAGFREEFUNC)(T_CHAR *tag,void *p); - - -UINT tagz_format(const T_CHAR * spec,TAGFUNC f,TAGFREEFUNC ff,void *fp,T_CHAR * out,UINT max); -T_CHAR * tagz_format_r(const T_CHAR * spec,TAGFUNC f,TAGFREEFUNC ff,void * fp); - -extern const char tagz_manual[]; - -#ifdef __cplusplus -} -#endif diff --git a/3rdparty/libflac/src/plugin_xmms/Makefile.am b/3rdparty/libflac/src/plugin_xmms/Makefile.am deleted file mode 100644 index 62ca2abb979..00000000000 --- a/3rdparty/libflac/src/plugin_xmms/Makefile.am +++ /dev/null @@ -1,70 +0,0 @@ -# libxmms-flac - XMMS FLAC input plugin -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# -# GNU makefile -# - -EXTRA_DIST = \ - Makefile.lite - -noinst_HEADERS = \ - charset.h \ - configure.h \ - http.h \ - locale_hack.h \ - plugin.h \ - tag.h - -AM_CFLAGS = @OGG_CFLAGS@ @XMMS_CFLAGS@ - -INCLUDES = -I$(top_srcdir)/src -if FLaC__INSTALL_XMMS_PLUGIN_LOCALLY -xmmsinputplugindir = $(HOME)/.xmms/Plugins -else -xmmsinputplugindir = @XMMS_INPUT_PLUGIN_DIR@ -endif - -# Don't build a static library -LIBTOOL = $(top_builddir)/libtool-disable-static - -xmmsinputplugin_LTLIBRARIES = libxmms-flac.la - -plugin_sources = charset.c configure.c fileinfo.c http.c plugin.c tag.c - -libxmms_flac_la_SOURCES = $(plugin_sources) - -# work around the bug in libtool where its relinking fails with a different DESTDIR -# for libtool bug info see: -# http://mail.gnu.org/pipermail/bug-libtool/2002-February/003018.html -# http://mail.gnu.org/pipermail/libtool/2002-April/006244.html -# http://mail.gnu.org/pipermail/libtool/2002-April/006250.html -# for fix info see: -# http://lists.freshrpms.net/pipermail/rpm-list/2002-April/000746.html -# the workaround is the extra '-L$(top_builddir)/src/libFLAC/.libs' -libxmms_flac_la_LIBADD = \ - $(top_builddir)/src/plugin_common/libplugin_common.la \ - $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \ - $(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \ - $(top_builddir)/src/share/utf8/libutf8.la \ - $(top_builddir)/src/libFLAC/libFLAC.la \ - -L$(top_builddir)/src/libFLAC/.libs \ - @OGG_LIBS@ \ - @XMMS_LIBS@ \ - @LIBICONV@ -libxmms_flac_la_LDFLAGS = -module -avoid-version diff --git a/3rdparty/libflac/src/plugin_xmms/Makefile.in b/3rdparty/libflac/src/plugin_xmms/Makefile.in deleted file mode 100644 index bf9eba974dd..00000000000 --- a/3rdparty/libflac/src/plugin_xmms/Makefile.in +++ /dev/null @@ -1,588 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# libxmms-flac - XMMS FLAC input plugin -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# -# GNU makefile -# - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ - -# Don't build a static library -LIBTOOL = $(top_builddir)/libtool-disable-static -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -EXTRA_DIST = \ - Makefile.lite - - -noinst_HEADERS = \ - charset.h \ - configure.h \ - http.h \ - locale_hack.h \ - plugin.h \ - tag.h - - -AM_CFLAGS = @OGG_CFLAGS@ @XMMS_CFLAGS@ - -INCLUDES = -I$(top_srcdir)/src -@FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@xmmsinputplugindir = @XMMS_INPUT_PLUGIN_DIR@ -@FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@xmmsinputplugindir = $(HOME)/.xmms/Plugins - -xmmsinputplugin_LTLIBRARIES = libxmms-flac.la - -plugin_sources = charset.c configure.c fileinfo.c http.c plugin.c tag.c - -libxmms_flac_la_SOURCES = $(plugin_sources) - -# work around the bug in libtool where its relinking fails with a different DESTDIR -# for libtool bug info see: -# http://mail.gnu.org/pipermail/bug-libtool/2002-February/003018.html -# http://mail.gnu.org/pipermail/libtool/2002-April/006244.html -# http://mail.gnu.org/pipermail/libtool/2002-April/006250.html -# for fix info see: -# http://lists.freshrpms.net/pipermail/rpm-list/2002-April/000746.html -# the workaround is the extra '-L$(top_builddir)/src/libFLAC/.libs' -libxmms_flac_la_LIBADD = \ - $(top_builddir)/src/plugin_common/libplugin_common.la \ - $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \ - $(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \ - $(top_builddir)/src/share/utf8/libutf8.la \ - $(top_builddir)/src/libFLAC/libFLAC.la \ - -L$(top_builddir)/src/libFLAC/.libs \ - @OGG_LIBS@ \ - @XMMS_LIBS@ \ - @LIBICONV@ - -libxmms_flac_la_LDFLAGS = -module -avoid-version -subdir = src/plugin_xmms -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(xmmsinputplugin_LTLIBRARIES) - -libxmms_flac_la_DEPENDENCIES = \ - $(top_builddir)/src/plugin_common/libplugin_common.la \ - $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \ - $(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \ - $(top_builddir)/src/share/utf8/libutf8.la \ - $(top_builddir)/src/libFLAC/libFLAC.la -am__objects_1 = charset.lo configure.lo fileinfo.lo http.lo plugin.lo \ - tag.lo -am_libxmms_flac_la_OBJECTS = $(am__objects_1) -libxmms_flac_la_OBJECTS = $(am_libxmms_flac_la_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/charset.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/configure.Plo ./$(DEPDIR)/fileinfo.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/http.Plo ./$(DEPDIR)/plugin.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/tag.Plo -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(libxmms_flac_la_SOURCES) -HEADERS = $(noinst_HEADERS) - -DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in Makefile.am -SOURCES = $(libxmms_flac_la_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/plugin_xmms/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -xmmsinputpluginLTLIBRARIES_INSTALL = $(INSTALL) -install-xmmsinputpluginLTLIBRARIES: $(xmmsinputplugin_LTLIBRARIES) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(xmmsinputplugindir) - @list='$(xmmsinputplugin_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(LIBTOOL) --mode=install $(xmmsinputpluginLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(xmmsinputplugindir)/$$f"; \ - $(LIBTOOL) --mode=install $(xmmsinputpluginLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(xmmsinputplugindir)/$$f; \ - else :; fi; \ - done - -uninstall-xmmsinputpluginLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(xmmsinputplugin_LTLIBRARIES)'; for p in $$list; do \ - p="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(xmmsinputplugindir)/$$p"; \ - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(xmmsinputplugindir)/$$p; \ - done - -clean-xmmsinputpluginLTLIBRARIES: - -test -z "$(xmmsinputplugin_LTLIBRARIES)" || rm -f $(xmmsinputplugin_LTLIBRARIES) - @list='$(xmmsinputplugin_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" = "$$p" && dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libxmms-flac.la: $(libxmms_flac_la_OBJECTS) $(libxmms_flac_la_DEPENDENCIES) - $(LINK) -rpath $(xmmsinputplugindir) $(libxmms_flac_la_LDFLAGS) $(libxmms_flac_la_OBJECTS) $(libxmms_flac_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/charset.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/configure.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileinfo.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plugin.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tag.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(HEADERS) - -installdirs: - $(mkinstalldirs) $(DESTDIR)$(xmmsinputplugindir) -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-xmmsinputpluginLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: install-xmmsinputpluginLTLIBRARIES - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am uninstall-xmmsinputpluginLTLIBRARIES - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-xmmsinputpluginLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip install-xmmsinputpluginLTLIBRARIES installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-info-am \ - uninstall-xmmsinputpluginLTLIBRARIES - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/plugin_xmms/Makefile.lite b/3rdparty/libflac/src/plugin_xmms/Makefile.lite deleted file mode 100644 index 6addb9da283..00000000000 --- a/3rdparty/libflac/src/plugin_xmms/Makefile.lite +++ /dev/null @@ -1,43 +0,0 @@ -# libxmms-flac - XMMS FLAC input plugin -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# -# GNU makefile -# - -topdir = ../.. - -LIB_NAME = libxmms-flac -INCLUDES = -I./include -I$(topdir)/include -I.. $(shell xmms-config --cflags) -# refer to the static libs explicitly -ifeq ($(DARWIN_BUILD),yes) -LIBS = $(topdir)/obj/$(BUILD)/lib/libFLAC.a $(topdir)/obj/$(BUILD)/lib/libplugin_common.a $(topdir)/obj/$(BUILD)/lib/libgrabbag.a $(topdir)/obj/$(BUILD)/lib/libreplaygain_analysis.a $(topdir)/obj/$(BUILD)/lib/libreplaygain_synthesis.a $(OGG_LIB_DIR)/libogg.a -liconv -lstdc++ -lz -else -LIBS = $(topdir)/obj/$(BUILD)/lib/libFLAC.a $(topdir)/obj/$(BUILD)/lib/libplugin_common.a $(topdir)/obj/$(BUILD)/lib/libgrabbag.a $(topdir)/obj/$(BUILD)/lib/libreplaygain_analysis.a $(topdir)/obj/$(BUILD)/lib/libreplaygain_synthesis.a -L$(OGG_LIB_DIR) -logg -lstdc++ -lz -endif - -SRCS_C = \ - charset.c \ - configure.c \ - plugin.c \ - fileinfo.c \ - http.c \ - tag.c - -include $(topdir)/build/lib.mk - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/3rdparty/libflac/src/plugin_xmms/charset.c b/3rdparty/libflac/src/plugin_xmms/charset.c deleted file mode 100644 index c79e2eff6a6..00000000000 --- a/3rdparty/libflac/src/plugin_xmms/charset.c +++ /dev/null @@ -1,198 +0,0 @@ -/* libxmms-flac - XMMS FLAC input plugin - * Copyright (C) 2002,2003,2004,2005,2006 Daisuke Shimamura - * - * Almost from charset.c - * EasyTAG - Tag editor for MP3 and OGG files - * Copyright (C) 1999-2001 Håvard Kvålen <havardk@xmms.org> - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdlib.h> -#include <glib.h> -#include <string.h> -#include <errno.h> - -#include "plugin_common/charset.h" -#include "charset.h" -#include "configure.h" -#include "locale_hack.h" - - -/**************** - * Declarations * - ****************/ - -#define CHARSET_TRANS_ARRAY_LEN ( sizeof(charset_trans_array) / sizeof((charset_trans_array)[0]) ) -const CharsetInfo charset_trans_array[] = { - {N_("Arabic (IBM-864)"), "IBM864" }, - {N_("Arabic (ISO-8859-6)"), "ISO-8859-6" }, - {N_("Arabic (Windows-1256)"), "windows-1256" }, - {N_("Baltic (ISO-8859-13)"), "ISO-8859-13" }, - {N_("Baltic (ISO-8859-4)"), "ISO-8859-4" }, - {N_("Baltic (Windows-1257)"), "windows-1257" }, - {N_("Celtic (ISO-8859-14)"), "ISO-8859-14" }, - {N_("Central European (IBM-852)"), "IBM852" }, - {N_("Central European (ISO-8859-2)"), "ISO-8859-2" }, - {N_("Central European (Windows-1250)"), "windows-1250" }, - {N_("Chinese Simplified (GB18030)"), "gb18030" }, - {N_("Chinese Simplified (GB2312)"), "GB2312" }, - {N_("Chinese Traditional (Big5)"), "Big5" }, - {N_("Chinese Traditional (Big5-HKSCS)"), "Big5-HKSCS" }, - {N_("Cyrillic (IBM-855)"), "IBM855" }, - {N_("Cyrillic (ISO-8859-5)"), "ISO-8859-5" }, - {N_("Cyrillic (ISO-IR-111)"), "ISO-IR-111" }, - {N_("Cyrillic (KOI8-R)"), "KOI8-R" }, - {N_("Cyrillic (Windows-1251)"), "windows-1251" }, - {N_("Cyrillic/Russian (CP-866)"), "IBM866" }, - {N_("Cyrillic/Ukrainian (KOI8-U)"), "KOI8-U" }, - {N_("English (US-ASCII)"), "us-ascii" }, - {N_("Greek (ISO-8859-7)"), "ISO-8859-7" }, - {N_("Greek (Windows-1253)"), "windows-1253" }, - {N_("Hebrew (IBM-862)"), "IBM862" }, - {N_("Hebrew (Windows-1255)"), "windows-1255" }, - {N_("Japanese (EUC-JP)"), "EUC-JP" }, - {N_("Japanese (ISO-2022-JP)"), "ISO-2022-JP" }, - {N_("Japanese (Shift_JIS)"), "Shift_JIS" }, - {N_("Korean (EUC-KR)"), "EUC-KR" }, - {N_("Nordic (ISO-8859-10)"), "ISO-8859-10" }, - {N_("South European (ISO-8859-3)"), "ISO-8859-3" }, - {N_("Thai (TIS-620)"), "TIS-620" }, - {N_("Turkish (IBM-857)"), "IBM857" }, - {N_("Turkish (ISO-8859-9)"), "ISO-8859-9" }, - {N_("Turkish (Windows-1254)"), "windows-1254" }, - {N_("Unicode (UTF-7)"), "UTF-7" }, - {N_("Unicode (UTF-8)"), "UTF-8" }, - {N_("Unicode (UTF-16BE)"), "UTF-16BE" }, - {N_("Unicode (UTF-16LE)"), "UTF-16LE" }, - {N_("Unicode (UTF-32BE)"), "UTF-32BE" }, - {N_("Unicode (UTF-32LE)"), "UTF-32LE" }, - {N_("Vietnamese (VISCII)"), "VISCII" }, - {N_("Vietnamese (Windows-1258)"), "windows-1258" }, - {N_("Visual Hebrew (ISO-8859-8)"), "ISO-8859-8" }, - {N_("Western (IBM-850)"), "IBM850" }, - {N_("Western (ISO-8859-1)"), "ISO-8859-1" }, - {N_("Western (ISO-8859-15)"), "ISO-8859-15" }, - {N_("Western (Windows-1252)"), "windows-1252" } - - /* - * From this point, character sets aren't supported by iconv - */ -#if 0 - {N_("Arabic (IBM-864-I)"), "IBM864i" }, - {N_("Arabic (ISO-8859-6-E)"), "ISO-8859-6-E" }, - {N_("Arabic (ISO-8859-6-I)"), "ISO-8859-6-I" }, - {N_("Arabic (MacArabic)"), "x-mac-arabic" }, - {N_("Armenian (ARMSCII-8)"), "armscii-8" }, - {N_("Central European (MacCE)"), "x-mac-ce" }, - {N_("Chinese Simplified (GBK)"), "x-gbk" }, - {N_("Chinese Simplified (HZ)"), "HZ-GB-2312" }, - {N_("Chinese Traditional (EUC-TW)"), "x-euc-tw" }, - {N_("Croatian (MacCroatian)"), "x-mac-croatian" }, - {N_("Cyrillic (MacCyrillic)"), "x-mac-cyrillic" }, - {N_("Cyrillic/Ukrainian (MacUkrainian)"), "x-mac-ukrainian" }, - {N_("Farsi (MacFarsi)"), "x-mac-farsi"}, - {N_("Greek (MacGreek)"), "x-mac-greek" }, - {N_("Gujarati (MacGujarati)"), "x-mac-gujarati" }, - {N_("Gurmukhi (MacGurmukhi)"), "x-mac-gurmukhi" }, - {N_("Hebrew (ISO-8859-8-E)"), "ISO-8859-8-E" }, - {N_("Hebrew (ISO-8859-8-I)"), "ISO-8859-8-I" }, - {N_("Hebrew (MacHebrew)"), "x-mac-hebrew" }, - {N_("Hindi (MacDevanagari)"), "x-mac-devanagari" }, - {N_("Icelandic (MacIcelandic)"), "x-mac-icelandic" }, - {N_("Korean (JOHAB)"), "x-johab" }, - {N_("Korean (UHC)"), "x-windows-949" }, - {N_("Romanian (MacRomanian)"), "x-mac-romanian" }, - {N_("Turkish (MacTurkish)"), "x-mac-turkish" }, - {N_("User Defined"), "x-user-defined" }, - {N_("Vietnamese (TCVN)"), "x-viet-tcvn5712" }, - {N_("Vietnamese (VPS)"), "x-viet-vps" }, - {N_("Western (MacRoman)"), "x-mac-roman" }, - /* charsets whithout posibly translatable names */ - {"T61.8bit", "T61.8bit" }, - {"x-imap4-modified-utf7", "x-imap4-modified-utf7"}, - {"x-u-escaped", "x-u-escaped" }, - {"windows-936", "windows-936" } -#endif -}; - -/************* - * Functions * - *************/ - -/* - * Commons conversion functions - */ -char *convert_from_utf8_to_user(const char *string) -{ - return FLAC_plugin__charset_convert_string(string, "UTF-8", flac_cfg.title.user_char_set); -} - -char *convert_from_user_to_utf8(const char *string) -{ - return FLAC_plugin__charset_convert_string(string, flac_cfg.title.user_char_set, "UTF-8"); -} - -GList *Charset_Create_List (void) -{ - GList *list = NULL; - guint i; - - for (i=0; i<CHARSET_TRANS_ARRAY_LEN; i++) - list = g_list_append(list,_(charset_trans_array[i].charset_title)); - return list; -} - -GList *Charset_Create_List_UTF8_Only (void) -{ - GList *list = NULL; - - list = g_list_append(list,_(Charset_Get_Title_From_Name("UTF-8"))); - return list; -} - - -/* - * Return charset_name from charset_title - */ -gchar *Charset_Get_Name_From_Title (gchar *charset_title) -{ - guint i; - - if (charset_title) - for (i=0; i<CHARSET_TRANS_ARRAY_LEN; i++) - if ( strcasecmp(_(charset_title),_(charset_trans_array[i].charset_title)) == 0 ) - return charset_trans_array[i].charset_name; - return ""; -} - - -/* - * Return charset_title from charset_name - */ -gchar *Charset_Get_Title_From_Name (gchar *charset_name) -{ - guint i; - - if (charset_name) - for (i=0; i<CHARSET_TRANS_ARRAY_LEN; i++) - if ( strcasecmp(charset_name,charset_trans_array[i].charset_name) == 0 ) - return _(charset_trans_array[i].charset_title); - return ""; -} diff --git a/3rdparty/libflac/src/plugin_xmms/charset.h b/3rdparty/libflac/src/plugin_xmms/charset.h deleted file mode 100644 index 6ed42c7b2c2..00000000000 --- a/3rdparty/libflac/src/plugin_xmms/charset.h +++ /dev/null @@ -1,56 +0,0 @@ -/* libxmms-flac - XMMS FLAC input plugin - * Copyright (C) 2002,2003,2004,2005,2006 Daisuke Shimamura - * - * Almost from charset.h - 2001/12/04 - * EasyTAG - Tag editor for MP3 and OGG files - * Copyright (C) 1999-2001 H蛆ard Kvè™±en <havardk@xmms.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - - -#ifndef FLAC__PLUGIN_XMMS__CHARSET_H -#define FLAC__PLUGIN_XMMS__CHARSET_H - - -/*************** - * Declaration * - ***************/ - -typedef struct { - gchar *charset_title; - gchar *charset_name; -} CharsetInfo; - -/* translated charset titles */ -extern const CharsetInfo charset_trans_array[]; - -/************** - * Prototypes * - **************/ - -/* - * The returned strings are malloc()ed an must be free()d by the caller - */ -char *convert_from_utf8_to_user(const char *string); -char *convert_from_user_to_utf8(const char *string); - -GList *Charset_Create_List (void); -GList *Charset_Create_List_UTF8_Only (void); -gchar *Charset_Get_Name_From_Title (gchar *charset_title); -gchar *Charset_Get_Title_From_Name (gchar *charset_name); - -#endif /* __CHARSET_H__ */ - diff --git a/3rdparty/libflac/src/plugin_xmms/configure.c b/3rdparty/libflac/src/plugin_xmms/configure.c deleted file mode 100644 index f9170e977b2..00000000000 --- a/3rdparty/libflac/src/plugin_xmms/configure.c +++ /dev/null @@ -1,823 +0,0 @@ -/* libxmms-flac - XMMS FLAC input plugin - * Copyright (C) 2002,2003,2004,2005,2006 Daisuke Shimamura - * - * Based on mpg123 plugin - * and prefs.c - 2000/05/06 - * EasyTAG - Tag editor for MP3 and OGG files - * Copyright (C) 2000-2002 Jerome Couderc <j.couderc@ifrance.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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdlib.h> -#include <string.h> -#include <glib.h> -#include <gtk/gtk.h> -#include <pthread.h> -#include <math.h> - -#include <xmms/configfile.h> -#include <xmms/dirbrowser.h> -#include <xmms/titlestring.h> -#include <xmms/util.h> -#include <xmms/plugin.h> - -#include "share/replaygain_synthesis.h" /* for NOISE_SHAPING_LOW */ -#include "charset.h" -#include "configure.h" -#include "locale_hack.h" - -/* - * Initialize Global Valueable - */ -flac_config_t flac_cfg = { - /* title */ - { - FALSE, /* tag_override */ - NULL, /* tag_format */ - FALSE, /* convert_char_set */ - NULL /* user_char_set */ - }, - /* stream */ - { - 100 /* KB */, /* http_buffer_size */ - 50, /* http_prebuffer */ - FALSE, /* use_proxy */ - NULL, /* proxy_host */ - 0, /* proxy_port */ - FALSE, /* proxy_use_auth */ - NULL, /* proxy_user */ - NULL, /* proxy_pass */ - FALSE, /* save_http_stream */ - NULL, /* save_http_path */ - FALSE, /* cast_title_streaming */ - FALSE /* use_udp_channel */ - }, - /* output */ - { - /* replaygain */ - { - FALSE, /* enable */ - TRUE, /* album_mode */ - 0, /* preamp */ - FALSE /* hard_limit */ - }, - /* resolution */ - { - /* normal */ - { - TRUE /* dither_24_to_16 */ - }, - /* replaygain */ - { - TRUE, /* dither */ - NOISE_SHAPING_LOW, /* noise_shaping */ - 16 /* bps_out */ - } - } - } -}; - - -static GtkWidget *flac_configurewin = NULL; -static GtkWidget *vbox, *notebook; - -static GtkWidget *title_tag_override, *title_tag_box, *title_tag_entry, *title_desc; -static GtkWidget *convert_char_set, *fileCharacterSetEntry, *userCharacterSetEntry; -static GtkWidget *replaygain_enable, *replaygain_album_mode; -static GtkWidget *replaygain_preamp_hscale, *replaygain_preamp_label, *replaygain_hard_limit; -static GtkObject *replaygain_preamp; -static GtkWidget *resolution_normal_dither_24_to_16; -static GtkWidget *resolution_replaygain_dither; -static GtkWidget *resolution_replaygain_noise_shaping_frame; -static GtkWidget *resolution_replaygain_noise_shaping_radio_none; -static GtkWidget *resolution_replaygain_noise_shaping_radio_low; -static GtkWidget *resolution_replaygain_noise_shaping_radio_medium; -static GtkWidget *resolution_replaygain_noise_shaping_radio_high; -static GtkWidget *resolution_replaygain_bps_out_frame; -static GtkWidget *resolution_replaygain_bps_out_radio_16bps; -static GtkWidget *resolution_replaygain_bps_out_radio_24bps; - -static GtkObject *streaming_size_adj, *streaming_pre_adj; -static GtkWidget *streaming_proxy_use, *streaming_proxy_host_entry; -static GtkWidget *streaming_proxy_port_entry, *streaming_save_use, *streaming_save_entry; -static GtkWidget *streaming_proxy_auth_use; -static GtkWidget *streaming_proxy_auth_pass_entry, *streaming_proxy_auth_user_entry; -static GtkWidget *streaming_proxy_auth_user_label, *streaming_proxy_auth_pass_label; -#ifdef FLAC_ICECAST -static GtkWidget *streaming_cast_title, *streaming_udp_title; -#endif -static GtkWidget *streaming_proxy_hbox, *streaming_proxy_auth_hbox, *streaming_save_dirbrowser; -static GtkWidget *streaming_save_hbox; - -static gchar *gtk_entry_get_text_1 (GtkWidget *widget); -static void flac_configurewin_ok(GtkWidget * widget, gpointer data); -static void configure_destroy(GtkWidget * w, gpointer data); - -static void flac_configurewin_ok(GtkWidget * widget, gpointer data) -{ - ConfigFile *cfg; - gchar *filename; - - (void)widget, (void)data; /* unused arguments */ - g_free(flac_cfg.title.tag_format); - flac_cfg.title.tag_format = g_strdup(gtk_entry_get_text(GTK_ENTRY(title_tag_entry))); - flac_cfg.title.user_char_set = Charset_Get_Name_From_Title(gtk_entry_get_text_1(userCharacterSetEntry)); - - filename = g_strconcat(g_get_home_dir(), "/.xmms/config", NULL); - cfg = xmms_cfg_open_file(filename); - if (!cfg) - cfg = xmms_cfg_new(); - /* title */ - xmms_cfg_write_boolean(cfg, "flac", "title.tag_override", flac_cfg.title.tag_override); - xmms_cfg_write_string(cfg, "flac", "title.tag_format", flac_cfg.title.tag_format); - xmms_cfg_write_boolean(cfg, "flac", "title.convert_char_set", flac_cfg.title.convert_char_set); - xmms_cfg_write_string(cfg, "flac", "title.user_char_set", flac_cfg.title.user_char_set); - /* output */ - xmms_cfg_write_boolean(cfg, "flac", "output.replaygain.enable", flac_cfg.output.replaygain.enable); - xmms_cfg_write_boolean(cfg, "flac", "output.replaygain.album_mode", flac_cfg.output.replaygain.album_mode); - xmms_cfg_write_int(cfg, "flac", "output.replaygain.preamp", flac_cfg.output.replaygain.preamp); - xmms_cfg_write_boolean(cfg, "flac", "output.replaygain.hard_limit", flac_cfg.output.replaygain.hard_limit); - xmms_cfg_write_boolean(cfg, "flac", "output.resolution.normal.dither_24_to_16", flac_cfg.output.resolution.normal.dither_24_to_16); - xmms_cfg_write_boolean(cfg, "flac", "output.resolution.replaygain.dither", flac_cfg.output.resolution.replaygain.dither); - xmms_cfg_write_int(cfg, "flac", "output.resolution.replaygain.noise_shaping", flac_cfg.output.resolution.replaygain.noise_shaping); - xmms_cfg_write_int(cfg, "flac", "output.resolution.replaygain.bps_out", flac_cfg.output.resolution.replaygain.bps_out); - /* streaming */ - flac_cfg.stream.http_buffer_size = (gint) GTK_ADJUSTMENT(streaming_size_adj)->value; - flac_cfg.stream.http_prebuffer = (gint) GTK_ADJUSTMENT(streaming_pre_adj)->value; - - flac_cfg.stream.use_proxy = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_use)); - if(flac_cfg.stream.proxy_host) - g_free(flac_cfg.stream.proxy_host); - flac_cfg.stream.proxy_host = g_strdup(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_host_entry))); - flac_cfg.stream.proxy_port = atoi(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_port_entry))); - - flac_cfg.stream.proxy_use_auth = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_auth_use)); - - if(flac_cfg.stream.proxy_user) - g_free(flac_cfg.stream.proxy_user); - flac_cfg.stream.proxy_user = NULL; - if(strlen(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_auth_user_entry))) > 0) - flac_cfg.stream.proxy_user = g_strdup(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_auth_user_entry))); - - if(flac_cfg.stream.proxy_pass) - g_free(flac_cfg.stream.proxy_pass); - flac_cfg.stream.proxy_pass = NULL; - if(strlen(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_auth_pass_entry))) > 0) - flac_cfg.stream.proxy_pass = g_strdup(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_auth_pass_entry))); - - - flac_cfg.stream.save_http_stream = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_save_use)); - if (flac_cfg.stream.save_http_path) - g_free(flac_cfg.stream.save_http_path); - flac_cfg.stream.save_http_path = g_strdup(gtk_entry_get_text(GTK_ENTRY(streaming_save_entry))); - -#ifdef FLAC_ICECAST - flac_cfg.stream.cast_title_streaming = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_cast_title)); - flac_cfg.stream.use_udp_channel = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_udp_title)); -#endif - - xmms_cfg_write_int(cfg, "flac", "stream.http_buffer_size", flac_cfg.stream.http_buffer_size); - xmms_cfg_write_int(cfg, "flac", "stream.http_prebuffer", flac_cfg.stream.http_prebuffer); - xmms_cfg_write_boolean(cfg, "flac", "stream.use_proxy", flac_cfg.stream.use_proxy); - xmms_cfg_write_string(cfg, "flac", "stream.proxy_host", flac_cfg.stream.proxy_host); - xmms_cfg_write_int(cfg, "flac", "stream.proxy_port", flac_cfg.stream.proxy_port); - xmms_cfg_write_boolean(cfg, "flac", "stream.proxy_use_auth", flac_cfg.stream.proxy_use_auth); - if(flac_cfg.stream.proxy_user) - xmms_cfg_write_string(cfg, "flac", "stream.proxy_user", flac_cfg.stream.proxy_user); - else - xmms_cfg_remove_key(cfg, "flac", "stream.proxy_user"); - if(flac_cfg.stream.proxy_pass) - xmms_cfg_write_string(cfg, "flac", "stream.proxy_pass", flac_cfg.stream.proxy_pass); - else - xmms_cfg_remove_key(cfg, "flac", "stream.proxy_pass"); - xmms_cfg_write_boolean(cfg, "flac", "stream.save_http_stream", flac_cfg.stream.save_http_stream); - xmms_cfg_write_string(cfg, "flac", "stream.save_http_path", flac_cfg.stream.save_http_path); -#ifdef FLAC_ICECAST - xmms_cfg_write_boolean(cfg, "flac", "stream.cast_title_streaming", flac_cfg.stream.cast_title_streaming); - xmms_cfg_write_boolean(cfg, "flac", "stream.use_udp_channel", flac_cfg.stream.use_udp_channel); -#endif - - xmms_cfg_write_file(cfg, filename); - xmms_cfg_free(cfg); - g_free(filename); - gtk_widget_destroy(flac_configurewin); -} - -static void configure_destroy(GtkWidget *widget, gpointer data) -{ - (void)widget, (void)data; /* unused arguments */ -} - -static void title_tag_override_cb(GtkWidget *widget, gpointer data) -{ - (void)widget, (void)data; /* unused arguments */ - flac_cfg.title.tag_override = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(title_tag_override)); - - gtk_widget_set_sensitive(title_tag_box, flac_cfg.title.tag_override); - gtk_widget_set_sensitive(title_desc, flac_cfg.title.tag_override); - -} - -static void convert_char_set_cb(GtkWidget *widget, gpointer data) -{ - (void)widget, (void)data; /* unused arguments */ - flac_cfg.title.convert_char_set = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(convert_char_set)); - - gtk_widget_set_sensitive(fileCharacterSetEntry, FALSE); - gtk_widget_set_sensitive(userCharacterSetEntry, flac_cfg.title.convert_char_set); -} - -static void replaygain_enable_cb(GtkWidget *widget, gpointer data) -{ - (void)widget, (void)data; /* unused arguments */ - flac_cfg.output.replaygain.enable = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(replaygain_enable)); - - gtk_widget_set_sensitive(replaygain_album_mode, flac_cfg.output.replaygain.enable); - gtk_widget_set_sensitive(replaygain_preamp_hscale, flac_cfg.output.replaygain.enable); - gtk_widget_set_sensitive(replaygain_hard_limit, flac_cfg.output.replaygain.enable); -} - -static void replaygain_album_mode_cb(GtkWidget *widget, gpointer data) -{ - (void)widget, (void)data; /* unused arguments */ - flac_cfg.output.replaygain.album_mode = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(replaygain_album_mode)); -} - -static void replaygain_hard_limit_cb(GtkWidget *widget, gpointer data) -{ - (void)widget, (void)data; /* unused arguments */ - flac_cfg.output.replaygain.hard_limit = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(replaygain_hard_limit)); -} - -static void replaygain_preamp_cb(GtkWidget *widget, gpointer data) -{ - GString *gstring = g_string_new(""); - (void)widget, (void)data; /* unused arguments */ - flac_cfg.output.replaygain.preamp = (int) floor(GTK_ADJUSTMENT(replaygain_preamp)->value + 0.5); - - g_string_sprintf(gstring, "%i dB", flac_cfg.output.replaygain.preamp); - gtk_label_set_text(GTK_LABEL(replaygain_preamp_label), _(gstring->str)); -} - -static void resolution_normal_dither_24_to_16_cb(GtkWidget *widget, gpointer data) -{ - (void)widget, (void)data; /* unused arguments */ - flac_cfg.output.resolution.normal.dither_24_to_16 = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_normal_dither_24_to_16)); -} - -static void resolution_replaygain_dither_cb(GtkWidget *widget, gpointer data) -{ - (void)widget, (void)data; /* unused arguments */ - flac_cfg.output.resolution.replaygain.dither = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_dither)); - - gtk_widget_set_sensitive(resolution_replaygain_noise_shaping_frame, flac_cfg.output.resolution.replaygain.dither); -} - -static void resolution_replaygain_noise_shaping_cb(GtkWidget *widget, gpointer data) -{ - (void)widget, (void)data; /* unused arguments */ - flac_cfg.output.resolution.replaygain.noise_shaping = - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_none))? 0 : - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_low))? 1 : - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_medium))? 2 : - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_high))? 3 : - 0 - ; -} - -static void resolution_replaygain_bps_out_cb(GtkWidget *widget, gpointer data) -{ - (void)widget, (void)data; /* unused arguments */ - flac_cfg.output.resolution.replaygain.bps_out = - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_bps_out_radio_16bps))? 16 : - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_bps_out_radio_24bps))? 24 : - 16 - ; -} - -static void proxy_use_cb(GtkWidget * w, gpointer data) -{ - gboolean use_proxy, use_proxy_auth; - (void) w; - (void) data; - - use_proxy = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_use)); - use_proxy_auth = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_auth_use)); - - gtk_widget_set_sensitive(streaming_proxy_hbox, use_proxy); - gtk_widget_set_sensitive(streaming_proxy_auth_use, use_proxy); - gtk_widget_set_sensitive(streaming_proxy_auth_hbox, use_proxy && use_proxy_auth); -} - -static void proxy_auth_use_cb(GtkWidget *w, gpointer data) -{ - gboolean use_proxy, use_proxy_auth; - (void) w; - (void) data; - - use_proxy = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_use)); - use_proxy_auth = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_auth_use)); - - gtk_widget_set_sensitive(streaming_proxy_auth_hbox, use_proxy && use_proxy_auth); -} - -static void streaming_save_dirbrowser_cb(gchar * dir) -{ - gtk_entry_set_text(GTK_ENTRY(streaming_save_entry), dir); -} - -static void streaming_save_browse_cb(GtkWidget * w, gpointer data) -{ - (void) w; - (void) data; - if (!streaming_save_dirbrowser) - { - streaming_save_dirbrowser = xmms_create_dir_browser(_("Select the directory where you want to store the MPEG streams:"), - flac_cfg.stream.save_http_path, GTK_SELECTION_SINGLE, streaming_save_dirbrowser_cb); - gtk_signal_connect(GTK_OBJECT(streaming_save_dirbrowser), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &streaming_save_dirbrowser); - gtk_window_set_transient_for(GTK_WINDOW(streaming_save_dirbrowser), GTK_WINDOW(flac_configurewin)); - gtk_widget_show(streaming_save_dirbrowser); - } -} - -static void streaming_save_use_cb(GtkWidget * w, gpointer data) -{ - gboolean save_stream; - (void) w; - (void) data; - - save_stream = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_save_use)); - - gtk_widget_set_sensitive(streaming_save_hbox, save_stream); -} - - -void FLAC_XMMS__configure(void) -{ - GtkWidget *title_frame, *title_tag_vbox, *title_tag_label; - GtkWidget *replaygain_frame, *resolution_frame, *output_vbox, *resolution_normal_frame, *resolution_replaygain_frame; - GtkWidget *replaygain_vbox, *resolution_hbox, *resolution_normal_vbox, *resolution_replaygain_vbox; - GtkWidget *resolution_replaygain_noise_shaping_vbox; - GtkWidget *resolution_replaygain_bps_out_vbox; - GtkWidget *label, *hbox; - GtkWidget *bbox, *ok, *cancel; - GList *list; - - GtkWidget *streaming_vbox; - GtkWidget *streaming_buf_frame, *streaming_buf_hbox; - GtkWidget *streaming_size_box, *streaming_size_label, *streaming_size_spin; - GtkWidget *streaming_pre_box, *streaming_pre_label, *streaming_pre_spin; - GtkWidget *streaming_proxy_frame, *streaming_proxy_vbox; - GtkWidget *streaming_proxy_port_label, *streaming_proxy_host_label; - GtkWidget *streaming_save_frame, *streaming_save_vbox; - GtkWidget *streaming_save_label, *streaming_save_browse; -#ifdef FLAC_ICECAST - GtkWidget *streaming_cast_frame, *streaming_cast_vbox; -#endif - char *temp; - - if (flac_configurewin != NULL) { - gdk_window_raise(flac_configurewin->window); - return; - } - flac_configurewin = gtk_window_new(GTK_WINDOW_DIALOG); - gtk_signal_connect(GTK_OBJECT(flac_configurewin), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &flac_configurewin); - gtk_signal_connect(GTK_OBJECT(flac_configurewin), "destroy", GTK_SIGNAL_FUNC(configure_destroy), &flac_configurewin); - gtk_window_set_title(GTK_WINDOW(flac_configurewin), _("Flac Configuration")); - gtk_window_set_policy(GTK_WINDOW(flac_configurewin), FALSE, FALSE, FALSE); - gtk_container_border_width(GTK_CONTAINER(flac_configurewin), 10); - - vbox = gtk_vbox_new(FALSE, 10); - gtk_container_add(GTK_CONTAINER(flac_configurewin), vbox); - - notebook = gtk_notebook_new(); - gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0); - - /* Title config.. */ - - title_frame = gtk_frame_new(_("Tag Handling")); - gtk_container_border_width(GTK_CONTAINER(title_frame), 5); - - title_tag_vbox = gtk_vbox_new(FALSE, 10); - gtk_container_border_width(GTK_CONTAINER(title_tag_vbox), 5); - gtk_container_add(GTK_CONTAINER(title_frame), title_tag_vbox); - - /* Convert Char Set */ - - convert_char_set = gtk_check_button_new_with_label(_("Convert Character Set")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(convert_char_set), flac_cfg.title.convert_char_set); - gtk_signal_connect(GTK_OBJECT(convert_char_set), "clicked", convert_char_set_cb, NULL); - gtk_box_pack_start(GTK_BOX(title_tag_vbox), convert_char_set, FALSE, FALSE, 0); - /* Combo boxes... */ - hbox = gtk_hbox_new(FALSE,4); - gtk_container_add(GTK_CONTAINER(title_tag_vbox),hbox); - label = gtk_label_new(_("Convert character set from :")); - gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0); - fileCharacterSetEntry = gtk_combo_new(); - gtk_box_pack_start(GTK_BOX(hbox),fileCharacterSetEntry,TRUE,TRUE,0); - - label = gtk_label_new (_("to :")); - gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0); - userCharacterSetEntry = gtk_combo_new(); - gtk_box_pack_start(GTK_BOX(hbox),userCharacterSetEntry,TRUE,TRUE,0); - - gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(fileCharacterSetEntry)->entry),FALSE); - gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(userCharacterSetEntry)->entry),FALSE); - gtk_combo_set_value_in_list(GTK_COMBO(fileCharacterSetEntry),TRUE,FALSE); - gtk_combo_set_value_in_list(GTK_COMBO(userCharacterSetEntry),TRUE,FALSE); - - list = Charset_Create_List(); - gtk_combo_set_popdown_strings(GTK_COMBO(fileCharacterSetEntry),Charset_Create_List_UTF8_Only()); - gtk_combo_set_popdown_strings(GTK_COMBO(userCharacterSetEntry),list); - gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(userCharacterSetEntry)->entry),Charset_Get_Title_From_Name(flac_cfg.title.user_char_set)); - gtk_widget_set_sensitive(fileCharacterSetEntry, FALSE); - gtk_widget_set_sensitive(userCharacterSetEntry, flac_cfg.title.convert_char_set); - - /* Override Tagging Format */ - - title_tag_override = gtk_check_button_new_with_label(_("Override generic titles")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(title_tag_override), flac_cfg.title.tag_override); - gtk_signal_connect(GTK_OBJECT(title_tag_override), "clicked", title_tag_override_cb, NULL); - gtk_box_pack_start(GTK_BOX(title_tag_vbox), title_tag_override, FALSE, FALSE, 0); - - title_tag_box = gtk_hbox_new(FALSE, 5); - gtk_widget_set_sensitive(title_tag_box, flac_cfg.title.tag_override); - gtk_box_pack_start(GTK_BOX(title_tag_vbox), title_tag_box, FALSE, FALSE, 0); - - title_tag_label = gtk_label_new(_("Title format:")); - gtk_box_pack_start(GTK_BOX(title_tag_box), title_tag_label, FALSE, FALSE, 0); - - title_tag_entry = gtk_entry_new(); - gtk_entry_set_text(GTK_ENTRY(title_tag_entry), flac_cfg.title.tag_format); - gtk_box_pack_start(GTK_BOX(title_tag_box), title_tag_entry, TRUE, TRUE, 0); - - title_desc = xmms_titlestring_descriptions("pafFetnygc", 2); - gtk_widget_set_sensitive(title_desc, flac_cfg.title.tag_override); - gtk_box_pack_start(GTK_BOX(title_tag_vbox), title_desc, FALSE, FALSE, 0); - - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), title_frame, gtk_label_new(_("Title"))); - - /* Output config.. */ - - output_vbox = gtk_vbox_new(FALSE, 10); - gtk_container_border_width(GTK_CONTAINER(output_vbox), 5); - - /* replaygain */ - - replaygain_frame = gtk_frame_new(_("ReplayGain")); - gtk_container_border_width(GTK_CONTAINER(replaygain_frame), 5); - gtk_box_pack_start(GTK_BOX(output_vbox), replaygain_frame, TRUE, TRUE, 0); - - replaygain_vbox = gtk_vbox_new(FALSE, 10); - gtk_container_border_width(GTK_CONTAINER(replaygain_vbox), 5); - gtk_container_add(GTK_CONTAINER(replaygain_frame), replaygain_vbox); - - replaygain_enable = gtk_check_button_new_with_label(_("Enable ReplayGain processing")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(replaygain_enable), flac_cfg.output.replaygain.enable); - gtk_signal_connect(GTK_OBJECT(replaygain_enable), "clicked", replaygain_enable_cb, NULL); - gtk_box_pack_start(GTK_BOX(replaygain_vbox), replaygain_enable, FALSE, FALSE, 0); - - replaygain_album_mode = gtk_check_button_new_with_label(_("Album mode")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(replaygain_album_mode), flac_cfg.output.replaygain.album_mode); - gtk_signal_connect(GTK_OBJECT(replaygain_album_mode), "clicked", replaygain_album_mode_cb, NULL); - gtk_box_pack_start(GTK_BOX(replaygain_vbox), replaygain_album_mode, FALSE, FALSE, 0); - - hbox = gtk_hbox_new(FALSE,3); - gtk_container_add(GTK_CONTAINER(replaygain_vbox),hbox); - label = gtk_label_new(_("Preamp:")); - gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0); - replaygain_preamp = gtk_adjustment_new(flac_cfg.output.replaygain.preamp, -24.0, +24.0, 1.0, 6.0, 0.0); - gtk_signal_connect(GTK_OBJECT(replaygain_preamp), "value-changed", replaygain_preamp_cb, NULL); - replaygain_preamp_hscale = gtk_hscale_new(GTK_ADJUSTMENT(replaygain_preamp)); - gtk_scale_set_draw_value(GTK_SCALE(replaygain_preamp_hscale), FALSE); - gtk_box_pack_start(GTK_BOX(hbox),replaygain_preamp_hscale,TRUE,TRUE,0); - replaygain_preamp_label = gtk_label_new(_("0 dB")); - gtk_box_pack_start(GTK_BOX(hbox),replaygain_preamp_label,FALSE,FALSE,0); - gtk_adjustment_value_changed(GTK_ADJUSTMENT(replaygain_preamp)); - - replaygain_hard_limit = gtk_check_button_new_with_label(_("6dB hard limiting")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(replaygain_hard_limit), flac_cfg.output.replaygain.hard_limit); - gtk_signal_connect(GTK_OBJECT(replaygain_hard_limit), "clicked", replaygain_hard_limit_cb, NULL); - gtk_box_pack_start(GTK_BOX(replaygain_vbox), replaygain_hard_limit, FALSE, FALSE, 0); - - replaygain_enable_cb(replaygain_enable, NULL); - - /* resolution */ - - resolution_frame = gtk_frame_new(_("Resolution")); - gtk_container_border_width(GTK_CONTAINER(resolution_frame), 5); - gtk_box_pack_start(GTK_BOX(output_vbox), resolution_frame, TRUE, TRUE, 0); - - resolution_hbox = gtk_hbox_new(FALSE, 10); - gtk_container_border_width(GTK_CONTAINER(resolution_hbox), 5); - gtk_container_add(GTK_CONTAINER(resolution_frame), resolution_hbox); - - resolution_normal_frame = gtk_frame_new(_("Without ReplayGain")); - gtk_container_border_width(GTK_CONTAINER(resolution_normal_frame), 5); - gtk_box_pack_start(GTK_BOX(resolution_hbox), resolution_normal_frame, TRUE, TRUE, 0); - - resolution_normal_vbox = gtk_vbox_new(FALSE, 10); - gtk_container_border_width(GTK_CONTAINER(resolution_normal_vbox), 5); - gtk_container_add(GTK_CONTAINER(resolution_normal_frame), resolution_normal_vbox); - - resolution_normal_dither_24_to_16 = gtk_check_button_new_with_label(_("Dither 24bps to 16bps")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_normal_dither_24_to_16), flac_cfg.output.resolution.normal.dither_24_to_16); - gtk_signal_connect(GTK_OBJECT(resolution_normal_dither_24_to_16), "clicked", resolution_normal_dither_24_to_16_cb, NULL); - gtk_box_pack_start(GTK_BOX(resolution_normal_vbox), resolution_normal_dither_24_to_16, FALSE, FALSE, 0); - - resolution_replaygain_frame = gtk_frame_new(_("With ReplayGain")); - gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_frame), 5); - gtk_box_pack_start(GTK_BOX(resolution_hbox), resolution_replaygain_frame, TRUE, TRUE, 0); - - resolution_replaygain_vbox = gtk_vbox_new(FALSE, 10); - gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_vbox), 5); - gtk_container_add(GTK_CONTAINER(resolution_replaygain_frame), resolution_replaygain_vbox); - - resolution_replaygain_dither = gtk_check_button_new_with_label(_("Enable dithering")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_dither), flac_cfg.output.resolution.replaygain.dither); - gtk_signal_connect(GTK_OBJECT(resolution_replaygain_dither), "clicked", resolution_replaygain_dither_cb, NULL); - gtk_box_pack_start(GTK_BOX(resolution_replaygain_vbox), resolution_replaygain_dither, FALSE, FALSE, 0); - - hbox = gtk_hbox_new(FALSE, 10); - gtk_container_border_width(GTK_CONTAINER(hbox), 5); - gtk_box_pack_start(GTK_BOX(resolution_replaygain_vbox), hbox, TRUE, TRUE, 0); - - resolution_replaygain_noise_shaping_frame = gtk_frame_new(_("Noise shaping")); - gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_noise_shaping_frame), 5); - gtk_box_pack_start(GTK_BOX(hbox), resolution_replaygain_noise_shaping_frame, TRUE, TRUE, 0); - - resolution_replaygain_noise_shaping_vbox = gtk_vbutton_box_new(); - gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), 5); - gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_frame), resolution_replaygain_noise_shaping_vbox); - - resolution_replaygain_noise_shaping_radio_none = gtk_radio_button_new_with_label(NULL, _("none")); - if(flac_cfg.output.resolution.replaygain.noise_shaping == 0) - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_none), TRUE); - gtk_signal_connect(GTK_OBJECT(resolution_replaygain_noise_shaping_radio_none), "clicked", resolution_replaygain_noise_shaping_cb, NULL); - gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), resolution_replaygain_noise_shaping_radio_none); - - resolution_replaygain_noise_shaping_radio_low = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(resolution_replaygain_noise_shaping_radio_none), _("low")); - if(flac_cfg.output.resolution.replaygain.noise_shaping == 1) - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_low), TRUE); - gtk_signal_connect(GTK_OBJECT(resolution_replaygain_noise_shaping_radio_low), "clicked", resolution_replaygain_noise_shaping_cb, NULL); - gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), resolution_replaygain_noise_shaping_radio_low); - - resolution_replaygain_noise_shaping_radio_medium = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(resolution_replaygain_noise_shaping_radio_none), _("medium")); - if(flac_cfg.output.resolution.replaygain.noise_shaping == 2) - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_medium), TRUE); - gtk_signal_connect(GTK_OBJECT(resolution_replaygain_noise_shaping_radio_medium), "clicked", resolution_replaygain_noise_shaping_cb, NULL); - gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), resolution_replaygain_noise_shaping_radio_medium); - - resolution_replaygain_noise_shaping_radio_high = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(resolution_replaygain_noise_shaping_radio_none), _("high")); - if(flac_cfg.output.resolution.replaygain.noise_shaping == 3) - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_high), TRUE); - gtk_signal_connect(GTK_OBJECT(resolution_replaygain_noise_shaping_radio_high), "clicked", resolution_replaygain_noise_shaping_cb, NULL); - gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), resolution_replaygain_noise_shaping_radio_high); - - resolution_replaygain_bps_out_frame = gtk_frame_new(_("Dither to")); - gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_bps_out_frame), 5); - gtk_box_pack_start(GTK_BOX(hbox), resolution_replaygain_bps_out_frame, FALSE, FALSE, 0); - - resolution_replaygain_bps_out_vbox = gtk_vbutton_box_new(); - gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_bps_out_vbox), 0); - gtk_container_add(GTK_CONTAINER(resolution_replaygain_bps_out_frame), resolution_replaygain_bps_out_vbox); - - resolution_replaygain_bps_out_radio_16bps = gtk_radio_button_new_with_label(NULL, _("16 bps")); - if(flac_cfg.output.resolution.replaygain.bps_out == 16) - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_bps_out_radio_16bps), TRUE); - gtk_signal_connect(GTK_OBJECT(resolution_replaygain_bps_out_radio_16bps), "clicked", resolution_replaygain_bps_out_cb, NULL); - gtk_container_add(GTK_CONTAINER(resolution_replaygain_bps_out_vbox), resolution_replaygain_bps_out_radio_16bps); - - resolution_replaygain_bps_out_radio_24bps = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(resolution_replaygain_bps_out_radio_16bps), _("24 bps")); - if(flac_cfg.output.resolution.replaygain.bps_out == 24) - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_bps_out_radio_24bps), TRUE); - gtk_signal_connect(GTK_OBJECT(resolution_replaygain_bps_out_radio_24bps), "clicked", resolution_replaygain_bps_out_cb, NULL); - gtk_container_add(GTK_CONTAINER(resolution_replaygain_bps_out_vbox), resolution_replaygain_bps_out_radio_24bps); - - resolution_replaygain_dither_cb(resolution_replaygain_dither, NULL); - - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), output_vbox, gtk_label_new(_("Output"))); - - /* Streaming */ - - streaming_vbox = gtk_vbox_new(FALSE, 0); - - streaming_buf_frame = gtk_frame_new(_("Buffering:")); - gtk_container_set_border_width(GTK_CONTAINER(streaming_buf_frame), 5); - gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_buf_frame, FALSE, FALSE, 0); - - streaming_buf_hbox = gtk_hbox_new(TRUE, 5); - gtk_container_set_border_width(GTK_CONTAINER(streaming_buf_hbox), 5); - gtk_container_add(GTK_CONTAINER(streaming_buf_frame), streaming_buf_hbox); - - streaming_size_box = gtk_hbox_new(FALSE, 5); - /*gtk_table_attach_defaults(GTK_TABLE(streaming_buf_table),streaming_size_box,0,1,0,1); */ - gtk_box_pack_start(GTK_BOX(streaming_buf_hbox), streaming_size_box, TRUE, TRUE, 0); - streaming_size_label = gtk_label_new(_("Buffer size (kb):")); - gtk_box_pack_start(GTK_BOX(streaming_size_box), streaming_size_label, FALSE, FALSE, 0); - streaming_size_adj = gtk_adjustment_new(flac_cfg.stream.http_buffer_size, 4, 4096, 4, 4, 4); - streaming_size_spin = gtk_spin_button_new(GTK_ADJUSTMENT(streaming_size_adj), 8, 0); - gtk_widget_set_usize(streaming_size_spin, 60, -1); - gtk_box_pack_start(GTK_BOX(streaming_size_box), streaming_size_spin, FALSE, FALSE, 0); - - streaming_pre_box = gtk_hbox_new(FALSE, 5); - /*gtk_table_attach_defaults(GTK_TABLE(streaming_buf_table),streaming_pre_box,1,2,0,1); */ - gtk_box_pack_start(GTK_BOX(streaming_buf_hbox), streaming_pre_box, TRUE, TRUE, 0); - streaming_pre_label = gtk_label_new(_("Pre-buffer (percent):")); - gtk_box_pack_start(GTK_BOX(streaming_pre_box), streaming_pre_label, FALSE, FALSE, 0); - streaming_pre_adj = gtk_adjustment_new(flac_cfg.stream.http_prebuffer, 0, 90, 1, 1, 1); - streaming_pre_spin = gtk_spin_button_new(GTK_ADJUSTMENT(streaming_pre_adj), 1, 0); - gtk_widget_set_usize(streaming_pre_spin, 60, -1); - gtk_box_pack_start(GTK_BOX(streaming_pre_box), streaming_pre_spin, FALSE, FALSE, 0); - - /* - * Proxy config. - */ - streaming_proxy_frame = gtk_frame_new(_("Proxy:")); - gtk_container_set_border_width(GTK_CONTAINER(streaming_proxy_frame), 5); - gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_proxy_frame, FALSE, FALSE, 0); - - streaming_proxy_vbox = gtk_vbox_new(FALSE, 5); - gtk_container_set_border_width(GTK_CONTAINER(streaming_proxy_vbox), 5); - gtk_container_add(GTK_CONTAINER(streaming_proxy_frame), streaming_proxy_vbox); - - streaming_proxy_use = gtk_check_button_new_with_label(_("Use proxy")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_proxy_use), flac_cfg.stream.use_proxy); - gtk_signal_connect(GTK_OBJECT(streaming_proxy_use), "clicked", GTK_SIGNAL_FUNC(proxy_use_cb), NULL); - gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_use, FALSE, FALSE, 0); - - streaming_proxy_hbox = gtk_hbox_new(FALSE, 5); - gtk_widget_set_sensitive(streaming_proxy_hbox, flac_cfg.stream.use_proxy); - gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_hbox, FALSE, FALSE, 0); - - streaming_proxy_host_label = gtk_label_new(_("Host:")); - gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox), streaming_proxy_host_label, FALSE, FALSE, 0); - - streaming_proxy_host_entry = gtk_entry_new(); - gtk_entry_set_text(GTK_ENTRY(streaming_proxy_host_entry), flac_cfg.stream.proxy_host? flac_cfg.stream.proxy_host : ""); - gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox), streaming_proxy_host_entry, TRUE, TRUE, 0); - - streaming_proxy_port_label = gtk_label_new(_("Port:")); - gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox), streaming_proxy_port_label, FALSE, FALSE, 0); - - streaming_proxy_port_entry = gtk_entry_new(); - gtk_widget_set_usize(streaming_proxy_port_entry, 50, -1); - temp = g_strdup_printf("%d", flac_cfg.stream.proxy_port); - gtk_entry_set_text(GTK_ENTRY(streaming_proxy_port_entry), temp); - g_free(temp); - gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox), streaming_proxy_port_entry, FALSE, FALSE, 0); - - streaming_proxy_auth_use = gtk_check_button_new_with_label(_("Use authentication")); - gtk_widget_set_sensitive(streaming_proxy_auth_use, flac_cfg.stream.use_proxy); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_proxy_auth_use), flac_cfg.stream.proxy_use_auth); - gtk_signal_connect(GTK_OBJECT(streaming_proxy_auth_use), "clicked", GTK_SIGNAL_FUNC(proxy_auth_use_cb), NULL); - gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_auth_use, FALSE, FALSE, 0); - - streaming_proxy_auth_hbox = gtk_hbox_new(FALSE, 5); - gtk_widget_set_sensitive(streaming_proxy_auth_hbox, flac_cfg.stream.use_proxy && flac_cfg.stream.proxy_use_auth); - gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_auth_hbox, FALSE, FALSE, 0); - - streaming_proxy_auth_user_label = gtk_label_new(_("Username:")); - gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox), streaming_proxy_auth_user_label, FALSE, FALSE, 0); - - streaming_proxy_auth_user_entry = gtk_entry_new(); - if(flac_cfg.stream.proxy_user) - gtk_entry_set_text(GTK_ENTRY(streaming_proxy_auth_user_entry), flac_cfg.stream.proxy_user); - gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox), streaming_proxy_auth_user_entry, TRUE, TRUE, 0); - - streaming_proxy_auth_pass_label = gtk_label_new(_("Password:")); - gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox), streaming_proxy_auth_pass_label, FALSE, FALSE, 0); - - streaming_proxy_auth_pass_entry = gtk_entry_new(); - if(flac_cfg.stream.proxy_pass) - gtk_entry_set_text(GTK_ENTRY(streaming_proxy_auth_pass_entry), flac_cfg.stream.proxy_pass); - gtk_entry_set_visibility(GTK_ENTRY(streaming_proxy_auth_pass_entry), FALSE); - gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox), streaming_proxy_auth_pass_entry, TRUE, TRUE, 0); - - - /* - * Save to disk config. - */ - streaming_save_frame = gtk_frame_new(_("Save stream to disk:")); - gtk_container_set_border_width(GTK_CONTAINER(streaming_save_frame), 5); - gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_save_frame, FALSE, FALSE, 0); - - streaming_save_vbox = gtk_vbox_new(FALSE, 5); - gtk_container_set_border_width(GTK_CONTAINER(streaming_save_vbox), 5); - gtk_container_add(GTK_CONTAINER(streaming_save_frame), streaming_save_vbox); - - streaming_save_use = gtk_check_button_new_with_label(_("Save stream to disk")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_save_use), flac_cfg.stream.save_http_stream); - gtk_signal_connect(GTK_OBJECT(streaming_save_use), "clicked", GTK_SIGNAL_FUNC(streaming_save_use_cb), NULL); - gtk_box_pack_start(GTK_BOX(streaming_save_vbox), streaming_save_use, FALSE, FALSE, 0); - - streaming_save_hbox = gtk_hbox_new(FALSE, 5); - gtk_widget_set_sensitive(streaming_save_hbox, flac_cfg.stream.save_http_stream); - gtk_box_pack_start(GTK_BOX(streaming_save_vbox), streaming_save_hbox, FALSE, FALSE, 0); - - streaming_save_label = gtk_label_new(_("Path:")); - gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_label, FALSE, FALSE, 0); - - streaming_save_entry = gtk_entry_new(); - gtk_entry_set_text(GTK_ENTRY(streaming_save_entry), flac_cfg.stream.save_http_path? flac_cfg.stream.save_http_path : ""); - gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_entry, TRUE, TRUE, 0); - - streaming_save_browse = gtk_button_new_with_label(_("Browse")); - gtk_signal_connect(GTK_OBJECT(streaming_save_browse), "clicked", GTK_SIGNAL_FUNC(streaming_save_browse_cb), NULL); - gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_browse, FALSE, FALSE, 0); - -#ifdef FLAC_ICECAST - streaming_cast_frame = gtk_frame_new(_("SHOUT/Icecast:")); - gtk_container_set_border_width(GTK_CONTAINER(streaming_cast_frame), 5); - gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_cast_frame, FALSE, FALSE, 0); - - streaming_cast_vbox = gtk_vbox_new(5, FALSE); - gtk_container_add(GTK_CONTAINER(streaming_cast_frame), streaming_cast_vbox); - - streaming_cast_title = gtk_check_button_new_with_label(_("Enable SHOUT/Icecast title streaming")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_cast_title), flac_cfg.stream.cast_title_streaming); - gtk_box_pack_start(GTK_BOX(streaming_cast_vbox), streaming_cast_title, FALSE, FALSE, 0); - - streaming_udp_title = gtk_check_button_new_with_label(_("Enable Icecast Metadata UDP Channel")); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_udp_title), flac_cfg.stream.use_udp_channel); - gtk_box_pack_start(GTK_BOX(streaming_cast_vbox), streaming_udp_title, FALSE, FALSE, 0); -#endif - - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), streaming_vbox, gtk_label_new(_("Streaming"))); - - /* Buttons */ - - bbox = gtk_hbutton_box_new(); - gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); - gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5); - gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); - - ok = gtk_button_new_with_label(_("Ok")); - gtk_signal_connect(GTK_OBJECT(ok), "clicked", GTK_SIGNAL_FUNC(flac_configurewin_ok), NULL); - GTK_WIDGET_SET_FLAGS(ok, GTK_CAN_DEFAULT); - gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 0); - gtk_widget_grab_default(ok); - - cancel = gtk_button_new_with_label(_("Cancel")); - gtk_signal_connect_object(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(flac_configurewin)); - GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT); - gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0); - - gtk_widget_show_all(flac_configurewin); -} - -void FLAC_XMMS__aboutbox(void) -{ - static GtkWidget *about_window; - - if (about_window) - gdk_window_raise(about_window->window); - - about_window = xmms_show_message( - _("About Flac Plugin"), - _("Flac Plugin by Josh Coalson\n" - "contributions by\n" - "......\n" - "......\n" - "and\n" - "Daisuke Shimamura\n" - "Visit http://flac.sourceforge.net/"), - _("Ok"), FALSE, NULL, NULL); - gtk_signal_connect(GTK_OBJECT(about_window), "destroy", - GTK_SIGNAL_FUNC(gtk_widget_destroyed), - &about_window); -} - -/* - * Get text of an Entry or a ComboBox - */ -static gchar *gtk_entry_get_text_1 (GtkWidget *widget) -{ - if (GTK_IS_COMBO(widget)) - { - return gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(widget)->entry)); - }else if (GTK_IS_ENTRY(widget)) - { - return gtk_entry_get_text(GTK_ENTRY(widget)); - }else - { - return NULL; - } -} diff --git a/3rdparty/libflac/src/plugin_xmms/configure.h b/3rdparty/libflac/src/plugin_xmms/configure.h deleted file mode 100644 index 88b2e37e194..00000000000 --- a/3rdparty/libflac/src/plugin_xmms/configure.h +++ /dev/null @@ -1,77 +0,0 @@ -/* libxmms-flac - XMMS FLAC input plugin - * Copyright (C) 2002,2003,2004,2005,2006 Daisuke Shimamura - * - * Based on mpg123 plugin - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef FLAC__PLUGIN_XMMS__CONFIGURE_H -#define FLAC__PLUGIN_XMMS__CONFIGURE_H - -#include <glib.h> - -typedef struct { - struct { - gboolean tag_override; - gchar *tag_format; - gboolean convert_char_set; - gchar *user_char_set; - } title; - - struct { - gint http_buffer_size; - gint http_prebuffer; - gboolean use_proxy; - gchar *proxy_host; - gint proxy_port; - gboolean proxy_use_auth; - gchar *proxy_user; - gchar *proxy_pass; - gboolean save_http_stream; - gchar *save_http_path; - gboolean cast_title_streaming; - gboolean use_udp_channel; - } stream; - - struct { - struct { - gboolean enable; - gboolean album_mode; - gint preamp; - gboolean hard_limit; - } replaygain; - struct { - struct { - gboolean dither_24_to_16; - } normal; - struct { - gboolean dither; - gint noise_shaping; /* value must be one of NoiseShaping enum, c.f. plugin_common/replaygain_synthesis.h */ - gint bps_out; - } replaygain; - } resolution; - } output; -} flac_config_t; - -extern flac_config_t flac_cfg; - -extern void FLAC_XMMS__configure(void); -extern void FLAC_XMMS__aboutbox(void); - -#endif - - - diff --git a/3rdparty/libflac/src/plugin_xmms/fileinfo.c b/3rdparty/libflac/src/plugin_xmms/fileinfo.c deleted file mode 100644 index 5589e1cba2b..00000000000 --- a/3rdparty/libflac/src/plugin_xmms/fileinfo.c +++ /dev/null @@ -1,496 +0,0 @@ -/* XMMS - Cross-platform multimedia player - * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies - * Copyright (C) 1999,2000 Håvard Kvålen - * Copyright (C) 2002,2003,2004,2005,2006 Daisuke Shimamura - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdlib.h> -#include <string.h> /* for strlen() */ -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> -#include <stdarg.h> -#include <gtk/gtk.h> - -#include "FLAC/metadata.h" -#include "charset.h" -#include "configure.h" -#include "plugin_common/replaygain.h" -#include "plugin_common/tags.h" -#include "locale_hack.h" - -static GtkWidget *window = NULL; -static GList *genre_list = NULL; -static GtkWidget *filename_entry, *tag_frame; -static GtkWidget *title_entry, *artist_entry, *album_entry, *date_entry, *tracknum_entry, *comment_entry; -static GtkWidget *replaygain_reference, *replaygain_track_gain, *replaygain_album_gain, *replaygain_track_peak, *replaygain_album_peak; -static GtkWidget *genre_combo; -static GtkWidget *flac_samplerate, *flac_channels, *flac_bits_per_sample, *flac_blocksize, *flac_filesize, *flac_samples, *flac_bitrate; - -static gchar *current_filename = NULL; -static FLAC__StreamMetadata *tags_ = NULL; - -static const gchar *vorbis_genres[] = -{ - N_("Blues"), N_("Classic Rock"), N_("Country"), N_("Dance"), - N_("Disco"), N_("Funk"), N_("Grunge"), N_("Hip-Hop"), - N_("Jazz"), N_("Metal"), N_("New Age"), N_("Oldies"), - N_("Other"), N_("Pop"), N_("R&B"), N_("Rap"), N_("Reggae"), - N_("Rock"), N_("Techno"), N_("Industrial"), N_("Alternative"), - N_("Ska"), N_("Death Metal"), N_("Pranks"), N_("Soundtrack"), - N_("Euro-Techno"), N_("Ambient"), N_("Trip-Hop"), N_("Vocal"), - N_("Jazz+Funk"), N_("Fusion"), N_("Trance"), N_("Classical"), - N_("Instrumental"), N_("Acid"), N_("House"), N_("Game"), - N_("Sound Clip"), N_("Gospel"), N_("Noise"), N_("Alt"), - N_("Bass"), N_("Soul"), N_("Punk"), N_("Space"), - N_("Meditative"), N_("Instrumental Pop"), - N_("Instrumental Rock"), N_("Ethnic"), N_("Gothic"), - N_("Darkwave"), N_("Techno-Industrial"), N_("Electronic"), - N_("Pop-Folk"), N_("Eurodance"), N_("Dream"), - N_("Southern Rock"), N_("Comedy"), N_("Cult"), - N_("Gangsta Rap"), N_("Top 40"), N_("Christian Rap"), - N_("Pop/Funk"), N_("Jungle"), N_("Native American"), - N_("Cabaret"), N_("New Wave"), N_("Psychedelic"), N_("Rave"), - N_("Showtunes"), N_("Trailer"), N_("Lo-Fi"), N_("Tribal"), - N_("Acid Punk"), N_("Acid Jazz"), N_("Polka"), N_("Retro"), - N_("Musical"), N_("Rock & Roll"), N_("Hard Rock"), N_("Folk"), - N_("Folk/Rock"), N_("National Folk"), N_("Swing"), - N_("Fast-Fusion"), N_("Bebob"), N_("Latin"), N_("Revival"), - N_("Celtic"), N_("Bluegrass"), N_("Avantgarde"), - N_("Gothic Rock"), N_("Progressive Rock"), - N_("Psychedelic Rock"), N_("Symphonic Rock"), N_("Slow Rock"), - N_("Big Band"), N_("Chorus"), N_("Easy Listening"), - N_("Acoustic"), N_("Humour"), N_("Speech"), N_("Chanson"), - N_("Opera"), N_("Chamber Music"), N_("Sonata"), N_("Symphony"), - N_("Booty Bass"), N_("Primus"), N_("Porn Groove"), - N_("Satire"), N_("Slow Jam"), N_("Club"), N_("Tango"), - N_("Samba"), N_("Folklore"), N_("Ballad"), N_("Power Ballad"), - N_("Rhythmic Soul"), N_("Freestyle"), N_("Duet"), - N_("Punk Rock"), N_("Drum Solo"), N_("A Cappella"), - N_("Euro-House"), N_("Dance Hall"), N_("Goa"), - N_("Drum & Bass"), N_("Club-House"), N_("Hardcore"), - N_("Terror"), N_("Indie"), N_("BritPop"), N_("Negerpunk"), - N_("Polsk Punk"), N_("Beat"), N_("Christian Gangsta Rap"), - N_("Heavy Metal"), N_("Black Metal"), N_("Crossover"), - N_("Contemporary Christian"), N_("Christian Rock"), - N_("Merengue"), N_("Salsa"), N_("Thrash Metal"), - N_("Anime"), N_("JPop"), N_("Synthpop") -}; - -static void label_set_text(GtkWidget * label, char *str, ...) -{ - va_list args; - gchar *tempstr; - - va_start(args, str); - tempstr = g_strdup_vprintf(str, args); - va_end(args); - - gtk_label_set_text(GTK_LABEL(label), tempstr); - g_free(tempstr); -} - -static void set_entry_tag(GtkEntry * entry, const char * utf8) -{ - if(utf8) { - if(flac_cfg.title.convert_char_set) { - char *text = convert_from_utf8_to_user(utf8); - gtk_entry_set_text(entry, text); - free(text); - } - else - gtk_entry_set_text(entry, utf8); - } - else - gtk_entry_set_text(entry, ""); -} - -static void get_entry_tag(GtkEntry * entry, const char *name) -{ - gchar *text; - char *utf8; - - text = gtk_entry_get_text(entry); - if (!text || strlen(text) == 0) - return; - if(flac_cfg.title.convert_char_set) - utf8 = convert_from_user_to_utf8(text); - else - utf8 = text; - - FLAC_plugin__tags_add_tag_utf8(tags_, name, utf8, /*separator=*/0); - - if(flac_cfg.title.convert_char_set) - free(utf8); -} - -static void show_tag(void) -{ - set_entry_tag(GTK_ENTRY(title_entry) , FLAC_plugin__tags_get_tag_utf8(tags_, "TITLE")); - set_entry_tag(GTK_ENTRY(artist_entry) , FLAC_plugin__tags_get_tag_utf8(tags_, "ARTIST")); - set_entry_tag(GTK_ENTRY(album_entry) , FLAC_plugin__tags_get_tag_utf8(tags_, "ALBUM")); - set_entry_tag(GTK_ENTRY(date_entry) , FLAC_plugin__tags_get_tag_utf8(tags_, "DATE")); - set_entry_tag(GTK_ENTRY(tracknum_entry) , FLAC_plugin__tags_get_tag_utf8(tags_, "TRACKNUMBER")); - set_entry_tag(GTK_ENTRY(comment_entry) , FLAC_plugin__tags_get_tag_utf8(tags_, "DESCRIPTION")); - set_entry_tag(GTK_ENTRY(GTK_COMBO(genre_combo)->entry), FLAC_plugin__tags_get_tag_utf8(tags_, "GENRE")); -} - -static void save_tag(GtkWidget * w, gpointer data) -{ - (void)w; - (void)data; - - FLAC_plugin__tags_delete_tag(tags_, "TITLE"); - FLAC_plugin__tags_delete_tag(tags_, "ARTIST"); - FLAC_plugin__tags_delete_tag(tags_, "ALBUM"); - FLAC_plugin__tags_delete_tag(tags_, "DATE"); - FLAC_plugin__tags_delete_tag(tags_, "TRACKNUMBER"); - FLAC_plugin__tags_delete_tag(tags_, "DESCRIPTION"); - FLAC_plugin__tags_delete_tag(tags_, "GENRE"); - - get_entry_tag(GTK_ENTRY(title_entry) , "TITLE"); - get_entry_tag(GTK_ENTRY(artist_entry) , "ARTIST"); - get_entry_tag(GTK_ENTRY(album_entry) , "ALBUM"); - get_entry_tag(GTK_ENTRY(date_entry) , "DATE"); - get_entry_tag(GTK_ENTRY(tracknum_entry) , "TRACKNUMBER"); - get_entry_tag(GTK_ENTRY(comment_entry) , "DESCRIPTION"); - get_entry_tag(GTK_ENTRY(GTK_COMBO(genre_combo)->entry), "GENRE"); - - FLAC_plugin__tags_set(current_filename, tags_); - gtk_widget_destroy(window); -} - -static void remove_tag(GtkWidget * w, gpointer data) -{ - (void)w; - (void)data; - - FLAC_plugin__tags_delete_tag(tags_, "TITLE"); - FLAC_plugin__tags_delete_tag(tags_, "ARTIST"); - FLAC_plugin__tags_delete_tag(tags_, "ALBUM"); - FLAC_plugin__tags_delete_tag(tags_, "DATE"); - FLAC_plugin__tags_delete_tag(tags_, "TRACKNUMBER"); - FLAC_plugin__tags_delete_tag(tags_, "DESCRIPTION"); - FLAC_plugin__tags_delete_tag(tags_, "GENRE"); - - FLAC_plugin__tags_set(current_filename, tags_); - gtk_widget_destroy(window); -} - -static void show_file_info(void) -{ - FLAC__StreamMetadata streaminfo; - struct stat _stat; - - gtk_label_set_text(GTK_LABEL(flac_samplerate), ""); - gtk_label_set_text(GTK_LABEL(flac_channels), ""); - gtk_label_set_text(GTK_LABEL(flac_bits_per_sample), ""); - gtk_label_set_text(GTK_LABEL(flac_blocksize), ""); - gtk_label_set_text(GTK_LABEL(flac_filesize), ""); - gtk_label_set_text(GTK_LABEL(flac_samples), ""); - gtk_label_set_text(GTK_LABEL(flac_bitrate), ""); - - if(!FLAC__metadata_get_streaminfo(current_filename, &streaminfo)) { - return; - } - - label_set_text(flac_samplerate, _("Samplerate: %d Hz"), streaminfo.data.stream_info.sample_rate); - label_set_text(flac_channels, _("Channels: %d"), streaminfo.data.stream_info.channels); - label_set_text(flac_bits_per_sample, _("Bits/Sample: %d"), streaminfo.data.stream_info.bits_per_sample); - if(streaminfo.data.stream_info.min_blocksize == streaminfo.data.stream_info.max_blocksize) - label_set_text(flac_blocksize, _("Blocksize: %d"), streaminfo.data.stream_info.min_blocksize); - else - label_set_text(flac_blocksize, _("Blocksize: variable\n min/max: %d/%d"), streaminfo.data.stream_info.min_blocksize, streaminfo.data.stream_info.max_blocksize); - - if (streaminfo.data.stream_info.total_samples) - label_set_text(flac_samples, _("Samples: %llu\nLength: %d:%.2d"), - streaminfo.data.stream_info.total_samples, - (int)(streaminfo.data.stream_info.total_samples / streaminfo.data.stream_info.sample_rate / 60), - (int)(streaminfo.data.stream_info.total_samples / streaminfo.data.stream_info.sample_rate % 60)); - - if(!stat(current_filename, &_stat) && S_ISREG(_stat.st_mode)) { -#if _FILE_OFFSET_BITS == 64 - label_set_text(flac_filesize, _("Filesize: %lld B"), _stat.st_size); -#else - label_set_text(flac_filesize, _("Filesize: %ld B"), _stat.st_size); -#endif - if (streaminfo.data.stream_info.total_samples) - label_set_text(flac_bitrate, _("Avg. bitrate: %.1f kb/s\nCompression ratio: %.1f%%"), - 8.0 * (float)(_stat.st_size) / (1000.0 * (float)streaminfo.data.stream_info.total_samples / (float)streaminfo.data.stream_info.sample_rate), - 100.0 * (float)_stat.st_size / (float)(streaminfo.data.stream_info.bits_per_sample / 8 * streaminfo.data.stream_info.channels * streaminfo.data.stream_info.total_samples)); - } -} - -static void show_replaygain(void) -{ - /* known limitation: If only one of gain and peak is set, neither will be shown. This is true for - * both track and album replaygain tags. Written so it will be easy to fix, with some trouble. */ - - gtk_label_set_text(GTK_LABEL(replaygain_reference), ""); - gtk_label_set_text(GTK_LABEL(replaygain_track_gain), ""); - gtk_label_set_text(GTK_LABEL(replaygain_album_gain), ""); - gtk_label_set_text(GTK_LABEL(replaygain_track_peak), ""); - gtk_label_set_text(GTK_LABEL(replaygain_album_peak), ""); - - double reference, track_gain, track_peak, album_gain, album_peak; - FLAC__bool reference_set, track_gain_set, track_peak_set, album_gain_set, album_peak_set; - - if(!FLAC_plugin__replaygain_get_from_file( - current_filename, - &reference, &reference_set, - &track_gain, &track_gain_set, - &album_gain, &album_gain_set, - &track_peak, &track_peak_set, - &album_peak, &album_peak_set - )) - return; - - if(reference_set) - label_set_text(replaygain_reference, _("ReplayGain Reference Loudness: %2.1f dB"), reference); - if(track_gain_set) - label_set_text(replaygain_track_gain, _("ReplayGain Track Gain: %+2.2f dB"), track_gain); - if(album_gain_set) - label_set_text(replaygain_album_gain, _("ReplayGain Album Gain: %+2.2f dB"), album_gain); - if(track_peak_set) - label_set_text(replaygain_track_peak, _("ReplayGain Track Peak: %1.8f"), track_peak); - if(album_peak_set) - label_set_text(replaygain_album_peak, _("ReplayGain Album Peak: %1.8f"), album_peak); -} - -void FLAC_XMMS__file_info_box(char *filename) -{ - unsigned i; - gchar *title; - - if (!window) - { - GtkWidget *vbox, *hbox, *left_vbox, *table; - GtkWidget *flac_frame, *flac_box; - GtkWidget *label, *filename_hbox; - GtkWidget *bbox, *save, *remove, *cancel; - - window = gtk_window_new(GTK_WINDOW_DIALOG); - gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE); - gtk_signal_connect(GTK_OBJECT(window), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &window); - gtk_container_set_border_width(GTK_CONTAINER(window), 10); - - vbox = gtk_vbox_new(FALSE, 10); - gtk_container_add(GTK_CONTAINER(window), vbox); - - filename_hbox = gtk_hbox_new(FALSE, 5); - gtk_box_pack_start(GTK_BOX(vbox), filename_hbox, FALSE, TRUE, 0); - - label = gtk_label_new(_("Filename:")); - gtk_box_pack_start(GTK_BOX(filename_hbox), label, FALSE, TRUE, 0); - filename_entry = gtk_entry_new(); - gtk_editable_set_editable(GTK_EDITABLE(filename_entry), FALSE); - gtk_box_pack_start(GTK_BOX(filename_hbox), filename_entry, TRUE, TRUE, 0); - - hbox = gtk_hbox_new(FALSE, 10); - gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, TRUE, 0); - - left_vbox = gtk_vbox_new(FALSE, 10); - gtk_box_pack_start(GTK_BOX(hbox), left_vbox, FALSE, FALSE, 0); - - tag_frame = gtk_frame_new(_("Tag:")); - gtk_box_pack_start(GTK_BOX(left_vbox), tag_frame, FALSE, FALSE, 0); - - table = gtk_table_new(5, 5, FALSE); - gtk_container_set_border_width(GTK_CONTAINER(table), 5); - gtk_container_add(GTK_CONTAINER(tag_frame), table); - - label = gtk_label_new(_("Title:")); - gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); - gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 5, 5); - - title_entry = gtk_entry_new(); - gtk_table_attach(GTK_TABLE(table), title_entry, 1, 4, 0, 1, GTK_FILL | GTK_EXPAND | GTK_SHRINK, GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); - - label = gtk_label_new(_("Artist:")); - gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); - gtk_table_attach(GTK_TABLE(table), label, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 5, 5); - - artist_entry = gtk_entry_new(); - gtk_table_attach(GTK_TABLE(table), artist_entry, 1, 4, 1, 2, GTK_FILL | GTK_EXPAND | GTK_SHRINK, GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); - - label = gtk_label_new(_("Album:")); - gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); - gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, GTK_FILL, GTK_FILL, 5, 5); - - album_entry = gtk_entry_new(); - gtk_table_attach(GTK_TABLE(table), album_entry, 1, 4, 2, 3, GTK_FILL | GTK_EXPAND | GTK_SHRINK, GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); - - label = gtk_label_new(_("Comment:")); - gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); - gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4, GTK_FILL, GTK_FILL, 5, 5); - - comment_entry = gtk_entry_new(); - gtk_table_attach(GTK_TABLE(table), comment_entry, 1, 4, 3, 4, GTK_FILL | GTK_EXPAND | GTK_SHRINK, GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); - - label = gtk_label_new(_("Date:")); - gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); - gtk_table_attach(GTK_TABLE(table), label, 0, 1, 4, 5, GTK_FILL, GTK_FILL, 5, 5); - - date_entry = gtk_entry_new(); - gtk_widget_set_usize(date_entry, 40, -1); - gtk_table_attach(GTK_TABLE(table), date_entry, 1, 2, 4, 5, GTK_FILL | GTK_EXPAND | GTK_SHRINK, GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); - - label = gtk_label_new(_("Track number:")); - gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); - gtk_table_attach(GTK_TABLE(table), label, 2, 3, 4, 5, GTK_FILL, GTK_FILL, 5, 5); - - tracknum_entry = gtk_entry_new(); - gtk_widget_set_usize(tracknum_entry, 40, -1); - gtk_table_attach(GTK_TABLE(table), tracknum_entry, 3, 4, 4, 5, GTK_FILL | GTK_EXPAND | GTK_SHRINK, GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); - - label = gtk_label_new(_("Genre:")); - gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5); - gtk_table_attach(GTK_TABLE(table), label, 0, 1, 5, 6, GTK_FILL, GTK_FILL, 5, 5); - - genre_combo = gtk_combo_new(); - gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(genre_combo)->entry), TRUE); - - if (!genre_list) - { - for (i = 0; i < sizeof(vorbis_genres) / sizeof(*vorbis_genres) ; i++) - genre_list = g_list_prepend(genre_list, (char *)vorbis_genres[i]); - genre_list = g_list_prepend(genre_list, ""); - genre_list = g_list_sort(genre_list, (GCompareFunc)g_strcasecmp); - } - gtk_combo_set_popdown_strings(GTK_COMBO(genre_combo), genre_list); - - gtk_table_attach(GTK_TABLE(table), genre_combo, 1, 4, 5, 6, GTK_FILL | GTK_EXPAND | GTK_SHRINK, GTK_FILL | GTK_EXPAND | GTK_SHRINK, 0, 5); - - bbox = gtk_hbutton_box_new(); - gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); - gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5); - gtk_box_pack_start(GTK_BOX(left_vbox), bbox, FALSE, FALSE, 0); - - save = gtk_button_new_with_label(_("Save")); - gtk_signal_connect(GTK_OBJECT(save), "clicked", GTK_SIGNAL_FUNC(save_tag), NULL); - GTK_WIDGET_SET_FLAGS(save, GTK_CAN_DEFAULT); - gtk_box_pack_start(GTK_BOX(bbox), save, TRUE, TRUE, 0); - gtk_widget_grab_default(save); - - remove= gtk_button_new_with_label(_("Remove Tag")); - gtk_signal_connect(GTK_OBJECT(remove), "clicked", GTK_SIGNAL_FUNC(remove_tag), NULL); - GTK_WIDGET_SET_FLAGS(remove, GTK_CAN_DEFAULT); - gtk_box_pack_start(GTK_BOX(bbox), remove, TRUE, TRUE, 0); - - cancel = gtk_button_new_with_label(_("Cancel")); - gtk_signal_connect_object(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(window)); - GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT); - gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0); - - flac_frame = gtk_frame_new(_("FLAC Info:")); - gtk_box_pack_start(GTK_BOX(hbox), flac_frame, FALSE, FALSE, 0); - - flac_box = gtk_vbox_new(FALSE, 5); - gtk_container_add(GTK_CONTAINER(flac_frame), flac_box); - gtk_container_set_border_width(GTK_CONTAINER(flac_box), 10); - gtk_box_set_spacing(GTK_BOX(flac_box), 0); - - flac_samplerate = gtk_label_new(""); - gtk_misc_set_alignment(GTK_MISC(flac_samplerate), 0, 0); - gtk_label_set_justify(GTK_LABEL(flac_samplerate), GTK_JUSTIFY_LEFT); - gtk_box_pack_start(GTK_BOX(flac_box), flac_samplerate, FALSE, FALSE, 0); - - flac_channels = gtk_label_new(""); - gtk_misc_set_alignment(GTK_MISC(flac_channels), 0, 0); - gtk_label_set_justify(GTK_LABEL(flac_channels), GTK_JUSTIFY_LEFT); - gtk_box_pack_start(GTK_BOX(flac_box), flac_channels, FALSE, FALSE, 0); - - flac_bits_per_sample = gtk_label_new(""); - gtk_misc_set_alignment(GTK_MISC(flac_bits_per_sample), 0, 0); - gtk_label_set_justify(GTK_LABEL(flac_bits_per_sample), GTK_JUSTIFY_LEFT); - gtk_box_pack_start(GTK_BOX(flac_box), flac_bits_per_sample, FALSE, FALSE, 0); - - flac_blocksize = gtk_label_new(""); - gtk_misc_set_alignment(GTK_MISC(flac_blocksize), 0, 0); - gtk_label_set_justify(GTK_LABEL(flac_blocksize), GTK_JUSTIFY_LEFT); - gtk_box_pack_start(GTK_BOX(flac_box), flac_blocksize, FALSE, FALSE, 0); - - flac_filesize = gtk_label_new(""); - gtk_misc_set_alignment(GTK_MISC(flac_filesize), 0, 0); - gtk_label_set_justify(GTK_LABEL(flac_filesize), GTK_JUSTIFY_LEFT); - gtk_box_pack_start(GTK_BOX(flac_box), flac_filesize, FALSE, FALSE, 0); - - flac_samples = gtk_label_new(""); - gtk_misc_set_alignment(GTK_MISC(flac_samples), 0, 0); - gtk_label_set_justify(GTK_LABEL(flac_samples), GTK_JUSTIFY_LEFT); - gtk_box_pack_start(GTK_BOX(flac_box), flac_samples, FALSE, FALSE, 0); - - flac_bitrate = gtk_label_new(""); - gtk_misc_set_alignment(GTK_MISC(flac_bitrate), 0, 0); - gtk_label_set_justify(GTK_LABEL(flac_bitrate), GTK_JUSTIFY_LEFT); - gtk_box_pack_start(GTK_BOX(flac_box), flac_bitrate, FALSE, FALSE, 0); - - replaygain_reference = gtk_label_new(""); - gtk_misc_set_alignment(GTK_MISC(replaygain_reference), 0, 0); - gtk_label_set_justify(GTK_LABEL(replaygain_reference), GTK_JUSTIFY_LEFT); - gtk_box_pack_start(GTK_BOX(flac_box), replaygain_reference, FALSE, FALSE, 0); - - replaygain_track_gain = gtk_label_new(""); - gtk_misc_set_alignment(GTK_MISC(replaygain_track_gain), 0, 0); - gtk_label_set_justify(GTK_LABEL(replaygain_track_gain), GTK_JUSTIFY_LEFT); - gtk_box_pack_start(GTK_BOX(flac_box), replaygain_track_gain, FALSE, FALSE, 0); - - replaygain_album_gain = gtk_label_new(""); - gtk_misc_set_alignment(GTK_MISC(replaygain_album_gain), 0, 0); - gtk_label_set_justify(GTK_LABEL(replaygain_album_gain), GTK_JUSTIFY_LEFT); - gtk_box_pack_start(GTK_BOX(flac_box), replaygain_album_gain, FALSE, FALSE, 0); - - replaygain_track_peak = gtk_label_new(""); - gtk_misc_set_alignment(GTK_MISC(replaygain_track_peak), 0, 0); - gtk_label_set_justify(GTK_LABEL(replaygain_track_peak), GTK_JUSTIFY_LEFT); - gtk_box_pack_start(GTK_BOX(flac_box), replaygain_track_peak, FALSE, FALSE, 0); - - replaygain_album_peak = gtk_label_new(""); - gtk_misc_set_alignment(GTK_MISC(replaygain_album_peak), 0, 0); - gtk_label_set_justify(GTK_LABEL(replaygain_album_peak), GTK_JUSTIFY_LEFT); - gtk_box_pack_start(GTK_BOX(flac_box), replaygain_album_peak, FALSE, FALSE, 0); - - gtk_widget_show_all(window); - } - - if(current_filename) - g_free(current_filename); - if(!(current_filename = g_strdup(filename))) - return; - - title = g_strdup_printf(_("File Info - %s"), g_basename(filename)); - gtk_window_set_title(GTK_WINDOW(window), title); - g_free(title); - - gtk_entry_set_text(GTK_ENTRY(filename_entry), filename); - gtk_editable_set_position(GTK_EDITABLE(filename_entry), -1); - - if(tags_) - FLAC_plugin__tags_destroy(&tags_); - - FLAC_plugin__tags_get(current_filename, &tags_); - - show_tag(); - show_file_info(); - show_replaygain(); - - gtk_widget_set_sensitive(tag_frame, TRUE); -} diff --git a/3rdparty/libflac/src/plugin_xmms/http.c b/3rdparty/libflac/src/plugin_xmms/http.c deleted file mode 100644 index af3235fb1f0..00000000000 --- a/3rdparty/libflac/src/plugin_xmms/http.c +++ /dev/null @@ -1,899 +0,0 @@ -/* XMMS - Cross-platform multimedia player - * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -/* modified for FLAC support by Steven Richman (2003) */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/time.h> -#include <netinet/in.h> -#include <arpa/inet.h> -#include <netdb.h> -#include <glib.h> -#include <string.h> -#include <fcntl.h> -#include <unistd.h> -#include <errno.h> -#include <stdio.h> -#include <stdlib.h> - -#include <pthread.h> - -#include <xmms/util.h> -#include <xmms/plugin.h> - -#include "FLAC/format.h" -#include "configure.h" -#include "locale_hack.h" -#include "plugin.h" - -/* on FreeBSD we get socklen_t from <sys/socket.h> */ -#if (!defined HAVE_SOCKLEN_T) && !defined(__FreeBSD__) -typedef unsigned int socklen_t; -#endif - -#define min(x,y) ((x)<(y)?(x):(y)) -#define min3(x,y,z) (min(x,y)<(z)?min(x,y):(z)) -#define min4(x,y,z,w) (min3(x,y,z)<(w)?min3(x,y,z):(w)) - -static gchar *icy_name = NULL; -static gint icy_metaint = 0; - -extern InputPlugin flac_ip; - -#undef DEBUG_UDP - -/* Static udp channel functions */ -static int udp_establish_listener (gint *sock); -static int udp_check_for_data(gint sock); - -static char *flac_http_get_title(char *url); - -static gboolean prebuffering, going, eof = FALSE; -static gint sock, rd_index, wr_index, buffer_length, prebuffer_length; -static guint64 buffer_read = 0; -static gchar *buffer; -static guint64 offset; -static pthread_t thread; -static GtkWidget *error_dialog = NULL; - -static FILE *output_file = NULL; - -#define BASE64_LENGTH(len) (4 * (((len) + 2) / 3)) - -/* Encode the string S of length LENGTH to base64 format and place it - to STORE. STORE will be 0-terminated, and must point to a writable - buffer of at least 1+BASE64_LENGTH(length) bytes. */ -static void base64_encode (const gchar *s, gchar *store, gint length) -{ - /* Conversion table. */ - static gchar tbl[64] = { - 'A','B','C','D','E','F','G','H', - 'I','J','K','L','M','N','O','P', - 'Q','R','S','T','U','V','W','X', - 'Y','Z','a','b','c','d','e','f', - 'g','h','i','j','k','l','m','n', - 'o','p','q','r','s','t','u','v', - 'w','x','y','z','0','1','2','3', - '4','5','6','7','8','9','+','/' - }; - gint i; - guchar *p = (guchar *)store; - - /* Transform the 3x8 bits to 4x6 bits, as required by base64. */ - for (i = 0; i < length; i += 3) - { - *p++ = tbl[s[0] >> 2]; - *p++ = tbl[((s[0] & 3) << 4) + (s[1] >> 4)]; - *p++ = tbl[((s[1] & 0xf) << 2) + (s[2] >> 6)]; - *p++ = tbl[s[2] & 0x3f]; - s += 3; - } - /* Pad the result if necessary... */ - if (i == length + 1) - *(p - 1) = '='; - else if (i == length + 2) - *(p - 1) = *(p - 2) = '='; - /* ...and zero-terminate it. */ - *p = '\0'; -} - -/* Create the authentication header contents for the `Basic' scheme. - This is done by encoding the string `USER:PASS' in base64 and - prepending `HEADER: Basic ' to it. */ -static gchar *basic_authentication_encode (const gchar *user, const gchar *passwd, const gchar *header) -{ - gchar *t1, *t2, *res; - gint len1 = strlen (user) + 1 + strlen (passwd); - gint len2 = BASE64_LENGTH (len1); - - t1 = g_strdup_printf("%s:%s", user, passwd); - t2 = g_malloc0(len2 + 1); - base64_encode (t1, t2, len1); - res = g_strdup_printf("%s: Basic %s\r\n", header, t2); - g_free(t2); - g_free(t1); - - return res; -} - -static void parse_url(const gchar * url, gchar ** user, gchar ** pass, gchar ** host, int *port, gchar ** filename) -{ - gchar *h, *p, *pt, *f, *temp, *ptr; - - temp = g_strdup(url); - ptr = temp; - - if (!strncasecmp("http://", ptr, 7)) - ptr += 7; - h = strchr(ptr, '@'); - f = strchr(ptr, '/'); - if (h != NULL && (!f || h < f)) - { - *h = '\0'; - p = strchr(ptr, ':'); - if (p != NULL && p < h) - { - *p = '\0'; - p++; - *pass = g_strdup(p); - } - else - *pass = NULL; - *user = g_strdup(ptr); - h++; - ptr = h; - } - else - { - *user = NULL; - *pass = NULL; - h = ptr; - } - pt = strchr(ptr, ':'); - if (pt != NULL && (f == NULL || pt < f)) - { - *pt = '\0'; - *port = atoi(pt + 1); - } - else - { - if (f) - *f = '\0'; - *port = 80; - } - *host = g_strdup(h); - - if (f) - *filename = g_strdup(f + 1); - else - *filename = NULL; - g_free(temp); -} - -void flac_http_close(void) -{ - going = FALSE; - - pthread_join(thread, NULL); - g_free(icy_name); - icy_name = NULL; -} - - -static gint http_used(void) -{ - if (wr_index >= rd_index) - return wr_index - rd_index; - return buffer_length - (rd_index - wr_index); -} - -static gint http_free(void) -{ - if (rd_index > wr_index) - return (rd_index - wr_index) - 1; - return (buffer_length - (wr_index - rd_index)) - 1; -} - -static void http_wait_for_data(gint bytes) -{ - while ((prebuffering || http_used() < bytes) && !eof && going) - xmms_usleep(10000); -} - -static void show_error_message(gchar *error) -{ - if(!error_dialog) - { - GDK_THREADS_ENTER(); - error_dialog = xmms_show_message(_("Error"), error, _("Ok"), FALSE, - NULL, NULL); - gtk_signal_connect(GTK_OBJECT(error_dialog), - "destroy", - GTK_SIGNAL_FUNC(gtk_widget_destroyed), - &error_dialog); - GDK_THREADS_LEAVE(); - } -} - -int flac_http_read(gpointer data, gint length) -{ - gint len, cnt, off = 0, meta_len, meta_off = 0, i; - gchar *meta_data, **tags, *temp, *title; - if (length > buffer_length) { - length = buffer_length; - } - - http_wait_for_data(length); - - if (!going) - return 0; - len = min(http_used(), length); - - while (len && http_used()) - { - if ((flac_cfg.stream.cast_title_streaming) && (icy_metaint > 0) && (buffer_read % icy_metaint) == 0 && (buffer_read > 0)) - { - meta_len = *((guchar *) buffer + rd_index) * 16; - rd_index = (rd_index + 1) % buffer_length; - if (meta_len > 0) - { - http_wait_for_data(meta_len); - meta_data = g_malloc0(meta_len); - if (http_used() >= meta_len) - { - while (meta_len) - { - cnt = min(meta_len, buffer_length - rd_index); - memcpy(meta_data + meta_off, buffer + rd_index, cnt); - rd_index = (rd_index + cnt) % buffer_length; - meta_len -= cnt; - meta_off += cnt; - } - tags = g_strsplit(meta_data, "';", 0); - - for (i = 0; tags[i]; i++) - { - if (!strncasecmp(tags[i], "StreamTitle=", 12)) - { - temp = g_strdup(tags[i] + 13); - title = g_strdup_printf("%s (%s)", temp, icy_name); - set_track_info(title, -1); - g_free(title); - g_free(temp); - } - - } - g_strfreev(tags); - - } - g_free(meta_data); - } - if (!http_used()) - http_wait_for_data(length - off); - cnt = min3(len, buffer_length - rd_index, http_used()); - } - else if ((icy_metaint > 0) && (flac_cfg.stream.cast_title_streaming)) - cnt = min4(len, buffer_length - rd_index, http_used(), icy_metaint - (gint) (buffer_read % icy_metaint)); - else - cnt = min3(len, buffer_length - rd_index, http_used()); - if (output_file) - fwrite(buffer + rd_index, 1, cnt, output_file); - - memcpy((gchar *)data + off, buffer + rd_index, cnt); - rd_index = (rd_index + cnt) % buffer_length; - buffer_read += cnt; - len -= cnt; - off += cnt; - } - if (!off) { - fprintf(stderr, "returning zero\n"); - } - return off; -} - -static gboolean http_check_for_data(void) -{ - - fd_set set; - struct timeval tv; - gint ret; - - tv.tv_sec = 0; - tv.tv_usec = 20000; - FD_ZERO(&set); - FD_SET(sock, &set); - ret = select(sock + 1, &set, NULL, NULL, &tv); - if (ret > 0) - return TRUE; - return FALSE; -} - -gint flac_http_read_line(gchar * buf, gint size) -{ - gint i = 0; - - while (going && i < size - 1) - { - if (http_check_for_data()) - { - if (read(sock, buf + i, 1) <= 0) - return -1; - if (buf[i] == '\n') - break; - if (buf[i] != '\r') - i++; - } - } - if (!going) - return -1; - buf[i] = '\0'; - return i; -} - -/* returns the file descriptor of the socket, or -1 on error */ -static int http_connect (gchar *url_, gboolean head, guint64 offset) -{ - gchar line[1024], *user, *pass, *host, *filename, - *status, *url, *temp, *file; - gchar *chost; - gint cnt, error, port, cport; - socklen_t err_len; - gboolean redirect; - int udp_sock = 0; - fd_set set; - struct hostent *hp; - struct sockaddr_in address; - struct timeval tv; - - url = g_strdup (url_); - - do - { - redirect=FALSE; - - g_strstrip(url); - - parse_url(url, &user, &pass, &host, &port, &filename); - - if ((!filename || !*filename) && url[strlen(url) - 1] != '/') - temp = g_strconcat(url, "/", NULL); - else - temp = g_strdup(url); - g_free(url); - url = temp; - - chost = flac_cfg.stream.use_proxy ? flac_cfg.stream.proxy_host : host; - cport = flac_cfg.stream.use_proxy ? flac_cfg.stream.proxy_port : port; - - sock = socket(AF_INET, SOCK_STREAM, 0); - fcntl(sock, F_SETFL, O_NONBLOCK); - address.sin_family = AF_INET; - - status = g_strdup_printf(_("LOOKING UP %s"), chost); - flac_ip.set_info_text(status); - g_free(status); - - if (!(hp = gethostbyname(chost))) - { - status = g_strdup_printf(_("Couldn't look up host %s"), chost); - show_error_message(status); - g_free(status); - - flac_ip.set_info_text(NULL); - eof = TRUE; - } - - if (!eof) - { - memcpy(&address.sin_addr.s_addr, *(hp->h_addr_list), sizeof (address.sin_addr.s_addr)); - address.sin_port = (gint) g_htons(cport); - - status = g_strdup_printf(_("CONNECTING TO %s:%d"), chost, cport); - flac_ip.set_info_text(status); - g_free(status); - if (connect(sock, (struct sockaddr *) &address, sizeof (struct sockaddr_in)) == -1) - { - if (errno != EINPROGRESS) - { - status = g_strdup_printf(_("Couldn't connect to host %s"), chost); - show_error_message(status); - g_free(status); - - flac_ip.set_info_text(NULL); - eof = TRUE; - } - } - while (going) - { - tv.tv_sec = 0; - tv.tv_usec = 10000; - FD_ZERO(&set); - FD_SET(sock, &set); - if (select(sock + 1, NULL, &set, NULL, &tv) > 0) - { - err_len = sizeof (error); - getsockopt(sock, SOL_SOCKET, SO_ERROR, &error, &err_len); - if (error) - { - status = g_strdup_printf(_("Couldn't connect to host %s"), - chost); - show_error_message(status); - g_free(status); - - flac_ip.set_info_text(NULL); - eof = TRUE; - - } - break; - } - } - if (!eof) - { - gchar *auth = NULL, *proxy_auth = NULL; - gchar udpspace[30]; - int udp_port; - - if (flac_cfg.stream.use_udp_channel) - { - udp_port = udp_establish_listener (&udp_sock); - if (udp_port > 0) - sprintf (udpspace, "x-audiocast-udpport: %d\r\n", udp_port); - else - udp_sock = 0; - } - - if(user && pass) - auth = basic_authentication_encode(user, pass, "Authorization"); - - if (flac_cfg.stream.use_proxy) - { - file = g_strdup(url); - if(flac_cfg.stream.proxy_use_auth && flac_cfg.stream.proxy_user && flac_cfg.stream.proxy_pass) - { - proxy_auth = basic_authentication_encode(flac_cfg.stream.proxy_user, - flac_cfg.stream.proxy_pass, - "Proxy-Authorization"); - } - } - else - file = g_strconcat("/", filename, NULL); - - temp = g_strdup_printf("GET %s HTTP/1.0\r\n" - "Host: %s\r\n" - "User-Agent: %s/%s\r\n" - "%s%s%s%s", - file, host, "Reference FLAC Player", FLAC__VERSION_STRING, - proxy_auth ? proxy_auth : "", auth ? auth : "", - flac_cfg.stream.cast_title_streaming ? "Icy-MetaData:1\r\n" : "", - flac_cfg.stream.use_udp_channel ? udpspace : ""); - if (offset && !head) { - gchar *temp_dead = temp; - temp = g_strdup_printf ("%sRange: %llu-\r\n", temp, offset); - fprintf (stderr, "%s", temp); - g_free (temp_dead); - } - - g_free(file); - if(proxy_auth) - g_free(proxy_auth); - if(auth) - g_free(auth); - write(sock, temp, strlen(temp)); - write(sock, "\r\n", 2); - g_free(temp); - flac_ip.set_info_text(_("CONNECTED: WAITING FOR REPLY")); - while (going && !eof) - { - if (http_check_for_data()) - { - if (flac_http_read_line(line, 1024)) - { - status = strchr(line, ' '); - if (status) - { - if (status[1] == '2') - break; - else if(status[1] == '3' && status[2] == '0' && status[3] == '2') - { - while(going) - { - if(http_check_for_data()) - { - if((cnt = flac_http_read_line(line, 1024)) != -1) - { - if(!cnt) - break; - if(!strncmp(line, "Location:", 9)) - { - g_free(url); - url = g_strdup(line+10); - } - } - else - { - eof=TRUE; - flac_ip.set_info_text(NULL); - break; - } - } - } - redirect=TRUE; - break; - } - else - { - status = g_strdup_printf(_("Couldn't connect to host %s\nServer reported: %s"), chost, status); - show_error_message(status); - g_free(status); - break; - } - } - } - else - { - eof = TRUE; - flac_ip.set_info_text(NULL); - } - } - } - - while (going && !redirect) - { - if (http_check_for_data()) - { - if ((cnt = flac_http_read_line(line, 1024)) != -1) - { - if (!cnt) - break; - if (!strncmp(line, "icy-name:", 9)) - icy_name = g_strdup(line + 9); - else if (!strncmp(line, "x-audiocast-name:", 17)) - icy_name = g_strdup(line + 17); - if (!strncmp(line, "icy-metaint:", 12)) - icy_metaint = atoi(line + 12); - if (!strncmp(line, "x-audiocast-udpport:", 20)) { -#ifdef DEBUG_UDP - fprintf (stderr, "Server wants udp messages on port %d\n", atoi (line + 20)); -#endif - /*udp_serverport = atoi (line + 20);*/ - } - - } - else - { - eof = TRUE; - flac_ip.set_info_text(NULL); - break; - } - } - } - } - } - - if(redirect) - { - if (output_file) - { - fclose(output_file); - output_file = NULL; - } - close(sock); - } - - g_free(user); - g_free(pass); - g_free(host); - g_free(filename); - } while(redirect); - - g_free(url); - return eof ? -1 : sock; -} - -static void *http_buffer_loop(void *arg) -{ - gchar *status, *url, *temp, *file; - gint cnt, written; - int udp_sock = 0; - - url = (gchar *) arg; - sock = http_connect (url, false, offset); - - if (sock >= 0 && flac_cfg.stream.save_http_stream) { - gchar *output_name; - file = flac_http_get_title(url); - output_name = file; - if (!strncasecmp(output_name, "http://", 7)) - output_name += 7; - temp = strrchr(output_name, '.'); - if (temp && (!strcasecmp(temp, ".fla") || !strcasecmp(temp, ".flac"))) - *temp = '\0'; - - while ((temp = strchr(output_name, '/'))) - *temp = '_'; - output_name = g_strdup_printf("%s/%s.flac", flac_cfg.stream.save_http_path, output_name); - - g_free(file); - - output_file = fopen(output_name, "wb"); - g_free(output_name); - } - - while (going) - { - - if (!http_used() && !flac_ip.output->buffer_playing()) - prebuffering = TRUE; - if (http_free() > 0 && !eof) - { - if (http_check_for_data()) - { - cnt = min(http_free(), buffer_length - wr_index); - if (cnt > 1024) - cnt = 1024; - written = read(sock, buffer + wr_index, cnt); - if (written <= 0) - { - eof = TRUE; - if (prebuffering) - { - prebuffering = FALSE; - - flac_ip.set_info_text(NULL); - } - - } - else - wr_index = (wr_index + written) % buffer_length; - } - - if (prebuffering) - { - if (http_used() > prebuffer_length) - { - prebuffering = FALSE; - flac_ip.set_info_text(NULL); - } - else - { - status = g_strdup_printf(_("PRE-BUFFERING: %dKB/%dKB"), http_used() / 1024, prebuffer_length / 1024); - flac_ip.set_info_text(status); - g_free(status); - } - - } - } - else - xmms_usleep(10000); - - if (flac_cfg.stream.use_udp_channel && udp_sock != 0) - if (udp_check_for_data(udp_sock) < 0) - { - close(udp_sock); - udp_sock = 0; - } - } - if (output_file) - { - fclose(output_file); - output_file = NULL; - } - if (sock >= 0) { - close(sock); - } - if (udp_sock != 0) - close(udp_sock); - - g_free(buffer); - g_free(url); - - pthread_exit(NULL); - return NULL; /* avoid compiler warning */ -} - -int flac_http_open(const gchar * _url, guint64 _offset) -{ - gchar *url; - - url = g_strdup(_url); - - rd_index = 0; - wr_index = 0; - buffer_length = flac_cfg.stream.http_buffer_size * 1024; - prebuffer_length = (buffer_length * flac_cfg.stream.http_prebuffer) / 100; - buffer_read = 0; - icy_metaint = 0; - prebuffering = TRUE; - going = TRUE; - eof = FALSE; - buffer = g_malloc(buffer_length); - offset = _offset; - - pthread_create(&thread, NULL, http_buffer_loop, url); - - return 0; -} - -char *flac_http_get_title(char *url) -{ - if (icy_name) - return g_strdup(icy_name); - if (g_basename(url) && strlen(g_basename(url)) > 0) - return g_strdup(g_basename(url)); - return g_strdup(url); -} - -/* Start UDP Channel specific stuff */ - -/* Find a good local udp port and bind udp_sock to it, return the port */ -static int udp_establish_listener(int *sock) -{ - struct sockaddr_in sin; - socklen_t sinlen = sizeof (struct sockaddr_in); - -#ifdef DEBUG_UDP - fprintf (stderr,"Establishing udp listener\n"); -#endif - - if ((*sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) - { - g_log(NULL, G_LOG_LEVEL_CRITICAL, - "udp_establish_listener(): unable to create socket"); - return -1; - } - - memset(&sin, 0, sinlen); - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = g_htonl(INADDR_ANY); - - if (bind(*sock, (struct sockaddr *)&sin, sinlen) < 0) - { - g_log(NULL, G_LOG_LEVEL_CRITICAL, - "udp_establish_listener(): Failed to bind socket to localhost: %s", strerror(errno)); - close(*sock); - return -1; - } - if (fcntl(*sock, F_SETFL, O_NONBLOCK) < 0) - { - g_log(NULL, G_LOG_LEVEL_CRITICAL, - "udp_establish_listener(): Failed to set flags: %s", strerror(errno)); - close(*sock); - return -1; - } - - memset(&sin, 0, sinlen); - if (getsockname(*sock, (struct sockaddr *)&sin, &sinlen) < 0) - { - g_log(NULL, G_LOG_LEVEL_CRITICAL, - "udp_establish_listener(): Failed to retrieve socket info: %s", strerror(errno)); - close(*sock); - return -1; - } - -#ifdef DEBUG_UDP - fprintf (stderr,"Listening on local %s:%d\n", inet_ntoa(sin.sin_addr), g_ntohs(sin.sin_port)); -#endif - - return g_ntohs(sin.sin_port); -} - -static int udp_check_for_data(int sock) -{ - char buf[1025], **lines; - char *valptr; - gchar *title; - gint len, i; - struct sockaddr_in from; - socklen_t fromlen; - - fromlen = sizeof(struct sockaddr_in); - - if ((len = recvfrom(sock, buf, 1024, 0, (struct sockaddr *)&from, &fromlen)) < 0) - { - if (errno != EAGAIN) - { - g_log(NULL, G_LOG_LEVEL_CRITICAL, - "udp_read_data(): Error reading from socket: %s", strerror(errno)); - return -1; - } - return 0; - } - buf[len] = '\0'; -#ifdef DEBUG_UDP - fprintf (stderr,"Received: [%s]\n", buf); -#endif - lines = g_strsplit(buf, "\n", 0); - if (!lines) - return 0; - - for (i = 0; lines[i]; i++) - { - while ((lines[i][strlen(lines[i]) - 1] == '\n') || - (lines[i][strlen(lines[i]) - 1] == '\r')) - lines[i][strlen(lines[i]) - 1] = '\0'; - - valptr = strchr(lines[i], ':'); - - if (!valptr) - continue; - else - valptr++; - - g_strstrip(valptr); - if (!strlen(valptr)) - continue; - - if (strstr(lines[i], "x-audiocast-streamtitle") != NULL) - { - title = g_strdup_printf ("%s (%s)", valptr, icy_name); - if (going) - set_track_info(title, -1); - g_free (title); - } - -#if 0 - else if (strstr(lines[i], "x-audiocast-streamlength") != NULL) - { - if (atoi(valptr) != -1) - set_track_info(NULL, atoi(valptr)); - } -#endif - - else if (strstr(lines[i], "x-audiocast-streammsg") != NULL) - { - /* set_track_info(title, -1); */ -/* xmms_show_message(_("Message"), valptr, _("Ok"), */ -/* FALSE, NULL, NULL); */ - g_message("Stream_message: %s", valptr); - } - -#if 0 - /* Use this to direct your webbrowser.. yeah right.. */ - else if (strstr(lines[i], "x-audiocast-streamurl") != NULL) - { - if (lasturl && g_strcmp (valptr, lasturl)) - { - c_message (stderr, "Song URL: %s\n", valptr); - g_free (lasturl); - lasturl = g_strdup (valptr); - } - } -#endif - else if (strstr(lines[i], "x-audiocast-udpseqnr:") != NULL) - { - gchar obuf[60]; - sprintf(obuf, "x-audiocast-ack: %ld \r\n", atol(valptr)); - if (sendto(sock, obuf, strlen(obuf), 0, (struct sockaddr *) &from, fromlen) < 0) - { - g_log(NULL, G_LOG_LEVEL_WARNING, - "udp_check_for_data(): Unable to send ack to server: %s", strerror(errno)); - } -#ifdef DEBUG_UDP - else - fprintf(stderr,"Sent ack: %s", obuf); - fprintf (stderr,"Remote: %s:%d\n", inet_ntoa(from.sin_addr), g_ntohs(from.sin_port)); -#endif - } - } - g_strfreev(lines); - return 0; -} diff --git a/3rdparty/libflac/src/plugin_xmms/http.h b/3rdparty/libflac/src/plugin_xmms/http.h deleted file mode 100644 index 00254307269..00000000000 --- a/3rdparty/libflac/src/plugin_xmms/http.h +++ /dev/null @@ -1,26 +0,0 @@ -/* libxmms-flac - XMMS FLAC input plugin - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef FLAC__PLUGIN_XMMS__HTTP_H -#define FLAC__PLUGIN_XMMS__HTTP_H - -extern int flac_http_open(const gchar * url, guint64 offset); -extern void flac_http_close(void); -extern int flac_http_read(gpointer data, gint length); - - -#endif diff --git a/3rdparty/libflac/src/plugin_xmms/locale_hack.h b/3rdparty/libflac/src/plugin_xmms/locale_hack.h deleted file mode 100644 index d04b1b2e90e..00000000000 --- a/3rdparty/libflac/src/plugin_xmms/locale_hack.h +++ /dev/null @@ -1,55 +0,0 @@ -/* plugin_common - Routines common to several plugins - * Copyright (C) 2002,2003,2004,2006,2007 Josh Coalson - * - * Based on: - * locale.h - 2000/05/05 13:10 Jerome Couderc - * EasyTAG - Tag editor for MP3 and OGG files - * Copyright (C) 1999-2001 H蛆ard Kvè™±en <havardk@xmms.org> - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -/* - * Gettext support for EasyTAG - */ - - -#ifndef FLAC__PLUGIN_COMMON__LOCALE_HACK_H -#define FLAC__PLUGIN_COMMON__LOCALE_HACK_H - -#include <locale.h> - -/* - * Standard gettext macros. - */ -#ifdef ENABLE_NLS -# include <libintl.h> -# define _(String) gettext (String) -# ifdef gettext_noop -# define N_(String) gettext_noop (String) -# else -# define N_(String) (String) -# endif -#else -# define textdomain(String) (String) -# define gettext(String) (String) -# define dgettext(Domain,Message) (Message) -# define dcgettext(Domain,Message,Type) (Message) -# define bindtextdomain(Domain,Directory) (Domain) -# define _(String) (String) -# define N_(String) (String) -#endif - - -#endif diff --git a/3rdparty/libflac/src/plugin_xmms/plugin.c b/3rdparty/libflac/src/plugin_xmms/plugin.c deleted file mode 100644 index 24a79b770ef..00000000000 --- a/3rdparty/libflac/src/plugin_xmms/plugin.c +++ /dev/null @@ -1,684 +0,0 @@ -/* libxmms-flac - XMMS FLAC input plugin - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <limits.h> -#include <pthread.h> -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <glib.h> -#include <pwd.h> -#include <sys/types.h> -#include <unistd.h> - -#include <xmms/plugin.h> -#include <xmms/util.h> -#include <xmms/configfile.h> -#include <xmms/titlestring.h> - -#ifdef HAVE_LANGINFO_CODESET -#include <langinfo.h> -#endif - -#include "FLAC/all.h" -#include "plugin_common/all.h" -#include "share/grabbag.h" -#include "share/replaygain_synthesis.h" -#include "configure.h" -#include "charset.h" -#include "http.h" -#include "tag.h" - -#ifdef min -#undef min -#endif -#define min(x,y) ((x)<(y)?(x):(y)) - -extern void FLAC_XMMS__file_info_box(char *filename); - -typedef struct { - FLAC__bool abort_flag; - FLAC__bool is_playing; - FLAC__bool is_http_source; - FLAC__bool eof; - FLAC__bool play_thread_open; /* if true, is_playing must also be true */ - FLAC__uint64 total_samples; - unsigned bits_per_sample; - unsigned channels; - unsigned sample_rate; - int length_in_msec; /* int (instead of FLAC__uint64) only because that's what XMMS uses; seeking won't work right if this maxes out */ - gchar *title; - AFormat sample_format; - unsigned sample_format_bytes_per_sample; - int seek_to_in_sec; - FLAC__bool has_replaygain; - double replay_scale; - DitherContext dither_context; -} stream_data_struct; - -static void FLAC_XMMS__init(void); -static int FLAC_XMMS__is_our_file(char *filename); -static void FLAC_XMMS__play_file(char *filename); -static void FLAC_XMMS__stop(void); -static void FLAC_XMMS__pause(short p); -static void FLAC_XMMS__seek(int time); -static int FLAC_XMMS__get_time(void); -static void FLAC_XMMS__cleanup(void); -static void FLAC_XMMS__get_song_info(char *filename, char **title, int *length); - -static void *play_loop_(void *arg); - -static FLAC__bool safe_decoder_init_(const char *filename, FLAC__StreamDecoder *decoder); -static void safe_decoder_finish_(FLAC__StreamDecoder *decoder); -static void safe_decoder_delete_(FLAC__StreamDecoder *decoder); - -static FLAC__StreamDecoderReadStatus http_read_callback_(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data); -static FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data); -static void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data); -static void error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data); - -InputPlugin flac_ip = -{ - NULL, - NULL, - "FLAC Player v" VERSION, - FLAC_XMMS__init, - FLAC_XMMS__aboutbox, - FLAC_XMMS__configure, - FLAC_XMMS__is_our_file, - NULL, - FLAC_XMMS__play_file, - FLAC_XMMS__stop, - FLAC_XMMS__pause, - FLAC_XMMS__seek, - NULL, - FLAC_XMMS__get_time, - NULL, - NULL, - FLAC_XMMS__cleanup, - NULL, - NULL, - NULL, - NULL, - FLAC_XMMS__get_song_info, - FLAC_XMMS__file_info_box, - NULL -}; - -#define SAMPLES_PER_WRITE 512 -#define SAMPLE_BUFFER_SIZE ((FLAC__MAX_BLOCK_SIZE + SAMPLES_PER_WRITE) * FLAC_PLUGIN__MAX_SUPPORTED_CHANNELS * (24/8)) -static FLAC__byte sample_buffer_[SAMPLE_BUFFER_SIZE]; -static unsigned sample_buffer_first_, sample_buffer_last_; - -static FLAC__StreamDecoder *decoder_ = 0; -static stream_data_struct stream_data_; -static pthread_t decode_thread_; -static FLAC__bool audio_error_ = false; -static FLAC__bool is_big_endian_host_; - -#define BITRATE_HIST_SEGMENT_MSEC 500 -/* 500ms * 50 = 25s should be enough */ -#define BITRATE_HIST_SIZE 50 -static unsigned bitrate_history_[BITRATE_HIST_SIZE]; - - -InputPlugin *get_iplugin_info(void) -{ - flac_ip.description = g_strdup_printf("Reference FLAC Player v%s", FLAC__VERSION_STRING); - return &flac_ip; -} - -void set_track_info(const char* title, int length_in_msec) -{ - if (stream_data_.is_playing) { - flac_ip.set_info((char*) title, length_in_msec, stream_data_.sample_rate * stream_data_.channels * stream_data_.bits_per_sample, stream_data_.sample_rate, stream_data_.channels); - } -} - -static gchar* homedir(void) -{ - gchar *result; - char *env_home = getenv("HOME"); - if (env_home) { - result = g_strdup (env_home); - } else { - uid_t uid = getuid(); - struct passwd *pwent; - do { - pwent = getpwent(); - } while (pwent && pwent->pw_uid != uid); - result = pwent ? g_strdup (pwent->pw_dir) : NULL; - endpwent(); - } - return result; -} - -static FLAC__bool is_http_source(const char *source) -{ - return 0 == strncasecmp(source, "http://", 7); -} - -void FLAC_XMMS__init(void) -{ - ConfigFile *cfg; - FLAC__uint32 test = 1; - - is_big_endian_host_ = (*((FLAC__byte*)(&test)))? false : true; - - flac_cfg.title.tag_override = FALSE; - if (flac_cfg.title.tag_format) - g_free(flac_cfg.title.tag_format); - flac_cfg.title.convert_char_set = FALSE; - - cfg = xmms_cfg_open_default_file(); - - /* title */ - - xmms_cfg_read_boolean(cfg, "flac", "title.tag_override", &flac_cfg.title.tag_override); - - if(!xmms_cfg_read_string(cfg, "flac", "title.tag_format", &flac_cfg.title.tag_format)) - flac_cfg.title.tag_format = g_strdup("%p - %t"); - - xmms_cfg_read_boolean(cfg, "flac", "title.convert_char_set", &flac_cfg.title.convert_char_set); - - if(!xmms_cfg_read_string(cfg, "flac", "title.user_char_set", &flac_cfg.title.user_char_set)) - flac_cfg.title.user_char_set = FLAC_plugin__charset_get_current(); - - /* replaygain */ - - xmms_cfg_read_boolean(cfg, "flac", "output.replaygain.enable", &flac_cfg.output.replaygain.enable); - - xmms_cfg_read_boolean(cfg, "flac", "output.replaygain.album_mode", &flac_cfg.output.replaygain.album_mode); - - if(!xmms_cfg_read_int(cfg, "flac", "output.replaygain.preamp", &flac_cfg.output.replaygain.preamp)) - flac_cfg.output.replaygain.preamp = 0; - - xmms_cfg_read_boolean(cfg, "flac", "output.replaygain.hard_limit", &flac_cfg.output.replaygain.hard_limit); - - xmms_cfg_read_boolean(cfg, "flac", "output.resolution.normal.dither_24_to_16", &flac_cfg.output.resolution.normal.dither_24_to_16); - xmms_cfg_read_boolean(cfg, "flac", "output.resolution.replaygain.dither", &flac_cfg.output.resolution.replaygain.dither); - - if(!xmms_cfg_read_int(cfg, "flac", "output.resolution.replaygain.noise_shaping", &flac_cfg.output.resolution.replaygain.noise_shaping)) - flac_cfg.output.resolution.replaygain.noise_shaping = 1; - - if(!xmms_cfg_read_int(cfg, "flac", "output.resolution.replaygain.bps_out", &flac_cfg.output.resolution.replaygain.bps_out)) - flac_cfg.output.resolution.replaygain.bps_out = 16; - - /* stream */ - - xmms_cfg_read_int(cfg, "flac", "stream.http_buffer_size", &flac_cfg.stream.http_buffer_size); - xmms_cfg_read_int(cfg, "flac", "stream.http_prebuffer", &flac_cfg.stream.http_prebuffer); - xmms_cfg_read_boolean(cfg, "flac", "stream.use_proxy", &flac_cfg.stream.use_proxy); - if(flac_cfg.stream.proxy_host) - g_free(flac_cfg.stream.proxy_host); - if(!xmms_cfg_read_string(cfg, "flac", "stream.proxy_host", &flac_cfg.stream.proxy_host)) - flac_cfg.stream.proxy_host = g_strdup(""); - xmms_cfg_read_int(cfg, "flac", "stream.proxy_port", &flac_cfg.stream.proxy_port); - xmms_cfg_read_boolean(cfg, "flac", "stream.proxy_use_auth", &flac_cfg.stream.proxy_use_auth); - if(flac_cfg.stream.proxy_user) - g_free(flac_cfg.stream.proxy_user); - flac_cfg.stream.proxy_user = NULL; - xmms_cfg_read_string(cfg, "flac", "stream.proxy_user", &flac_cfg.stream.proxy_user); - if(flac_cfg.stream.proxy_pass) - g_free(flac_cfg.stream.proxy_pass); - flac_cfg.stream.proxy_pass = NULL; - xmms_cfg_read_string(cfg, "flac", "stream.proxy_pass", &flac_cfg.stream.proxy_pass); - xmms_cfg_read_boolean(cfg, "flac", "stream.save_http_stream", &flac_cfg.stream.save_http_stream); - if (flac_cfg.stream.save_http_path) - g_free (flac_cfg.stream.save_http_path); - if (!xmms_cfg_read_string(cfg, "flac", "stream.save_http_path", &flac_cfg.stream.save_http_path) || ! *flac_cfg.stream.save_http_path) { - if (flac_cfg.stream.save_http_path) - g_free (flac_cfg.stream.save_http_path); - flac_cfg.stream.save_http_path = homedir(); - } - xmms_cfg_read_boolean(cfg, "flac", "stream.cast_title_streaming", &flac_cfg.stream.cast_title_streaming); - xmms_cfg_read_boolean(cfg, "flac", "stream.use_udp_channel", &flac_cfg.stream.use_udp_channel); - - decoder_ = FLAC__stream_decoder_new(); - - xmms_cfg_free(cfg); -} - -int FLAC_XMMS__is_our_file(char *filename) -{ - char *ext; - - ext = strrchr(filename, '.'); - if(ext) - if(!strcasecmp(ext, ".flac") || !strcasecmp(ext, ".fla")) - return 1; - return 0; -} - -void FLAC_XMMS__play_file(char *filename) -{ - FILE *f; - - sample_buffer_first_ = sample_buffer_last_ = 0; - audio_error_ = false; - stream_data_.abort_flag = false; - stream_data_.is_playing = false; - stream_data_.is_http_source = is_http_source(filename); - stream_data_.eof = false; - stream_data_.play_thread_open = false; - stream_data_.has_replaygain = false; - - if(!is_http_source(filename)) { - if(0 == (f = fopen(filename, "r"))) - return; - fclose(f); - } - - if(decoder_ == 0) - return; - - if(!safe_decoder_init_(filename, decoder_)) - return; - - if(stream_data_.has_replaygain && flac_cfg.output.replaygain.enable) { - if(flac_cfg.output.resolution.replaygain.bps_out == 8) { - stream_data_.sample_format = FMT_U8; - stream_data_.sample_format_bytes_per_sample = 1; - } - else if(flac_cfg.output.resolution.replaygain.bps_out == 16) { - stream_data_.sample_format = (is_big_endian_host_) ? FMT_S16_BE : FMT_S16_LE; - stream_data_.sample_format_bytes_per_sample = 2; - } - else { - /*@@@ need some error here like wa2: MessageBox(mod_.hMainWindow, "ERROR: plugin can only handle 8/16-bit samples\n", "ERROR: plugin can only handle 8/16-bit samples", 0); */ - fprintf(stderr, "libxmms-flac: can't handle %d bit output\n", flac_cfg.output.resolution.replaygain.bps_out); - safe_decoder_finish_(decoder_); - return; - } - } - else { - if(stream_data_.bits_per_sample == 8) { - stream_data_.sample_format = FMT_U8; - stream_data_.sample_format_bytes_per_sample = 1; - } - else if(stream_data_.bits_per_sample == 16 || (stream_data_.bits_per_sample == 24 && flac_cfg.output.resolution.normal.dither_24_to_16)) { - stream_data_.sample_format = (is_big_endian_host_) ? FMT_S16_BE : FMT_S16_LE; - stream_data_.sample_format_bytes_per_sample = 2; - } - else { - /*@@@ need some error here like wa2: MessageBox(mod_.hMainWindow, "ERROR: plugin can only handle 8/16-bit samples\n", "ERROR: plugin can only handle 8/16-bit samples", 0); */ - fprintf(stderr, "libxmms-flac: can't handle %d bit output\n", stream_data_.bits_per_sample); - safe_decoder_finish_(decoder_); - return; - } - } - FLAC__replaygain_synthesis__init_dither_context(&stream_data_.dither_context, stream_data_.sample_format_bytes_per_sample * 8, flac_cfg.output.resolution.replaygain.noise_shaping); - stream_data_.is_playing = true; - - if(flac_ip.output->open_audio(stream_data_.sample_format, stream_data_.sample_rate, stream_data_.channels) == 0) { - audio_error_ = true; - safe_decoder_finish_(decoder_); - return; - } - - stream_data_.title = flac_format_song_title(filename); - flac_ip.set_info(stream_data_.title, stream_data_.length_in_msec, stream_data_.sample_rate * stream_data_.channels * stream_data_.bits_per_sample, stream_data_.sample_rate, stream_data_.channels); - - stream_data_.seek_to_in_sec = -1; - stream_data_.play_thread_open = true; - pthread_create(&decode_thread_, NULL, play_loop_, NULL); -} - -void FLAC_XMMS__stop(void) -{ - if(stream_data_.is_playing) { - stream_data_.is_playing = false; - if(stream_data_.play_thread_open) { - stream_data_.play_thread_open = false; - pthread_join(decode_thread_, NULL); - } - flac_ip.output->close_audio(); - safe_decoder_finish_(decoder_); - } -} - -void FLAC_XMMS__pause(short p) -{ - flac_ip.output->pause(p); -} - -void FLAC_XMMS__seek(int time) -{ - if(!stream_data_.is_http_source) { - stream_data_.seek_to_in_sec = time; - stream_data_.eof = false; - - while(stream_data_.seek_to_in_sec != -1) - xmms_usleep(10000); - } -} - -int FLAC_XMMS__get_time(void) -{ - if(audio_error_) - return -2; - if(!stream_data_.is_playing || (stream_data_.eof && !flac_ip.output->buffer_playing())) - return -1; - else - return flac_ip.output->output_time(); -} - -void FLAC_XMMS__cleanup(void) -{ - safe_decoder_delete_(decoder_); - decoder_ = 0; -} - -void FLAC_XMMS__get_song_info(char *filename, char **title, int *length_in_msec) -{ - FLAC__StreamMetadata streaminfo; - - if(0 == filename) - filename = ""; - - if(!FLAC__metadata_get_streaminfo(filename, &streaminfo)) { - /* @@@ how to report the error? */ - if(title) { - if (!is_http_source(filename)) { - static const char *errtitle = "Invalid FLAC File: "; - if(strlen(errtitle) + 1 + strlen(filename) + 1 + 1 < strlen(filename)) { /* overflow check */ - *title = NULL; - } - else { - *title = g_malloc(strlen(errtitle) + 1 + strlen(filename) + 1 + 1); - sprintf(*title, "%s\"%s\"", errtitle, filename); - } - } else { - *title = NULL; - } - } - if(length_in_msec) - *length_in_msec = -1; - return; - } - - if(title) { - *title = flac_format_song_title(filename); - } - if(length_in_msec) { - FLAC__uint64 l = (FLAC__uint64)((double)streaminfo.data.stream_info.total_samples / (double)streaminfo.data.stream_info.sample_rate * 1000.0 + 0.5); - if (l > INT_MAX) - l = INT_MAX; - *length_in_msec = (int)l; - } -} - -/*********************************************************************** - * local routines - **********************************************************************/ - -void *play_loop_(void *arg) -{ - unsigned written_time_last = 0, bh_index_last_w = 0, bh_index_last_o = BITRATE_HIST_SIZE, blocksize = 1; - FLAC__uint64 decode_position_last = 0, decode_position_frame_last = 0, decode_position_frame = 0; - - (void)arg; - - while(stream_data_.is_playing) { - if(!stream_data_.eof) { - while(sample_buffer_last_ - sample_buffer_first_ < SAMPLES_PER_WRITE) { - unsigned s; - - s = sample_buffer_last_ - sample_buffer_first_; - if(FLAC__stream_decoder_get_state(decoder_) == FLAC__STREAM_DECODER_END_OF_STREAM) { - stream_data_.eof = true; - break; - } - else if(!FLAC__stream_decoder_process_single(decoder_)) { - /*@@@ this should probably be a dialog */ - fprintf(stderr, "libxmms-flac: READ ERROR processing frame\n"); - stream_data_.eof = true; - break; - } - blocksize = sample_buffer_last_ - sample_buffer_first_ - s; - decode_position_frame_last = decode_position_frame; - if(stream_data_.is_http_source || !FLAC__stream_decoder_get_decode_position(decoder_, &decode_position_frame)) - decode_position_frame = 0; - } - if(sample_buffer_last_ - sample_buffer_first_ > 0) { - const unsigned n = min(sample_buffer_last_ - sample_buffer_first_, SAMPLES_PER_WRITE); - int bytes = n * stream_data_.channels * stream_data_.sample_format_bytes_per_sample; - FLAC__byte *sample_buffer_start = sample_buffer_ + sample_buffer_first_ * stream_data_.channels * stream_data_.sample_format_bytes_per_sample; - unsigned written_time, bh_index_w; - FLAC__uint64 decode_position; - - sample_buffer_first_ += n; - flac_ip.add_vis_pcm(flac_ip.output->written_time(), stream_data_.sample_format, stream_data_.channels, bytes, sample_buffer_start); - while(flac_ip.output->buffer_free() < (int)bytes && stream_data_.is_playing && stream_data_.seek_to_in_sec == -1) - xmms_usleep(10000); - if(stream_data_.is_playing && stream_data_.seek_to_in_sec == -1) - flac_ip.output->write_audio(sample_buffer_start, bytes); - - /* compute current bitrate */ - - written_time = flac_ip.output->written_time(); - bh_index_w = written_time / BITRATE_HIST_SEGMENT_MSEC % BITRATE_HIST_SIZE; - if(bh_index_w != bh_index_last_w) { - bh_index_last_w = bh_index_w; - decode_position = decode_position_frame - (double)(sample_buffer_last_ - sample_buffer_first_) * (double)(decode_position_frame - decode_position_frame_last) / (double)blocksize; - bitrate_history_[(bh_index_w + BITRATE_HIST_SIZE - 1) % BITRATE_HIST_SIZE] = - decode_position > decode_position_last && written_time > written_time_last ? - 8000 * (decode_position - decode_position_last) / (written_time - written_time_last) : - stream_data_.sample_rate * stream_data_.channels * stream_data_.bits_per_sample; - decode_position_last = decode_position; - written_time_last = written_time; - } - } - else { - stream_data_.eof = true; - xmms_usleep(10000); - } - } - else - xmms_usleep(10000); - if(!stream_data_.is_http_source && stream_data_.seek_to_in_sec != -1) { - const double distance = (double)stream_data_.seek_to_in_sec * 1000.0 / (double)stream_data_.length_in_msec; - FLAC__uint64 target_sample = (FLAC__uint64)(distance * (double)stream_data_.total_samples); - if(stream_data_.total_samples > 0 && target_sample >= stream_data_.total_samples) - target_sample = stream_data_.total_samples - 1; - if(FLAC__stream_decoder_seek_absolute(decoder_, target_sample)) { - flac_ip.output->flush(stream_data_.seek_to_in_sec * 1000); - bh_index_last_w = bh_index_last_o = flac_ip.output->output_time() / BITRATE_HIST_SEGMENT_MSEC % BITRATE_HIST_SIZE; - if(!FLAC__stream_decoder_get_decode_position(decoder_, &decode_position_frame)) - decode_position_frame = 0; - stream_data_.eof = false; - sample_buffer_first_ = sample_buffer_last_ = 0; - } - else if(FLAC__stream_decoder_get_state(decoder_) == FLAC__STREAM_DECODER_SEEK_ERROR) { - /*@@@ this should probably be a dialog */ - fprintf(stderr, "libxmms-flac: SEEK ERROR\n"); - FLAC__stream_decoder_flush(decoder_); - stream_data_.eof = false; - sample_buffer_first_ = sample_buffer_last_ = 0; - } - stream_data_.seek_to_in_sec = -1; - } - else { - /* display the right bitrate from history */ - unsigned bh_index_o = flac_ip.output->output_time() / BITRATE_HIST_SEGMENT_MSEC % BITRATE_HIST_SIZE; - if(bh_index_o != bh_index_last_o && bh_index_o != bh_index_last_w && bh_index_o != (bh_index_last_w + 1) % BITRATE_HIST_SIZE) { - bh_index_last_o = bh_index_o; - flac_ip.set_info(stream_data_.title, stream_data_.length_in_msec, bitrate_history_[bh_index_o], stream_data_.sample_rate, stream_data_.channels); - } - } - } - - safe_decoder_finish_(decoder_); - - /* are these two calls necessary? */ - flac_ip.output->buffer_free(); - flac_ip.output->buffer_free(); - - g_free(stream_data_.title); - - pthread_exit(NULL); - return 0; /* to silence the compiler warning about not returning a value */ -} - -FLAC__bool safe_decoder_init_(const char *filename, FLAC__StreamDecoder *decoder) -{ - if(decoder == 0) - return false; - - safe_decoder_finish_(decoder); - - FLAC__stream_decoder_set_md5_checking(decoder, false); - FLAC__stream_decoder_set_metadata_ignore_all(decoder); - FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_STREAMINFO); - FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT); - if(stream_data_.is_http_source) { - flac_http_open(filename, 0); - if(FLAC__stream_decoder_init_stream(decoder, http_read_callback_, /*seek_callback=*/0, /*tell_callback=*/0, /*length_callback=*/0, /*eof_callback=*/0, write_callback_, metadata_callback_, error_callback_, /*client_data=*/&stream_data_) != FLAC__STREAM_DECODER_INIT_STATUS_OK) - return false; - } - else { - if(FLAC__stream_decoder_init_file(decoder, filename, write_callback_, metadata_callback_, error_callback_, /*client_data=*/&stream_data_) != FLAC__STREAM_DECODER_INIT_STATUS_OK) - return false; - } - - if(!FLAC__stream_decoder_process_until_end_of_metadata(decoder)) - return false; - - return true; -} - -void safe_decoder_finish_(FLAC__StreamDecoder *decoder) -{ - if(decoder && FLAC__stream_decoder_get_state(decoder) != FLAC__STREAM_DECODER_UNINITIALIZED) - (void)FLAC__stream_decoder_finish(decoder); - if(stream_data_.is_http_source) - flac_http_close(); -} - -void safe_decoder_delete_(FLAC__StreamDecoder *decoder) -{ - if(decoder) { - safe_decoder_finish_(decoder); - FLAC__stream_decoder_delete(decoder); - } -} - -FLAC__StreamDecoderReadStatus http_read_callback_(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data) -{ - (void)decoder; - (void)client_data; - *bytes = flac_http_read(buffer, *bytes); - return *bytes ? FLAC__STREAM_DECODER_READ_STATUS_CONTINUE : FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; -} - -FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data) -{ - stream_data_struct *stream_data = (stream_data_struct *)client_data; - const unsigned channels = stream_data->channels, wide_samples = frame->header.blocksize; - const unsigned bits_per_sample = stream_data->bits_per_sample; - FLAC__byte *sample_buffer_start; - - (void)decoder; - - if(stream_data->abort_flag) - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - - if((sample_buffer_last_ + wide_samples) > (SAMPLE_BUFFER_SIZE / (channels * stream_data->sample_format_bytes_per_sample))) { - memmove(sample_buffer_, sample_buffer_ + sample_buffer_first_ * channels * stream_data->sample_format_bytes_per_sample, (sample_buffer_last_ - sample_buffer_first_) * channels * stream_data->sample_format_bytes_per_sample); - sample_buffer_last_ -= sample_buffer_first_; - sample_buffer_first_ = 0; - } - sample_buffer_start = sample_buffer_ + sample_buffer_last_ * channels * stream_data->sample_format_bytes_per_sample; - if(stream_data->has_replaygain && flac_cfg.output.replaygain.enable) { - FLAC__replaygain_synthesis__apply_gain( - sample_buffer_start, - !is_big_endian_host_, - stream_data->sample_format_bytes_per_sample == 1, /* unsigned_data_out */ - buffer, - wide_samples, - channels, - bits_per_sample, - stream_data->sample_format_bytes_per_sample * 8, - stream_data->replay_scale, - flac_cfg.output.replaygain.hard_limit, - flac_cfg.output.resolution.replaygain.dither, - &stream_data->dither_context - ); - } - else if(is_big_endian_host_) { - FLAC__plugin_common__pack_pcm_signed_big_endian( - sample_buffer_start, - buffer, - wide_samples, - channels, - bits_per_sample, - stream_data->sample_format_bytes_per_sample * 8 - ); - } - else { - FLAC__plugin_common__pack_pcm_signed_little_endian( - sample_buffer_start, - buffer, - wide_samples, - channels, - bits_per_sample, - stream_data->sample_format_bytes_per_sample * 8 - ); - } - - sample_buffer_last_ += wide_samples; - - return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; -} - -void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) -{ - stream_data_struct *stream_data = (stream_data_struct *)client_data; - (void)decoder; - if(metadata->type == FLAC__METADATA_TYPE_STREAMINFO) { - stream_data->total_samples = metadata->data.stream_info.total_samples; - stream_data->bits_per_sample = metadata->data.stream_info.bits_per_sample; - stream_data->channels = metadata->data.stream_info.channels; - stream_data->sample_rate = metadata->data.stream_info.sample_rate; - { - FLAC__uint64 l = (FLAC__uint64)((double)stream_data->total_samples / (double)stream_data->sample_rate * 1000.0 + 0.5); - if (l > INT_MAX) - l = INT_MAX; - stream_data->length_in_msec = (int)l; - } - } - else if(metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) { - double reference, gain, peak; - if(grabbag__replaygain_load_from_vorbiscomment(metadata, flac_cfg.output.replaygain.album_mode, /*strict=*/false, &reference, &gain, &peak)) { - stream_data->has_replaygain = true; - stream_data->replay_scale = grabbag__replaygain_compute_scale_factor(peak, gain, (double)flac_cfg.output.replaygain.preamp, /*prevent_clipping=*/!flac_cfg.output.replaygain.hard_limit); - } - } -} - -void error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) -{ - stream_data_struct *stream_data = (stream_data_struct *)client_data; - (void)decoder; - if(status != FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC) - stream_data->abort_flag = true; -} diff --git a/3rdparty/libflac/src/plugin_xmms/plugin.h b/3rdparty/libflac/src/plugin_xmms/plugin.h deleted file mode 100644 index 334c167be69..00000000000 --- a/3rdparty/libflac/src/plugin_xmms/plugin.h +++ /dev/null @@ -1,24 +0,0 @@ -/* libxmms-flac - XMMS FLAC input plugin - * Copyright (C) 2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef FLAC__PLUGIN_XMMS__PLUGIN_H -#define FLAC__PLUGIN_XMMS__PLUGIN_H - -void set_track_info(const char* title, int length_in_msec); - -#endif diff --git a/3rdparty/libflac/src/plugin_xmms/tag.c b/3rdparty/libflac/src/plugin_xmms/tag.c deleted file mode 100644 index c4a7c940874..00000000000 --- a/3rdparty/libflac/src/plugin_xmms/tag.c +++ /dev/null @@ -1,154 +0,0 @@ -/* libxmms-flac - XMMS FLAC input plugin - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * Copyright (C) 2002,2003,2004,2005,2006,2007 Daisuke Shimamura - * - * Based on FLAC plugin.c and mpg123 plugin - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <glib.h> -#include <xmms/plugin.h> -#include <xmms/util.h> -#include <xmms/configfile.h> -#include <xmms/titlestring.h> - -#include "FLAC/metadata.h" -#include "plugin_common/tags.h" -#include "charset.h" -#include "configure.h" - -/* - * Function local__extname (filename) - * - * Return pointer within filename to its extenstion, or NULL if - * filename has no extension. - * - */ -static char *local__extname(const char *filename) -{ - char *ext = strrchr(filename, '.'); - - if (ext != NULL) - ++ext; - - return ext; -} - -static char *local__getstr(char* str) -{ - if (str && strlen(str) > 0) - return str; - return NULL; -} - -static int local__getnum(char* str) -{ - if (str && strlen(str) > 0) - return atoi(str); - return 0; -} - -static char *local__getfield(const FLAC__StreamMetadata *tags, const char *name) -{ - if (0 != tags) { - const char *utf8 = FLAC_plugin__tags_get_tag_utf8(tags, name); - if (0 != utf8) { - if(flac_cfg.title.convert_char_set) - return convert_from_utf8_to_user(utf8); - else - return strdup(utf8); - } - } - - return 0; -} - -static void local__safe_free(char *s) -{ - if (0 != s) - free(s); -} - -/* - * Function flac_format_song_title (tag, filename) - * - * Create song title according to `tag' and/or `filename' and - * return it. The title must be subsequently freed using g_free(). - * - */ -char *flac_format_song_title(char *filename) -{ - char *ret = NULL; - TitleInput *input = NULL; - FLAC__StreamMetadata *tags; - char *title, *artist, *performer, *album, *date, *tracknumber, *genre, *description; - - FLAC_plugin__tags_get(filename, &tags); - - title = local__getfield(tags, "TITLE"); - artist = local__getfield(tags, "ARTIST"); - performer = local__getfield(tags, "PERFORMER"); - album = local__getfield(tags, "ALBUM"); - date = local__getfield(tags, "DATE"); - tracknumber = local__getfield(tags, "TRACKNUMBER"); - genre = local__getfield(tags, "GENRE"); - description = local__getfield(tags, "DESCRIPTION"); - - XMMS_NEW_TITLEINPUT(input); - - input->performer = local__getstr(performer); - if(!input->performer) - input->performer = local__getstr(artist); - input->album_name = local__getstr(album); - input->track_name = local__getstr(title); - input->track_number = local__getnum(tracknumber); - input->year = local__getnum(date); - input->genre = local__getstr(genre); - input->comment = local__getstr(description); - - input->file_name = g_basename(filename); - input->file_path = filename; - input->file_ext = local__extname(filename); - ret = xmms_get_titlestring(flac_cfg.title.tag_override ? flac_cfg.title.tag_format : xmms_get_gentitle_format(), input); - g_free(input); - - if (!ret) { - /* - * Format according to filename. - */ - ret = g_strdup(g_basename(filename)); - if (local__extname(ret) != NULL) - *(local__extname(ret) - 1) = '\0'; /* removes period */ - } - - FLAC_plugin__tags_destroy(&tags); - local__safe_free(title); - local__safe_free(artist); - local__safe_free(performer); - local__safe_free(album); - local__safe_free(date); - local__safe_free(tracknumber); - local__safe_free(genre); - local__safe_free(description); - return ret; -} diff --git a/3rdparty/libflac/src/plugin_xmms/tag.h b/3rdparty/libflac/src/plugin_xmms/tag.h deleted file mode 100644 index d952fbc6d52..00000000000 --- a/3rdparty/libflac/src/plugin_xmms/tag.h +++ /dev/null @@ -1,24 +0,0 @@ -/* libxmms-flac - XMMS FLAC input plugin - * Copyright (C) 2002,2003,2004,2005,2006 Daisuke Shimamura - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef FLAC__PLUGIN_XMMS__TAG_H -#define FLAC__PLUGIN_XMMS__TAG_H - -gchar *flac_format_song_title(gchar * filename); - -#endif diff --git a/3rdparty/libflac/src/share/Makefile.am b/3rdparty/libflac/src/share/Makefile.am deleted file mode 100644 index 19d71ee6af0..00000000000 --- a/3rdparty/libflac/src/share/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -# FLAC - Free Lossless Audio Codec -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# This file is part the FLAC project. FLAC is comprised of several -# components distributed under difference licenses. The codec libraries -# are distributed under Xiph.Org's BSD-like license (see the file -# COPYING.Xiph in this distribution). All other programs, libraries, and -# plugins are distributed under the GPL (see COPYING.GPL). The documentation -# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the -# FLAC distribution contains at the top the terms under which it may be -# distributed. -# -# Since this particular file is relevant to all components of FLAC, -# it may be distributed under the Xiph.Org license, which is the least -# restrictive of those mentioned above. See the file COPYING.Xiph in this -# distribution. - -SUBDIRS = getopt replaygain_analysis replaygain_synthesis grabbag utf8 - -EXTRA_DIST = \ - Makefile.lite \ - README diff --git a/3rdparty/libflac/src/share/Makefile.in b/3rdparty/libflac/src/share/Makefile.in deleted file mode 100644 index a348b495267..00000000000 --- a/3rdparty/libflac/src/share/Makefile.in +++ /dev/null @@ -1,525 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# FLAC - Free Lossless Audio Codec -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# This file is part the FLAC project. FLAC is comprised of several -# components distributed under difference licenses. The codec libraries -# are distributed under Xiph.Org's BSD-like license (see the file -# COPYING.Xiph in this distribution). All other programs, libraries, and -# plugins are distributed under the GPL (see COPYING.GPL). The documentation -# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the -# FLAC distribution contains at the top the terms under which it may be -# distributed. -# -# Since this particular file is relevant to all components of FLAC, -# it may be distributed under the Xiph.Org license, which is the least -# restrictive of those mentioned above. See the file COPYING.Xiph in this -# distribution. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -SUBDIRS = getopt replaygain_analysis replaygain_synthesis grabbag utf8 - -EXTRA_DIST = \ - Makefile.lite \ - README - -subdir = src/share -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = - -RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ - ps-recursive install-info-recursive uninstall-info-recursive \ - all-recursive install-data-recursive install-exec-recursive \ - installdirs-recursive install-recursive uninstall-recursive \ - check-recursive installcheck-recursive -DIST_COMMON = README $(srcdir)/Makefile.in Makefile.am -DIST_SUBDIRS = $(SUBDIRS) -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/share/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if (etags --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - else \ - include_option=--include; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: - -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags - -dvi: dvi-recursive - -dvi-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ - clean-generic clean-libtool clean-recursive ctags \ - ctags-recursive distclean distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am \ - dvi-recursive info info-am info-recursive install install-am \ - install-data install-data-am install-data-recursive \ - install-exec install-exec-am install-exec-recursive \ - install-info install-info-am install-info-recursive install-man \ - install-recursive install-strip installcheck installcheck-am \ - installdirs installdirs-am installdirs-recursive \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-libtool mostlyclean-recursive pdf pdf-am \ - pdf-recursive ps ps-am ps-recursive tags tags-recursive \ - uninstall uninstall-am uninstall-info-am \ - uninstall-info-recursive uninstall-recursive - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/share/Makefile.lite b/3rdparty/libflac/src/share/Makefile.lite deleted file mode 100644 index 9ed2198eb21..00000000000 --- a/3rdparty/libflac/src/share/Makefile.lite +++ /dev/null @@ -1,53 +0,0 @@ -# FLAC - Free Lossless Audio Codec -# Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# This file is part the FLAC project. FLAC is comprised of several -# components distributed under difference licenses. The codec libraries -# are distributed under Xiph.Org's BSD-like license (see the file -# COPYING.Xiph in this distribution). All other programs, libraries, and -# plugins are distributed under the GPL (see COPYING.GPL). The documentation -# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the -# FLAC distribution contains at the top the terms under which it may be -# distributed. -# -# Since this particular file is relevant to all components of FLAC, -# it may be distributed under the Xiph.Org license, which is the least -# restrictive of those mentioned above. See the file COPYING.Xiph in this -# distribution. - -.PHONY: all getopt grabbag replaygain_analysis replaygain_synthesis utf8 -all: getopt grabbag replaygain_analysis replaygain_synthesis utf8 - -DEFAULT_CONFIG = release - -CONFIG = $(DEFAULT_CONFIG) - -debug : CONFIG = debug -valgrind: CONFIG = valgrind -release : CONFIG = release - -debug : all -valgrind: all -release : all - -getopt: - (cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG)) - -grabbag: - (cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG)) - -replaygain_analysis: - (cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG)) - -replaygain_synthesis: - (cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG)) - -utf8: - (cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG)) - -clean: - -(cd getopt ; $(MAKE) -f Makefile.lite clean) - -(cd grabbag ; $(MAKE) -f Makefile.lite clean) - -(cd replaygain_analysis ; $(MAKE) -f Makefile.lite clean) - -(cd replaygain_synthesis ; $(MAKE) -f Makefile.lite clean) - -(cd utf8 ; $(MAKE) -f Makefile.lite clean) diff --git a/3rdparty/libflac/src/share/README b/3rdparty/libflac/src/share/README deleted file mode 100644 index 1d4fededa77..00000000000 --- a/3rdparty/libflac/src/share/README +++ /dev/null @@ -1,5 +0,0 @@ -This directory contains several convenience libraries used by the rest of the -tools and plugins. Two of them (getopt and utf8) are shamelessly copied from -vorbistools, one for manipulating UTF-8 strings (GPL) and one for implementing -getopt (LGPL). libFLAC does not link to either; the only FLAC tools that do -are GPL'ed. diff --git a/3rdparty/libflac/src/share/getopt/Makefile.am b/3rdparty/libflac/src/share/getopt/Makefile.am deleted file mode 100644 index f40464e638b..00000000000 --- a/3rdparty/libflac/src/share/getopt/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ -## Process this file with automake to produce Makefile.in - -AUTOMAKE_OPTIONS = foreign - -INCLUDES = -I$(top_srcdir)/include/share - -noinst_LIBRARIES = libgetopt.a - -libgetopt_a_SOURCES = getopt.c getopt1.c - -EXTRA_DIST = \ - Makefile.lite \ - getopt_static.dsp \ - getopt_static.vcproj - -debug: - $(MAKE) all CFLAGS="@DEBUG@" - -profile: - $(MAKE) all CFLAGS="@PROFILE@" diff --git a/3rdparty/libflac/src/share/getopt/Makefile.in b/3rdparty/libflac/src/share/getopt/Makefile.in deleted file mode 100644 index 4a2fbc9b452..00000000000 --- a/3rdparty/libflac/src/share/getopt/Makefile.in +++ /dev/null @@ -1,496 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -AUTOMAKE_OPTIONS = foreign - -INCLUDES = -I$(top_srcdir)/include/share - -noinst_LIBRARIES = libgetopt.a - -libgetopt_a_SOURCES = getopt.c getopt1.c - -EXTRA_DIST = \ - Makefile.lite \ - getopt_static.dsp \ - getopt_static.vcproj - -subdir = src/share/getopt -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - -libgetopt_a_AR = $(AR) cru -libgetopt_a_LIBADD = -am_libgetopt_a_OBJECTS = getopt.$(OBJEXT) getopt1.$(OBJEXT) -libgetopt_a_OBJECTS = $(am_libgetopt_a_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/getopt.Po ./$(DEPDIR)/getopt1.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(libgetopt_a_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(libgetopt_a_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/share/getopt/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -libgetopt.a: $(libgetopt_a_OBJECTS) $(libgetopt_a_DEPENDENCIES) - -rm -f libgetopt.a - $(libgetopt_a_AR) libgetopt.a $(libgetopt_a_OBJECTS) $(libgetopt_a_LIBADD) - $(RANLIB) libgetopt.a - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LIBRARIES) - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am - - -debug: - $(MAKE) all CFLAGS="@DEBUG@" - -profile: - $(MAKE) all CFLAGS="@PROFILE@" -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/share/getopt/Makefile.lite b/3rdparty/libflac/src/share/getopt/Makefile.lite deleted file mode 100644 index e36f341d37b..00000000000 --- a/3rdparty/libflac/src/share/getopt/Makefile.lite +++ /dev/null @@ -1,16 +0,0 @@ -# -# GNU makefile -# - -topdir = ../../.. - -LIB_NAME = libgetopt -INCLUDES = -I$(topdir)/include -I$(topdir)/include/share - -SRCS_C = \ - getopt.c \ - getopt1.c - -include $(topdir)/build/lib.mk - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/3rdparty/libflac/src/share/getopt/getopt.c b/3rdparty/libflac/src/share/getopt/getopt.c deleted file mode 100644 index 279dff0216b..00000000000 --- a/3rdparty/libflac/src/share/getopt/getopt.c +++ /dev/null @@ -1,1065 +0,0 @@ -/* - NOTE: - I cannot get the vanilla getopt code to work (i.e. compile only what - is needed and not duplicate symbols found in the standard library) - on all the platforms that FLAC supports. In particular the gating - of code with the ELIDE_CODE #define is not accurate enough on systems - that are POSIX but not glibc. If someone has a patch that works on - GNU/Linux, Darwin, AND Solaris please submit it on the project page: - http://sourceforge.net/projects/flac - - In the meantime I have munged the global symbols and removed gates - around code, while at the same time trying to touch the original as - little as possible. -*/ -/* Getopt for GNU. - NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to drepper@gnu.org - before changing it! - - Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 - Free Software Foundation, Inc. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>. - Ditto for AIX 3.2 and <stdlib.h>. */ -#ifndef _NO_PROTO -# define _NO_PROTO -#endif - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#if !defined __STDC__ || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -# ifndef const -# define const -# endif -#endif - -#include <stdio.h> - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -# include <gnu-versions.h> -# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -# define ELIDE_CODE -# endif -#endif - -#if 1 -/*[JEC] was:#ifndef ELIDE_CODE*/ - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -/* Don't include stdlib.h for non-GNU C libraries because some of them - contain conflicting prototypes for getopt. */ -# include <stdlib.h> -# include <unistd.h> -#endif /* GNU C library. */ - -#ifdef VMS -# include <unixlib.h> -# if HAVE_STRING_H - 0 -# include <string.h> -# endif -#endif - -#ifndef _ -/* This is for other GNU distributions with internationalized messages. - When compiling libc, the _ macro is predefined. */ -# ifdef HAVE_LIBINTL_H -# include <libintl.h> -# define _(msgid) gettext (msgid) -# else -# define _(msgid) (msgid) -# endif -#endif - -/* This version of `share__getopt' appears to the caller like standard Unix `getopt' - but it behaves differently for the user, since it allows the user - to intersperse the options with the other arguments. - - As `share__getopt' works, it permutes the elements of ARGV so that, - when it is done, all the options precede everything else. Thus - all application programs are extended to handle flexible argument order. - - Setting the environment variable POSIXLY_CORRECT disables permutation. - Then the behavior is completely standard. - - GNU application programs can use a third alternative mode in which - they can distinguish the relative order of options and other arguments. */ - -#include "share/getopt.h" -/*[JEC] was:#include "getopt.h"*/ - -/* For communication from `share__getopt' to the caller. - When `share__getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -char *share__optarg = 0; /*[JEC] initialize to avoid being a 'Common' symbol */ - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `share__getopt'. - - On entry to `share__getopt', zero means this is the first call; initialize. - - When `share__getopt' returns -1, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `share__optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -/* 1003.2 says this must be 1 before any call. */ -int share__optind = 1; - -/* Formerly, initialization of getopt depended on share__optind==0, which - causes problems with re-calling getopt as programs generally don't - know that. */ - -static int share____getopt_initialized = 0; - -/* The next char to be scanned in the option-element - in which the last option character we returned was found. - This allows us to pick up the scan where we left off. - - If this is zero, or a null string, it means resume the scan - by advancing to the next ARGV-element. */ - -static char *nextchar; - -/* Callers store zero here to inhibit the error message - for unrecognized options. */ - -int share__opterr = 1; - -/* Set to an option character which was unrecognized. - This must be initialized on some systems to avoid linking in the - system's own getopt implementation. */ - -int share__optopt = '?'; - -/* Describe how to deal with options that follow non-option ARGV-elements. - - If the caller did not specify anything, - the default is REQUIRE_ORDER if the environment variable - POSIXLY_CORRECT is defined, PERMUTE otherwise. - - REQUIRE_ORDER means don't recognize them as options; - stop option processing when the first non-option is seen. - This is what Unix does. - This mode of operation is selected by either setting the environment - variable POSIXLY_CORRECT, or using `+' as the first character - of the list of option characters. - - PERMUTE is the default. We permute the contents of ARGV as we scan, - so that eventually all the non-options are at the end. This allows options - to be given in any order, even with programs that were not written to - expect this. - - RETURN_IN_ORDER is an option available to programs that were written - to expect options and other ARGV-elements in any order and that care about - the ordering of the two. We describe each non-option ARGV-element - as if it were the argument of an option with character code 1. - Using `-' as the first character of the list of option characters - selects this mode of operation. - - The special argument `--' forces an end of option-scanning regardless - of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `share__getopt' to return -1 with `share__optind' != ARGC. */ - -static enum -{ - REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -} ordering; - -/* Value of POSIXLY_CORRECT environment variable. */ -static char *posixly_correct; - -#ifdef __GNU_LIBRARY__ -/* We want to avoid inclusion of string.h with non-GNU libraries - because there are many ways it can cause trouble. - On some systems, it contains special magic macros that don't work - in GCC. */ -# include <string.h> -# define my_index strchr -#else - -#include <string.h> - -/* Avoid depending on library functions or files - whose names are inconsistent. */ - -#ifndef getenv -extern char *getenv (); -#endif - -static char * -my_index (str, chr) - const char *str; - int chr; -{ - while (*str) - { - if (*str == chr) - return (char *) str; - str++; - } - return 0; -} - -/* If using GCC, we can safely declare strlen this way. - If not using GCC, it is ok not to declare it. */ -#ifdef __GNUC__ -/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. - That was relevant to code that was here before. */ -# if (!defined __STDC__ || !__STDC__) && !defined strlen -/* gcc with -traditional declares the built-in strlen to return int, - and has done so at least since version 2.4.5. -- rms. */ -extern int strlen (const char *); -# endif /* not __STDC__ */ -#endif /* __GNUC__ */ - -#endif /* not __GNU_LIBRARY__ */ - -/* Handle permutation of arguments. */ - -/* Describe the part of ARGV that contains non-options that have - been skipped. `first_nonopt' is the index in ARGV of the first of them; - `last_nonopt' is the index after the last of them. */ - -static int first_nonopt; -static int last_nonopt; - -#ifdef _LIBC -/* Bash 2.0 gives us an environment variable containing flags - indicating ARGV elements that should not be considered arguments. */ - -/* Defined in getopt_init.c */ -extern char *__getopt_nonoption_flags; - -static int nonoption_flags_max_len; -static int nonoption_flags_len; - -static int original_argc; -static char *const *original_argv; - -/* Make sure the environment variable bash 2.0 puts in the environment - is valid for the getopt call we must make sure that the ARGV passed - to getopt is that one passed to the process. */ -static void -__attribute__ ((unused)) -store_args_and_env (int argc, char *const *argv) -{ - /* XXX This is no good solution. We should rather copy the args so - that we can compare them later. But we must not use malloc(3). */ - original_argc = argc; - original_argv = argv; -} -# ifdef text_set_element -text_set_element (__libc_subinit, store_args_and_env); -# endif /* text_set_element */ - -# define SWAP_FLAGS(ch1, ch2) \ - if (nonoption_flags_len > 0) \ - { \ - char __tmp = __getopt_nonoption_flags[ch1]; \ - __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ - __getopt_nonoption_flags[ch2] = __tmp; \ - } -#else /* !_LIBC */ -# define SWAP_FLAGS(ch1, ch2) -#endif /* _LIBC */ - -/* Exchange two adjacent subsequences of ARGV. - One subsequence is elements [first_nonopt,last_nonopt) - which contains all the non-options that have been skipped so far. - The other is elements [last_nonopt,share__optind), which contains all - the options processed since those non-options were skipped. - - `first_nonopt' and `last_nonopt' are relocated so that they describe - the new indices of the non-options in ARGV after they are moved. */ - -#if defined __STDC__ && __STDC__ -static void exchange (char **); -#endif - -static void -exchange (argv) - char **argv; -{ - int bottom = first_nonopt; - int middle = last_nonopt; - int top = share__optind; - char *tem; - - /* Exchange the shorter segment with the far end of the longer segment. - That puts the shorter segment into the right place. - It leaves the longer segment in the right place overall, - but it consists of two parts that need to be swapped next. */ - -#ifdef _LIBC - /* First make sure the handling of the `__getopt_nonoption_flags' - string can work normally. Our top argument must be in the range - of the string. */ - if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) - { - /* We must extend the array. The user plays games with us and - presents new arguments. */ - char *new_str = malloc (top + 1); - if (new_str == NULL) - nonoption_flags_len = nonoption_flags_max_len = 0; - else - { - memset (__mempcpy (new_str, __getopt_nonoption_flags, - nonoption_flags_max_len), - '\0', top + 1 - nonoption_flags_max_len); - nonoption_flags_max_len = top + 1; - __getopt_nonoption_flags = new_str; - } - } -#endif - - while (top > middle && middle > bottom) - { - if (top - middle > middle - bottom) - { - /* Bottom segment is the short one. */ - int len = middle - bottom; - register int i; - - /* Swap it with the top part of the top segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[top - (middle - bottom) + i]; - argv[top - (middle - bottom) + i] = tem; - SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); - } - /* Exclude the moved bottom segment from further swapping. */ - top -= len; - } - else - { - /* Top segment is the short one. */ - int len = top - middle; - register int i; - - /* Swap it with the bottom part of the bottom segment. */ - for (i = 0; i < len; i++) - { - tem = argv[bottom + i]; - argv[bottom + i] = argv[middle + i]; - argv[middle + i] = tem; - SWAP_FLAGS (bottom + i, middle + i); - } - /* Exclude the moved top segment from further swapping. */ - bottom += len; - } - } - - /* Update records for the slots the non-options now occupy. */ - - first_nonopt += (share__optind - last_nonopt); - last_nonopt = share__optind; -} - -/* Initialize the internal data when the first call is made. */ - -#if defined __STDC__ && __STDC__ -static const char *share___getopt_initialize (int, char *const *, const char *); -#endif -static const char * -share___getopt_initialize (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - /* Start processing options with ARGV-element 1 (since ARGV-element 0 - is the program name); the sequence of previously skipped - non-option ARGV-elements is empty. */ - - first_nonopt = last_nonopt = share__optind; - - nextchar = NULL; - - posixly_correct = getenv ("POSIXLY_CORRECT"); - - /* Determine how to handle the ordering of options and nonoptions. */ - - if (optstring[0] == '-') - { - ordering = RETURN_IN_ORDER; - ++optstring; - } - else if (optstring[0] == '+') - { - ordering = REQUIRE_ORDER; - ++optstring; - } - else if (posixly_correct != NULL) - ordering = REQUIRE_ORDER; - else - ordering = PERMUTE; - -#ifdef _LIBC - if (posixly_correct == NULL - && argc == original_argc && argv == original_argv) - { - if (nonoption_flags_max_len == 0) - { - if (__getopt_nonoption_flags == NULL - || __getopt_nonoption_flags[0] == '\0') - nonoption_flags_max_len = -1; - else - { - const char *orig_str = __getopt_nonoption_flags; - int len = nonoption_flags_max_len = strlen (orig_str); - if (nonoption_flags_max_len < argc) - nonoption_flags_max_len = argc; - __getopt_nonoption_flags = - (char *) malloc (nonoption_flags_max_len); - if (__getopt_nonoption_flags == NULL) - nonoption_flags_max_len = -1; - else - memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), - '\0', nonoption_flags_max_len - len); - } - } - nonoption_flags_len = nonoption_flags_max_len; - } - else - nonoption_flags_len = 0; -#else - (void)argc, (void)argv; -#endif - - return optstring; -} - -/* Scan elements of ARGV (whose length is ARGC) for option characters - given in OPTSTRING. - - If an element of ARGV starts with '-', and is not exactly "-" or "--", - then it is an option element. The characters of this element - (aside from the initial '-') are option characters. If `share__getopt' - is called repeatedly, it returns successively each of the option characters - from each of the option elements. - - If `share__getopt' finds another option character, it returns that character, - updating `share__optind' and `nextchar' so that the next call to `share__getopt' can - resume the scan with the following option character or ARGV-element. - - If there are no more option characters, `share__getopt' returns -1. - Then `share__optind' is the index in ARGV of the first ARGV-element - that is not an option. (The ARGV-elements have been permuted - so that those that are not options now come last.) - - OPTSTRING is a string containing the legitimate option characters. - If an option character is seen that is not listed in OPTSTRING, - return '?' after printing an error message. If you set `share__opterr' to - zero, the error message is suppressed but we still return '?'. - - If a char in OPTSTRING is followed by a colon, that means it wants an arg, - so the following text in the same ARGV-element, or the text of the following - ARGV-element, is returned in `share__optarg'. Two colons mean an option that - wants an optional arg; if there is text in the current ARGV-element, - it is returned in `share__optarg', otherwise `share__optarg' is set to zero. - - If OPTSTRING starts with `-' or `+', it requests different methods of - handling the non-option ARGV-elements. - See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. - - Long-named options begin with `--' instead of `-'. - Their names may be abbreviated as long as the abbreviation is unique - or is an exact match for some defined option. If they have an - argument, it follows the option name in the same ARGV-element, separated - from the option name by a `=', or else the in next ARGV-element. - When `share__getopt' finds a long-named option, it returns 0 if that option's - `flag' field is nonzero, the value of the option's `val' field - if the `flag' field is zero. - - The elements of ARGV aren't really const, because we permute them. - But we pretend they're const in the prototype to be compatible - with other systems. - - LONGOPTS is a vector of `struct share__option' terminated by an - element containing a name which is zero. - - LONGIND returns the index in LONGOPT of the long-named option found. - It is only valid when a long-named option has been found by the most - recent call. - - If LONG_ONLY is nonzero, '-' as well as '--' can introduce - long-named options. */ - -int -share___getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct share__option *longopts; - int *longind; - int long_only; -{ - share__optarg = NULL; - - if (share__optind == 0 || !share____getopt_initialized) - { - if (share__optind == 0) - share__optind = 1; /* Don't scan ARGV[0], the program name. */ - optstring = share___getopt_initialize (argc, argv, optstring); - share____getopt_initialized = 1; - } - - /* Test whether ARGV[share__optind] points to a non-option argument. - Either it does not have option syntax, or there is an environment flag - from the shell indicating it is not an option. The later information - is only used when the used in the GNU libc. */ -#ifdef _LIBC -# define NONOPTION_P (argv[share__optind][0] != '-' || argv[share__optind][1] == '\0' \ - || (share__optind < nonoption_flags_len \ - && __getopt_nonoption_flags[share__optind] == '1')) -#else -# define NONOPTION_P (argv[share__optind][0] != '-' || argv[share__optind][1] == '\0') -#endif - - if (nextchar == NULL || *nextchar == '\0') - { - /* Advance to the next ARGV-element. */ - - /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been - moved back by the user (who may also have changed the arguments). */ - if (last_nonopt > share__optind) - last_nonopt = share__optind; - if (first_nonopt > share__optind) - first_nonopt = share__optind; - - if (ordering == PERMUTE) - { - /* If we have just processed some options following some non-options, - exchange them so that the options come first. */ - - if (first_nonopt != last_nonopt && last_nonopt != share__optind) - exchange ((char **) argv); - else if (last_nonopt != share__optind) - first_nonopt = share__optind; - - /* Skip any additional non-options - and extend the range of non-options previously skipped. */ - - while (share__optind < argc && NONOPTION_P) - share__optind++; - last_nonopt = share__optind; - } - - /* The special ARGV-element `--' means premature end of options. - Skip it like a null option, - then exchange with previous non-options as if it were an option, - then skip everything else like a non-option. */ - - if (share__optind != argc && !strcmp (argv[share__optind], "--")) - { - share__optind++; - - if (first_nonopt != last_nonopt && last_nonopt != share__optind) - exchange ((char **) argv); - else if (first_nonopt == last_nonopt) - first_nonopt = share__optind; - last_nonopt = argc; - - share__optind = argc; - } - - /* If we have done all the ARGV-elements, stop the scan - and back over any non-options that we skipped and permuted. */ - - if (share__optind == argc) - { - /* Set the next-arg-index to point at the non-options - that we previously skipped, so the caller will digest them. */ - if (first_nonopt != last_nonopt) - share__optind = first_nonopt; - return -1; - } - - /* If we have come to a non-option and did not permute it, - either stop the scan or describe it to the caller and pass it by. */ - - if (NONOPTION_P) - { - if (ordering == REQUIRE_ORDER) - return -1; - share__optarg = argv[share__optind++]; - return 1; - } - - /* We have found another option-ARGV-element. - Skip the initial punctuation. */ - - nextchar = (argv[share__optind] + 1 - + (longopts != NULL && argv[share__optind][1] == '-')); - } - - /* Decode the current option-ARGV-element. */ - - /* Check whether the ARGV-element is a long option. - - If long_only and the ARGV-element has the form "-f", where f is - a valid short option, don't consider it an abbreviated form of - a long option that starts with f. Otherwise there would be no - way to give the -f short option. - - On the other hand, if there's a long option "fubar" and - the ARGV-element is "-fu", do consider that an abbreviation of - the long option, just like "--fu", and not "-f" with arg "u". - - This distinction seems to be the most useful approach. */ - - if (longopts != NULL - && (argv[share__optind][1] == '-' - || (long_only && (argv[share__optind][2] || !my_index (optstring, argv[share__optind][1]))))) - { - char *nameend; - const struct share__option *p; - const struct share__option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = -1; - int option_index; - - for (nameend = nextchar; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) - == (unsigned int) strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - - if (ambig && !exact) - { - if (share__opterr) - fprintf (stderr, _("%s: option `%s' is ambiguous\n"), - argv[0], argv[share__optind]); - nextchar += strlen (nextchar); - share__optind++; - share__optopt = 0; - return '?'; - } - - if (pfound != NULL) - { - option_index = indfound; - share__optind++; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - share__optarg = nameend + 1; - else - { - if (share__opterr) - { - if (argv[share__optind - 1][1] == '-') - /* --option */ - fprintf (stderr, - _("%s: option `--%s' doesn't allow an argument\n"), - argv[0], pfound->name); - else - /* +option or -option */ - fprintf (stderr, - _("%s: option `%c%s' doesn't allow an argument\n"), - argv[0], argv[share__optind - 1][0], pfound->name); - } - - nextchar += strlen (nextchar); - - share__optopt = pfound->val; - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (share__optind < argc) - share__optarg = argv[share__optind++]; - else - { - if (share__opterr) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[share__optind - 1]); - nextchar += strlen (nextchar); - share__optopt = pfound->val; - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - - /* Can't find it as a long option. If this is not share__getopt_long_only, - or the option starts with '--' or is not a valid short - option, then it's an error. - Otherwise interpret it as a short option. */ - if (!long_only || argv[share__optind][1] == '-' - || my_index (optstring, *nextchar) == NULL) - { - if (share__opterr) - { - if (argv[share__optind][1] == '-') - /* --option */ - fprintf (stderr, _("%s: unrecognized option `--%s'\n"), - argv[0], nextchar); - else - /* +option or -option */ - fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), - argv[0], argv[share__optind][0], nextchar); - } - nextchar = (char *) ""; - share__optind++; - share__optopt = 0; - return '?'; - } - } - - /* Look at and handle the next short option-character. */ - - { - char c = *nextchar++; - char *temp = my_index (optstring, c); - - /* Increment `share__optind' when we start to process its last character. */ - if (*nextchar == '\0') - ++share__optind; - - if (temp == NULL || c == ':') - { - if (share__opterr) - { - if (posixly_correct) - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: illegal option -- %c\n"), - argv[0], c); - else - fprintf (stderr, _("%s: invalid option -- %c\n"), - argv[0], c); - } - share__optopt = c; - return '?'; - } - /* Convenience. Treat POSIX -W foo same as long option --foo */ - if (temp[0] == 'W' && temp[1] == ';') - { - char *nameend; - const struct share__option *p; - const struct share__option *pfound = NULL; - int exact = 0; - int ambig = 0; - int indfound = 0; - int option_index; - - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - share__optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - share__optind++; - } - else if (share__optind == argc) - { - if (share__opterr) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - share__optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - return c; - } - else - /* We already incremented `share__optind' once; - increment it again when taking next ARGV-elt as argument. */ - share__optarg = argv[share__optind++]; - - /* share__optarg is now the argument, see if it's in the - table of longopts. */ - - for (nextchar = nameend = share__optarg; *nameend && *nameend != '='; nameend++) - /* Do nothing. */ ; - - /* Test all long options for either exact match - or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; p++, option_index++) - if (!strncmp (p->name, nextchar, nameend - nextchar)) - { - if ((unsigned int) (nameend - nextchar) == strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second or later nonexact match found. */ - ambig = 1; - } - if (ambig && !exact) - { - if (share__opterr) - fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), - argv[0], argv[share__optind]); - nextchar += strlen (nextchar); - share__optind++; - return '?'; - } - if (pfound != NULL) - { - option_index = indfound; - if (*nameend) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - share__optarg = nameend + 1; - else - { - if (share__opterr) - fprintf (stderr, _("\ -%s: option `-W %s' doesn't allow an argument\n"), - argv[0], pfound->name); - - nextchar += strlen (nextchar); - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (share__optind < argc) - share__optarg = argv[share__optind++]; - else - { - if (share__opterr) - fprintf (stderr, - _("%s: option `%s' requires an argument\n"), - argv[0], argv[share__optind - 1]); - nextchar += strlen (nextchar); - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - nextchar = NULL; - return 'W'; /* Let the application handle it. */ - } - if (temp[1] == ':') - { - if (temp[2] == ':') - { - /* This is an option that accepts an argument optionally. */ - if (*nextchar != '\0') - { - share__optarg = nextchar; - share__optind++; - } - else - share__optarg = NULL; - nextchar = NULL; - } - else - { - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - share__optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - share__optind++; - } - else if (share__optind == argc) - { - if (share__opterr) - { - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, - _("%s: option requires an argument -- %c\n"), - argv[0], c); - } - share__optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - } - else - /* We already incremented `share__optind' once; - increment it again when taking next ARGV-elt as argument. */ - share__optarg = argv[share__optind++]; - nextchar = NULL; - } - } - return c; - } -} - -int -share__getopt (argc, argv, optstring) - int argc; - char *const *argv; - const char *optstring; -{ - return share___getopt_internal (argc, argv, optstring, - (const struct share__option *) 0, - (int *) 0, - 0); -} - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -/* Compile with -DTEST to make an executable for use in testing - the above definition of `share__getopt'. */ - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = share__optind ? share__optind : 1; - - c = share__getopt (argc, argv, "abc:d:0123456789"); - if (c == -1) - break; - - switch (c) - { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", share__optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (share__optind < argc) - { - printf ("non-option ARGV-elements: "); - while (share__optind < argc) - printf ("%s ", argv[share__optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ diff --git a/3rdparty/libflac/src/share/getopt/getopt1.c b/3rdparty/libflac/src/share/getopt/getopt1.c deleted file mode 100644 index 1e57486b6cb..00000000000 --- a/3rdparty/libflac/src/share/getopt/getopt1.c +++ /dev/null @@ -1,204 +0,0 @@ -/* - NOTE: - I cannot get the vanilla getopt code to work (i.e. compile only what - is needed and not duplicate symbols found in the standard library) - on all the platforms that FLAC supports. In particular the gating - of code with the ELIDE_CODE #define is not accurate enough on systems - that are POSIX but not glibc. If someone has a patch that works on - GNU/Linux, Darwin, AND Solaris please submit it on the project page: - http://sourceforge.net/projects/flac - - In the meantime I have munged the global symbols and removed gates - around code, while at the same time trying to touch the original as - little as possible. -*/ -/* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - The GNU C 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "share/getopt.h" -/*[JEC] was:#include "getopt.h"*/ - -#if !defined __STDC__ || !__STDC__ -/* This is a separate conditional since some stdc systems - reject `defined (const)'. */ -#ifndef const -#define const -#endif -#endif - -#include <stdio.h> - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -#define GETOPT_INTERFACE_VERSION 2 -#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 -#include <gnu-versions.h> -#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION -#define ELIDE_CODE -#endif -#endif - -#if 1 -/*[JEC] was:#ifndef ELIDE_CODE*/ - - -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -#include <stdlib.h> -#endif - -#ifndef NULL -#define NULL 0 -#endif - -int -share__getopt_long (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct share__option *long_options; - int *opt_index; -{ - return share___getopt_internal (argc, argv, options, long_options, opt_index, 0); -} - -/* Like share__getopt_long, but '-' as well as '--' can indicate a long option. - If an option that starts with '-' (not '--') doesn't match a long option, - but does match a short option, it is parsed as a short option - instead. */ - -int -share__getopt_long_only (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct share__option *long_options; - int *opt_index; -{ - return share___getopt_internal (argc, argv, options, long_options, opt_index, 1); -} - - -#endif /* Not ELIDE_CODE. */ - -#ifdef TEST - -#include <stdio.h> - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = share__optind ? share__optind : 1; - int option_index = 0; - static struct share__option long_options[] = - { - {"add", 1, 0, 0}, - {"append", 0, 0, 0}, - {"delete", 1, 0, 0}, - {"verbose", 0, 0, 0}, - {"create", 0, 0, 0}, - {"file", 1, 0, 0}, - {0, 0, 0, 0} - }; - - c = share__getopt_long (argc, argv, "abc:d:0123456789", - long_options, &option_index); - if (c == -1) - break; - - switch (c) - { - case 0: - printf ("option %s", long_options[option_index].name); - if (share__optarg) - printf (" with arg %s", share__optarg); - printf ("\n"); - break; - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", share__optarg); - break; - - case 'd': - printf ("option d with value `%s'\n", share__optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (share__optind < argc) - { - printf ("non-option ARGV-elements: "); - while (share__optind < argc) - printf ("%s ", argv[share__optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ diff --git a/3rdparty/libflac/src/share/getopt/getopt_static.dsp b/3rdparty/libflac/src/share/getopt/getopt_static.dsp deleted file mode 100644 index 1cdbd71080d..00000000000 --- a/3rdparty/libflac/src/share/getopt/getopt_static.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="getopt_static" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=getopt_static - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "getopt_static.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "getopt_static.mak" CFG="getopt_static - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "getopt_static - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "getopt_static - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "getopt" -# PROP Scc_LocalPath "..\..\.." -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "getopt_static - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\..\obj\release\lib" -# PROP Intermediate_Dir "Release_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I "..\..\..\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /nodefaultlib - -!ELSEIF "$(CFG)" == "getopt_static - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\..\obj\debug\lib" -# PROP Intermediate_Dir "Debug_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\include" /I "..\..\..\include" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /nodefaultlib - -!ENDIF - -# Begin Target - -# Name "getopt_static - Win32 Release" -# Name "getopt_static - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "c" -# Begin Source File - -SOURCE=.\getopt.c -# End Source File -# Begin Source File - -SOURCE=.\getopt1.c -# End Source File -# End Group -# Begin Group "Private Header Files" - -# PROP Default_Filter "" -# End Group -# Begin Group "Protected Header Files" - -# PROP Default_Filter "" -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\..\include\share\getopt.h -# End Source File -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/share/getopt/getopt_static.vcproj b/3rdparty/libflac/src/share/getopt/getopt_static.vcproj deleted file mode 100644 index 028c82d0b45..00000000000 --- a/3rdparty/libflac/src/share/getopt/getopt_static.vcproj +++ /dev/null @@ -1,185 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="getopt_static" - ProjectGUID="{4cefbc80-c215-11db-8314-0800200c9a66}" - RootNamespace="getopt_static" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\..\obj\debug\lib" - IntermediateDirectory="Debug_static" - ConfigurationType="4" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".\include;..\..\..\include" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;FLAC__NO_DLL;DEBUG" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\..\..\obj\debug\lib\$(ProjectName).lib" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\..\obj\release\lib" - IntermediateDirectory="Release_static" - ConfigurationType="4" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".\include;..\..\..\include" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__NO_DLL" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\..\..\obj\release\lib\$(ProjectName).lib" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\getopt.c" - > - </File> - <File - RelativePath=".\getopt1.c" - > - </File> - </Filter> - <Filter - Name="Public Header Files" - > - <File - RelativePath="..\..\..\include\share\getopt.h" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/share/grabbag/Makefile.am b/3rdparty/libflac/src/share/grabbag/Makefile.am deleted file mode 100644 index 879b15511a5..00000000000 --- a/3rdparty/libflac/src/share/grabbag/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -## Process this file with automake to produce Makefile.in - -AUTOMAKE_OPTIONS = foreign - -INCLUDES = -I$(top_srcdir)/include - -noinst_LTLIBRARIES = libgrabbag.la - -libgrabbag_la_SOURCES = \ - cuesheet.c \ - file.c \ - picture.c \ - replaygain.c \ - seektable.c - -EXTRA_DIST = \ - Makefile.lite \ - grabbag_static.dsp \ - grabbag_static.vcproj - -debug: - $(MAKE) all CFLAGS="@DEBUG@" - -profile: - $(MAKE) all CFLAGS="@PROFILE@" diff --git a/3rdparty/libflac/src/share/grabbag/Makefile.in b/3rdparty/libflac/src/share/grabbag/Makefile.in deleted file mode 100644 index a7780a3c644..00000000000 --- a/3rdparty/libflac/src/share/grabbag/Makefile.in +++ /dev/null @@ -1,512 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -AUTOMAKE_OPTIONS = foreign - -INCLUDES = -I$(top_srcdir)/include - -noinst_LTLIBRARIES = libgrabbag.la - -libgrabbag_la_SOURCES = \ - cuesheet.c \ - file.c \ - picture.c \ - replaygain.c \ - seektable.c - - -EXTRA_DIST = \ - Makefile.lite \ - grabbag_static.dsp \ - grabbag_static.vcproj - -subdir = src/share/grabbag -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) - -libgrabbag_la_LDFLAGS = -libgrabbag_la_LIBADD = -am_libgrabbag_la_OBJECTS = cuesheet.lo file.lo picture.lo replaygain.lo \ - seektable.lo -libgrabbag_la_OBJECTS = $(am_libgrabbag_la_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cuesheet.Plo ./$(DEPDIR)/file.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/picture.Plo ./$(DEPDIR)/replaygain.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/seektable.Plo -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(libgrabbag_la_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(libgrabbag_la_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/share/grabbag/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" = "$$p" && dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libgrabbag.la: $(libgrabbag_la_OBJECTS) $(libgrabbag_la_DEPENDENCIES) - $(LINK) $(libgrabbag_la_LDFLAGS) $(libgrabbag_la_OBJECTS) $(libgrabbag_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cuesheet.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/picture.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/replaygain.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seektable.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am - - -debug: - $(MAKE) all CFLAGS="@DEBUG@" - -profile: - $(MAKE) all CFLAGS="@PROFILE@" -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/share/grabbag/Makefile.lite b/3rdparty/libflac/src/share/grabbag/Makefile.lite deleted file mode 100644 index daf19751719..00000000000 --- a/3rdparty/libflac/src/share/grabbag/Makefile.lite +++ /dev/null @@ -1,19 +0,0 @@ -# -# GNU makefile -# - -topdir = ../../.. - -LIB_NAME = libgrabbag -INCLUDES = -I$(topdir)/include - -SRCS_C = \ - cuesheet.c \ - file.c \ - picture.c \ - replaygain.c \ - seektable.c - -include $(topdir)/build/lib.mk - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/3rdparty/libflac/src/share/grabbag/cuesheet.c b/3rdparty/libflac/src/share/grabbag/cuesheet.c deleted file mode 100644 index 03f7cdaa75b..00000000000 --- a/3rdparty/libflac/src/share/grabbag/cuesheet.c +++ /dev/null @@ -1,611 +0,0 @@ -/* grabbag - Convenience lib for various routines common to several tools - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "share/grabbag.h" -#include "FLAC/assert.h" -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -unsigned grabbag__cuesheet_msf_to_frame(unsigned minutes, unsigned seconds, unsigned frames) -{ - return ((minutes * 60) + seconds) * 75 + frames; -} - -void grabbag__cuesheet_frame_to_msf(unsigned frame, unsigned *minutes, unsigned *seconds, unsigned *frames) -{ - *frames = frame % 75; - frame /= 75; - *seconds = frame % 60; - frame /= 60; - *minutes = frame; -} - -/* since we only care about values >= 0 or error, returns < 0 for any illegal string, else value */ -static int local__parse_int_(const char *s) -{ - int ret = 0; - char c; - - if(*s == '\0') - return -1; - - while('\0' != (c = *s++)) - if(c >= '0' && c <= '9') - ret = ret * 10 + (c - '0'); - else - return -1; - - return ret; -} - -/* since we only care about values >= 0 or error, returns < 0 for any illegal string, else value */ -static FLAC__int64 local__parse_int64_(const char *s) -{ - FLAC__int64 ret = 0; - char c; - - if(*s == '\0') - return -1; - - while('\0' != (c = *s++)) - if(c >= '0' && c <= '9') - ret = ret * 10 + (c - '0'); - else - return -1; - - return ret; -} - -/* accept '[0-9]+:[0-9][0-9]?:[0-9][0-9]?', but max second of 59 and max frame of 74, e.g. 0:0:0, 123:45:67 - * return sample number or <0 for error - */ -static FLAC__int64 local__parse_msf_(const char *s) -{ - FLAC__int64 ret, field; - char c; - - c = *s++; - if(c >= '0' && c <= '9') - field = (c - '0'); - else - return -1; - while(':' != (c = *s++)) { - if(c >= '0' && c <= '9') - field = field * 10 + (c - '0'); - else - return -1; - } - - ret = field * 60 * 44100; - - c = *s++; - if(c >= '0' && c <= '9') - field = (c - '0'); - else - return -1; - if(':' != (c = *s++)) { - if(c >= '0' && c <= '9') { - field = field * 10 + (c - '0'); - c = *s++; - if(c != ':') - return -1; - } - else - return -1; - } - - if(field >= 60) - return -1; - - ret += field * 44100; - - c = *s++; - if(c >= '0' && c <= '9') - field = (c - '0'); - else - return -1; - if('\0' != (c = *s++)) { - if(c >= '0' && c <= '9') { - field = field * 10 + (c - '0'); - c = *s++; - } - else - return -1; - } - - if(c != '\0') - return -1; - - if(field >= 75) - return -1; - - ret += field * (44100 / 75); - - return ret; -} - -static char *local__get_field_(char **s, FLAC__bool allow_quotes) -{ - FLAC__bool has_quote = false; - char *p; - - FLAC__ASSERT(0 != s); - - if(0 == *s) - return 0; - - /* skip leading whitespace */ - while(**s && 0 != strchr(" \t\r\n", **s)) - (*s)++; - - if(**s == 0) { - *s = 0; - return 0; - } - - if(allow_quotes && (**s == '"')) { - has_quote = true; - (*s)++; - if(**s == 0) { - *s = 0; - return 0; - } - } - - p = *s; - - if(has_quote) { - *s = strchr(*s, '\"'); - /* if there is no matching end quote, it's an error */ - if(0 == *s) - p = *s = 0; - else { - **s = '\0'; - (*s)++; - } - } - else { - while(**s && 0 == strchr(" \t\r\n", **s)) - (*s)++; - if(**s) { - **s = '\0'; - (*s)++; - } - else - *s = 0; - } - - return p; -} - -static FLAC__bool local__cuesheet_parse_(FILE *file, const char **error_message, unsigned *last_line_read, FLAC__StreamMetadata *cuesheet, FLAC__bool is_cdda, FLAC__uint64 lead_out_offset) -{ -#if defined _MSC_VER || defined __MINGW32__ || defined __EMX__ -#define FLAC__STRCASECMP stricmp -#else -#define FLAC__STRCASECMP strcasecmp -#endif - char buffer[4096], *line, *field; - unsigned forced_leadout_track_num = 0; - FLAC__uint64 forced_leadout_track_offset = 0; - int in_track_num = -1, in_index_num = -1; - FLAC__bool disc_has_catalog = false, track_has_flags = false, track_has_isrc = false, has_forced_leadout = false; - FLAC__StreamMetadata_CueSheet *cs = &cuesheet->data.cue_sheet; - - cs->lead_in = is_cdda? 2 * 44100 /* The default lead-in size for CD-DA */ : 0; - cs->is_cd = is_cdda; - - while(0 != fgets(buffer, sizeof(buffer), file)) { - (*last_line_read)++; - line = buffer; - - { - size_t linelen = strlen(line); - if((linelen == sizeof(buffer)-1) && line[linelen-1] != '\n') { - *error_message = "line too long"; - return false; - } - } - - if(0 != (field = local__get_field_(&line, /*allow_quotes=*/false))) { - if(0 == FLAC__STRCASECMP(field, "CATALOG")) { - if(disc_has_catalog) { - *error_message = "found multiple CATALOG commands"; - return false; - } - if(0 == (field = local__get_field_(&line, /*allow_quotes=*/true))) { - *error_message = "CATALOG is missing catalog number"; - return false; - } - if(strlen(field) >= sizeof(cs->media_catalog_number)) { - *error_message = "CATALOG number is too long"; - return false; - } - if(is_cdda && (strlen(field) != 13 || strspn(field, "0123456789") != 13)) { - *error_message = "CD-DA CATALOG number must be 13 decimal digits"; - return false; - } - strcpy(cs->media_catalog_number, field); - disc_has_catalog = true; - } - else if(0 == FLAC__STRCASECMP(field, "FLAGS")) { - if(track_has_flags) { - *error_message = "found multiple FLAGS commands"; - return false; - } - if(in_track_num < 0 || in_index_num >= 0) { - *error_message = "FLAGS command must come after TRACK but before INDEX"; - return false; - } - while(0 != (field = local__get_field_(&line, /*allow_quotes=*/false))) { - if(0 == FLAC__STRCASECMP(field, "PRE")) - cs->tracks[cs->num_tracks-1].pre_emphasis = 1; - } - track_has_flags = true; - } - else if(0 == FLAC__STRCASECMP(field, "INDEX")) { - FLAC__int64 xx; - FLAC__StreamMetadata_CueSheet_Track *track = &cs->tracks[cs->num_tracks-1]; - if(in_track_num < 0) { - *error_message = "found INDEX before any TRACK"; - return false; - } - if(0 == (field = local__get_field_(&line, /*allow_quotes=*/false))) { - *error_message = "INDEX is missing index number"; - return false; - } - in_index_num = local__parse_int_(field); - if(in_index_num < 0) { - *error_message = "INDEX has invalid index number"; - return false; - } - FLAC__ASSERT(cs->num_tracks > 0); - if(track->num_indices == 0) { - /* it's the first index point of the track */ - if(in_index_num > 1) { - *error_message = "first INDEX number of a TRACK must be 0 or 1"; - return false; - } - } - else { - if(in_index_num != track->indices[track->num_indices-1].number + 1) { - *error_message = "INDEX numbers must be sequential"; - return false; - } - } - if(is_cdda && in_index_num > 99) { - *error_message = "CD-DA INDEX number must be between 0 and 99, inclusive"; - return false; - } - /*@@@ search for duplicate track number? */ - if(0 == (field = local__get_field_(&line, /*allow_quotes=*/false))) { - *error_message = "INDEX is missing an offset after the index number"; - return false; - } - xx = local__parse_msf_(field); - if(xx < 0) { - if(is_cdda) { - *error_message = "illegal INDEX offset (not of the form MM:SS:FF)"; - return false; - } - xx = local__parse_int64_(field); - if(xx < 0) { - *error_message = "illegal INDEX offset"; - return false; - } - } - if(is_cdda && cs->num_tracks == 1 && cs->tracks[0].num_indices == 0 && xx != 0) { - *error_message = "first INDEX of first TRACK must have an offset of 00:00:00"; - return false; - } - if(is_cdda && track->num_indices > 0 && (FLAC__uint64)xx <= track->indices[track->num_indices-1].offset) { - *error_message = "CD-DA INDEX offsets must increase in time"; - return false; - } - /* fill in track offset if it's the first index of the track */ - if(track->num_indices == 0) - track->offset = (FLAC__uint64)xx; - if(is_cdda && cs->num_tracks > 1) { - const FLAC__StreamMetadata_CueSheet_Track *prev = &cs->tracks[cs->num_tracks-2]; - if((FLAC__uint64)xx <= prev->offset + prev->indices[prev->num_indices-1].offset) { - *error_message = "CD-DA INDEX offsets must increase in time"; - return false; - } - } - if(!FLAC__metadata_object_cuesheet_track_insert_blank_index(cuesheet, cs->num_tracks-1, track->num_indices)) { - *error_message = "memory allocation error"; - return false; - } - track->indices[track->num_indices-1].offset = (FLAC__uint64)xx - track->offset; - track->indices[track->num_indices-1].number = in_index_num; - } - else if(0 == FLAC__STRCASECMP(field, "ISRC")) { - char *l, *r; - if(track_has_isrc) { - *error_message = "found multiple ISRC commands"; - return false; - } - if(in_track_num < 0 || in_index_num >= 0) { - *error_message = "ISRC command must come after TRACK but before INDEX"; - return false; - } - if(0 == (field = local__get_field_(&line, /*allow_quotes=*/false))) { - *error_message = "ISRC is missing ISRC number"; - return false; - } - /* strip out dashes */ - for(l = r = field; *r; r++) { - if(*r != '-') - *l++ = *r; - } - *l = '\0'; - if(strlen(field) != 12 || strspn(field, "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") < 5 || strspn(field+5, "1234567890") != 7) { - *error_message = "invalid ISRC number"; - return false; - } - strcpy(cs->tracks[cs->num_tracks-1].isrc, field); - track_has_isrc = true; - } - else if(0 == FLAC__STRCASECMP(field, "TRACK")) { - if(cs->num_tracks > 0) { - const FLAC__StreamMetadata_CueSheet_Track *prev = &cs->tracks[cs->num_tracks-1]; - if( - prev->num_indices == 0 || - ( - is_cdda && - ( - (prev->num_indices == 1 && prev->indices[0].number != 1) || - (prev->num_indices == 2 && prev->indices[0].number != 1 && prev->indices[1].number != 1) - ) - ) - ) { - *error_message = is_cdda? - "previous TRACK must specify at least one INDEX 01" : - "previous TRACK must specify at least one INDEX"; - return false; - } - } - if(0 == (field = local__get_field_(&line, /*allow_quotes=*/false))) { - *error_message = "TRACK is missing track number"; - return false; - } - in_track_num = local__parse_int_(field); - if(in_track_num < 0) { - *error_message = "TRACK has invalid track number"; - return false; - } - if(in_track_num == 0) { - *error_message = "TRACK number must be greater than 0"; - return false; - } - if(is_cdda) { - if(in_track_num > 99) { - *error_message = "CD-DA TRACK number must be between 1 and 99, inclusive"; - return false; - } - } - else { - if(in_track_num == 255) { - *error_message = "TRACK number 255 is reserved for the lead-out"; - return false; - } - else if(in_track_num > 255) { - *error_message = "TRACK number must be between 1 and 254, inclusive"; - return false; - } - } - if(is_cdda && cs->num_tracks > 0 && in_track_num != cs->tracks[cs->num_tracks-1].number + 1) { - *error_message = "CD-DA TRACK numbers must be sequential"; - return false; - } - /*@@@ search for duplicate track number? */ - if(0 == (field = local__get_field_(&line, /*allow_quotes=*/false))) { - *error_message = "TRACK is missing a track type after the track number"; - return false; - } - if(!FLAC__metadata_object_cuesheet_insert_blank_track(cuesheet, cs->num_tracks)) { - *error_message = "memory allocation error"; - return false; - } - cs->tracks[cs->num_tracks-1].number = in_track_num; - cs->tracks[cs->num_tracks-1].type = (0 == FLAC__STRCASECMP(field, "AUDIO"))? 0 : 1; /*@@@ should we be more strict with the value here? */ - in_index_num = -1; - track_has_flags = false; - track_has_isrc = false; - } - else if(0 == FLAC__STRCASECMP(field, "REM")) { - if(0 != (field = local__get_field_(&line, /*allow_quotes=*/false))) { - if(0 == strcmp(field, "FLAC__lead-in")) { - FLAC__int64 xx; - if(0 == (field = local__get_field_(&line, /*allow_quotes=*/false))) { - *error_message = "FLAC__lead-in is missing offset"; - return false; - } - xx = local__parse_int64_(field); - if(xx < 0) { - *error_message = "illegal FLAC__lead-in offset"; - return false; - } - if(is_cdda && xx % 588 != 0) { - *error_message = "illegal CD-DA FLAC__lead-in offset, must be even multiple of 588 samples"; - return false; - } - cs->lead_in = (FLAC__uint64)xx; - } - else if(0 == strcmp(field, "FLAC__lead-out")) { - int track_num; - FLAC__int64 offset; - if(has_forced_leadout) { - *error_message = "multiple FLAC__lead-out commands"; - return false; - } - if(0 == (field = local__get_field_(&line, /*allow_quotes=*/false))) { - *error_message = "FLAC__lead-out is missing track number"; - return false; - } - track_num = local__parse_int_(field); - if(track_num < 0) { - *error_message = "illegal FLAC__lead-out track number"; - return false; - } - forced_leadout_track_num = (unsigned)track_num; - /*@@@ search for duplicate track number? */ - if(0 == (field = local__get_field_(&line, /*allow_quotes=*/false))) { - *error_message = "FLAC__lead-out is missing offset"; - return false; - } - offset = local__parse_int64_(field); - if(offset < 0) { - *error_message = "illegal FLAC__lead-out offset"; - return false; - } - forced_leadout_track_offset = (FLAC__uint64)offset; - if(forced_leadout_track_offset != lead_out_offset) { - *error_message = "FLAC__lead-out offset does not match end-of-stream offset"; - return false; - } - has_forced_leadout = true; - } - } - } - } - } - - if(cs->num_tracks == 0) { - *error_message = "there must be at least one TRACK command"; - return false; - } - else { - const FLAC__StreamMetadata_CueSheet_Track *prev = &cs->tracks[cs->num_tracks-1]; - if( - prev->num_indices == 0 || - ( - is_cdda && - ( - (prev->num_indices == 1 && prev->indices[0].number != 1) || - (prev->num_indices == 2 && prev->indices[0].number != 1 && prev->indices[1].number != 1) - ) - ) - ) { - *error_message = is_cdda? - "previous TRACK must specify at least one INDEX 01" : - "previous TRACK must specify at least one INDEX"; - return false; - } - } - - if(!has_forced_leadout) { - forced_leadout_track_num = is_cdda? 170 : 255; - forced_leadout_track_offset = lead_out_offset; - } - if(!FLAC__metadata_object_cuesheet_insert_blank_track(cuesheet, cs->num_tracks)) { - *error_message = "memory allocation error"; - return false; - } - cs->tracks[cs->num_tracks-1].number = forced_leadout_track_num; - cs->tracks[cs->num_tracks-1].offset = forced_leadout_track_offset; - - if(!feof(file)) { - *error_message = "read error"; - return false; - } - return true; -#undef FLAC__STRCASECMP -} - -FLAC__StreamMetadata *grabbag__cuesheet_parse(FILE *file, const char **error_message, unsigned *last_line_read, FLAC__bool is_cdda, FLAC__uint64 lead_out_offset) -{ - FLAC__StreamMetadata *cuesheet; - - FLAC__ASSERT(0 != file); - FLAC__ASSERT(0 != error_message); - FLAC__ASSERT(0 != last_line_read); - - *last_line_read = 0; - cuesheet = FLAC__metadata_object_new(FLAC__METADATA_TYPE_CUESHEET); - - if(0 == cuesheet) { - *error_message = "memory allocation error"; - return 0; - } - - if(!local__cuesheet_parse_(file, error_message, last_line_read, cuesheet, is_cdda, lead_out_offset)) { - FLAC__metadata_object_delete(cuesheet); - return 0; - } - - return cuesheet; -} - -void grabbag__cuesheet_emit(FILE *file, const FLAC__StreamMetadata *cuesheet, const char *file_reference) -{ - const FLAC__StreamMetadata_CueSheet *cs; - unsigned track_num, index_num; - - FLAC__ASSERT(0 != file); - FLAC__ASSERT(0 != cuesheet); - FLAC__ASSERT(cuesheet->type == FLAC__METADATA_TYPE_CUESHEET); - - cs = &cuesheet->data.cue_sheet; - - if(*(cs->media_catalog_number)) - fprintf(file, "CATALOG %s\n", cs->media_catalog_number); - fprintf(file, "FILE %s\n", file_reference); - - for(track_num = 0; track_num < cs->num_tracks-1; track_num++) { - const FLAC__StreamMetadata_CueSheet_Track *track = cs->tracks + track_num; - - fprintf(file, " TRACK %02u %s\n", (unsigned)track->number, track->type == 0? "AUDIO" : "DATA"); - - if(track->pre_emphasis) - fprintf(file, " FLAGS PRE\n"); - if(*(track->isrc)) - fprintf(file, " ISRC %s\n", track->isrc); - - for(index_num = 0; index_num < track->num_indices; index_num++) { - const FLAC__StreamMetadata_CueSheet_Index *index = track->indices + index_num; - - fprintf(file, " INDEX %02u ", (unsigned)index->number); - if(cs->is_cd) { - const unsigned logical_frame = (unsigned)((track->offset + index->offset) / (44100 / 75)); - unsigned m, s, f; - grabbag__cuesheet_frame_to_msf(logical_frame, &m, &s, &f); - fprintf(file, "%02u:%02u:%02u\n", m, s, f); - } - else -#ifdef _MSC_VER - fprintf(file, "%I64u\n", track->offset + index->offset); -#else - fprintf(file, "%llu\n", (unsigned long long)(track->offset + index->offset)); -#endif - } - } - -#ifdef _MSC_VER - fprintf(file, "REM FLAC__lead-in %I64u\n", cs->lead_in); - fprintf(file, "REM FLAC__lead-out %u %I64u\n", (unsigned)cs->tracks[track_num].number, cs->tracks[track_num].offset); -#else - fprintf(file, "REM FLAC__lead-in %llu\n", (unsigned long long)cs->lead_in); - fprintf(file, "REM FLAC__lead-out %u %llu\n", (unsigned)cs->tracks[track_num].number, (unsigned long long)cs->tracks[track_num].offset); -#endif -} diff --git a/3rdparty/libflac/src/share/grabbag/file.c b/3rdparty/libflac/src/share/grabbag/file.c deleted file mode 100644 index d073c4bf1fd..00000000000 --- a/3rdparty/libflac/src/share/grabbag/file.c +++ /dev/null @@ -1,192 +0,0 @@ -/* grabbag - Convenience lib for various routines common to several tools - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#if defined _MSC_VER || defined __MINGW32__ -#include <sys/utime.h> /* for utime() */ -#include <io.h> /* for chmod(), _setmode(), unlink() */ -#include <fcntl.h> /* for _O_BINARY */ -#else -#include <sys/types.h> /* some flavors of BSD (like OS X) require this to get time_t */ -#include <utime.h> /* for utime() */ -#endif -#if defined __CYGWIN__ || defined __EMX__ -#include <io.h> /* for setmode(), O_BINARY */ -#include <fcntl.h> /* for _O_BINARY */ -#endif -#include <sys/stat.h> /* for stat(), maybe chmod() */ -#if defined _WIN32 && !defined __CYGWIN__ -#else -#include <unistd.h> /* for unlink() */ -#endif -#include <stdio.h> -#include <stdlib.h> -#include <string.h> /* for strrchr() */ -#if defined _WIN32 && !defined __CYGWIN__ -// for GetFileInformationByHandle() etc -#include <windows.h> -#include <winbase.h> -#endif -#include "share/grabbag.h" - - -void grabbag__file_copy_metadata(const char *srcpath, const char *destpath) -{ - struct stat srcstat; - struct utimbuf srctime; - - if(0 == stat(srcpath, &srcstat)) { - srctime.actime = srcstat.st_atime; - srctime.modtime = srcstat.st_mtime; - (void)chmod(destpath, srcstat.st_mode); - (void)utime(destpath, &srctime); - } -} - -off_t grabbag__file_get_filesize(const char *srcpath) -{ - struct stat srcstat; - - if(0 == stat(srcpath, &srcstat)) - return srcstat.st_size; - else - return -1; -} - -const char *grabbag__file_get_basename(const char *srcpath) -{ - const char *p; - - p = strrchr(srcpath, '/'); - if(0 == p) { - p = strrchr(srcpath, '\\'); - if(0 == p) - return srcpath; - } - return ++p; -} - -FLAC__bool grabbag__file_change_stats(const char *filename, FLAC__bool read_only) -{ - struct stat stats; - - if(0 == stat(filename, &stats)) { -#if !defined _MSC_VER && !defined __MINGW32__ - if(read_only) { - stats.st_mode &= ~S_IWUSR; - stats.st_mode &= ~S_IWGRP; - stats.st_mode &= ~S_IWOTH; - } - else { - stats.st_mode |= S_IWUSR; - } -#else - if(read_only) - stats.st_mode &= ~S_IWRITE; - else - stats.st_mode |= S_IWRITE; -#endif - if(0 != chmod(filename, stats.st_mode)) - return false; - } - else - return false; - - return true; -} - -FLAC__bool grabbag__file_are_same(const char *f1, const char *f2) -{ -#if defined _MSC_VER || defined __MINGW32__ - /* see - * http://www.hydrogenaudio.org/forums/index.php?showtopic=49439&pid=444300&st=0 - * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/getfileinformationbyhandle.asp - * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/by_handle_file_information_str.asp - * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/createfile.asp - * apparently both the files have to be open at the same time for the comparison to work - */ - FLAC__bool same = false; - BY_HANDLE_FILE_INFORMATION info1, info2; - HANDLE h1, h2; - BOOL ok = 1; - h1 = CreateFile(f1, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - h2 = CreateFile(f2, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if(h1 == INVALID_HANDLE_VALUE || h2 == INVALID_HANDLE_VALUE) - ok = 0; - ok &= GetFileInformationByHandle(h1, &info1); - ok &= GetFileInformationByHandle(h2, &info2); - if(ok) - same = - info1.dwVolumeSerialNumber == info2.dwVolumeSerialNumber && - info1.nFileIndexHigh == info2.nFileIndexHigh && - info1.nFileIndexLow == info2.nFileIndexLow - ; - if(h1 != INVALID_HANDLE_VALUE) - CloseHandle(h1); - if(h2 != INVALID_HANDLE_VALUE) - CloseHandle(h2); - return same; -#else - struct stat s1, s2; - return f1 && f2 && stat(f1, &s1) == 0 && stat(f2, &s2) == 0 && s1.st_ino == s2.st_ino && s1.st_dev == s2.st_dev; -#endif -} - -FLAC__bool grabbag__file_remove_file(const char *filename) -{ - return grabbag__file_change_stats(filename, /*read_only=*/false) && 0 == unlink(filename); -} - -FILE *grabbag__file_get_binary_stdin(void) -{ - /* if something breaks here it is probably due to the presence or - * absence of an underscore before the identifiers 'setmode', - * 'fileno', and/or 'O_BINARY'; check your system header files. - */ -#if defined _MSC_VER || defined __MINGW32__ - _setmode(_fileno(stdin), _O_BINARY); -#elif defined __CYGWIN__ - /* almost certainly not needed for any modern Cygwin, but let's be safe... */ - setmode(_fileno(stdin), _O_BINARY); -#elif defined __EMX__ - setmode(fileno(stdin), O_BINARY); -#endif - - return stdin; -} - -FILE *grabbag__file_get_binary_stdout(void) -{ - /* if something breaks here it is probably due to the presence or - * absence of an underscore before the identifiers 'setmode', - * 'fileno', and/or 'O_BINARY'; check your system header files. - */ -#if defined _MSC_VER || defined __MINGW32__ - _setmode(_fileno(stdout), _O_BINARY); -#elif defined __CYGWIN__ - /* almost certainly not needed for any modern Cygwin, but let's be safe... */ - setmode(_fileno(stdout), _O_BINARY); -#elif defined __EMX__ - setmode(fileno(stdout), O_BINARY); -#endif - - return stdout; -} diff --git a/3rdparty/libflac/src/share/grabbag/grabbag_static.dsp b/3rdparty/libflac/src/share/grabbag/grabbag_static.dsp deleted file mode 100644 index 11835bd4af9..00000000000 --- a/3rdparty/libflac/src/share/grabbag/grabbag_static.dsp +++ /dev/null @@ -1,144 +0,0 @@ -# Microsoft Developer Studio Project File - Name="grabbag_static" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=grabbag_static - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "grabbag_static.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "grabbag_static.mak" CFG="grabbag_static - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "grabbag_static - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "grabbag_static - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "grabbag" -# PROP Scc_LocalPath "..\..\.." -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "grabbag_static - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\..\obj\release\lib" -# PROP Intermediate_Dir "Release_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /Op /I ".\include" /I "..\..\..\include" /D "FLAC__NO_DLL" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /nodefaultlib - -!ELSEIF "$(CFG)" == "grabbag_static - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\..\obj\debug\lib" -# PROP Intermediate_Dir "Debug_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\include" /I "..\..\..\include" /D "FLAC__NO_DLL" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /nodefaultlib - -!ENDIF - -# Begin Target - -# Name "grabbag_static - Win32 Release" -# Name "grabbag_static - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "c" -# Begin Source File - -SOURCE=.\cuesheet.c -# End Source File -# Begin Source File - -SOURCE=.\file.c -# End Source File -# Begin Source File - -SOURCE=.\picture.c -# End Source File -# Begin Source File - -SOURCE=.\replaygain.c -# End Source File -# Begin Source File - -SOURCE=.\seektable.c -# End Source File -# End Group -# Begin Group "Private Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\..\include\share\grabbag\cuesheet.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\share\grabbag\file.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\share\grabbag\picture.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\share\grabbag\replaygain.h -# End Source File -# Begin Source File - -SOURCE=..\..\..\include\share\grabbag\seektable.h -# End Source File -# End Group -# Begin Group "Protected Header Files" - -# PROP Default_Filter "" -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\..\include\share\grabbag.h -# End Source File -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/share/grabbag/grabbag_static.vcproj b/3rdparty/libflac/src/share/grabbag/grabbag_static.vcproj deleted file mode 100644 index f5482028bd5..00000000000 --- a/3rdparty/libflac/src/share/grabbag/grabbag_static.vcproj +++ /dev/null @@ -1,221 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="grabbag_static" - ProjectGUID="{4cefbc81-c215-11db-8314-0800200c9a66}" - RootNamespace="grabbag_static" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\..\obj\debug\lib" - IntermediateDirectory="Debug_static" - ConfigurationType="4" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".\include;..\..\..\include" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;FLAC__NO_DLL;DEBUG" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\..\..\obj\debug\lib\$(ProjectName).lib" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\..\obj\release\lib" - IntermediateDirectory="Release_static" - ConfigurationType="4" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".\include;..\..\..\include" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__NO_DLL" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\..\..\obj\release\lib\$(ProjectName).lib" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\cuesheet.c" - > - </File> - <File - RelativePath=".\file.c" - > - </File> - <File - RelativePath=".\picture.c" - > - </File> - <File - RelativePath=".\replaygain.c" - > - </File> - <File - RelativePath=".\seektable.c" - > - </File> - </Filter> - <Filter - Name="Public Header Files" - > - <File - RelativePath="..\..\..\include\share\grabbag.h" - > - </File> - <Filter - Name="grabbag" - > - <File - RelativePath="..\..\..\include\share\grabbag\cuesheet.h" - > - </File> - <File - RelativePath="..\..\..\include\share\grabbag\file.h" - > - </File> - <File - RelativePath="..\..\..\include\share\grabbag\picture.h" - > - </File> - <File - RelativePath="..\..\..\include\share\grabbag\replaygain.h" - > - </File> - <File - RelativePath="..\..\..\include\share\grabbag\seektable.h" - > - </File> - </Filter> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/share/grabbag/picture.c b/3rdparty/libflac/src/share/grabbag/picture.c deleted file mode 100644 index 0e37273803d..00000000000 --- a/3rdparty/libflac/src/share/grabbag/picture.c +++ /dev/null @@ -1,407 +0,0 @@ -/* grabbag - Convenience lib for various routines common to several tools - * Copyright (C) 2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "share/alloc.h" -#include "share/grabbag.h" -#include "FLAC/assert.h" -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -/* slightly different that strndup(): this always copies 'size' bytes starting from s into a NUL-terminated string. */ -static char *local__strndup_(const char *s, size_t size) -{ - char *x = (char*)safe_malloc_add_2op_(size, /*+*/1); - if(x) { - memcpy(x, s, size); - x[size] = '\0'; - } - return x; -} - -static FLAC__bool local__parse_type_(const char *s, size_t len, FLAC__StreamMetadata_Picture *picture) -{ - size_t i; - FLAC__uint32 val = 0; - - picture->type = FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER; - - if(len == 0) - return true; /* empty string implies default to 'front cover' */ - - for(i = 0; i < len; i++) { - if(s[i] >= '0' && s[i] <= '9') - val = 10*val + (FLAC__uint32)(s[i] - '0'); - else - return false; - } - - if(i == len) - picture->type = val; - else - return false; - - return true; -} - -static FLAC__bool local__parse_resolution_(const char *s, size_t len, FLAC__StreamMetadata_Picture *picture) -{ - int state = 0; - size_t i; - FLAC__uint32 val = 0; - - picture->width = picture->height = picture->depth = picture->colors = 0; - - if(len == 0) - return true; /* empty string implies client wants to get info from the file itself */ - - for(i = 0; i < len; i++) { - if(s[i] == 'x') { - if(state == 0) - picture->width = val; - else if(state == 1) - picture->height = val; - else - return false; - state++; - val = 0; - } - else if(s[i] == '/') { - if(state == 2) - picture->depth = val; - else - return false; - state++; - val = 0; - } - else if(s[i] >= '0' && s[i] <= '9') - val = 10*val + (FLAC__uint32)(s[i] - '0'); - else - return false; - } - - if(state < 2) - return false; - else if(state == 2) - picture->depth = val; - else if(state == 3) - picture->colors = val; - else - return false; - if(picture->depth < 32 && 1u<<picture->depth < picture->colors) - return false; - - return true; -} - -static FLAC__bool local__extract_mime_type_(FLAC__StreamMetadata *obj) -{ - if(obj->data.picture.data_length >= 8 && 0 == memcmp(obj->data.picture.data, "\x89PNG\x0d\x0a\x1a\x0a", 8)) - return FLAC__metadata_object_picture_set_mime_type(obj, "image/png", /*copy=*/true); - else if(obj->data.picture.data_length >= 6 && (0 == memcmp(obj->data.picture.data, "GIF87a", 6) || 0 == memcmp(obj->data.picture.data, "GIF89a", 6))) - return FLAC__metadata_object_picture_set_mime_type(obj, "image/gif", /*copy=*/true); - else if(obj->data.picture.data_length >= 2 && 0 == memcmp(obj->data.picture.data, "\xff\xd8", 2)) - return FLAC__metadata_object_picture_set_mime_type(obj, "image/jpeg", /*copy=*/true); - return false; -} - -static FLAC__bool local__extract_resolution_color_info_(FLAC__StreamMetadata_Picture *picture) -{ - const FLAC__byte *data = picture->data; - FLAC__uint32 len = picture->data_length; - - if(0 == strcmp(picture->mime_type, "image/png")) { - /* c.f. http://www.w3.org/TR/PNG/ */ - FLAC__bool need_palette = false; /* if IHDR has color_type=3, we need to also read the PLTE chunk to get the #colors */ - if(len < 8 || memcmp(data, "\x89PNG\x0d\x0a\x1a\x0a", 8)) - return false; - /* try to find IHDR chunk */ - data += 8; - len -= 8; - while(len > 12) { /* every PNG chunk must be at least 12 bytes long */ - const FLAC__uint32 clen = (FLAC__uint32)data[0] << 24 | (FLAC__uint32)data[1] << 16 | (FLAC__uint32)data[2] << 8 | (FLAC__uint32)data[3]; - if(0 == memcmp(data+4, "IHDR", 4) && clen == 13) { - unsigned color_type = data[17]; - picture->width = (FLAC__uint32)data[8] << 24 | (FLAC__uint32)data[9] << 16 | (FLAC__uint32)data[10] << 8 | (FLAC__uint32)data[11]; - picture->height = (FLAC__uint32)data[12] << 24 | (FLAC__uint32)data[13] << 16 | (FLAC__uint32)data[14] << 8 | (FLAC__uint32)data[15]; - if(color_type == 3) { - /* even though the bit depth for color_type==3 can be 1,2,4,or 8, - * the spec in 11.2.2 of http://www.w3.org/TR/PNG/ says that the - * sample depth is always 8 - */ - picture->depth = 8 * 3u; - need_palette = true; - data += 12 + clen; - len -= 12 + clen; - } - else { - if(color_type == 0) /* greyscale, 1 sample per pixel */ - picture->depth = (FLAC__uint32)data[16]; - if(color_type == 2) /* truecolor, 3 samples per pixel */ - picture->depth = (FLAC__uint32)data[16] * 3u; - if(color_type == 4) /* greyscale+alpha, 2 samples per pixel */ - picture->depth = (FLAC__uint32)data[16] * 2u; - if(color_type == 6) /* truecolor+alpha, 4 samples per pixel */ - picture->depth = (FLAC__uint32)data[16] * 4u; - picture->colors = 0; - return true; - } - } - else if(need_palette && 0 == memcmp(data+4, "PLTE", 4)) { - picture->colors = clen / 3u; - return true; - } - else if(clen + 12 > len) - return false; - else { - data += 12 + clen; - len -= 12 + clen; - } - } - } - else if(0 == strcmp(picture->mime_type, "image/jpeg")) { - /* c.f. http://www.w3.org/Graphics/JPEG/itu-t81.pdf and Q22 of http://www.faqs.org/faqs/jpeg-faq/part1/ */ - if(len < 2 || memcmp(data, "\xff\xd8", 2)) - return false; - data += 2; - len -= 2; - while(1) { - /* look for sync FF byte */ - for( ; len > 0; data++, len--) { - if(*data == 0xff) - break; - } - if(len == 0) - return false; - /* eat any extra pad FF bytes before marker */ - for( ; len > 0; data++, len--) { - if(*data != 0xff) - break; - } - if(len == 0) - return false; - /* if we hit SOS or EOI, bail */ - if(*data == 0xda || *data == 0xd9) - return false; - /* looking for some SOFn */ - else if(memchr("\xc0\xc1\xc2\xc3\xc5\xc6\xc7\xc9\xca\xcb\xcd\xce\xcf", *data, 13)) { - data++; len--; /* skip marker byte */ - if(len < 2) - return false; - else { - const FLAC__uint32 clen = (FLAC__uint32)data[0] << 8 | (FLAC__uint32)data[1]; - if(clen < 8 || len < clen) - return false; - picture->width = (FLAC__uint32)data[5] << 8 | (FLAC__uint32)data[6]; - picture->height = (FLAC__uint32)data[3] << 8 | (FLAC__uint32)data[4]; - picture->depth = (FLAC__uint32)data[2] * (FLAC__uint32)data[7]; - picture->colors = 0; - return true; - } - } - /* else skip it */ - else { - data++; len--; /* skip marker byte */ - if(len < 2) - return false; - else { - const FLAC__uint32 clen = (FLAC__uint32)data[0] << 8 | (FLAC__uint32)data[1]; - if(clen < 2 || len < clen) - return false; - data += clen; - len -= clen; - } - } - } - } - else if(0 == strcmp(picture->mime_type, "image/gif")) { - /* c.f. http://www.w3.org/Graphics/GIF/spec-gif89a.txt */ - if(len < 14) - return false; - if(memcmp(data, "GIF87a", 6) && memcmp(data, "GIF89a", 6)) - return false; -#if 0 - /* according to the GIF spec, even if the GCTF is 0, the low 3 bits should still tell the total # colors used */ - if(data[10] & 0x80 == 0) - return false; -#endif - picture->width = (FLAC__uint32)data[6] | ((FLAC__uint32)data[7] << 8); - picture->height = (FLAC__uint32)data[8] | ((FLAC__uint32)data[9] << 8); -#if 0 - /* this value doesn't seem to be reliable... */ - picture->depth = (((FLAC__uint32)(data[10] & 0x70) >> 4) + 1) * 3u; -#else - /* ...just pessimistically assume it's 24-bit color without scanning all the color tables */ - picture->depth = 8u * 3u; -#endif - picture->colors = 1u << ((FLAC__uint32)(data[10] & 0x07) + 1u); - return true; - } - return false; -} - -FLAC__StreamMetadata *grabbag__picture_parse_specification(const char *spec, const char **error_message) -{ - FLAC__StreamMetadata *obj; - int state = 0; - static const char *error_messages[] = { - "memory allocation error", - "invalid picture specification", - "invalid picture specification: can't parse resolution/color part", - "unable to extract resolution and color info from URL, user must set explicitly", - "unable to extract resolution and color info from file, user must set explicitly", - "error opening picture file", - "error reading picture file", - "invalid picture type", - "unable to guess MIME type from file, user must set explicitly", - "type 1 icon must be a 32x32 pixel PNG" - }; - - FLAC__ASSERT(0 != spec); - FLAC__ASSERT(0 != error_message); - - /* double protection */ - if(0 == spec) - return 0; - if(0 == error_message) - return 0; - - *error_message = 0; - - if(0 == (obj = FLAC__metadata_object_new(FLAC__METADATA_TYPE_PICTURE))) - *error_message = error_messages[0]; - - if(strchr(spec, '|')) { /* full format */ - const char *p; - char *q; - for(p = spec; *error_message==0 && *p; ) { - if(*p == '|') { - switch(state) { - case 0: /* type */ - if(!local__parse_type_(spec, p-spec, &obj->data.picture)) - *error_message = error_messages[7]; - break; - case 1: /* mime type */ - if(p-spec) { /* if blank, we'll try to guess later from the picture data */ - if(0 == (q = local__strndup_(spec, p-spec))) - *error_message = error_messages[0]; - else if(!FLAC__metadata_object_picture_set_mime_type(obj, q, /*copy=*/false)) - *error_message = error_messages[0]; - } - break; - case 2: /* description */ - if(0 == (q = local__strndup_(spec, p-spec))) - *error_message = error_messages[0]; - else if(!FLAC__metadata_object_picture_set_description(obj, (FLAC__byte*)q, /*copy=*/false)) - *error_message = error_messages[0]; - break; - case 3: /* resolution/color (e.g. [300x300x16[/1234]] */ - if(!local__parse_resolution_(spec, p-spec, &obj->data.picture)) - *error_message = error_messages[2]; - break; - default: - *error_message = error_messages[1]; - break; - } - p++; - spec = p; - state++; - } - else - p++; - } - } - else { /* simple format, filename only, everything else guessed */ - if(!local__parse_type_("", 0, &obj->data.picture)) /* use default picture type */ - *error_message = error_messages[7]; - /* leave MIME type to be filled in later */ - /* leave description empty */ - /* leave the rest to be filled in later: */ - else if(!local__parse_resolution_("", 0, &obj->data.picture)) - *error_message = error_messages[2]; - else - state = 4; - } - - /* parse filename, read file, try to extract resolution/color info if needed */ - if(*error_message == 0) { - if(state != 4) - *error_message = error_messages[1]; - else { /* 'spec' points to filename/URL */ - if(0 == strcmp(obj->data.picture.mime_type, "-->")) { /* magic MIME type means URL */ - if(!FLAC__metadata_object_picture_set_data(obj, (FLAC__byte*)spec, strlen(spec), /*copy=*/true)) - *error_message = error_messages[0]; - else if(obj->data.picture.width == 0 || obj->data.picture.height == 0 || obj->data.picture.depth == 0) - *error_message = error_messages[3]; - } - else { /* regular picture file */ - const off_t size = grabbag__file_get_filesize(spec); - if(size < 0) - *error_message = error_messages[5]; - else { - FLAC__byte *buffer = (FLAC__byte*)safe_malloc_(size); - if(0 == buffer) - *error_message = error_messages[0]; - else { - FILE *f = fopen(spec, "rb"); - if(0 == f) - *error_message = error_messages[5]; - else { - if(fread(buffer, 1, size, f) != (size_t)size) - *error_message = error_messages[6]; - fclose(f); - if(0 == *error_message) { - if(!FLAC__metadata_object_picture_set_data(obj, buffer, size, /*copy=*/false)) - *error_message = error_messages[6]; - /* try to extract MIME type if user left it blank */ - else if(*obj->data.picture.mime_type == '\0' && !local__extract_mime_type_(obj)) - *error_message = error_messages[8]; - /* try to extract resolution/color info if user left it blank */ - else if((obj->data.picture.width == 0 || obj->data.picture.height == 0 || obj->data.picture.depth == 0) && !local__extract_resolution_color_info_(&obj->data.picture)) - *error_message = error_messages[4]; - } - } - } - } - } - } - } - - if(*error_message == 0) { - if( - obj->data.picture.type == FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD && - ( - (strcmp(obj->data.picture.mime_type, "image/png") && strcmp(obj->data.picture.mime_type, "-->")) || - obj->data.picture.width != 32 || - obj->data.picture.height != 32 - ) - ) - *error_message = error_messages[9]; - } - - if(*error_message && obj) { - FLAC__metadata_object_delete(obj); - obj = 0; - } - - return obj; -} diff --git a/3rdparty/libflac/src/share/grabbag/replaygain.c b/3rdparty/libflac/src/share/grabbag/replaygain.c deleted file mode 100644 index b3d3d210e38..00000000000 --- a/3rdparty/libflac/src/share/grabbag/replaygain.c +++ /dev/null @@ -1,668 +0,0 @@ -/* grabbag - Convenience lib for various routines common to several tools - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "share/grabbag.h" -#include "share/replaygain_analysis.h" -#include "FLAC/assert.h" -#include "FLAC/metadata.h" -#include "FLAC/stream_decoder.h" -#include <locale.h> -#include <math.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#if defined _MSC_VER || defined __MINGW32__ -#include <io.h> /* for chmod() */ -#endif -#include <sys/stat.h> /* for stat(), maybe chmod() */ - -#ifdef local_min -#undef local_min -#endif -#define local_min(a,b) ((a)<(b)?(a):(b)) - -#ifdef local_max -#undef local_max -#endif -#define local_max(a,b) ((a)>(b)?(a):(b)) - -static const char *reference_format_ = "%s=%2.1f dB"; -static const char *gain_format_ = "%s=%+2.2f dB"; -static const char *peak_format_ = "%s=%1.8f"; - -static double album_peak_, title_peak_; - -const unsigned GRABBAG__REPLAYGAIN_MAX_TAG_SPACE_REQUIRED = 190; -/* - FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN/8 + 29 + 1 + 8 + - FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN/8 + 21 + 1 + 10 + - FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN/8 + 21 + 1 + 12 + - FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN/8 + 21 + 1 + 10 + - FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN/8 + 21 + 1 + 12 -*/ - -const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_REFERENCE_LOUDNESS = (const FLAC__byte * const)"REPLAYGAIN_REFERENCE_LOUDNESS"; -const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_TITLE_GAIN = (const FLAC__byte * const)"REPLAYGAIN_TRACK_GAIN"; -const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_TITLE_PEAK = (const FLAC__byte * const)"REPLAYGAIN_TRACK_PEAK"; -const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_ALBUM_GAIN = (const FLAC__byte * const)"REPLAYGAIN_ALBUM_GAIN"; -const FLAC__byte * const GRABBAG__REPLAYGAIN_TAG_ALBUM_PEAK = (const FLAC__byte * const)"REPLAYGAIN_ALBUM_PEAK"; - - -static FLAC__bool get_file_stats_(const char *filename, struct stat *stats) -{ - FLAC__ASSERT(0 != filename); - FLAC__ASSERT(0 != stats); - return (0 == stat(filename, stats)); -} - -static void set_file_stats_(const char *filename, struct stat *stats) -{ - FLAC__ASSERT(0 != filename); - FLAC__ASSERT(0 != stats); - - (void)chmod(filename, stats->st_mode); -} - -static FLAC__bool append_tag_(FLAC__StreamMetadata *block, const char *format, const FLAC__byte *name, float value) -{ - char buffer[256]; - char *saved_locale; - FLAC__StreamMetadata_VorbisComment_Entry entry; - - FLAC__ASSERT(0 != block); - FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - FLAC__ASSERT(0 != format); - FLAC__ASSERT(0 != name); - - buffer[sizeof(buffer)-1] = '\0'; - /* - * We need to save the old locale and switch to "C" because the locale - * influences the formatting of %f and we want it a certain way. - */ - saved_locale = strdup(setlocale(LC_ALL, 0)); - if (0 == saved_locale) - return false; - setlocale(LC_ALL, "C"); -#if defined _MSC_VER || defined __MINGW32__ - _snprintf(buffer, sizeof(buffer)-1, format, name, value); -#else - snprintf(buffer, sizeof(buffer)-1, format, name, value); -#endif - setlocale(LC_ALL, saved_locale); - free(saved_locale); - - entry.entry = (FLAC__byte *)buffer; - entry.length = strlen(buffer); - - return FLAC__metadata_object_vorbiscomment_append_comment(block, entry, /*copy=*/true); -} - -FLAC__bool grabbag__replaygain_is_valid_sample_frequency(unsigned sample_frequency) -{ - static const unsigned valid_sample_rates[] = { - 8000, - 11025, - 12000, - 16000, - 22050, - 24000, - 32000, - 44100, - 48000 - }; - static const unsigned n_valid_sample_rates = sizeof(valid_sample_rates) / sizeof(valid_sample_rates[0]); - - unsigned i; - - for(i = 0; i < n_valid_sample_rates; i++) - if(sample_frequency == valid_sample_rates[i]) - return true; - return false; -} - -FLAC__bool grabbag__replaygain_init(unsigned sample_frequency) -{ - title_peak_ = album_peak_ = 0.0; - return InitGainAnalysis((long)sample_frequency) == INIT_GAIN_ANALYSIS_OK; -} - -FLAC__bool grabbag__replaygain_analyze(const FLAC__int32 * const input[], FLAC__bool is_stereo, unsigned bps, unsigned samples) -{ - /* using a small buffer improves data locality; we'd like it to fit easily in the dcache */ - static Float_t lbuffer[2048], rbuffer[2048]; - static const unsigned nbuffer = sizeof(lbuffer) / sizeof(lbuffer[0]); - FLAC__int32 block_peak = 0, s; - unsigned i, j; - - FLAC__ASSERT(bps >= 4 && bps <= FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE); - FLAC__ASSERT(FLAC__MIN_BITS_PER_SAMPLE == 4); - /* - * We use abs() on a FLAC__int32 which is undefined for the most negative value. - * If the reference codec ever handles 32bps we will have to write a special - * case here. - */ - FLAC__ASSERT(FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE < 32); - - if(bps == 16) { - if(is_stereo) { - j = 0; - while(samples > 0) { - const unsigned n = local_min(samples, nbuffer); - for(i = 0; i < n; i++, j++) { - s = input[0][j]; - lbuffer[i] = (Float_t)s; - s = abs(s); - block_peak = local_max(block_peak, s); - - s = input[1][j]; - rbuffer[i] = (Float_t)s; - s = abs(s); - block_peak = local_max(block_peak, s); - } - samples -= n; - if(AnalyzeSamples(lbuffer, rbuffer, n, 2) != GAIN_ANALYSIS_OK) - return false; - } - } - else { - j = 0; - while(samples > 0) { - const unsigned n = local_min(samples, nbuffer); - for(i = 0; i < n; i++, j++) { - s = input[0][j]; - lbuffer[i] = (Float_t)s; - s = abs(s); - block_peak = local_max(block_peak, s); - } - samples -= n; - if(AnalyzeSamples(lbuffer, 0, n, 1) != GAIN_ANALYSIS_OK) - return false; - } - } - } - else { /* bps must be < 32 according to above assertion */ - const double scale = ( - (bps > 16)? - (double)1. / (double)(1u << (bps - 16)) : - (double)(1u << (16 - bps)) - ); - - if(is_stereo) { - j = 0; - while(samples > 0) { - const unsigned n = local_min(samples, nbuffer); - for(i = 0; i < n; i++, j++) { - s = input[0][j]; - lbuffer[i] = (Float_t)(scale * (double)s); - s = abs(s); - block_peak = local_max(block_peak, s); - - s = input[1][j]; - rbuffer[i] = (Float_t)(scale * (double)s); - s = abs(s); - block_peak = local_max(block_peak, s); - } - samples -= n; - if(AnalyzeSamples(lbuffer, rbuffer, n, 2) != GAIN_ANALYSIS_OK) - return false; - } - } - else { - j = 0; - while(samples > 0) { - const unsigned n = local_min(samples, nbuffer); - for(i = 0; i < n; i++, j++) { - s = input[0][j]; - lbuffer[i] = (Float_t)(scale * (double)s); - s = abs(s); - block_peak = local_max(block_peak, s); - } - samples -= n; - if(AnalyzeSamples(lbuffer, 0, n, 1) != GAIN_ANALYSIS_OK) - return false; - } - } - } - - { - const double peak_scale = (double)(1u << (bps - 1)); - double peak = (double)block_peak / peak_scale; - if(peak > title_peak_) - title_peak_ = peak; - if(peak > album_peak_) - album_peak_ = peak; - } - - return true; -} - -void grabbag__replaygain_get_album(float *gain, float *peak) -{ - *gain = (float)GetAlbumGain(); - *peak = (float)album_peak_; - album_peak_ = 0.0; -} - -void grabbag__replaygain_get_title(float *gain, float *peak) -{ - *gain = (float)GetTitleGain(); - *peak = (float)title_peak_; - title_peak_ = 0.0; -} - - -typedef struct { - unsigned channels; - unsigned bits_per_sample; - unsigned sample_rate; - FLAC__bool error; -} DecoderInstance; - -static FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data) -{ - DecoderInstance *instance = (DecoderInstance*)client_data; - const unsigned bits_per_sample = frame->header.bits_per_sample; - const unsigned channels = frame->header.channels; - const unsigned sample_rate = frame->header.sample_rate; - const unsigned samples = frame->header.blocksize; - - (void)decoder; - - if( - !instance->error && - (channels == 2 || channels == 1) && - bits_per_sample == instance->bits_per_sample && - channels == instance->channels && - sample_rate == instance->sample_rate - ) { - instance->error = !grabbag__replaygain_analyze(buffer, channels==2, bits_per_sample, samples); - } - else { - instance->error = true; - } - - if(!instance->error) - return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; - else - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; -} - -static void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) -{ - DecoderInstance *instance = (DecoderInstance*)client_data; - - (void)decoder; - - if(metadata->type == FLAC__METADATA_TYPE_STREAMINFO) { - instance->bits_per_sample = metadata->data.stream_info.bits_per_sample; - instance->channels = metadata->data.stream_info.channels; - instance->sample_rate = metadata->data.stream_info.sample_rate; - - if(instance->channels != 1 && instance->channels != 2) { - instance->error = true; - return; - } - - if(!grabbag__replaygain_is_valid_sample_frequency(instance->sample_rate)) { - instance->error = true; - return; - } - } -} - -static void error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) -{ - DecoderInstance *instance = (DecoderInstance*)client_data; - - (void)decoder, (void)status; - - instance->error = true; -} - -const char *grabbag__replaygain_analyze_file(const char *filename, float *title_gain, float *title_peak) -{ - DecoderInstance instance; - FLAC__StreamDecoder *decoder = FLAC__stream_decoder_new(); - - if(0 == decoder) - return "memory allocation error"; - - instance.error = false; - - /* It does these three by default but lets be explicit: */ - FLAC__stream_decoder_set_md5_checking(decoder, false); - FLAC__stream_decoder_set_metadata_ignore_all(decoder); - FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_STREAMINFO); - - if(FLAC__stream_decoder_init_file(decoder, filename, write_callback_, metadata_callback_, error_callback_, &instance) != FLAC__STREAM_DECODER_INIT_STATUS_OK) { - FLAC__stream_decoder_delete(decoder); - return "initializing decoder"; - } - - if(!FLAC__stream_decoder_process_until_end_of_stream(decoder) || instance.error) { - FLAC__stream_decoder_delete(decoder); - return "decoding file"; - } - - FLAC__stream_decoder_delete(decoder); - - grabbag__replaygain_get_title(title_gain, title_peak); - - return 0; -} - -const char *grabbag__replaygain_store_to_vorbiscomment(FLAC__StreamMetadata *block, float album_gain, float album_peak, float title_gain, float title_peak) -{ - const char *error; - - if(0 != (error = grabbag__replaygain_store_to_vorbiscomment_reference(block))) - return error; - - if(0 != (error = grabbag__replaygain_store_to_vorbiscomment_title(block, title_gain, title_peak))) - return error; - - if(0 != (error = grabbag__replaygain_store_to_vorbiscomment_album(block, album_gain, album_peak))) - return error; - - return 0; -} - -const char *grabbag__replaygain_store_to_vorbiscomment_reference(FLAC__StreamMetadata *block) -{ - FLAC__ASSERT(0 != block); - FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - - if(FLAC__metadata_object_vorbiscomment_remove_entries_matching(block, (const char *)GRABBAG__REPLAYGAIN_TAG_REFERENCE_LOUDNESS) < 0) - return "memory allocation error"; - - if(!append_tag_(block, reference_format_, GRABBAG__REPLAYGAIN_TAG_REFERENCE_LOUDNESS, ReplayGainReferenceLoudness)) - return "memory allocation error"; - - return 0; -} - -const char *grabbag__replaygain_store_to_vorbiscomment_album(FLAC__StreamMetadata *block, float album_gain, float album_peak) -{ - FLAC__ASSERT(0 != block); - FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - - if( - FLAC__metadata_object_vorbiscomment_remove_entries_matching(block, (const char *)GRABBAG__REPLAYGAIN_TAG_ALBUM_GAIN) < 0 || - FLAC__metadata_object_vorbiscomment_remove_entries_matching(block, (const char *)GRABBAG__REPLAYGAIN_TAG_ALBUM_PEAK) < 0 - ) - return "memory allocation error"; - - if( - !append_tag_(block, gain_format_, GRABBAG__REPLAYGAIN_TAG_ALBUM_GAIN, album_gain) || - !append_tag_(block, peak_format_, GRABBAG__REPLAYGAIN_TAG_ALBUM_PEAK, album_peak) - ) - return "memory allocation error"; - - return 0; -} - -const char *grabbag__replaygain_store_to_vorbiscomment_title(FLAC__StreamMetadata *block, float title_gain, float title_peak) -{ - FLAC__ASSERT(0 != block); - FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - - if( - FLAC__metadata_object_vorbiscomment_remove_entries_matching(block, (const char *)GRABBAG__REPLAYGAIN_TAG_TITLE_GAIN) < 0 || - FLAC__metadata_object_vorbiscomment_remove_entries_matching(block, (const char *)GRABBAG__REPLAYGAIN_TAG_TITLE_PEAK) < 0 - ) - return "memory allocation error"; - - if( - !append_tag_(block, gain_format_, GRABBAG__REPLAYGAIN_TAG_TITLE_GAIN, title_gain) || - !append_tag_(block, peak_format_, GRABBAG__REPLAYGAIN_TAG_TITLE_PEAK, title_peak) - ) - return "memory allocation error"; - - return 0; -} - -static const char *store_to_file_pre_(const char *filename, FLAC__Metadata_Chain **chain, FLAC__StreamMetadata **block) -{ - FLAC__Metadata_Iterator *iterator; - const char *error; - FLAC__bool found_vc_block = false; - - if(0 == (*chain = FLAC__metadata_chain_new())) - return "memory allocation error"; - - if(!FLAC__metadata_chain_read(*chain, filename)) { - error = FLAC__Metadata_ChainStatusString[FLAC__metadata_chain_status(*chain)]; - FLAC__metadata_chain_delete(*chain); - return error; - } - - if(0 == (iterator = FLAC__metadata_iterator_new())) { - FLAC__metadata_chain_delete(*chain); - return "memory allocation error"; - } - - FLAC__metadata_iterator_init(iterator, *chain); - - do { - *block = FLAC__metadata_iterator_get_block(iterator); - if((*block)->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) - found_vc_block = true; - } while(!found_vc_block && FLAC__metadata_iterator_next(iterator)); - - if(!found_vc_block) { - /* create a new block */ - *block = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT); - if(0 == *block) { - FLAC__metadata_chain_delete(*chain); - FLAC__metadata_iterator_delete(iterator); - return "memory allocation error"; - } - while(FLAC__metadata_iterator_next(iterator)) - ; - if(!FLAC__metadata_iterator_insert_block_after(iterator, *block)) { - error = FLAC__Metadata_ChainStatusString[FLAC__metadata_chain_status(*chain)]; - FLAC__metadata_chain_delete(*chain); - FLAC__metadata_iterator_delete(iterator); - return error; - } - /* iterator is left pointing to new block */ - FLAC__ASSERT(FLAC__metadata_iterator_get_block(iterator) == *block); - } - - FLAC__metadata_iterator_delete(iterator); - - FLAC__ASSERT(0 != *block); - FLAC__ASSERT((*block)->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - - return 0; -} - -static const char *store_to_file_post_(const char *filename, FLAC__Metadata_Chain *chain, FLAC__bool preserve_modtime) -{ - struct stat stats; - const FLAC__bool have_stats = get_file_stats_(filename, &stats); - - (void)grabbag__file_change_stats(filename, /*read_only=*/false); - - FLAC__metadata_chain_sort_padding(chain); - if(!FLAC__metadata_chain_write(chain, /*use_padding=*/true, preserve_modtime)) { - FLAC__metadata_chain_delete(chain); - return FLAC__Metadata_ChainStatusString[FLAC__metadata_chain_status(chain)]; - } - - FLAC__metadata_chain_delete(chain); - - if(have_stats) - set_file_stats_(filename, &stats); - - return 0; -} - -const char *grabbag__replaygain_store_to_file(const char *filename, float album_gain, float album_peak, float title_gain, float title_peak, FLAC__bool preserve_modtime) -{ - FLAC__Metadata_Chain *chain; - FLAC__StreamMetadata *block; - const char *error; - - if(0 != (error = store_to_file_pre_(filename, &chain, &block))) - return error; - - if(0 != (error = grabbag__replaygain_store_to_vorbiscomment(block, album_gain, album_peak, title_gain, title_peak))) { - FLAC__metadata_chain_delete(chain); - return error; - } - - if(0 != (error = store_to_file_post_(filename, chain, preserve_modtime))) - return error; - - return 0; -} - -const char *grabbag__replaygain_store_to_file_reference(const char *filename, FLAC__bool preserve_modtime) -{ - FLAC__Metadata_Chain *chain; - FLAC__StreamMetadata *block; - const char *error; - - if(0 != (error = store_to_file_pre_(filename, &chain, &block))) - return error; - - if(0 != (error = grabbag__replaygain_store_to_vorbiscomment_reference(block))) { - FLAC__metadata_chain_delete(chain); - return error; - } - - if(0 != (error = store_to_file_post_(filename, chain, preserve_modtime))) - return error; - - return 0; -} - -const char *grabbag__replaygain_store_to_file_album(const char *filename, float album_gain, float album_peak, FLAC__bool preserve_modtime) -{ - FLAC__Metadata_Chain *chain; - FLAC__StreamMetadata *block; - const char *error; - - if(0 != (error = store_to_file_pre_(filename, &chain, &block))) - return error; - - if(0 != (error = grabbag__replaygain_store_to_vorbiscomment_album(block, album_gain, album_peak))) { - FLAC__metadata_chain_delete(chain); - return error; - } - - if(0 != (error = store_to_file_post_(filename, chain, preserve_modtime))) - return error; - - return 0; -} - -const char *grabbag__replaygain_store_to_file_title(const char *filename, float title_gain, float title_peak, FLAC__bool preserve_modtime) -{ - FLAC__Metadata_Chain *chain; - FLAC__StreamMetadata *block; - const char *error; - - if(0 != (error = store_to_file_pre_(filename, &chain, &block))) - return error; - - if(0 != (error = grabbag__replaygain_store_to_vorbiscomment_title(block, title_gain, title_peak))) { - FLAC__metadata_chain_delete(chain); - return error; - } - - if(0 != (error = store_to_file_post_(filename, chain, preserve_modtime))) - return error; - - return 0; -} - -static FLAC__bool parse_double_(const FLAC__StreamMetadata_VorbisComment_Entry *entry, double *val) -{ - char s[32], *end; - const char *p, *q; - double v; - - FLAC__ASSERT(0 != entry); - FLAC__ASSERT(0 != val); - - p = (const char *)entry->entry; - q = strchr(p, '='); - if(0 == q) - return false; - q++; - memset(s, 0, sizeof(s)-1); - strncpy(s, q, local_min(sizeof(s)-1, entry->length - (q-p))); - - v = strtod(s, &end); - if(end == s) - return false; - - *val = v; - return true; -} - -FLAC__bool grabbag__replaygain_load_from_vorbiscomment(const FLAC__StreamMetadata *block, FLAC__bool album_mode, FLAC__bool strict, double *reference, double *gain, double *peak) -{ - int reference_offset, gain_offset, peak_offset; - - FLAC__ASSERT(0 != block); - FLAC__ASSERT(0 != reference); - FLAC__ASSERT(0 != gain); - FLAC__ASSERT(0 != peak); - FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_VORBIS_COMMENT); - - /* Default to current level until overridden by a detected tag; this - * will always be true until we change replaygain_analysis.c - */ - *reference = ReplayGainReferenceLoudness; - - if(0 <= (reference_offset = FLAC__metadata_object_vorbiscomment_find_entry_from(block, /*offset=*/0, (const char *)GRABBAG__REPLAYGAIN_TAG_REFERENCE_LOUDNESS))) - (void)parse_double_(block->data.vorbis_comment.comments + reference_offset, reference); - - if(0 > (gain_offset = FLAC__metadata_object_vorbiscomment_find_entry_from(block, /*offset=*/0, (const char *)(album_mode? GRABBAG__REPLAYGAIN_TAG_ALBUM_GAIN : GRABBAG__REPLAYGAIN_TAG_TITLE_GAIN)))) - return !strict && grabbag__replaygain_load_from_vorbiscomment(block, !album_mode, /*strict=*/true, reference, gain, peak); - if(0 > (peak_offset = FLAC__metadata_object_vorbiscomment_find_entry_from(block, /*offset=*/0, (const char *)(album_mode? GRABBAG__REPLAYGAIN_TAG_ALBUM_PEAK : GRABBAG__REPLAYGAIN_TAG_TITLE_PEAK)))) - return !strict && grabbag__replaygain_load_from_vorbiscomment(block, !album_mode, /*strict=*/true, reference, gain, peak); - - if(!parse_double_(block->data.vorbis_comment.comments + gain_offset, gain)) - return !strict && grabbag__replaygain_load_from_vorbiscomment(block, !album_mode, /*strict=*/true, reference, gain, peak); - if(!parse_double_(block->data.vorbis_comment.comments + peak_offset, peak)) - return !strict && grabbag__replaygain_load_from_vorbiscomment(block, !album_mode, /*strict=*/true, reference, gain, peak); - - return true; -} - -double grabbag__replaygain_compute_scale_factor(double peak, double gain, double preamp, FLAC__bool prevent_clipping) -{ - double scale; - FLAC__ASSERT(peak >= 0.0); - gain += preamp; - scale = (float) pow(10.0, gain * 0.05); - if(prevent_clipping && peak > 0.0) { - const double max_scale = (float)(1.0 / peak); - if(scale > max_scale) - scale = max_scale; - } - return scale; -} diff --git a/3rdparty/libflac/src/share/grabbag/seektable.c b/3rdparty/libflac/src/share/grabbag/seektable.c deleted file mode 100644 index 55ac766ed14..00000000000 --- a/3rdparty/libflac/src/share/grabbag/seektable.c +++ /dev/null @@ -1,132 +0,0 @@ -/* grabbag - Convenience lib for various routines common to several tools - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "share/grabbag.h" -#include "FLAC/assert.h" -#include <stdlib.h> /* for atoi() */ -#include <string.h> - -#ifdef _MSC_VER -/* There's no strtoll() in MSVC6 so we just write a specialized one */ -static FLAC__int64 local__strtoll(const char *src, char **endptr) -{ - FLAC__bool neg = false; - FLAC__int64 ret = 0; - int c; - FLAC__ASSERT(0 != src); - if(*src == '-') { - neg = true; - src++; - } - while(0 != (c = *src)) { - c -= '0'; - if(c >= 0 && c <= 9) - ret = (ret * 10) + c; - else - break; - src++; - } - if(endptr) - *endptr = (char*)src; - return neg? -ret : ret; -} -#endif - -FLAC__bool grabbag__seektable_convert_specification_to_template(const char *spec, FLAC__bool only_explicit_placeholders, FLAC__uint64 total_samples_to_encode, unsigned sample_rate, FLAC__StreamMetadata *seektable_template, FLAC__bool *spec_has_real_points) -{ - unsigned i; - const char *pt; - - FLAC__ASSERT(0 != spec); - FLAC__ASSERT(0 != seektable_template); - FLAC__ASSERT(seektable_template->type = FLAC__METADATA_TYPE_SEEKTABLE); - - if(0 != spec_has_real_points) - *spec_has_real_points = false; - - for(pt = spec, i = 0; pt && *pt; i++) { - const char *q = strchr(pt, ';'); - FLAC__ASSERT(0 != q); - - if(q > pt) { - if(0 == strncmp(pt, "X;", 2)) { /* -S X */ - if(!FLAC__metadata_object_seektable_template_append_placeholders(seektable_template, 1)) - return false; - } - else if(q[-1] == 'x') { /* -S #x */ - if(total_samples_to_encode > 0) { /* we can only do these if we know the number of samples to encode up front */ - if(0 != spec_has_real_points) - *spec_has_real_points = true; - if(!only_explicit_placeholders) { - const int n = (unsigned)atoi(pt); - if(n > 0) - if(!FLAC__metadata_object_seektable_template_append_spaced_points(seektable_template, (unsigned)n, total_samples_to_encode)) - return false; - } - } - } - else if(q[-1] == 's') { /* -S #s */ - if(total_samples_to_encode > 0) { /* we can only do these if we know the number of samples to encode up front */ - FLAC__ASSERT(sample_rate > 0); - if(0 != spec_has_real_points) - *spec_has_real_points = true; - if(!only_explicit_placeholders) { - const double sec = atof(pt); - if(sec > 0.0) { - unsigned samples = (unsigned)(sec * (double)sample_rate); - if(samples > 0) { - /* +1 for the initial point at sample 0 */ - if(!FLAC__metadata_object_seektable_template_append_spaced_points_by_samples(seektable_template, samples, total_samples_to_encode)) - return false; - } - } - } - } - } - else { /* -S # */ - if(0 != spec_has_real_points) - *spec_has_real_points = true; - if(!only_explicit_placeholders) { - char *endptr; -#ifdef _MSC_VER - const FLAC__int64 n = local__strtoll(pt, &endptr); -#else - const FLAC__int64 n = (FLAC__int64)strtoll(pt, &endptr, 10); -#endif - if( - (n > 0 || (endptr > pt && *endptr == ';')) && /* is a valid number (extra check needed for "0") */ - (total_samples_to_encode == 0 || (FLAC__uint64)n < total_samples_to_encode) /* number is not >= the known total_samples_to_encode */ - ) - if(!FLAC__metadata_object_seektable_template_append_point(seektable_template, (FLAC__uint64)n)) - return false; - } - } - } - - pt = ++q; - } - - if(!FLAC__metadata_object_seektable_template_sort(seektable_template, /*compact=*/true)) - return false; - - return true; -} diff --git a/3rdparty/libflac/src/share/replaygain_analysis/Makefile.am b/3rdparty/libflac/src/share/replaygain_analysis/Makefile.am deleted file mode 100644 index de841aa78e6..00000000000 --- a/3rdparty/libflac/src/share/replaygain_analysis/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ -## Process this file with automake to produce Makefile.in - -AUTOMAKE_OPTIONS = foreign - -INCLUDES = -I$(top_srcdir)/include/share - -noinst_LTLIBRARIES = libreplaygain_analysis.la - -libreplaygain_analysis_la_SOURCES = replaygain_analysis.c - -EXTRA_DIST = \ - Makefile.lite \ - replaygain_analysis_static.dsp \ - replaygain_analysis_static.vcproj - -debug: - $(MAKE) all CFLAGS="@DEBUG@" - -profile: - $(MAKE) all CFLAGS="@PROFILE@" diff --git a/3rdparty/libflac/src/share/replaygain_analysis/Makefile.in b/3rdparty/libflac/src/share/replaygain_analysis/Makefile.in deleted file mode 100644 index 8c19187b718..00000000000 --- a/3rdparty/libflac/src/share/replaygain_analysis/Makefile.in +++ /dev/null @@ -1,500 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -AUTOMAKE_OPTIONS = foreign - -INCLUDES = -I$(top_srcdir)/include/share - -noinst_LTLIBRARIES = libreplaygain_analysis.la - -libreplaygain_analysis_la_SOURCES = replaygain_analysis.c - -EXTRA_DIST = \ - Makefile.lite \ - replaygain_analysis_static.dsp \ - replaygain_analysis_static.vcproj - -subdir = src/share/replaygain_analysis -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) - -libreplaygain_analysis_la_LDFLAGS = -libreplaygain_analysis_la_LIBADD = -am_libreplaygain_analysis_la_OBJECTS = replaygain_analysis.lo -libreplaygain_analysis_la_OBJECTS = \ - $(am_libreplaygain_analysis_la_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/replaygain_analysis.Plo -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(libreplaygain_analysis_la_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(libreplaygain_analysis_la_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/share/replaygain_analysis/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" = "$$p" && dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libreplaygain_analysis.la: $(libreplaygain_analysis_la_OBJECTS) $(libreplaygain_analysis_la_DEPENDENCIES) - $(LINK) $(libreplaygain_analysis_la_LDFLAGS) $(libreplaygain_analysis_la_OBJECTS) $(libreplaygain_analysis_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/replaygain_analysis.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am - - -debug: - $(MAKE) all CFLAGS="@DEBUG@" - -profile: - $(MAKE) all CFLAGS="@PROFILE@" -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/share/replaygain_analysis/Makefile.lite b/3rdparty/libflac/src/share/replaygain_analysis/Makefile.lite deleted file mode 100644 index 8c4c6982659..00000000000 --- a/3rdparty/libflac/src/share/replaygain_analysis/Makefile.lite +++ /dev/null @@ -1,15 +0,0 @@ -# -# GNU makefile -# - -topdir = ../../.. - -LIB_NAME = libreplaygain_analysis -INCLUDES = -I$(topdir)/include/share - -SRCS_C = \ - replaygain_analysis.c - -include $(topdir)/build/lib.mk - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/3rdparty/libflac/src/share/replaygain_analysis/replaygain_analysis.c b/3rdparty/libflac/src/share/replaygain_analysis/replaygain_analysis.c deleted file mode 100644 index c64231f61da..00000000000 --- a/3rdparty/libflac/src/share/replaygain_analysis/replaygain_analysis.c +++ /dev/null @@ -1,430 +0,0 @@ -/* - * ReplayGainAnalysis - analyzes input samples and give the recommended dB change - * Copyright (C) 2001 David Robinson and Glen Sawyer - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * concept and filter values by David Robinson (David@Robinson.org) - * -- blame him if you think the idea is flawed - * original coding by Glen Sawyer (glensawyer@hotmail.com) - * -- blame him if you think this runs too slowly, or the coding is otherwise flawed - * - * lots of code improvements by Frank Klemm ( http://www.uni-jena.de/~pfk/mpp/ ) - * -- credit him for all the _good_ programming ;) - * - * minor cosmetic tweaks to integrate with FLAC by Josh Coalson - * - * - * For an explanation of the concepts and the basic algorithms involved, go to: - * http://www.replaygain.org/ - */ - -/* - * Here's the deal. Call - * - * InitGainAnalysis ( long samplefreq ); - * - * to initialize everything. Call - * - * AnalyzeSamples ( const Float_t* left_samples, - * const Float_t* right_samples, - * size_t num_samples, - * int num_channels ); - * - * as many times as you want, with as many or as few samples as you want. - * If mono, pass the sample buffer in through left_samples, leave - * right_samples NULL, and make sure num_channels = 1. - * - * GetTitleGain() - * - * will return the recommended dB level change for all samples analyzed - * SINCE THE LAST TIME you called GetTitleGain() OR InitGainAnalysis(). - * - * GetAlbumGain() - * - * will return the recommended dB level change for all samples analyzed - * since InitGainAnalysis() was called and finalized with GetTitleGain(). - * - * Pseudo-code to process an album: - * - * Float_t l_samples [4096]; - * Float_t r_samples [4096]; - * size_t num_samples; - * unsigned int num_songs; - * unsigned int i; - * - * InitGainAnalysis ( 44100 ); - * for ( i = 1; i <= num_songs; i++ ) { - * while ( ( num_samples = getSongSamples ( song[i], left_samples, right_samples ) ) > 0 ) - * AnalyzeSamples ( left_samples, right_samples, num_samples, 2 ); - * fprintf ("Recommended dB change for song %2d: %+6.2f dB\n", i, GetTitleGain() ); - * } - * fprintf ("Recommended dB change for whole album: %+6.2f dB\n", GetAlbumGain() ); - */ - -/* - * So here's the main source of potential code confusion: - * - * The filters applied to the incoming samples are IIR filters, - * meaning they rely on up to <filter order> number of previous samples - * AND up to <filter order> number of previous filtered samples. - * - * I set up the AnalyzeSamples routine to minimize memory usage and interface - * complexity. The speed isn't compromised too much (I don't think), but the - * internal complexity is higher than it should be for such a relatively - * simple routine. - * - * Optimization/clarity suggestions are welcome. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <math.h> - -#include "replaygain_analysis.h" - -Float_t ReplayGainReferenceLoudness = 89.0; /* in dB SPL */ - -typedef unsigned short Uint16_t; -typedef signed short Int16_t; -typedef unsigned int Uint32_t; -typedef signed int Int32_t; - -#define YULE_ORDER 10 -#define BUTTER_ORDER 2 -#define RMS_PERCENTILE 0.95 /* percentile which is louder than the proposed level */ -#define MAX_SAMP_FREQ 48000. /* maximum allowed sample frequency [Hz] */ -#define RMS_WINDOW_TIME 0.050 /* Time slice size [s] */ -#define STEPS_per_dB 100. /* Table entries per dB */ -#define MAX_dB 120. /* Table entries for 0...MAX_dB (normal max. values are 70...80 dB) */ - -#define MAX_ORDER (BUTTER_ORDER > YULE_ORDER ? BUTTER_ORDER : YULE_ORDER) -/* [JEC] the following was originally #defined as: - * (size_t) (MAX_SAMP_FREQ * RMS_WINDOW_TIME) - * but that seemed to fail to take into account the ceil() part of the - * sampleWindow calculation in ResetSampleFrequency(), and was causing - * buffer overflows for 48kHz analysis, hence the +1. - */ -#ifndef __sun - #define MAX_SAMPLES_PER_WINDOW (size_t) (MAX_SAMP_FREQ * RMS_WINDOW_TIME + 1.) /* max. Samples per Time slice */ -#else - /* [JEC] Solaris Forte compiler doesn't like float calc in array indices */ - #define MAX_SAMPLES_PER_WINDOW (size_t) (2401) -#endif -#define PINK_REF 64.82 /* 298640883795 */ /* calibration value */ - -static Float_t linprebuf [MAX_ORDER * 2]; -static Float_t* linpre; /* left input samples, with pre-buffer */ -static Float_t lstepbuf [MAX_SAMPLES_PER_WINDOW + MAX_ORDER]; -static Float_t* lstep; /* left "first step" (i.e. post first filter) samples */ -static Float_t loutbuf [MAX_SAMPLES_PER_WINDOW + MAX_ORDER]; -static Float_t* lout; /* left "out" (i.e. post second filter) samples */ -static Float_t rinprebuf [MAX_ORDER * 2]; -static Float_t* rinpre; /* right input samples ... */ -static Float_t rstepbuf [MAX_SAMPLES_PER_WINDOW + MAX_ORDER]; -static Float_t* rstep; -static Float_t routbuf [MAX_SAMPLES_PER_WINDOW + MAX_ORDER]; -static Float_t* rout; -static unsigned int sampleWindow; /* number of samples required to reach number of milliseconds required for RMS window */ -static unsigned long totsamp; -static double lsum; -static double rsum; -static int freqindex; -#ifndef __sun -static Uint32_t A [(size_t)(STEPS_per_dB * MAX_dB)]; -static Uint32_t B [(size_t)(STEPS_per_dB * MAX_dB)]; -#else -/* [JEC] Solaris Forte compiler doesn't like float calc in array indices */ -static Uint32_t A [12000]; -static Uint32_t B [12000]; -#endif - -/* for each filter: - [0] 48 kHz, [1] 44.1 kHz, [2] 32 kHz, [3] 24 kHz, [4] 22050 Hz, [5] 16 kHz, [6] 12 kHz, [7] is 11025 Hz, [8] 8 kHz */ - -#ifdef WIN32 -#pragma warning ( disable : 4305 ) -#endif - -static const Float_t AYule [9] [11] = { - { 1., -3.84664617118067, 7.81501653005538,-11.34170355132042, 13.05504219327545,-12.28759895145294, 9.48293806319790, -5.87257861775999, 2.75465861874613, -0.86984376593551, 0.13919314567432 }, - { 1., -3.47845948550071, 6.36317777566148, -8.54751527471874, 9.47693607801280, -8.81498681370155, 6.85401540936998, -4.39470996079559, 2.19611684890774, -0.75104302451432, 0.13149317958808 }, - { 1., -2.37898834973084, 2.84868151156327, -2.64577170229825, 2.23697657451713, -1.67148153367602, 1.00595954808547, -0.45953458054983, 0.16378164858596, -0.05032077717131, 0.02347897407020 }, - { 1., -1.61273165137247, 1.07977492259970, -0.25656257754070, -0.16276719120440, -0.22638893773906, 0.39120800788284, -0.22138138954925, 0.04500235387352, 0.02005851806501, 0.00302439095741 }, - { 1., -1.49858979367799, 0.87350271418188, 0.12205022308084, -0.80774944671438, 0.47854794562326, -0.12453458140019, -0.04067510197014, 0.08333755284107, -0.04237348025746, 0.02977207319925 }, - { 1., -0.62820619233671, 0.29661783706366, -0.37256372942400, 0.00213767857124, -0.42029820170918, 0.22199650564824, 0.00613424350682, 0.06747620744683, 0.05784820375801, 0.03222754072173 }, - { 1., -1.04800335126349, 0.29156311971249, -0.26806001042947, 0.00819999645858, 0.45054734505008, -0.33032403314006, 0.06739368333110, -0.04784254229033, 0.01639907836189, 0.01807364323573 }, - { 1., -0.51035327095184, -0.31863563325245, -0.20256413484477, 0.14728154134330, 0.38952639978999, -0.23313271880868, -0.05246019024463, -0.02505961724053, 0.02442357316099, 0.01818801111503 }, - { 1., -0.25049871956020, -0.43193942311114, -0.03424681017675, -0.04678328784242, 0.26408300200955, 0.15113130533216, -0.17556493366449, -0.18823009262115, 0.05477720428674, 0.04704409688120 } -}; - -static const Float_t BYule [9] [11] = { - { 0.03857599435200, -0.02160367184185, -0.00123395316851, -0.00009291677959, -0.01655260341619, 0.02161526843274, -0.02074045215285, 0.00594298065125, 0.00306428023191, 0.00012025322027, 0.00288463683916 }, - { 0.05418656406430, -0.02911007808948, -0.00848709379851, -0.00851165645469, -0.00834990904936, 0.02245293253339, -0.02596338512915, 0.01624864962975, -0.00240879051584, 0.00674613682247, -0.00187763777362 }, - { 0.15457299681924, -0.09331049056315, -0.06247880153653, 0.02163541888798, -0.05588393329856, 0.04781476674921, 0.00222312597743, 0.03174092540049, -0.01390589421898, 0.00651420667831, -0.00881362733839 }, - { 0.30296907319327, -0.22613988682123, -0.08587323730772, 0.03282930172664, -0.00915702933434, -0.02364141202522, -0.00584456039913, 0.06276101321749, -0.00000828086748, 0.00205861885564, -0.02950134983287 }, - { 0.33642304856132, -0.25572241425570, -0.11828570177555, 0.11921148675203, -0.07834489609479, -0.00469977914380, -0.00589500224440, 0.05724228140351, 0.00832043980773, -0.01635381384540, -0.01760176568150 }, - { 0.44915256608450, -0.14351757464547, -0.22784394429749, -0.01419140100551, 0.04078262797139, -0.12398163381748, 0.04097565135648, 0.10478503600251, -0.01863887810927, -0.03193428438915, 0.00541907748707 }, - { 0.56619470757641, -0.75464456939302, 0.16242137742230, 0.16744243493672, -0.18901604199609, 0.30931782841830, -0.27562961986224, 0.00647310677246, 0.08647503780351, -0.03788984554840, -0.00588215443421 }, - { 0.58100494960553, -0.53174909058578, -0.14289799034253, 0.17520704835522, 0.02377945217615, 0.15558449135573, -0.25344790059353, 0.01628462406333, 0.06920467763959, -0.03721611395801, -0.00749618797172 }, - { 0.53648789255105, -0.42163034350696, -0.00275953611929, 0.04267842219415, -0.10214864179676, 0.14590772289388, -0.02459864859345, -0.11202315195388, -0.04060034127000, 0.04788665548180, -0.02217936801134 } -}; - -static const Float_t AButter [9] [3] = { - { 1., -1.97223372919527, 0.97261396931306 }, - { 1., -1.96977855582618, 0.97022847566350 }, - { 1., -1.95835380975398, 0.95920349965459 }, - { 1., -1.95002759149878, 0.95124613669835 }, - { 1., -1.94561023566527, 0.94705070426118 }, - { 1., -1.92783286977036, 0.93034775234268 }, - { 1., -1.91858953033784, 0.92177618768381 }, - { 1., -1.91542108074780, 0.91885558323625 }, - { 1., -1.88903307939452, 0.89487434461664 } -}; - -static const Float_t BButter [9] [3] = { - { 0.98621192462708, -1.97242384925416, 0.98621192462708 }, - { 0.98500175787242, -1.97000351574484, 0.98500175787242 }, - { 0.97938932735214, -1.95877865470428, 0.97938932735214 }, - { 0.97531843204928, -1.95063686409857, 0.97531843204928 }, - { 0.97316523498161, -1.94633046996323, 0.97316523498161 }, - { 0.96454515552826, -1.92909031105652, 0.96454515552826 }, - { 0.96009142950541, -1.92018285901082, 0.96009142950541 }, - { 0.95856916599601, -1.91713833199203, 0.95856916599601 }, - { 0.94597685600279, -1.89195371200558, 0.94597685600279 } -}; - -#ifdef WIN32 -#pragma warning ( default : 4305 ) -#endif - -/* When calling this procedure, make sure that ip[-order] and op[-order] point to real data! */ - -static void -filter ( const Float_t* input, Float_t* output, size_t nSamples, const Float_t* a, const Float_t* b, size_t order ) -{ - double y; - size_t i; - size_t k; - - for ( i = 0; i < nSamples; i++ ) { - y = input[i] * b[0]; - for ( k = 1; k <= order; k++ ) - y += input[i-k] * b[k] - output[i-k] * a[k]; - output[i] = (Float_t)y; - } -} - -/* returns a INIT_GAIN_ANALYSIS_OK if successful, INIT_GAIN_ANALYSIS_ERROR if not */ - -int -ResetSampleFrequency ( long samplefreq ) { - int i; - - /* zero out initial values */ - for ( i = 0; i < MAX_ORDER; i++ ) - linprebuf[i] = lstepbuf[i] = loutbuf[i] = rinprebuf[i] = rstepbuf[i] = routbuf[i] = 0.; - - switch ( (int)(samplefreq) ) { - case 48000: freqindex = 0; break; - case 44100: freqindex = 1; break; - case 32000: freqindex = 2; break; - case 24000: freqindex = 3; break; - case 22050: freqindex = 4; break; - case 16000: freqindex = 5; break; - case 12000: freqindex = 6; break; - case 11025: freqindex = 7; break; - case 8000: freqindex = 8; break; - default: return INIT_GAIN_ANALYSIS_ERROR; - } - - sampleWindow = (int) ceil (samplefreq * RMS_WINDOW_TIME); - - lsum = 0.; - rsum = 0.; - totsamp = 0; - - memset ( A, 0, sizeof(A) ); - - return INIT_GAIN_ANALYSIS_OK; -} - -int -InitGainAnalysis ( long samplefreq ) -{ - if (ResetSampleFrequency(samplefreq) != INIT_GAIN_ANALYSIS_OK) { - return INIT_GAIN_ANALYSIS_ERROR; - } - - linpre = linprebuf + MAX_ORDER; - rinpre = rinprebuf + MAX_ORDER; - lstep = lstepbuf + MAX_ORDER; - rstep = rstepbuf + MAX_ORDER; - lout = loutbuf + MAX_ORDER; - rout = routbuf + MAX_ORDER; - - memset ( B, 0, sizeof(B) ); - - return INIT_GAIN_ANALYSIS_OK; -} - -/* returns GAIN_ANALYSIS_OK if successful, GAIN_ANALYSIS_ERROR if not */ - -int -AnalyzeSamples ( const Float_t* left_samples, const Float_t* right_samples, size_t num_samples, int num_channels ) -{ - const Float_t* curleft; - const Float_t* curright; - long batchsamples; - long cursamples; - long cursamplepos; - int i; - - if ( num_samples == 0 ) - return GAIN_ANALYSIS_OK; - - cursamplepos = 0; - batchsamples = num_samples; - - switch ( num_channels) { - case 1: right_samples = left_samples; - case 2: break; - default: return GAIN_ANALYSIS_ERROR; - } - - if ( num_samples < MAX_ORDER ) { - memcpy ( linprebuf + MAX_ORDER, left_samples , num_samples * sizeof(Float_t) ); - memcpy ( rinprebuf + MAX_ORDER, right_samples, num_samples * sizeof(Float_t) ); - } - else { - memcpy ( linprebuf + MAX_ORDER, left_samples, MAX_ORDER * sizeof(Float_t) ); - memcpy ( rinprebuf + MAX_ORDER, right_samples, MAX_ORDER * sizeof(Float_t) ); - } - - while ( batchsamples > 0 ) { - cursamples = batchsamples > (long)(sampleWindow-totsamp) ? (long)(sampleWindow - totsamp) : batchsamples; - if ( cursamplepos < MAX_ORDER ) { - curleft = linpre+cursamplepos; - curright = rinpre+cursamplepos; - if (cursamples > MAX_ORDER - cursamplepos ) - cursamples = MAX_ORDER - cursamplepos; - } - else { - curleft = left_samples + cursamplepos; - curright = right_samples + cursamplepos; - } - - filter ( curleft , lstep + totsamp, cursamples, AYule[freqindex], BYule[freqindex], YULE_ORDER ); - filter ( curright, rstep + totsamp, cursamples, AYule[freqindex], BYule[freqindex], YULE_ORDER ); - - filter ( lstep + totsamp, lout + totsamp, cursamples, AButter[freqindex], BButter[freqindex], BUTTER_ORDER ); - filter ( rstep + totsamp, rout + totsamp, cursamples, AButter[freqindex], BButter[freqindex], BUTTER_ORDER ); - - for ( i = 0; i < cursamples; i++ ) { /* Get the squared values */ - lsum += lout [totsamp+i] * lout [totsamp+i]; - rsum += rout [totsamp+i] * rout [totsamp+i]; - } - - batchsamples -= cursamples; - cursamplepos += cursamples; - totsamp += cursamples; - if ( totsamp == sampleWindow ) { /* Get the Root Mean Square (RMS) for this set of samples */ - double val = STEPS_per_dB * 10. * log10 ( (lsum+rsum) / totsamp * 0.5 + 1.e-37 ); - int ival = (int) val; - if ( ival < 0 ) ival = 0; - if ( ival >= (int)(sizeof(A)/sizeof(*A)) ) ival = (int)(sizeof(A)/sizeof(*A)) - 1; - A [ival]++; - lsum = rsum = 0.; - memmove ( loutbuf , loutbuf + totsamp, MAX_ORDER * sizeof(Float_t) ); - memmove ( routbuf , routbuf + totsamp, MAX_ORDER * sizeof(Float_t) ); - memmove ( lstepbuf, lstepbuf + totsamp, MAX_ORDER * sizeof(Float_t) ); - memmove ( rstepbuf, rstepbuf + totsamp, MAX_ORDER * sizeof(Float_t) ); - totsamp = 0; - } - if ( totsamp > sampleWindow ) /* somehow I really screwed up: Error in programming! Contact author about totsamp > sampleWindow */ - return GAIN_ANALYSIS_ERROR; - } - if ( num_samples < MAX_ORDER ) { - memmove ( linprebuf, linprebuf + num_samples, (MAX_ORDER-num_samples) * sizeof(Float_t) ); - memmove ( rinprebuf, rinprebuf + num_samples, (MAX_ORDER-num_samples) * sizeof(Float_t) ); - memcpy ( linprebuf + MAX_ORDER - num_samples, left_samples, num_samples * sizeof(Float_t) ); - memcpy ( rinprebuf + MAX_ORDER - num_samples, right_samples, num_samples * sizeof(Float_t) ); - } - else { - memcpy ( linprebuf, left_samples + num_samples - MAX_ORDER, MAX_ORDER * sizeof(Float_t) ); - memcpy ( rinprebuf, right_samples + num_samples - MAX_ORDER, MAX_ORDER * sizeof(Float_t) ); - } - - return GAIN_ANALYSIS_OK; -} - - -static Float_t -analyzeResult ( Uint32_t* Array, size_t len ) -{ - Uint32_t elems; - Int32_t upper; - size_t i; - - elems = 0; - for ( i = 0; i < len; i++ ) - elems += Array[i]; - if ( elems == 0 ) - return GAIN_NOT_ENOUGH_SAMPLES; - - upper = (Int32_t) ceil (elems * (1. - RMS_PERCENTILE)); - for ( i = len; i-- > 0; ) { - if ( (upper -= Array[i]) <= 0 ) - break; - } - - return (Float_t) ((Float_t)PINK_REF - (Float_t)i / (Float_t)STEPS_per_dB); -} - - -Float_t -GetTitleGain ( void ) -{ - Float_t retval; - unsigned int i; - - retval = analyzeResult ( A, sizeof(A)/sizeof(*A) ); - - for ( i = 0; i < sizeof(A)/sizeof(*A); i++ ) { - B[i] += A[i]; - A[i] = 0; - } - - for ( i = 0; i < MAX_ORDER; i++ ) - linprebuf[i] = lstepbuf[i] = loutbuf[i] = rinprebuf[i] = rstepbuf[i] = routbuf[i] = 0.f; - - totsamp = 0; - lsum = rsum = 0.; - return retval; -} - - -Float_t -GetAlbumGain ( void ) -{ - return analyzeResult ( B, sizeof(B)/sizeof(*B) ); -} - -/* end of replaygain_analysis.c */ diff --git a/3rdparty/libflac/src/share/replaygain_analysis/replaygain_analysis_static.dsp b/3rdparty/libflac/src/share/replaygain_analysis/replaygain_analysis_static.dsp deleted file mode 100644 index e4364309d57..00000000000 --- a/3rdparty/libflac/src/share/replaygain_analysis/replaygain_analysis_static.dsp +++ /dev/null @@ -1,108 +0,0 @@ -# Microsoft Developer Studio Project File - Name="replaygain_analysis_static" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=replaygain_analysis_static - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "replaygain_analysis_static.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "replaygain_analysis_static.mak" CFG="replaygain_analysis_static - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "replaygain_analysis_static - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "replaygain_analysis_static - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "replaygain_analysis" -# PROP Scc_LocalPath "..\..\.." -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "replaygain_analysis_static - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\..\obj\release\lib" -# PROP Intermediate_Dir "Release_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /Op /I ".\include" /I "..\..\..\include\share" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /nodefaultlib - -!ELSEIF "$(CFG)" == "replaygain_analysis_static - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\..\obj\debug\lib" -# PROP Intermediate_Dir "Debug_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\include" /I "..\..\..\include\share" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /nodefaultlib - -!ENDIF - -# Begin Target - -# Name "replaygain_analysis_static - Win32 Release" -# Name "replaygain_analysis_static - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "c" -# Begin Source File - -SOURCE=.\replaygain_analysis.c -# End Source File -# End Group -# Begin Group "Private Header Files" - -# PROP Default_Filter "" -# End Group -# Begin Group "Protected Header Files" - -# PROP Default_Filter "" -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\..\include\share\replaygain_analysis.h -# End Source File -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/share/replaygain_analysis/replaygain_analysis_static.vcproj b/3rdparty/libflac/src/share/replaygain_analysis/replaygain_analysis_static.vcproj deleted file mode 100644 index a6ffda29b4a..00000000000 --- a/3rdparty/libflac/src/share/replaygain_analysis/replaygain_analysis_static.vcproj +++ /dev/null @@ -1,181 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="replaygain_analysis_static" - ProjectGUID="{4cefbc89-c215-11db-8314-0800200c9a66}" - RootNamespace="replaygain_analysis_static" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\..\obj\debug\lib" - IntermediateDirectory="Debug_static" - ConfigurationType="4" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".\include;..\..\..\include\share" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;FLAC__NO_DLL;DEBUG" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\..\..\obj\debug\lib\$(ProjectName).lib" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\..\obj\release\lib" - IntermediateDirectory="Release_static" - ConfigurationType="4" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".\include;..\..\..\include\share" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__NO_DLL" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\..\..\obj\release\lib\$(ProjectName).lib" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - </Filter> - <Filter - Name="Public Header Files" - > - <File - RelativePath="..\..\..\include\share\replaygain_analysis.h" - > - </File> - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\replaygain_analysis.c" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/share/replaygain_synthesis/Makefile.am b/3rdparty/libflac/src/share/replaygain_synthesis/Makefile.am deleted file mode 100644 index 4ea9e8a28ae..00000000000 --- a/3rdparty/libflac/src/share/replaygain_synthesis/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -## Process this file with automake to produce Makefile.in - -AUTOMAKE_OPTIONS = foreign - -SUBDIRS = include . - -INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/include/share - -noinst_LTLIBRARIES = libreplaygain_synthesis.la - -libreplaygain_synthesis_la_SOURCES = replaygain_synthesis.c - -EXTRA_DIST = \ - Makefile.lite \ - replaygain_synthesis_static.dsp \ - replaygain_synthesis_static.vcproj - -debug: - $(MAKE) all CFLAGS="@DEBUG@" - -profile: - $(MAKE) all CFLAGS="@PROFILE@" diff --git a/3rdparty/libflac/src/share/replaygain_synthesis/Makefile.in b/3rdparty/libflac/src/share/replaygain_synthesis/Makefile.in deleted file mode 100644 index 7ae61da4732..00000000000 --- a/3rdparty/libflac/src/share/replaygain_synthesis/Makefile.in +++ /dev/null @@ -1,602 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -AUTOMAKE_OPTIONS = foreign - -SUBDIRS = include . - -INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/include/share - -noinst_LTLIBRARIES = libreplaygain_synthesis.la - -libreplaygain_synthesis_la_SOURCES = replaygain_synthesis.c - -EXTRA_DIST = \ - Makefile.lite \ - replaygain_synthesis_static.dsp \ - replaygain_synthesis_static.vcproj - -subdir = src/share/replaygain_synthesis -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) - -libreplaygain_synthesis_la_LDFLAGS = -libreplaygain_synthesis_la_LIBADD = -am_libreplaygain_synthesis_la_OBJECTS = replaygain_synthesis.lo -libreplaygain_synthesis_la_OBJECTS = \ - $(am_libreplaygain_synthesis_la_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/replaygain_synthesis.Plo -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(libreplaygain_synthesis_la_SOURCES) - -RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ - ps-recursive install-info-recursive uninstall-info-recursive \ - all-recursive install-data-recursive install-exec-recursive \ - installdirs-recursive install-recursive uninstall-recursive \ - check-recursive installcheck-recursive -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -DIST_SUBDIRS = $(SUBDIRS) -SOURCES = $(libreplaygain_synthesis_la_SOURCES) - -all: all-recursive - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/share/replaygain_synthesis/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" = "$$p" && dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libreplaygain_synthesis.la: $(libreplaygain_synthesis_la_OBJECTS) $(libreplaygain_synthesis_la_DEPENDENCIES) - $(LINK) $(libreplaygain_synthesis_la_LDFLAGS) $(libreplaygain_synthesis_la_OBJECTS) $(libreplaygain_synthesis_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/replaygain_synthesis.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if (etags --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - else \ - include_option=--include; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile $(LTLIBRARIES) -installdirs: installdirs-recursive -installdirs-am: - -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-recursive - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-recursive - -dvi-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ - clean-generic clean-libtool clean-noinstLTLIBRARIES \ - clean-recursive ctags ctags-recursive distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am \ - dvi-recursive info info-am info-recursive install install-am \ - install-data install-data-am install-data-recursive \ - install-exec install-exec-am install-exec-recursive \ - install-info install-info-am install-info-recursive install-man \ - install-recursive install-strip installcheck installcheck-am \ - installdirs installdirs-am installdirs-recursive \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ - pdf pdf-am pdf-recursive ps ps-am ps-recursive tags \ - tags-recursive uninstall uninstall-am uninstall-info-am \ - uninstall-info-recursive uninstall-recursive - - -debug: - $(MAKE) all CFLAGS="@DEBUG@" - -profile: - $(MAKE) all CFLAGS="@PROFILE@" -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/share/replaygain_synthesis/Makefile.lite b/3rdparty/libflac/src/share/replaygain_synthesis/Makefile.lite deleted file mode 100644 index e58e708821f..00000000000 --- a/3rdparty/libflac/src/share/replaygain_synthesis/Makefile.lite +++ /dev/null @@ -1,15 +0,0 @@ -# -# GNU makefile -# - -topdir = ../../.. - -LIB_NAME = libreplaygain_synthesis -INCLUDES = -I./include -I$(topdir)/include -I$(topdir)/include/share - -SRCS_C = \ - replaygain_synthesis.c - -include $(topdir)/build/lib.mk - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/3rdparty/libflac/src/share/replaygain_synthesis/include/Makefile.am b/3rdparty/libflac/src/share/replaygain_synthesis/include/Makefile.am deleted file mode 100644 index 4418640f410..00000000000 --- a/3rdparty/libflac/src/share/replaygain_synthesis/include/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -# replaygain_synthesis - Routines for applying ReplayGain to a signal -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 - -SUBDIRS = private diff --git a/3rdparty/libflac/src/share/replaygain_synthesis/include/Makefile.in b/3rdparty/libflac/src/share/replaygain_synthesis/include/Makefile.in deleted file mode 100644 index 47c6376ec91..00000000000 --- a/3rdparty/libflac/src/share/replaygain_synthesis/include/Makefile.in +++ /dev/null @@ -1,520 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# replaygain_synthesis - Routines for applying ReplayGain to a signal -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -SUBDIRS = private -subdir = src/share/replaygain_synthesis/include -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = - -RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ - ps-recursive install-info-recursive uninstall-info-recursive \ - all-recursive install-data-recursive install-exec-recursive \ - installdirs-recursive install-recursive uninstall-recursive \ - check-recursive installcheck-recursive -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -DIST_SUBDIRS = $(SUBDIRS) -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/share/replaygain_synthesis/include/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if (etags --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - else \ - include_option=--include; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: - -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags - -dvi: dvi-recursive - -dvi-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ - clean-generic clean-libtool clean-recursive ctags \ - ctags-recursive distclean distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am \ - dvi-recursive info info-am info-recursive install install-am \ - install-data install-data-am install-data-recursive \ - install-exec install-exec-am install-exec-recursive \ - install-info install-info-am install-info-recursive install-man \ - install-recursive install-strip installcheck installcheck-am \ - installdirs installdirs-am installdirs-recursive \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-libtool mostlyclean-recursive pdf pdf-am \ - pdf-recursive ps ps-am ps-recursive tags tags-recursive \ - uninstall uninstall-am uninstall-info-am \ - uninstall-info-recursive uninstall-recursive - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/share/replaygain_synthesis/include/private/Makefile.am b/3rdparty/libflac/src/share/replaygain_synthesis/include/private/Makefile.am deleted file mode 100644 index 081d7ba41b7..00000000000 --- a/3rdparty/libflac/src/share/replaygain_synthesis/include/private/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -# replaygain_synthesis - Routines for applying ReplayGain to a signal -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 - -noinst_HEADERS = \ - fast_float_math_hack.h diff --git a/3rdparty/libflac/src/share/replaygain_synthesis/include/private/Makefile.in b/3rdparty/libflac/src/share/replaygain_synthesis/include/private/Makefile.in deleted file mode 100644 index 95f6bcc9ce7..00000000000 --- a/3rdparty/libflac/src/share/replaygain_synthesis/include/private/Makefile.in +++ /dev/null @@ -1,424 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# replaygain_synthesis - Routines for applying ReplayGain to a signal -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -noinst_HEADERS = \ - fast_float_math_hack.h - -subdir = src/share/replaygain_synthesis/include/private -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = -HEADERS = $(noinst_HEADERS) - -DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in Makefile.am -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/share/replaygain_synthesis/include/private/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(HEADERS) - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool ctags distclean distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am info \ - info-am install install-am install-data install-data-am \ - install-exec install-exec-am install-info install-info-am \ - install-man install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags uninstall uninstall-am uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/share/replaygain_synthesis/include/private/fast_float_math_hack.h b/3rdparty/libflac/src/share/replaygain_synthesis/include/private/fast_float_math_hack.h deleted file mode 100644 index d8608fc444b..00000000000 --- a/3rdparty/libflac/src/share/replaygain_synthesis/include/private/fast_float_math_hack.h +++ /dev/null @@ -1,39 +0,0 @@ -# ifdef __ICL /* only Intel C compiler has fmath ??? */ - - #include <mathf.h> - -/* Nearest integer, absolute value, etc. */ - - #define ceil ceilf - #define fabs fabsf - #define floor floorf - #define fmod fmodf - #define rint rintf - #define hypot hypotf - -/* Power functions */ - - #define pow powf - #define sqrt sqrtf - -/* Exponential and logarithmic functions */ - - #define exp expf - #define log logf - #define log10 log10f - -/* Trigonometric functions */ - - #define acos acosf - #define asin asinf - #define atan atanf - #define cos cosf - #define sin sinf - #define tan tanf - -/* Hyperbolic functions */ - #define cosh coshf - #define sinh sinhf - #define tanh tanhf - -# endif diff --git a/3rdparty/libflac/src/share/replaygain_synthesis/replaygain_synthesis.c b/3rdparty/libflac/src/share/replaygain_synthesis/replaygain_synthesis.c deleted file mode 100644 index e5615766d7b..00000000000 --- a/3rdparty/libflac/src/share/replaygain_synthesis/replaygain_synthesis.c +++ /dev/null @@ -1,467 +0,0 @@ -/* replaygain_synthesis - Routines for applying ReplayGain to a signal - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 - */ -/* - * This is an aggregation of pieces of code from John Edwards' WaveGain - * program. Mostly cosmetic changes were made; otherwise, the dithering - * code is almost untouched and the gain processing was converted from - * processing a whole file to processing chunks of samples. - * - * The original copyright notices for WaveGain's dither.c and wavegain.c - * appear below: - */ -/* - * (c) 2002 John Edwards - * mostly lifted from work by Frank Klemm - * random functions for dithering. - */ -/* - * Copyright (C) 2002 John Edwards - * Additional code by Magnus Holmgren and Gian-Carlo Pascutto - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <string.h> /* for memset() */ -#include <math.h> -#include "private/fast_float_math_hack.h" -#include "replaygain_synthesis.h" -#include "FLAC/assert.h" - -#ifndef FLaC__INLINE -#define FLaC__INLINE -#endif - -/* adjust for compilers that can't understand using LL suffix for int64_t literals */ -#ifdef _MSC_VER -#define FLAC__I64L(x) x -#else -#define FLAC__I64L(x) x##LL -#endif - - -/* - * the following is based on parts of dither.c - */ - - -/* - * This is a simple random number generator with good quality for audio purposes. - * It consists of two polycounters with opposite rotation direction and different - * periods. The periods are coprime, so the total period is the product of both. - * - * ------------------------------------------------------------------------------------------------- - * +-> |31:30:29:28:27:26:25:24:23:22:21:20:19:18:17:16:15:14:13:12:11:10: 9: 8: 7: 6: 5: 4: 3: 2: 1: 0| - * | ------------------------------------------------------------------------------------------------- - * | | | | | | | - * | +--+--+--+-XOR-+--------+ - * | | - * +--------------------------------------------------------------------------------------+ - * - * ------------------------------------------------------------------------------------------------- - * |31:30:29:28:27:26:25:24:23:22:21:20:19:18:17:16:15:14:13:12:11:10: 9: 8: 7: 6: 5: 4: 3: 2: 1: 0| <-+ - * ------------------------------------------------------------------------------------------------- | - * | | | | | - * +--+----XOR----+--+ | - * | | - * +----------------------------------------------------------------------------------------+ - * - * - * The first has an period of 3*5*17*257*65537, the second of 7*47*73*178481, - * which gives a period of 18.410.713.077.675.721.215. The result is the - * XORed values of both generators. - */ - -static unsigned int random_int_(void) -{ - static const unsigned char parity_[256] = { - 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1, - 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0, - 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0, - 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1, - 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0, - 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1, - 0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1, - 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0 - }; - static unsigned int r1_ = 1; - static unsigned int r2_ = 1; - - unsigned int t1, t2, t3, t4; - - /* Parity calculation is done via table lookup, this is also available - * on CPUs without parity, can be implemented in C and avoid unpredictable - * jumps and slow rotate through the carry flag operations. - */ - t3 = t1 = r1_; t4 = t2 = r2_; - t1 &= 0xF5; t2 >>= 25; - t1 = parity_[t1]; t2 &= 0x63; - t1 <<= 31; t2 = parity_[t2]; - - return (r1_ = (t3 >> 1) | t1 ) ^ (r2_ = (t4 + t4) | t2 ); -} - -/* gives a equal distributed random number */ -/* between -2^31*mult and +2^31*mult */ -static double random_equi_(double mult) -{ - return mult * (int) random_int_(); -} - -/* gives a triangular distributed random number */ -/* between -2^32*mult and +2^32*mult */ -static double random_triangular_(double mult) -{ - return mult * ( (double) (int) random_int_() + (double) (int) random_int_() ); -} - - -static const float F44_0 [16 + 32] = { - (float)0, (float)0, (float)0, (float)0, (float)0, (float)0, (float)0, (float)0, - (float)0, (float)0, (float)0, (float)0, (float)0, (float)0, (float)0, (float)0, - - (float)0, (float)0, (float)0, (float)0, (float)0, (float)0, (float)0, (float)0, - (float)0, (float)0, (float)0, (float)0, (float)0, (float)0, (float)0, (float)0, - - (float)0, (float)0, (float)0, (float)0, (float)0, (float)0, (float)0, (float)0, - (float)0, (float)0, (float)0, (float)0, (float)0, (float)0, (float)0, (float)0 -}; - - -static const float F44_1 [16 + 32] = { /* SNR(w) = 4.843163 dB, SNR = -3.192134 dB */ - (float) 0.85018292704024355931, (float) 0.29089597350995344721, (float)-0.05021866022121039450, (float)-0.23545456294599161833, - (float)-0.58362726442227032096, (float)-0.67038978965193036429, (float)-0.38566861572833459221, (float)-0.15218663390367969967, - (float)-0.02577543084864530676, (float) 0.14119295297688728127, (float) 0.22398848581628781612, (float) 0.15401727203382084116, - (float) 0.05216161232906000929, (float)-0.00282237820999675451, (float)-0.03042794608323867363, (float)-0.03109780942998826024, - - (float) 0.85018292704024355931, (float) 0.29089597350995344721, (float)-0.05021866022121039450, (float)-0.23545456294599161833, - (float)-0.58362726442227032096, (float)-0.67038978965193036429, (float)-0.38566861572833459221, (float)-0.15218663390367969967, - (float)-0.02577543084864530676, (float) 0.14119295297688728127, (float) 0.22398848581628781612, (float) 0.15401727203382084116, - (float) 0.05216161232906000929, (float)-0.00282237820999675451, (float)-0.03042794608323867363, (float)-0.03109780942998826024, - - (float) 0.85018292704024355931, (float) 0.29089597350995344721, (float)-0.05021866022121039450, (float)-0.23545456294599161833, - (float)-0.58362726442227032096, (float)-0.67038978965193036429, (float)-0.38566861572833459221, (float)-0.15218663390367969967, - (float)-0.02577543084864530676, (float) 0.14119295297688728127, (float) 0.22398848581628781612, (float) 0.15401727203382084116, - (float) 0.05216161232906000929, (float)-0.00282237820999675451, (float)-0.03042794608323867363, (float)-0.03109780942998826024, -}; - - -static const float F44_2 [16 + 32] = { /* SNR(w) = 10.060213 dB, SNR = -12.766730 dB */ - (float) 1.78827593892108555290, (float) 0.95508210637394326553, (float)-0.18447626783899924429, (float)-0.44198126506275016437, - (float)-0.88404052492547413497, (float)-1.42218907262407452967, (float)-1.02037566838362314995, (float)-0.34861755756425577264, - (float)-0.11490230170431934434, (float) 0.12498899339968611803, (float) 0.38065885268563131927, (float) 0.31883491321310506562, - (float) 0.10486838686563442765, (float)-0.03105361685110374845, (float)-0.06450524884075370758, (float)-0.02939198261121969816, - - (float) 1.78827593892108555290, (float) 0.95508210637394326553, (float)-0.18447626783899924429, (float)-0.44198126506275016437, - (float)-0.88404052492547413497, (float)-1.42218907262407452967, (float)-1.02037566838362314995, (float)-0.34861755756425577264, - (float)-0.11490230170431934434, (float) 0.12498899339968611803, (float) 0.38065885268563131927, (float) 0.31883491321310506562, - (float) 0.10486838686563442765, (float)-0.03105361685110374845, (float)-0.06450524884075370758, (float)-0.02939198261121969816, - - (float) 1.78827593892108555290, (float) 0.95508210637394326553, (float)-0.18447626783899924429, (float)-0.44198126506275016437, - (float)-0.88404052492547413497, (float)-1.42218907262407452967, (float)-1.02037566838362314995, (float)-0.34861755756425577264, - (float)-0.11490230170431934434, (float) 0.12498899339968611803, (float) 0.38065885268563131927, (float) 0.31883491321310506562, - (float) 0.10486838686563442765, (float)-0.03105361685110374845, (float)-0.06450524884075370758, (float)-0.02939198261121969816, -}; - - -static const float F44_3 [16 + 32] = { /* SNR(w) = 15.382598 dB, SNR = -29.402334 dB */ - (float) 2.89072132015058161445, (float) 2.68932810943698754106, (float) 0.21083359339410251227, (float)-0.98385073324997617515, - (float)-1.11047823227097316719, (float)-2.18954076314139673147, (float)-2.36498032881953056225, (float)-0.95484132880101140785, - (float)-0.23924057925542965158, (float)-0.13865235703915925642, (float) 0.43587843191057992846, (float) 0.65903257226026665927, - (float) 0.24361815372443152787, (float)-0.00235974960154720097, (float) 0.01844166574603346289, (float) 0.01722945988740875099, - - (float) 2.89072132015058161445, (float) 2.68932810943698754106, (float) 0.21083359339410251227, (float)-0.98385073324997617515, - (float)-1.11047823227097316719, (float)-2.18954076314139673147, (float)-2.36498032881953056225, (float)-0.95484132880101140785, - (float)-0.23924057925542965158, (float)-0.13865235703915925642, (float) 0.43587843191057992846, (float) 0.65903257226026665927, - (float) 0.24361815372443152787, (float)-0.00235974960154720097, (float) 0.01844166574603346289, (float) 0.01722945988740875099, - - (float) 2.89072132015058161445, (float) 2.68932810943698754106, (float) 0.21083359339410251227, (float)-0.98385073324997617515, - (float)-1.11047823227097316719, (float)-2.18954076314139673147, (float)-2.36498032881953056225, (float)-0.95484132880101140785, - (float)-0.23924057925542965158, (float)-0.13865235703915925642, (float) 0.43587843191057992846, (float) 0.65903257226026665927, - (float) 0.24361815372443152787, (float)-0.00235974960154720097, (float) 0.01844166574603346289, (float) 0.01722945988740875099 -}; - - -static double scalar16_(const float* x, const float* y) -{ - return - x[ 0]*y[ 0] + x[ 1]*y[ 1] + x[ 2]*y[ 2] + x[ 3]*y[ 3] + - x[ 4]*y[ 4] + x[ 5]*y[ 5] + x[ 6]*y[ 6] + x[ 7]*y[ 7] + - x[ 8]*y[ 8] + x[ 9]*y[ 9] + x[10]*y[10] + x[11]*y[11] + - x[12]*y[12] + x[13]*y[13] + x[14]*y[14] + x[15]*y[15]; -} - - -void FLAC__replaygain_synthesis__init_dither_context(DitherContext *d, int bits, int shapingtype) -{ - static unsigned char default_dither [] = { 92, 92, 88, 84, 81, 78, 74, 67, 0, 0 }; - static const float* F [] = { F44_0, F44_1, F44_2, F44_3 }; - - int index; - - if (shapingtype < 0) shapingtype = 0; - if (shapingtype > 3) shapingtype = 3; - d->ShapingType = (NoiseShaping)shapingtype; - index = bits - 11 - shapingtype; - if (index < 0) index = 0; - if (index > 9) index = 9; - - memset ( d->ErrorHistory , 0, sizeof (d->ErrorHistory ) ); - memset ( d->DitherHistory, 0, sizeof (d->DitherHistory) ); - - d->FilterCoeff = F [shapingtype]; - d->Mask = ((FLAC__uint64)-1) << (32 - bits); - d->Add = 0.5 * ((1L << (32 - bits)) - 1); - d->Dither = 0.01f*default_dither[index] / (((FLAC__int64)1) << bits); - d->LastHistoryIndex = 0; -} - -/* - * the following is based on parts of wavegain.c - */ - -static FLaC__INLINE FLAC__int64 dither_output_(DitherContext *d, FLAC__bool do_dithering, int shapingtype, int i, double Sum, int k) -{ - union { - double d; - FLAC__int64 i; - } doubletmp; - double Sum2; - FLAC__int64 val; - -#define ROUND64(x) ( doubletmp.d = (x) + d->Add + (FLAC__int64)FLAC__I64L(0x001FFFFD80000000), doubletmp.i - (FLAC__int64)FLAC__I64L(0x433FFFFD80000000) ) - - if(do_dithering) { - if(shapingtype == 0) { - double tmp = random_equi_(d->Dither); - Sum2 = tmp - d->LastRandomNumber [k]; - d->LastRandomNumber [k] = (int)tmp; - Sum2 = Sum += Sum2; - val = ROUND64(Sum2) & d->Mask; - } - else { - Sum2 = random_triangular_(d->Dither) - scalar16_(d->DitherHistory[k], d->FilterCoeff + i); - Sum += d->DitherHistory [k] [(-1-i)&15] = (float)Sum2; - Sum2 = Sum + scalar16_(d->ErrorHistory [k], d->FilterCoeff + i); - val = ROUND64(Sum2) & d->Mask; - d->ErrorHistory [k] [(-1-i)&15] = (float)(Sum - val); - } - return val; - } - else - return ROUND64(Sum); - -#undef ROUND64 -} - -#if 0 - float peak = 0.f, - new_peak, - factor_clip - double scale, - dB; - - ... - - peak is in the range -32768.0 .. 32767.0 - - /* calculate factors for ReplayGain and ClippingPrevention */ - *track_gain = GetTitleGain() + settings->man_gain; - scale = (float) pow(10., *track_gain * 0.05); - if(settings->clip_prev) { - factor_clip = (float) (32767./( peak + 1)); - if(scale < factor_clip) - factor_clip = 1.f; - else - factor_clip /= scale; - scale *= factor_clip; - } - new_peak = (float) peak * scale; - - dB = 20. * log10(scale); - *track_gain = (float) dB; - - const double scale = pow(10., (double)gain * 0.05); -#endif - - -size_t FLAC__replaygain_synthesis__apply_gain(FLAC__byte *data_out, FLAC__bool little_endian_data_out, FLAC__bool unsigned_data_out, const FLAC__int32 * const input[], unsigned wide_samples, unsigned channels, const unsigned source_bps, const unsigned target_bps, const double scale, const FLAC__bool hard_limit, FLAC__bool do_dithering, DitherContext *dither_context) -{ - static const FLAC__int32 conv_factors_[33] = { - -1, /* 0 bits-per-sample (not supported) */ - -1, /* 1 bits-per-sample (not supported) */ - -1, /* 2 bits-per-sample (not supported) */ - -1, /* 3 bits-per-sample (not supported) */ - 268435456, /* 4 bits-per-sample */ - 134217728, /* 5 bits-per-sample */ - 67108864, /* 6 bits-per-sample */ - 33554432, /* 7 bits-per-sample */ - 16777216, /* 8 bits-per-sample */ - 8388608, /* 9 bits-per-sample */ - 4194304, /* 10 bits-per-sample */ - 2097152, /* 11 bits-per-sample */ - 1048576, /* 12 bits-per-sample */ - 524288, /* 13 bits-per-sample */ - 262144, /* 14 bits-per-sample */ - 131072, /* 15 bits-per-sample */ - 65536, /* 16 bits-per-sample */ - 32768, /* 17 bits-per-sample */ - 16384, /* 18 bits-per-sample */ - 8192, /* 19 bits-per-sample */ - 4096, /* 20 bits-per-sample */ - 2048, /* 21 bits-per-sample */ - 1024, /* 22 bits-per-sample */ - 512, /* 23 bits-per-sample */ - 256, /* 24 bits-per-sample */ - 128, /* 25 bits-per-sample */ - 64, /* 26 bits-per-sample */ - 32, /* 27 bits-per-sample */ - 16, /* 28 bits-per-sample */ - 8, /* 29 bits-per-sample */ - 4, /* 30 bits-per-sample */ - 2, /* 31 bits-per-sample */ - 1 /* 32 bits-per-sample */ - }; - static const FLAC__int64 hard_clip_factors_[33] = { - 0, /* 0 bits-per-sample (not supported) */ - 0, /* 1 bits-per-sample (not supported) */ - 0, /* 2 bits-per-sample (not supported) */ - 0, /* 3 bits-per-sample (not supported) */ - -8, /* 4 bits-per-sample */ - -16, /* 5 bits-per-sample */ - -32, /* 6 bits-per-sample */ - -64, /* 7 bits-per-sample */ - -128, /* 8 bits-per-sample */ - -256, /* 9 bits-per-sample */ - -512, /* 10 bits-per-sample */ - -1024, /* 11 bits-per-sample */ - -2048, /* 12 bits-per-sample */ - -4096, /* 13 bits-per-sample */ - -8192, /* 14 bits-per-sample */ - -16384, /* 15 bits-per-sample */ - -32768, /* 16 bits-per-sample */ - -65536, /* 17 bits-per-sample */ - -131072, /* 18 bits-per-sample */ - -262144, /* 19 bits-per-sample */ - -524288, /* 20 bits-per-sample */ - -1048576, /* 21 bits-per-sample */ - -2097152, /* 22 bits-per-sample */ - -4194304, /* 23 bits-per-sample */ - -8388608, /* 24 bits-per-sample */ - -16777216, /* 25 bits-per-sample */ - -33554432, /* 26 bits-per-sample */ - -67108864, /* 27 bits-per-sample */ - -134217728, /* 28 bits-per-sample */ - -268435456, /* 29 bits-per-sample */ - -536870912, /* 30 bits-per-sample */ - -1073741824, /* 31 bits-per-sample */ - (FLAC__int64)(-1073741824) * 2 /* 32 bits-per-sample */ - }; - const FLAC__int32 conv_factor = conv_factors_[target_bps]; - const FLAC__int64 hard_clip_factor = hard_clip_factors_[target_bps]; - /* - * The integer input coming in has a varying range based on the - * source_bps. We want to normalize it to [-1.0, 1.0) so instead - * of doing two multiplies on each sample, we just multiple - * 'scale' by 1/(2^(source_bps-1)) - */ - const double multi_scale = scale / (double)(1u << (source_bps-1)); - - FLAC__byte * const start = data_out; - unsigned i, channel; - const FLAC__int32 *input_; - double sample; - const unsigned bytes_per_sample = target_bps / 8; - const unsigned last_history_index = dither_context->LastHistoryIndex; - NoiseShaping noise_shaping = dither_context->ShapingType; - FLAC__int64 val64; - FLAC__int32 val32; - FLAC__int32 uval32; - const FLAC__uint32 twiggle = 1u << (target_bps - 1); - - FLAC__ASSERT(channels > 0 && channels <= FLAC_SHARE__MAX_SUPPORTED_CHANNELS); - FLAC__ASSERT(source_bps >= 4); - FLAC__ASSERT(target_bps >= 4); - FLAC__ASSERT(source_bps <= 32); - FLAC__ASSERT(target_bps < 32); - FLAC__ASSERT((target_bps & 7) == 0); - - for(channel = 0; channel < channels; channel++) { - const unsigned incr = bytes_per_sample * channels; - data_out = start + bytes_per_sample * channel; - input_ = input[channel]; - for(i = 0; i < wide_samples; i++, data_out += incr) { - sample = (double)input_[i] * multi_scale; - - if(hard_limit) { - /* hard 6dB limiting */ - if(sample < -0.5) - sample = tanh((sample + 0.5) / (1-0.5)) * (1-0.5) - 0.5; - else if(sample > 0.5) - sample = tanh((sample - 0.5) / (1-0.5)) * (1-0.5) + 0.5; - } - sample *= 2147483647.f; - - val64 = dither_output_(dither_context, do_dithering, noise_shaping, (i + last_history_index) % 32, sample, channel) / conv_factor; - - val32 = (FLAC__int32)val64; - if(val64 >= -hard_clip_factor) - val32 = (FLAC__int32)(-(hard_clip_factor+1)); - else if(val64 < hard_clip_factor) - val32 = (FLAC__int32)hard_clip_factor; - - uval32 = (FLAC__uint32)val32; - if (unsigned_data_out) - uval32 ^= twiggle; - - if (little_endian_data_out) { - switch(target_bps) { - case 24: - data_out[2] = (FLAC__byte)(uval32 >> 16); - /* fall through */ - case 16: - data_out[1] = (FLAC__byte)(uval32 >> 8); - /* fall through */ - case 8: - data_out[0] = (FLAC__byte)uval32; - break; - } - } - else { - switch(target_bps) { - case 24: - data_out[0] = (FLAC__byte)(uval32 >> 16); - data_out[1] = (FLAC__byte)(uval32 >> 8); - data_out[2] = (FLAC__byte)uval32; - break; - case 16: - data_out[0] = (FLAC__byte)(uval32 >> 8); - data_out[1] = (FLAC__byte)uval32; - break; - case 8: - data_out[0] = (FLAC__byte)uval32; - break; - } - } - } - } - dither_context->LastHistoryIndex = (last_history_index + wide_samples) % 32; - - return wide_samples * channels * (target_bps/8); -} diff --git a/3rdparty/libflac/src/share/replaygain_synthesis/replaygain_synthesis_static.dsp b/3rdparty/libflac/src/share/replaygain_synthesis/replaygain_synthesis_static.dsp deleted file mode 100644 index a443efa0035..00000000000 --- a/3rdparty/libflac/src/share/replaygain_synthesis/replaygain_synthesis_static.dsp +++ /dev/null @@ -1,108 +0,0 @@ -# Microsoft Developer Studio Project File - Name="replaygain_synthesis_static" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=replaygain_synthesis_static - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "replaygain_synthesis_static.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "replaygain_synthesis_static.mak" CFG="replaygain_synthesis_static - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "replaygain_synthesis_static - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "replaygain_synthesis_static - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "replaygain_synthesis" -# PROP Scc_LocalPath "..\..\.." -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "replaygain_synthesis_static - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\..\obj\release\lib" -# PROP Intermediate_Dir "Release_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /Op /I ".\include" /I "..\..\..\include" /I "..\..\..\include\share" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /nodefaultlib - -!ELSEIF "$(CFG)" == "replaygain_synthesis_static - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\..\obj\debug\lib" -# PROP Intermediate_Dir "Debug_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\include" /I "..\..\..\include" /I "..\..\..\include\share" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /nodefaultlib - -!ENDIF - -# Begin Target - -# Name "replaygain_synthesis_static - Win32 Release" -# Name "replaygain_synthesis_static - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "c" -# Begin Source File - -SOURCE=.\replaygain_synthesis.c -# End Source File -# End Group -# Begin Group "Private Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\include\private\fast_float_math_hack.h -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\..\include\share\replaygain_synthesis.h -# End Source File -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/share/replaygain_synthesis/replaygain_synthesis_static.vcproj b/3rdparty/libflac/src/share/replaygain_synthesis/replaygain_synthesis_static.vcproj deleted file mode 100644 index 627ab496ad5..00000000000 --- a/3rdparty/libflac/src/share/replaygain_synthesis/replaygain_synthesis_static.vcproj +++ /dev/null @@ -1,185 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="replaygain_synthesis_static" - ProjectGUID="{4cefbc8a-c215-11db-8314-0800200c9a66}" - RootNamespace="replaygain_synthesis_static" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\..\obj\debug\lib" - IntermediateDirectory="Debug_static" - ConfigurationType="4" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".\include;..\..\..\include;..\..\..\include\share" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;FLAC__NO_DLL;DEBUG" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\..\..\obj\debug\lib\$(ProjectName).lib" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\..\obj\release\lib" - IntermediateDirectory="Release_static" - ConfigurationType="4" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".\include;..\..\..\include;..\..\..\include\share" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__NO_DLL" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\..\..\obj\release\lib\$(ProjectName).lib" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath=".\include\private\fast_float_math_hack.h" - > - </File> - </Filter> - <Filter - Name="Public Header Files" - > - <File - RelativePath="..\..\..\include\share\replaygain_synthesis.h" - > - </File> - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\replaygain_synthesis.c" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/share/utf8/Makefile.am b/3rdparty/libflac/src/share/utf8/Makefile.am deleted file mode 100644 index bc42c2dfd62..00000000000 --- a/3rdparty/libflac/src/share/utf8/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -## Process this file with automake to produce Makefile.in - -AUTOMAKE_OPTIONS = foreign - -INCLUDES = -I$(top_srcdir)/include/share - -noinst_LTLIBRARIES = libutf8.la - -libutf8_la_SOURCES = charset.c charset.h iconvert.c utf8.c - -EXTRA_DIST = \ - Makefile.lite \ - charmaps.h \ - makemap.c \ - charset_test.c \ - charsetmap.h \ - iconvert.h \ - utf8_static.dsp \ - utf8_static.vcproj - -debug: - $(MAKE) all CFLAGS="@DEBUG@" - -profile: - $(MAKE) all CFLAGS="@PROFILE@" diff --git a/3rdparty/libflac/src/share/utf8/Makefile.in b/3rdparty/libflac/src/share/utf8/Makefile.in deleted file mode 100644 index b3c9ff7886a..00000000000 --- a/3rdparty/libflac/src/share/utf8/Makefile.in +++ /dev/null @@ -1,507 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -AUTOMAKE_OPTIONS = foreign - -INCLUDES = -I$(top_srcdir)/include/share - -noinst_LTLIBRARIES = libutf8.la - -libutf8_la_SOURCES = charset.c charset.h iconvert.c utf8.c - -EXTRA_DIST = \ - Makefile.lite \ - charmaps.h \ - makemap.c \ - charset_test.c \ - charsetmap.h \ - iconvert.h \ - utf8_static.dsp \ - utf8_static.vcproj - -subdir = src/share/utf8 -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) - -libutf8_la_LDFLAGS = -libutf8_la_LIBADD = -am_libutf8_la_OBJECTS = charset.lo iconvert.lo utf8.lo -libutf8_la_OBJECTS = $(am_libutf8_la_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/charset.Plo ./$(DEPDIR)/iconvert.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/utf8.Plo -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(libutf8_la_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(libutf8_la_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/share/utf8/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" = "$$p" && dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libutf8.la: $(libutf8_la_OBJECTS) $(libutf8_la_DEPENDENCIES) - $(LINK) $(libutf8_la_LDFLAGS) $(libutf8_la_OBJECTS) $(libutf8_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/charset.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconvert.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utf8.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am - - -debug: - $(MAKE) all CFLAGS="@DEBUG@" - -profile: - $(MAKE) all CFLAGS="@PROFILE@" -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/share/utf8/Makefile.lite b/3rdparty/libflac/src/share/utf8/Makefile.lite deleted file mode 100644 index 95e4a7fafc3..00000000000 --- a/3rdparty/libflac/src/share/utf8/Makefile.lite +++ /dev/null @@ -1,17 +0,0 @@ -# -# GNU makefile -# - -topdir = ../../.. - -LIB_NAME = libutf8 -INCLUDES = -I$(topdir)/include -I$(topdir)/include/share - -SRCS_C = \ - charset.c \ - iconvert.c \ - utf8.c - -include $(topdir)/build/lib.mk - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/3rdparty/libflac/src/share/utf8/charmaps.h b/3rdparty/libflac/src/share/utf8/charmaps.h deleted file mode 100644 index 690d8906f8e..00000000000 --- a/3rdparty/libflac/src/share/utf8/charmaps.h +++ /dev/null @@ -1,57 +0,0 @@ - -/* - * If you need to generate more maps, use makemap.c on a system - * with a decent iconv. - */ - -static const unsigned short mapping_iso_8859_2[256] = { - 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, - 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, - 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, - 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, - 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, - 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, - 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, - 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, - 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, - 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, - 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, - 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, - 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, - 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, - 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, - 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, - 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, - 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, - 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, - 0x00a0, 0x0104, 0x02d8, 0x0141, 0x00a4, 0x013d, 0x015a, 0x00a7, - 0x00a8, 0x0160, 0x015e, 0x0164, 0x0179, 0x00ad, 0x017d, 0x017b, - 0x00b0, 0x0105, 0x02db, 0x0142, 0x00b4, 0x013e, 0x015b, 0x02c7, - 0x00b8, 0x0161, 0x015f, 0x0165, 0x017a, 0x02dd, 0x017e, 0x017c, - 0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7, - 0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e, - 0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7, - 0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df, - 0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7, - 0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f, - 0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7, - 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9 -}; - -static struct { - const char *name; - const unsigned short *map; - struct charset *charset; -} maps[] = { - { "ISO-8859-2", mapping_iso_8859_2, 0 }, - { 0, 0, 0 } -}; - -static const struct { - const char *bad; - const char *good; -} names[] = { - { "ANSI_X3.4-1968", "us-ascii" }, - { 0, 0 } -}; diff --git a/3rdparty/libflac/src/share/utf8/charset.c b/3rdparty/libflac/src/share/utf8/charset.c deleted file mode 100644 index dcef6fc94b3..00000000000 --- a/3rdparty/libflac/src/share/utf8/charset.c +++ /dev/null @@ -1,532 +0,0 @@ -/* - * Copyright (C) 2001 Edmund Grimley Evans <edmundo@rano.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * See the corresponding header file for a description of the functions - * that this file provides. - * - * This was first written for Ogg Vorbis but could be of general use. - * - * The only deliberate assumption about data sizes is that a short has - * at least 16 bits, but this code has only been tested on systems with - * 8-bit char, 16-bit short and 32-bit int. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#ifndef HAVE_ICONV /* should be ifdef USE_CHARSET_CONVERT */ - -#include <stdlib.h> - -#include "share/alloc.h" -#include "charset.h" - -#include "charmaps.h" - -/* - * This is like the standard strcasecmp, but it does not depend - * on the locale. Locale-dependent functions can be dangerous: - * we once had a bug involving strcasecmp("iso", "ISO") in a - * Turkish locale! - * - * (I'm not really sure what the official standard says - * about the sign of strcasecmp("Z", "["), but usually - * we're only interested in whether it's zero.) - */ - -static int ascii_strcasecmp(const char *s1, const char *s2) -{ - char c1, c2; - - for (;; s1++, s2++) { - if (!*s1 || !*s1) - break; - if (*s1 == *s2) - continue; - c1 = *s1; - if ('a' <= c1 && c1 <= 'z') - c1 += 'A' - 'a'; - c2 = *s2; - if ('a' <= c2 && c2 <= 'z') - c2 += 'A' - 'a'; - if (c1 != c2) - break; - } - return (unsigned char)*s1 - (unsigned char)*s2; -} - -/* - * UTF-8 equivalents of the C library's wctomb() and mbtowc(). - */ - -int utf8_mbtowc(int *pwc, const char *s, size_t n) -{ - unsigned char c; - int wc, i, k; - - if (!n || !s) - return 0; - - c = *s; - if (c < 0x80) { - if (pwc) - *pwc = c; - return c ? 1 : 0; - } - else if (c < 0xc2) - return -1; - else if (c < 0xe0) { - if (n >= 2 && (s[1] & 0xc0) == 0x80) { - if (pwc) - *pwc = ((c & 0x1f) << 6) | (s[1] & 0x3f); - return 2; - } - else - return -1; - } - else if (c < 0xf0) - k = 3; - else if (c < 0xf8) - k = 4; - else if (c < 0xfc) - k = 5; - else if (c < 0xfe) - k = 6; - else - return -1; - - if (n < (size_t)k) - return -1; - wc = *s++ & ((1 << (7 - k)) - 1); - for (i = 1; i < k; i++) { - if ((*s & 0xc0) != 0x80) - return -1; - wc = (wc << 6) | (*s++ & 0x3f); - } - if (wc < (1 << (5 * k - 4))) - return -1; - if (pwc) - *pwc = wc; - return k; -} - -int utf8_wctomb(char *s, int wc1) -{ - unsigned int wc = wc1; - - if (!s) - return 0; - if (wc < (1u << 7)) { - *s++ = wc; - return 1; - } - else if (wc < (1u << 11)) { - *s++ = 0xc0 | (wc >> 6); - *s++ = 0x80 | (wc & 0x3f); - return 2; - } - else if (wc < (1u << 16)) { - *s++ = 0xe0 | (wc >> 12); - *s++ = 0x80 | ((wc >> 6) & 0x3f); - *s++ = 0x80 | (wc & 0x3f); - return 3; - } - else if (wc < (1u << 21)) { - *s++ = 0xf0 | (wc >> 18); - *s++ = 0x80 | ((wc >> 12) & 0x3f); - *s++ = 0x80 | ((wc >> 6) & 0x3f); - *s++ = 0x80 | (wc & 0x3f); - return 4; - } - else if (wc < (1u << 26)) { - *s++ = 0xf8 | (wc >> 24); - *s++ = 0x80 | ((wc >> 18) & 0x3f); - *s++ = 0x80 | ((wc >> 12) & 0x3f); - *s++ = 0x80 | ((wc >> 6) & 0x3f); - *s++ = 0x80 | (wc & 0x3f); - return 5; - } - else if (wc < (1u << 31)) { - *s++ = 0xfc | (wc >> 30); - *s++ = 0x80 | ((wc >> 24) & 0x3f); - *s++ = 0x80 | ((wc >> 18) & 0x3f); - *s++ = 0x80 | ((wc >> 12) & 0x3f); - *s++ = 0x80 | ((wc >> 6) & 0x3f); - *s++ = 0x80 | (wc & 0x3f); - return 6; - } - else - return -1; -} - -/* - * The charset "object" and methods. - */ - -struct charset { - int max; - int (*mbtowc)(void *table, int *pwc, const char *s, size_t n); - int (*wctomb)(void *table, char *s, int wc); - void *map; -}; - -int charset_mbtowc(struct charset *charset, int *pwc, const char *s, size_t n) -{ - return (*charset->mbtowc)(charset->map, pwc, s, n); -} - -int charset_wctomb(struct charset *charset, char *s, int wc) -{ - return (*charset->wctomb)(charset->map, s, wc); -} - -int charset_max(struct charset *charset) -{ - return charset->max; -} - -/* - * Implementation of UTF-8. - */ - -static int mbtowc_utf8(void *map, int *pwc, const char *s, size_t n) -{ - (void)map; - return utf8_mbtowc(pwc, s, n); -} - -static int wctomb_utf8(void *map, char *s, int wc) -{ - (void)map; - return utf8_wctomb(s, wc); -} - -/* - * Implementation of US-ASCII. - * Probably on most architectures this compiles to less than 256 bytes - * of code, so we can save space by not having a table for this one. - */ - -static int mbtowc_ascii(void *map, int *pwc, const char *s, size_t n) -{ - int wc; - - (void)map; - if (!n || !s) - return 0; - wc = (unsigned char)*s; - if (wc & ~0x7f) - return -1; - if (pwc) - *pwc = wc; - return wc ? 1 : 0; -} - -static int wctomb_ascii(void *map, char *s, int wc) -{ - (void)map; - if (!s) - return 0; - if (wc & ~0x7f) - return -1; - *s = wc; - return 1; -} - -/* - * Implementation of ISO-8859-1. - * Probably on most architectures this compiles to less than 256 bytes - * of code, so we can save space by not having a table for this one. - */ - -static int mbtowc_iso1(void *map, int *pwc, const char *s, size_t n) -{ - int wc; - - (void)map; - if (!n || !s) - return 0; - wc = (unsigned char)*s; - if (wc & ~0xff) - return -1; - if (pwc) - *pwc = wc; - return wc ? 1 : 0; -} - -static int wctomb_iso1(void *map, char *s, int wc) -{ - (void)map; - if (!s) - return 0; - if (wc & ~0xff) - return -1; - *s = wc; - return 1; -} - -/* - * Implementation of any 8-bit charset. - */ - -struct map { - const unsigned short *from; - struct inverse_map *to; -}; - -static int mbtowc_8bit(void *map1, int *pwc, const char *s, size_t n) -{ - struct map *map = map1; - unsigned short wc; - - if (!n || !s) - return 0; - wc = map->from[(unsigned char)*s]; - if (wc == 0xffff) - return -1; - if (pwc) - *pwc = (int)wc; - return wc ? 1 : 0; -} - -/* - * For the inverse map we use a hash table, which has the advantages - * of small constant memory requirement and simple memory allocation, - * but the disadvantage of slow conversion in the worst case. - * If you need real-time performance while letting a potentially - * malicious user define their own map, then the method used in - * linux/drivers/char/consolemap.c would be more appropriate. - */ - -struct inverse_map { - unsigned char first[256]; - unsigned char next[256]; -}; - -/* - * The simple hash is good enough for this application. - * Use the alternative trivial hashes for testing. - */ -#define HASH(i) ((i) & 0xff) -/* #define HASH(i) 0 */ -/* #define HASH(i) 99 */ - -static struct inverse_map *make_inverse_map(const unsigned short *from) -{ - struct inverse_map *to; - char used[256]; - int i, j, k; - - to = (struct inverse_map *)malloc(sizeof(struct inverse_map)); - if (!to) - return 0; - for (i = 0; i < 256; i++) - to->first[i] = to->next[i] = used[i] = 0; - for (i = 255; i >= 0; i--) - if (from[i] != 0xffff) { - k = HASH(from[i]); - to->next[i] = to->first[k]; - to->first[k] = i; - used[k] = 1; - } - - /* Point the empty buckets at an empty list. */ - for (i = 0; i < 256; i++) - if (!to->next[i]) - break; - if (i < 256) - for (j = 0; j < 256; j++) - if (!used[j]) - to->first[j] = i; - - return to; -} - -int wctomb_8bit(void *map1, char *s, int wc1) -{ - struct map *map = map1; - unsigned short wc = wc1; - int i; - - if (!s) - return 0; - - if (wc1 & ~0xffff) - return -1; - - if (1) /* Change 1 to 0 to test the case where malloc fails. */ - if (!map->to) - map->to = make_inverse_map(map->from); - - if (map->to) { - /* Use the inverse map. */ - i = map->to->first[HASH(wc)]; - for (;;) { - if (map->from[i] == wc) { - *s = i; - return 1; - } - if (!(i = map->to->next[i])) - break; - } - } - else { - /* We don't have an inverse map, so do a linear search. */ - for (i = 0; i < 256; i++) - if (map->from[i] == wc) { - *s = i; - return 1; - } - } - - return -1; -} - -/* - * The "constructor" charset_find(). - */ - -struct charset charset_utf8 = { - 6, - &mbtowc_utf8, - &wctomb_utf8, - 0 -}; - -struct charset charset_iso1 = { - 1, - &mbtowc_iso1, - &wctomb_iso1, - 0 -}; - -struct charset charset_ascii = { - 1, - &mbtowc_ascii, - &wctomb_ascii, - 0 -}; - -struct charset *charset_find(const char *code) -{ - int i; - - /* Find good (MIME) name. */ - for (i = 0; names[i].bad; i++) - if (!ascii_strcasecmp(code, names[i].bad)) { - code = names[i].good; - break; - } - - /* Recognise some charsets for which we avoid using a table. */ - if (!ascii_strcasecmp(code, "UTF-8")) - return &charset_utf8; - if (!ascii_strcasecmp(code, "US-ASCII")) - return &charset_ascii; - if (!ascii_strcasecmp(code, "ISO-8859-1")) - return &charset_iso1; - - /* Look for a mapping for a simple 8-bit encoding. */ - for (i = 0; maps[i].name; i++) - if (!ascii_strcasecmp(code, maps[i].name)) { - if (!maps[i].charset) { - maps[i].charset = (struct charset *)malloc(sizeof(struct charset)); - if (maps[i].charset) { - struct map *map = (struct map *)malloc(sizeof(struct map)); - if (!map) { - free(maps[i].charset); - maps[i].charset = 0; - } - else { - maps[i].charset->max = 1; - maps[i].charset->mbtowc = &mbtowc_8bit; - maps[i].charset->wctomb = &wctomb_8bit; - maps[i].charset->map = map; - map->from = maps[i].map; - map->to = 0; /* inverse mapping is created when required */ - } - } - } - return maps[i].charset; - } - - return 0; -} - -/* - * Function to convert a buffer from one encoding to another. - * Invalid bytes are replaced by '#', and characters that are - * not available in the target encoding are replaced by '?'. - * Each of TO and TOLEN may be zero, if the result is not needed. - * The output buffer is null-terminated, so it is all right to - * use charset_convert(fromcode, tocode, s, strlen(s), &t, 0). - */ - -int charset_convert(const char *fromcode, const char *tocode, - const char *from, size_t fromlen, - char **to, size_t *tolen) -{ - int ret = 0; - struct charset *charset1, *charset2; - char *tobuf, *p, *newbuf; - int i, j, wc; - - charset1 = charset_find(fromcode); - charset2 = charset_find(tocode); - if (!charset1 || !charset2 ) - return -1; - - tobuf = (char *)safe_malloc_mul2add_(fromlen, /*times*/charset2->max, /*+*/1); - if (!tobuf) - return -2; - - for (p = tobuf; fromlen; from += i, fromlen -= i, p += j) { - i = charset_mbtowc(charset1, &wc, from, fromlen); - if (!i) - i = 1; - else if (i == -1) { - i = 1; - wc = '#'; - ret = 2; - } - j = charset_wctomb(charset2, p, wc); - if (j == -1) { - if (!ret) - ret = 1; - j = charset_wctomb(charset2, p, '?'); - if (j == -1) - j = 0; - } - } - - if (tolen) - *tolen = p - tobuf; - *p++ = '\0'; - if (to) { - newbuf = realloc(tobuf, p - tobuf); - *to = newbuf ? newbuf : tobuf; - } - else - free(tobuf); - - return ret; -} - -#endif /* USE_CHARSET_ICONV */ diff --git a/3rdparty/libflac/src/share/utf8/charset.h b/3rdparty/libflac/src/share/utf8/charset.h deleted file mode 100644 index b5e2fb7384e..00000000000 --- a/3rdparty/libflac/src/share/utf8/charset.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2001 Edmund Grimley Evans <edmundo@rano.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <stdlib.h> - -/* - * These functions are like the C library's mbtowc() and wctomb(), - * but instead of depending on the locale they always work in UTF-8, - * and they use int instead of wchar_t. - */ - -int utf8_mbtowc(int *pwc, const char *s, size_t n); -int utf8_wctomb(char *s, int wc); - -/* - * This is an object-oriented version of mbtowc() and wctomb(). - * The caller first uses charset_find() to get a pointer to struct - * charset, then uses the mbtowc() and wctomb() methods on it. - * The function charset_max() gives the maximum length of a - * multibyte character in that encoding. - * This API is only appropriate for stateless encodings like UTF-8 - * or ISO-8859-3, but I have no intention of implementing anything - * other than UTF-8 and 8-bit encodings. - * - * MINOR BUG: If there is no memory charset_find() may return 0 and - * there is no way to distinguish this case from an unknown encoding. - */ - -struct charset; - -struct charset *charset_find(const char *code); - -int charset_mbtowc(struct charset *charset, int *pwc, const char *s, size_t n); -int charset_wctomb(struct charset *charset, char *s, int wc); -int charset_max(struct charset *charset); - -/* - * Function to convert a buffer from one encoding to another. - * Invalid bytes are replaced by '#', and characters that are - * not available in the target encoding are replaced by '?'. - * Each of TO and TOLEN may be zero if the result is not wanted. - * The input or output may contain null bytes, but the output - * buffer is also null-terminated, so it is all right to - * use charset_convert(fromcode, tocode, s, strlen(s), &t, 0). - * - * Return value: - * - * -2 : memory allocation failed - * -1 : unknown encoding - * 0 : data was converted exactly - * 1 : valid data was converted approximately (using '?') - * 2 : input was invalid (but still converted, using '#') - */ - -int charset_convert(const char *fromcode, const char *tocode, - const char *from, size_t fromlen, - char **to, size_t *tolen); diff --git a/3rdparty/libflac/src/share/utf8/charset_test.c b/3rdparty/libflac/src/share/utf8/charset_test.c deleted file mode 100644 index 1d5bf717557..00000000000 --- a/3rdparty/libflac/src/share/utf8/charset_test.c +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright (C) 2001 Edmund Grimley Evans <edmundo@rano.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <assert.h> -#include <string.h> - -#include "charset.h" - -void test_any(struct charset *charset) -{ - int wc; - char s[2]; - - assert(charset); - - /* Decoder */ - - assert(charset_mbtowc(charset, 0, 0, 0) == 0); - assert(charset_mbtowc(charset, 0, 0, 1) == 0); - assert(charset_mbtowc(charset, 0, (char *)(-1), 0) == 0); - - assert(charset_mbtowc(charset, 0, "a", 0) == 0); - assert(charset_mbtowc(charset, 0, "", 1) == 0); - assert(charset_mbtowc(charset, 0, "b", 1) == 1); - assert(charset_mbtowc(charset, 0, "", 2) == 0); - assert(charset_mbtowc(charset, 0, "c", 2) == 1); - - wc = 'x'; - assert(charset_mbtowc(charset, &wc, "a", 0) == 0 && wc == 'x'); - assert(charset_mbtowc(charset, &wc, "", 1) == 0 && wc == 0); - assert(charset_mbtowc(charset, &wc, "b", 1) == 1 && wc == 'b'); - assert(charset_mbtowc(charset, &wc, "", 2) == 0 && wc == 0); - assert(charset_mbtowc(charset, &wc, "c", 2) == 1 && wc == 'c'); - - /* Encoder */ - - assert(charset_wctomb(charset, 0, 0) == 0); - - s[0] = s[1] = '.'; - assert(charset_wctomb(charset, s, 0) == 1 && - s[0] == '\0' && s[1] == '.'); - assert(charset_wctomb(charset, s, 'x') == 1 && - s[0] == 'x' && s[1] == '.'); -} - -void test_utf8() -{ - struct charset *charset; - int wc; - char s[8]; - - charset = charset_find("UTF-8"); - test_any(charset); - - /* Decoder */ - wc = 0; - assert(charset_mbtowc(charset, &wc, "\177", 1) == 1 && wc == 127); - assert(charset_mbtowc(charset, &wc, "\200", 2) == -1); - assert(charset_mbtowc(charset, &wc, "\301\277", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\302\200", 1) == -1); - assert(charset_mbtowc(charset, &wc, "\302\200", 2) == 2 && wc == 128); - assert(charset_mbtowc(charset, &wc, "\302\200", 3) == 2 && wc == 128); - assert(charset_mbtowc(charset, &wc, "\340\237\200", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\340\240\200", 9) == 3 && - wc == 1 << 11); - assert(charset_mbtowc(charset, &wc, "\360\217\277\277", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\360\220\200\200", 9) == 4 && - wc == 1 << 16); - assert(charset_mbtowc(charset, &wc, "\370\207\277\277\277", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\370\210\200\200\200", 9) == 5 && - wc == 1 << 21); - assert(charset_mbtowc(charset, &wc, "\374\203\277\277\277\277", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\374\204\200\200\200\200", 9) == 6 && - wc == 1 << 26); - assert(charset_mbtowc(charset, &wc, "\375\277\277\277\277\277", 9) == 6 && - wc == 0x7fffffff); - - assert(charset_mbtowc(charset, &wc, "\302\000", 2) == -1); - assert(charset_mbtowc(charset, &wc, "\302\300", 2) == -1); - assert(charset_mbtowc(charset, &wc, "\340\040\200", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\340\340\200", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\340\240\000", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\340\240\300", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\360\020\200\200", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\360\320\200\200", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\360\220\000\200", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\360\220\300\200", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\360\220\200\000", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\360\220\200\300", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\375\077\277\277\277\277", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\375\377\277\277\277\277", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\375\277\077\277\277\277", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\375\277\377\277\277\277", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\375\277\277\277\077\277", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\375\277\277\277\377\277", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\375\277\277\277\277\077", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\375\277\277\277\277\377", 9) == -1); - - assert(charset_mbtowc(charset, &wc, "\376\277\277\277\277\277", 9) == -1); - assert(charset_mbtowc(charset, &wc, "\377\277\277\277\277\277", 9) == -1); - - /* Encoder */ - strcpy(s, "......."); - assert(charset_wctomb(charset, s, 1 << 31) == -1 && - !strcmp(s, ".......")); - assert(charset_wctomb(charset, s, 127) == 1 && - !strcmp(s, "\177......")); - assert(charset_wctomb(charset, s, 128) == 2 && - !strcmp(s, "\302\200.....")); - assert(charset_wctomb(charset, s, 0x7ff) == 2 && - !strcmp(s, "\337\277.....")); - assert(charset_wctomb(charset, s, 0x800) == 3 && - !strcmp(s, "\340\240\200....")); - assert(charset_wctomb(charset, s, 0xffff) == 3 && - !strcmp(s, "\357\277\277....")); - assert(charset_wctomb(charset, s, 0x10000) == 4 && - !strcmp(s, "\360\220\200\200...")); - assert(charset_wctomb(charset, s, 0x1fffff) == 4 && - !strcmp(s, "\367\277\277\277...")); - assert(charset_wctomb(charset, s, 0x200000) == 5 && - !strcmp(s, "\370\210\200\200\200..")); - assert(charset_wctomb(charset, s, 0x3ffffff) == 5 && - !strcmp(s, "\373\277\277\277\277..")); - assert(charset_wctomb(charset, s, 0x4000000) == 6 && - !strcmp(s, "\374\204\200\200\200\200.")); - assert(charset_wctomb(charset, s, 0x7fffffff) == 6 && - !strcmp(s, "\375\277\277\277\277\277.")); -} - -void test_ascii() -{ - struct charset *charset; - int wc; - char s[3]; - - charset = charset_find("us-ascii"); - test_any(charset); - - /* Decoder */ - wc = 0; - assert(charset_mbtowc(charset, &wc, "\177", 2) == 1 && wc == 127); - assert(charset_mbtowc(charset, &wc, "\200", 2) == -1); - - /* Encoder */ - strcpy(s, ".."); - assert(charset_wctomb(charset, s, 256) == -1 && !strcmp(s, "..")); - assert(charset_wctomb(charset, s, 255) == -1); - assert(charset_wctomb(charset, s, 128) == -1); - assert(charset_wctomb(charset, s, 127) == 1 && !strcmp(s, "\177.")); -} - -void test_iso1() -{ - struct charset *charset; - int wc; - char s[3]; - - charset = charset_find("iso-8859-1"); - test_any(charset); - - /* Decoder */ - wc = 0; - assert(charset_mbtowc(charset, &wc, "\302\200", 9) == 1 && wc == 0xc2); - - /* Encoder */ - strcpy(s, ".."); - assert(charset_wctomb(charset, s, 256) == -1 && !strcmp(s, "..")); - assert(charset_wctomb(charset, s, 255) == 1 && !strcmp(s, "\377.")); - assert(charset_wctomb(charset, s, 128) == 1 && !strcmp(s, "\200.")); -} - -void test_iso2() -{ - struct charset *charset; - int wc; - char s[3]; - - charset = charset_find("iso-8859-2"); - test_any(charset); - - /* Decoder */ - wc = 0; - assert(charset_mbtowc(charset, &wc, "\302\200", 9) == 1 && wc == 0xc2); - assert(charset_mbtowc(charset, &wc, "\377", 2) == 1 && wc == 0x2d9); - - /* Encoder */ - strcpy(s, ".."); - assert(charset_wctomb(charset, s, 256) == -1 && !strcmp(s, "..")); - assert(charset_wctomb(charset, s, 255) == -1 && !strcmp(s, "..")); - assert(charset_wctomb(charset, s, 258) == 1 && !strcmp(s, "\303.")); - assert(charset_wctomb(charset, s, 128) == 1 && !strcmp(s, "\200.")); -} - -void test_convert() -{ - const char *p; - char *q, *r; - char s[256]; - size_t n, n2; - int i; - - p = "\000x\302\200\375\277\277\277\277\277"; - assert(charset_convert("UTF-8", "UTF-8", p, 10, &q, &n) == 0 && - n == 10 && !strcmp(p, q)); - assert(charset_convert("UTF-8", "UTF-8", "x\301\277y", 4, &q, &n) == 2 && - n == 4 && !strcmp(q, "x##y")); - assert(charset_convert("UTF-8", "UTF-8", "x\301\277y", 4, 0, &n) == 2 && - n == 4); - assert(charset_convert("UTF-8", "UTF-8", "x\301\277y", 4, &q, 0) == 2 && - !strcmp(q, "x##y")); - assert(charset_convert("UTF-8", "iso-8859-1", - "\302\200\304\200x", 5, &q, &n) == 1 && - n == 3 && !strcmp(q, "\200?x")); - assert(charset_convert("iso-8859-1", "UTF-8", - "\000\200\377", 3, &q, &n) == 0 && - n == 5 && !memcmp(q, "\000\302\200\303\277", 5)); - assert(charset_convert("iso-8859-1", "iso-8859-1", - "\000\200\377", 3, &q, &n) == 0 && - n == 3 && !memcmp(q, "\000\200\377", 3)); - - assert(charset_convert("iso-8859-2", "utf-8", "\300", 1, &q, &n) == 0 && - n == 2 && !strcmp(q, "\305\224")); - assert(charset_convert("utf-8", "iso-8859-2", "\305\224", 2, &q, &n) == 0 && - n == 1 && !strcmp(q, "\300")); - - for (i = 0; i < 256; i++) - s[i] = i; - - assert(charset_convert("iso-8859-2", "utf-8", s, 256, &q, &n) == 0); - assert(charset_convert("utf-8", "iso-8859-2", q, n, &r, &n2) == 0); - assert(n2 == 256 && !memcmp(r, s, n2)); -} - -int main() -{ - test_utf8(); - test_ascii(); - test_iso1(); - test_iso2(); - - test_convert(); - - return 0; -} diff --git a/3rdparty/libflac/src/share/utf8/charsetmap.h b/3rdparty/libflac/src/share/utf8/charsetmap.h deleted file mode 100644 index b81259051f0..00000000000 --- a/3rdparty/libflac/src/share/utf8/charsetmap.h +++ /dev/null @@ -1,79 +0,0 @@ -/* This file was automatically generated by make_code_map.pl - please don't edit directly - Daniel Resare <noa@metamatrix.se> -*/ -charset_map maps[] = { - {"ISO-8859-1", - { - 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, - 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, - 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, - 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, - 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, - 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, - 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, - 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, - 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, - 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, - 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, - 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, - 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, - 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, - 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, - 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, - 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, - 0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, - 0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, - 0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, - 0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7, - 0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF, - 0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7, - 0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF, - 0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7, - 0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF, - 0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7, - 0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF, - 0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7, - 0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF, - 0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7, - 0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF - } - }, - {"ISO-8859-2", - { - 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, - 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, - 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, - 0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F, - 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027, - 0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F, - 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037, - 0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F, - 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047, - 0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F, - 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057, - 0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F, - 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067, - 0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F, - 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077, - 0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E,0x007F, - 0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087, - 0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F, - 0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097, - 0x0098,0x0099,0x009A,0x009B,0x009C,0x009D,0x009E,0x009F, - 0x00A0,0x0104,0x02D8,0x0141,0x00A4,0x013D,0x015A,0x00A7, - 0x00A8,0x0160,0x015E,0x0164,0x0179,0x00AD,0x017D,0x017B, - 0x00B0,0x0105,0x02DB,0x0142,0x00B4,0x013E,0x015B,0x02C7, - 0x00B8,0x0161,0x015F,0x0165,0x017A,0x02DD,0x017E,0x017C, - 0x0154,0x00C1,0x00C2,0x0102,0x00C4,0x0139,0x0106,0x00C7, - 0x010C,0x00C9,0x0118,0x00CB,0x011A,0x00CD,0x00CE,0x010E, - 0x0110,0x0143,0x0147,0x00D3,0x00D4,0x0150,0x00D6,0x00D7, - 0x0158,0x016E,0x00DA,0x0170,0x00DC,0x00DD,0x0162,0x00DF, - 0x0155,0x00E1,0x00E2,0x0103,0x00E4,0x013A,0x0107,0x00E7, - 0x010D,0x00E9,0x0119,0x00EB,0x011B,0x00ED,0x00EE,0x010F, - 0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7, - 0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9 - } - }, - {NULL} -}; diff --git a/3rdparty/libflac/src/share/utf8/iconvert.c b/3rdparty/libflac/src/share/utf8/iconvert.c deleted file mode 100644 index f0311ee0610..00000000000 --- a/3rdparty/libflac/src/share/utf8/iconvert.c +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright (C) 2001 Edmund Grimley Evans <edmundo@rano.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#ifdef HAVE_ICONV - -#include <assert.h> -#include <errno.h> -#include <iconv.h> -#include <stdlib.h> -#include <string.h> - -#include "iconvert.h" -#include "share/alloc.h" - -/* - * Convert data from one encoding to another. Return: - * - * -2 : memory allocation failed - * -1 : unknown encoding - * 0 : data was converted exactly - * 1 : data was converted inexactly - * 2 : data was invalid (but still converted) - * - * We convert in two steps, via UTF-8, as this is the only - * reliable way of distinguishing between invalid input - * and valid input which iconv refuses to transliterate. - * We convert from UTF-8 twice, because we have no way of - * knowing whether the conversion was exact if iconv returns - * E2BIG (due to a bug in the specification of iconv). - * An alternative approach is to assume that the output of - * iconv is never more than 4 times as long as the input, - * but I prefer to avoid that assumption if possible. - */ - -int iconvert(const char *fromcode, const char *tocode, - const char *from, size_t fromlen, - char **to, size_t *tolen) -{ - int ret = 0; - iconv_t cd1, cd2; - char *ib; - char *ob; - char *utfbuf = 0, *outbuf, *newbuf; - size_t utflen, outlen, ibl, obl, k; - char tbuf[2048]; - - cd1 = iconv_open("UTF-8", fromcode); - if (cd1 == (iconv_t)(-1)) - return -1; - - cd2 = (iconv_t)(-1); - /* Don't use strcasecmp() as it's locale-dependent. */ - if (!strchr("Uu", tocode[0]) || - !strchr("Tt", tocode[1]) || - !strchr("Ff", tocode[2]) || - tocode[3] != '-' || - tocode[4] != '8' || - tocode[5] != '\0') { - char *tocode1; - - /* - * Try using this non-standard feature of glibc and libiconv. - * This is deliberately not a config option as people often - * change their iconv library without rebuilding applications. - */ - tocode1 = (char *)safe_malloc_add_2op_(strlen(tocode), /*+*/11); - if (!tocode1) - goto fail; - - strcpy(tocode1, tocode); - strcat(tocode1, "//TRANSLIT"); - cd2 = iconv_open(tocode1, "UTF-8"); - free(tocode1); - - if (cd2 == (iconv_t)(-1)) - cd2 = iconv_open(tocode, fromcode); - - if (cd2 == (iconv_t)(-1)) { - iconv_close(cd1); - return -1; - } - } - - utflen = 1; /*fromlen * 2 + 1; XXX */ - utfbuf = (char *)malloc(utflen); - if (!utfbuf) - goto fail; - - /* Convert to UTF-8 */ - ib = (char *)from; - ibl = fromlen; - ob = utfbuf; - obl = utflen; - for (;;) { - k = iconv(cd1, &ib, &ibl, &ob, &obl); - assert((!k && !ibl) || - (k == (size_t)(-1) && errno == E2BIG && ibl && obl < 6) || - (k == (size_t)(-1) && - (errno == EILSEQ || errno == EINVAL) && ibl)); - if (!ibl) - break; - if (obl < 6) { - /* Enlarge the buffer */ - if(utflen*2 < utflen) /* overflow check */ - goto fail; - utflen *= 2; - newbuf = (char *)realloc(utfbuf, utflen); - if (!newbuf) - goto fail; - ob = (ob - utfbuf) + newbuf; - obl = utflen - (ob - newbuf); - utfbuf = newbuf; - } - else { - /* Invalid input */ - ib++, ibl--; - *ob++ = '#', obl--; - ret = 2; - iconv(cd1, 0, 0, 0, 0); - } - } - - if (cd2 == (iconv_t)(-1)) { - /* The target encoding was UTF-8 */ - if (tolen) - *tolen = ob - utfbuf; - if (!to) { - free(utfbuf); - iconv_close(cd1); - return ret; - } - newbuf = (char *)safe_realloc_add_2op_(utfbuf, (ob - utfbuf), /*+*/1); - if (!newbuf) - goto fail; - ob = (ob - utfbuf) + newbuf; - *ob = '\0'; - *to = newbuf; - iconv_close(cd1); - return ret; - } - - /* Truncate the buffer to be tidy */ - utflen = ob - utfbuf; - newbuf = (char *)realloc(utfbuf, utflen); - if (!newbuf) - goto fail; - utfbuf = newbuf; - - /* Convert from UTF-8 to discover how long the output is */ - outlen = 0; - ib = utfbuf; - ibl = utflen; - while (ibl) { - ob = tbuf; - obl = sizeof(tbuf); - k = iconv(cd2, &ib, &ibl, &ob, &obl); - assert((k != (size_t)(-1) && !ibl) || - (k == (size_t)(-1) && errno == E2BIG && ibl) || - (k == (size_t)(-1) && errno == EILSEQ && ibl)); - if (ibl && !(k == (size_t)(-1) && errno == E2BIG)) { - /* Replace one character */ - char *tb = "?"; - size_t tbl = 1; - - outlen += ob - tbuf; - ob = tbuf; - obl = sizeof(tbuf); - k = iconv(cd2, &tb, &tbl, &ob, &obl); - assert((!k && !tbl) || - (k == (size_t)(-1) && errno == EILSEQ && tbl)); - for (++ib, --ibl; ibl && (*ib & 0x80); ib++, ibl--) - ; - } - outlen += ob - tbuf; - } - ob = tbuf; - obl = sizeof(tbuf); - k = iconv(cd2, 0, 0, &ob, &obl); - assert(!k); - outlen += ob - tbuf; - - /* Convert from UTF-8 for real */ - outbuf = (char *)safe_malloc_add_2op_(outlen, /*+*/1); - if (!outbuf) - goto fail; - ib = utfbuf; - ibl = utflen; - ob = outbuf; - obl = outlen; - while (ibl) { - k = iconv(cd2, &ib, &ibl, &ob, &obl); - assert((k != (size_t)(-1) && !ibl) || - (k == (size_t)(-1) && errno == EILSEQ && ibl)); - if (k && !ret) - ret = 1; - if (ibl && !(k == (size_t)(-1) && errno == E2BIG)) { - /* Replace one character */ - char *tb = "?"; - size_t tbl = 1; - - k = iconv(cd2, &tb, &tbl, &ob, &obl); - assert((!k && !tbl) || - (k == (size_t)(-1) && errno == EILSEQ && tbl)); - for (++ib, --ibl; ibl && (*ib & 0x80); ib++, ibl--) - ; - } - } - k = iconv(cd2, 0, 0, &ob, &obl); - assert(!k); - assert(!obl); - *ob = '\0'; - - free(utfbuf); - iconv_close(cd1); - iconv_close(cd2); - if (tolen) - *tolen = outlen; - if (!to) { - free(outbuf); - return ret; - } - *to = outbuf; - return ret; - - fail: - if(0 != utfbuf) - free(utfbuf); - iconv_close(cd1); - if (cd2 != (iconv_t)(-1)) - iconv_close(cd2); - return -2; -} - -#endif /* HAVE_ICONV */ diff --git a/3rdparty/libflac/src/share/utf8/iconvert.h b/3rdparty/libflac/src/share/utf8/iconvert.h deleted file mode 100644 index 1a1a06a13ab..00000000000 --- a/3rdparty/libflac/src/share/utf8/iconvert.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2001 Edmund Grimley Evans <edmundo@rano.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#ifdef HAVE_ICONV - -/* - * Convert data from one encoding to another. Return: - * - * -2 : memory allocation failed - * -1 : unknown encoding - * 0 : data was converted exactly - * 1 : data was converted inexactly - * 2 : data was invalid (but still converted) - * - * We convert in two steps, via UTF-8, as this is the only - * reliable way of distinguishing between invalid input - * and valid input which iconv refuses to transliterate. - * We convert from UTF-8 twice, because we have no way of - * knowing whether the conversion was exact if iconv returns - * E2BIG (due to a bug in the specification of iconv). - * An alternative approach is to assume that the output of - * iconv is never more than 4 times as long as the input, - * but I prefer to avoid that assumption if possible. - */ - -int iconvert(const char *fromcode, const char *tocode, - const char *from, size_t fromlen, - char **to, size_t *tolen) ; - -#endif /* HAVE_ICONV */ diff --git a/3rdparty/libflac/src/share/utf8/makemap.c b/3rdparty/libflac/src/share/utf8/makemap.c deleted file mode 100644 index 72a9de18def..00000000000 --- a/3rdparty/libflac/src/share/utf8/makemap.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2001 Edmund Grimley Evans <edmundo@rano.org> - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <errno.h> -#include <iconv.h> -#include <stdio.h> - -int main(int argc, char *argv[]) -{ - iconv_t cd; - const char *ib; - char *ob; - size_t ibl, obl, k; - unsigned char c, buf[4]; - int i, wc; - - if (argc != 2) { - printf("Usage: %s ENCODING\n", argv[0]); - printf("Output a charset map for the 8-bit ENCODING.\n"); - return 1; - } - - cd = iconv_open("UCS-4", argv[1]); - if (cd == (iconv_t)(-1)) { - perror("iconv_open"); - return 1; - } - - for (i = 0; i < 256; i++) { - c = i; - ib = &c; - ibl = 1; - ob = buf; - obl = 4; - k = iconv(cd, &ib, &ibl, &ob, &obl); - if (!k && !ibl && !obl) { - wc = (buf[0] << 24) + (buf[1] << 16) + (buf[2] << 8) + buf[3]; - if (wc >= 0xffff) { - printf("Dodgy value.\n"); - return 1; - } - } - else if (k == (size_t)(-1) && errno == EILSEQ) - wc = 0xffff; - else { - printf("Non-standard iconv.\n"); - return 1; - } - - if (i % 8 == 0) - printf(" "); - printf("0x%04x", wc); - if (i == 255) - printf("\n"); - else if (i % 8 == 7) - printf(",\n"); - else - printf(", "); - } - - return 0; -} diff --git a/3rdparty/libflac/src/share/utf8/utf8.c b/3rdparty/libflac/src/share/utf8/utf8.c deleted file mode 100644 index 303fe23a060..00000000000 --- a/3rdparty/libflac/src/share/utf8/utf8.c +++ /dev/null @@ -1,319 +0,0 @@ -/* - * Copyright (C) 2001 Peter Harris <peter.harris@hummingbird.com> - * Copyright (C) 2001 Edmund Grimley Evans <edmundo@rano.org> - * - * Buffer overflow checking added: Josh Coalson, 9/9/2007 - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Convert a string between UTF-8 and the locale's charset. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdlib.h> -#include <string.h> - -#include "share/alloc.h" -#include "utf8.h" -#include "charset.h" - - -#ifdef _WIN32 - - /* Thanks to Peter Harris <peter.harris@hummingbird.com> for this win32 - * code. - */ - -#include <stdio.h> -#include <windows.h> - -static unsigned char *make_utf8_string(const wchar_t *unicode) -{ - size_t size = 0, n; - int index = 0, out_index = 0; - unsigned char *out; - unsigned short c; - - /* first calculate the size of the target string */ - c = unicode[index++]; - while(c) { - if(c < 0x0080) { - n = 1; - } else if(c < 0x0800) { - n = 2; - } else { - n = 3; - } - if(size+n < size) /* overflow check */ - return NULL; - size += n; - c = unicode[index++]; - } - - out = safe_malloc_add_2op_(size, /*+*/1); - if (out == NULL) - return NULL; - index = 0; - - c = unicode[index++]; - while(c) - { - if(c < 0x080) { - out[out_index++] = (unsigned char)c; - } else if(c < 0x800) { - out[out_index++] = 0xc0 | (c >> 6); - out[out_index++] = 0x80 | (c & 0x3f); - } else { - out[out_index++] = 0xe0 | (c >> 12); - out[out_index++] = 0x80 | ((c >> 6) & 0x3f); - out[out_index++] = 0x80 | (c & 0x3f); - } - c = unicode[index++]; - } - out[out_index] = 0x00; - - return out; -} - -static wchar_t *make_unicode_string(const unsigned char *utf8) -{ - size_t size = 0; - int index = 0, out_index = 0; - wchar_t *out; - unsigned char c; - - /* first calculate the size of the target string */ - c = utf8[index++]; - while(c) { - if((c & 0x80) == 0) { - index += 0; - } else if((c & 0xe0) == 0xe0) { - index += 2; - } else { - index += 1; - } - if(size + 1 == 0) /* overflow check */ - return NULL; - size++; - c = utf8[index++]; - } - - if(size + 1 == 0) /* overflow check */ - return NULL; - out = safe_malloc_mul_2op_(size+1, /*times*/sizeof(wchar_t)); - if (out == NULL) - return NULL; - index = 0; - - c = utf8[index++]; - while(c) - { - if((c & 0x80) == 0) { - out[out_index++] = c; - } else if((c & 0xe0) == 0xe0) { - out[out_index] = (c & 0x1F) << 12; - c = utf8[index++]; - out[out_index] |= (c & 0x3F) << 6; - c = utf8[index++]; - out[out_index++] |= (c & 0x3F); - } else { - out[out_index] = (c & 0x3F) << 6; - c = utf8[index++]; - out[out_index++] |= (c & 0x3F); - } - c = utf8[index++]; - } - out[out_index] = 0; - - return out; -} - -int utf8_encode(const char *from, char **to) -{ - wchar_t *unicode; - int wchars, err; - - wchars = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, from, - strlen(from), NULL, 0); - - if(wchars == 0) - { - fprintf(stderr, "Unicode translation error %d\n", GetLastError()); - return -1; - } - - if(wchars < 0) /* underflow check */ - return -1; - - unicode = safe_calloc_((size_t)wchars + 1, sizeof(unsigned short)); - if(unicode == NULL) - { - fprintf(stderr, "Out of memory processing string to UTF8\n"); - return -1; - } - - err = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, from, - strlen(from), unicode, wchars); - if(err != wchars) - { - free(unicode); - fprintf(stderr, "Unicode translation error %d\n", GetLastError()); - return -1; - } - - /* On NT-based windows systems, we could use WideCharToMultiByte(), but - * MS doesn't actually have a consistent API across win32. - */ - *to = make_utf8_string(unicode); - - free(unicode); - return 0; -} - -int utf8_decode(const char *from, char **to) -{ - wchar_t *unicode; - int chars, err; - - /* On NT-based windows systems, we could use MultiByteToWideChar(CP_UTF8), but - * MS doesn't actually have a consistent API across win32. - */ - unicode = make_unicode_string(from); - if(unicode == NULL) - { - fprintf(stderr, "Out of memory processing string from UTF8 to UNICODE16\n"); - return -1; - } - - chars = WideCharToMultiByte(GetConsoleCP(), WC_COMPOSITECHECK, unicode, - -1, NULL, 0, NULL, NULL); - - if(chars < 0) /* underflow check */ - return -1; - - if(chars == 0) - { - fprintf(stderr, "Unicode translation error %d\n", GetLastError()); - free(unicode); - return -1; - } - - *to = safe_calloc_((size_t)chars + 1, sizeof(unsigned char)); - if(*to == NULL) - { - fprintf(stderr, "Out of memory processing string to local charset\n"); - free(unicode); - return -1; - } - - err = WideCharToMultiByte(GetConsoleCP(), WC_COMPOSITECHECK, unicode, - -1, *to, chars, NULL, NULL); - if(err != chars) - { - fprintf(stderr, "Unicode translation error %d\n", GetLastError()); - free(unicode); - free(*to); - *to = NULL; - return -1; - } - - free(unicode); - return 0; -} - -#else /* End win32. Rest is for real operating systems */ - - -#ifdef HAVE_LANGINFO_CODESET -#include <langinfo.h> -#endif - -#include "iconvert.h" - -static const char *current_charset(void) -{ - const char *c = 0; -#ifdef HAVE_LANGINFO_CODESET - c = nl_langinfo(CODESET); -#endif - - if (!c) - c = getenv("CHARSET"); - - return c? c : "US-ASCII"; -} - -static int convert_buffer(const char *fromcode, const char *tocode, - const char *from, size_t fromlen, - char **to, size_t *tolen) -{ - int ret = -1; - -#ifdef HAVE_ICONV - ret = iconvert(fromcode, tocode, from, fromlen, to, tolen); - if (ret != -1) - return ret; -#endif - -#ifndef HAVE_ICONV /* should be ifdef USE_CHARSET_CONVERT */ - ret = charset_convert(fromcode, tocode, from, fromlen, to, tolen); - if (ret != -1) - return ret; -#endif - - return ret; -} - -static int convert_string(const char *fromcode, const char *tocode, - const char *from, char **to, char replace) -{ - int ret; - size_t fromlen; - char *s; - - fromlen = strlen(from); - ret = convert_buffer(fromcode, tocode, from, fromlen, to, 0); - if (ret == -2) - return -1; - if (ret != -1) - return ret; - - s = safe_malloc_add_2op_(fromlen, /*+*/1); - if (!s) - return -1; - strcpy(s, from); - *to = s; - for (; *s; s++) - if (*s & ~0x7f) - *s = replace; - return 3; -} - -int utf8_encode(const char *from, char **to) -{ - return convert_string(current_charset(), "UTF-8", from, to, '#'); -} - -int utf8_decode(const char *from, char **to) -{ - return convert_string("UTF-8", current_charset(), from, to, '?'); -} - -#endif diff --git a/3rdparty/libflac/src/share/utf8/utf8_static.dsp b/3rdparty/libflac/src/share/utf8/utf8_static.dsp deleted file mode 100644 index c655ef7d0aa..00000000000 --- a/3rdparty/libflac/src/share/utf8/utf8_static.dsp +++ /dev/null @@ -1,116 +0,0 @@ -# Microsoft Developer Studio Project File - Name="utf8_static" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=utf8_static - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "utf8_static.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "utf8_static.mak" CFG="utf8_static - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "utf8_static - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "utf8_static - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "utf8" -# PROP Scc_LocalPath "..\..\.." -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "utf8_static - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\..\obj\release\lib" -# PROP Intermediate_Dir "Release_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ".\include" /I "..\..\..\include" /I "..\..\..\include\share" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /nodefaultlib - -!ELSEIF "$(CFG)" == "utf8_static - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\..\obj\debug\lib" -# PROP Intermediate_Dir "Debug_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\include" /I "..\..\..\include" /I "..\..\..\include\share" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /nodefaultlib - -!ENDIF - -# Begin Target - -# Name "utf8_static - Win32 Release" -# Name "utf8_static - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "c" -# Begin Source File - -SOURCE=.\charset.c -# End Source File -# Begin Source File - -SOURCE=.\iconvert.c -# End Source File -# Begin Source File - -SOURCE=.\utf8.c -# End Source File -# End Group -# Begin Group "Private Header Files" - -# PROP Default_Filter "" -# End Group -# Begin Group "Protected Header Files" - -# PROP Default_Filter "" -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\..\include\share\utf8.h -# End Source File -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/share/utf8/utf8_static.vcproj b/3rdparty/libflac/src/share/utf8/utf8_static.vcproj deleted file mode 100644 index bcc8ca3c796..00000000000 --- a/3rdparty/libflac/src/share/utf8/utf8_static.vcproj +++ /dev/null @@ -1,201 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="utf8_static" - ProjectGUID="{4cefbc92-c215-11db-8314-0800200c9a66}" - RootNamespace="utf8_static" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\..\obj\debug\lib" - IntermediateDirectory="Debug_static" - ConfigurationType="4" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".\include;..\..\..\include;..\..\..\include\share" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;FLAC__NO_DLL;DEBUG" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\..\..\obj\debug\lib\$(ProjectName).lib" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\..\obj\release\lib" - IntermediateDirectory="Release_static" - ConfigurationType="4" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".\include;..\..\..\include;..\..\..\include\share" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__NO_DLL" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\..\..\obj\release\lib\$(ProjectName).lib" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath=".\charmaps.h" - > - </File> - <File - RelativePath=".\charset.h" - > - </File> - <File - RelativePath=".\charsetmap.h" - > - </File> - </Filter> - <Filter - Name="Public Header Files" - > - <File - RelativePath="..\..\..\include\share\utf8.h" - > - </File> - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\charset.c" - > - </File> - <File - RelativePath=".\iconvert.c" - > - </File> - <File - RelativePath=".\utf8.c" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/test_grabbag/Makefile.am b/3rdparty/libflac/src/test_grabbag/Makefile.am deleted file mode 100644 index 825d1cbe39b..00000000000 --- a/3rdparty/libflac/src/test_grabbag/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -# FLAC - Free Lossless Audio Codec -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# This file is part the FLAC project. FLAC is comprised of several -# components distributed under difference licenses. The codec libraries -# are distributed under Xiph.Org's BSD-like license (see the file -# COPYING.Xiph in this distribution). All other programs, libraries, and -# plugins are distributed under the GPL (see COPYING.GPL). The documentation -# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the -# FLAC distribution contains at the top the terms under which it may be -# distributed. -# -# Since this particular file is relevant to all components of FLAC, -# it may be distributed under the Xiph.Org license, which is the least -# restrictive of those mentioned above. See the file COPYING.Xiph in this -# distribution. - -SUBDIRS = cuesheet picture - -EXTRA_DIST = \ - Makefile.lite diff --git a/3rdparty/libflac/src/test_grabbag/Makefile.in b/3rdparty/libflac/src/test_grabbag/Makefile.in deleted file mode 100644 index 752b7b1b3aa..00000000000 --- a/3rdparty/libflac/src/test_grabbag/Makefile.in +++ /dev/null @@ -1,524 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# FLAC - Free Lossless Audio Codec -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# This file is part the FLAC project. FLAC is comprised of several -# components distributed under difference licenses. The codec libraries -# are distributed under Xiph.Org's BSD-like license (see the file -# COPYING.Xiph in this distribution). All other programs, libraries, and -# plugins are distributed under the GPL (see COPYING.GPL). The documentation -# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the -# FLAC distribution contains at the top the terms under which it may be -# distributed. -# -# Since this particular file is relevant to all components of FLAC, -# it may be distributed under the Xiph.Org license, which is the least -# restrictive of those mentioned above. See the file COPYING.Xiph in this -# distribution. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -SUBDIRS = cuesheet picture - -EXTRA_DIST = \ - Makefile.lite - -subdir = src/test_grabbag -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = - -RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ - ps-recursive install-info-recursive uninstall-info-recursive \ - all-recursive install-data-recursive install-exec-recursive \ - installdirs-recursive install-recursive uninstall-recursive \ - check-recursive installcheck-recursive -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -DIST_SUBDIRS = $(SUBDIRS) -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/test_grabbag/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -mostlyclean-recursive clean-recursive distclean-recursive \ -maintainer-clean-recursive: - @set fnord $$MAKEFLAGS; amf=$$2; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if (etags --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - else \ - include_option=--include; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: - -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-libtool \ - distclean-tags - -dvi: dvi-recursive - -dvi-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-recursive - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-info-am - -uninstall-info: uninstall-info-recursive - -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ - clean-generic clean-libtool clean-recursive ctags \ - ctags-recursive distclean distclean-generic distclean-libtool \ - distclean-recursive distclean-tags distdir dvi dvi-am \ - dvi-recursive info info-am info-recursive install install-am \ - install-data install-data-am install-data-recursive \ - install-exec install-exec-am install-exec-recursive \ - install-info install-info-am install-info-recursive install-man \ - install-recursive install-strip installcheck installcheck-am \ - installdirs installdirs-am installdirs-recursive \ - maintainer-clean maintainer-clean-generic \ - maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-libtool mostlyclean-recursive pdf pdf-am \ - pdf-recursive ps ps-am ps-recursive tags tags-recursive \ - uninstall uninstall-am uninstall-info-am \ - uninstall-info-recursive uninstall-recursive - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/test_grabbag/Makefile.lite b/3rdparty/libflac/src/test_grabbag/Makefile.lite deleted file mode 100644 index 93512c315f1..00000000000 --- a/3rdparty/libflac/src/test_grabbag/Makefile.lite +++ /dev/null @@ -1,40 +0,0 @@ -# test_grabbag - Simple testers for the grabbag library -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -.PHONY: cuesheet picture -all: cuesheet picture - -DEFAULT_CONFIG = release - -CONFIG = $(DEFAULT_CONFIG) - -debug : CONFIG = debug -valgrind: CONFIG = valgrind -release : CONFIG = release - -debug : all -valgrind: all -release : all - -cuesheet: - (cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG)) -picture: - (cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG)) - -clean: - -(cd cuesheet ; $(MAKE) -f Makefile.lite clean) - -(cd picture ; $(MAKE) -f Makefile.lite clean) diff --git a/3rdparty/libflac/src/test_grabbag/cuesheet/Makefile.am b/3rdparty/libflac/src/test_grabbag/cuesheet/Makefile.am deleted file mode 100644 index 1d6d709b46c..00000000000 --- a/3rdparty/libflac/src/test_grabbag/cuesheet/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -# test_cuesheet - Simple tester for cuesheet routines in grabbag -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -EXTRA_DIST = \ - Makefile.lite \ - test_cuesheet.dsp \ - test_cuesheet.vcproj - -noinst_PROGRAMS = test_cuesheet -test_cuesheet_SOURCES = \ - main.c -test_cuesheet_LDADD = \ - $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \ - $(top_builddir)/src/libFLAC/libFLAC.la \ - @OGG_LIBS@ \ - -lm diff --git a/3rdparty/libflac/src/test_grabbag/cuesheet/Makefile.in b/3rdparty/libflac/src/test_grabbag/cuesheet/Makefile.in deleted file mode 100644 index aee54dad67d..00000000000 --- a/3rdparty/libflac/src/test_grabbag/cuesheet/Makefile.in +++ /dev/null @@ -1,517 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# test_cuesheet - Simple tester for cuesheet routines in grabbag -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -EXTRA_DIST = \ - Makefile.lite \ - test_cuesheet.dsp \ - test_cuesheet.vcproj - - -noinst_PROGRAMS = test_cuesheet -test_cuesheet_SOURCES = \ - main.c - -test_cuesheet_LDADD = \ - $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \ - $(top_builddir)/src/libFLAC/libFLAC.la \ - @OGG_LIBS@ \ - -lm - -subdir = src/test_grabbag/cuesheet -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -noinst_PROGRAMS = test_cuesheet$(EXEEXT) -PROGRAMS = $(noinst_PROGRAMS) - -am_test_cuesheet_OBJECTS = main.$(OBJEXT) -test_cuesheet_OBJECTS = $(am_test_cuesheet_OBJECTS) -test_cuesheet_DEPENDENCIES = \ - $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \ - $(top_builddir)/src/libFLAC/libFLAC.la -test_cuesheet_LDFLAGS = - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/main.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(test_cuesheet_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(test_cuesheet_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/test_grabbag/cuesheet/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -test_cuesheet$(EXEEXT): $(test_cuesheet_OBJECTS) $(test_cuesheet_DEPENDENCIES) - @rm -f test_cuesheet$(EXEEXT) - $(LINK) $(test_cuesheet_LDFLAGS) $(test_cuesheet_OBJECTS) $(test_cuesheet_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/test_grabbag/cuesheet/Makefile.lite b/3rdparty/libflac/src/test_grabbag/cuesheet/Makefile.lite deleted file mode 100644 index 0178b1e5bd8..00000000000 --- a/3rdparty/libflac/src/test_grabbag/cuesheet/Makefile.lite +++ /dev/null @@ -1,40 +0,0 @@ -# test_cuesheet - Simple tester for cuesheet routines in grabbag -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# -# GNU makefile -# - -topdir = ../../.. -libdir = $(topdir)/obj/$(BUILD)/lib - -PROGRAM_NAME = test_cuesheet - -INCLUDES = -I./include -I$(topdir)/include - -ifeq ($(DARWIN_BUILD),yes) -EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm -else -LIBS = -lgrabbag -lreplaygain_analysis -lFLAC -L$(OGG_LIB_DIR) -logg -lm -endif - -SRCS_C = \ - main.c - -include $(topdir)/build/exe.mk - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/3rdparty/libflac/src/test_grabbag/cuesheet/main.c b/3rdparty/libflac/src/test_grabbag/cuesheet/main.c deleted file mode 100644 index bb99834c6fe..00000000000 --- a/3rdparty/libflac/src/test_grabbag/cuesheet/main.c +++ /dev/null @@ -1,138 +0,0 @@ -/* test_cuesheet - Simple tester for cuesheet routines in grabbag - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <errno.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "FLAC/assert.h" -#include "FLAC/metadata.h" -#include "share/grabbag.h" - -static int do_cuesheet(const char *infilename, FLAC__bool is_cdda, FLAC__uint64 lead_out_offset) -{ - FILE *fin, *fout; - const char *error_message; - char tmpfilename[4096]; - unsigned last_line_read; - FLAC__StreamMetadata *cuesheet; - - FLAC__ASSERT(strlen(infilename) + 2 < sizeof(tmpfilename)); - - /* - * pass 1 - */ - if(0 == strcmp(infilename, "-")) { - fin = stdin; - } - else if(0 == (fin = fopen(infilename, "r"))) { - fprintf(stderr, "can't open file %s for reading: %s\n", infilename, strerror(errno)); - return 255; - } - if(0 != (cuesheet = grabbag__cuesheet_parse(fin, &error_message, &last_line_read, is_cdda, lead_out_offset))) { - if(fin != stdin) - fclose(fin); - } - else { - printf("pass1: parse error, line %u: \"%s\"\n", last_line_read, error_message); - if(fin != stdin) - fclose(fin); - return 1; - } - if(!FLAC__metadata_object_cuesheet_is_legal(cuesheet, is_cdda, &error_message)) { - printf("pass1: illegal cuesheet: \"%s\"\n", error_message); - FLAC__metadata_object_delete(cuesheet); - return 1; - } - sprintf(tmpfilename, "%s.1", infilename); - if(0 == (fout = fopen(tmpfilename, "w"))) { - fprintf(stderr, "can't open file %s for writing: %s\n", tmpfilename, strerror(errno)); - FLAC__metadata_object_delete(cuesheet); - return 255; - } - grabbag__cuesheet_emit(fout, cuesheet, "\"dummy.wav\" WAVE"); - FLAC__metadata_object_delete(cuesheet); - fclose(fout); - - /* - * pass 2 - */ - if(0 == (fin = fopen(tmpfilename, "r"))) { - fprintf(stderr, "can't open file %s for reading: %s\n", tmpfilename, strerror(errno)); - return 255; - } - if(0 != (cuesheet = grabbag__cuesheet_parse(fin, &error_message, &last_line_read, is_cdda, lead_out_offset))) { - if(fin != stdin) - fclose(fin); - } - else { - printf("pass2: parse error, line %u: \"%s\"\n", last_line_read, error_message); - if(fin != stdin) - fclose(fin); - return 1; - } - if(!FLAC__metadata_object_cuesheet_is_legal(cuesheet, is_cdda, &error_message)) { - printf("pass2: illegal cuesheet: \"%s\"\n", error_message); - FLAC__metadata_object_delete(cuesheet); - return 1; - } - sprintf(tmpfilename, "%s.2", infilename); - if(0 == (fout = fopen(tmpfilename, "w"))) { - fprintf(stderr, "can't open file %s for writing: %s\n", tmpfilename, strerror(errno)); - FLAC__metadata_object_delete(cuesheet); - return 255; - } - grabbag__cuesheet_emit(fout, cuesheet, "\"dummy.wav\" WAVE"); - FLAC__metadata_object_delete(cuesheet); - fclose(fout); - - return 0; -} - -int main(int argc, char *argv[]) -{ - FLAC__uint64 lead_out_offset; - FLAC__bool is_cdda = false; - const char *usage = "usage: test_cuesheet cuesheet_file lead_out_offset [ cdda ]\n"; - - if(argc > 1 && 0 == strcmp(argv[1], "-h")) { - printf(usage); - return 0; - } - - if(argc < 3 || argc > 4) { - fprintf(stderr, usage); - return 255; - } - - lead_out_offset = (FLAC__uint64)strtoul(argv[2], 0, 10); - if(argc == 4) { - if(0 == strcmp(argv[3], "cdda")) - is_cdda = true; - else { - fprintf(stderr, usage); - return 255; - } - } - - return do_cuesheet(argv[1], is_cdda, lead_out_offset); -} diff --git a/3rdparty/libflac/src/test_grabbag/cuesheet/test_cuesheet.dsp b/3rdparty/libflac/src/test_grabbag/cuesheet/test_cuesheet.dsp deleted file mode 100644 index 7baeef57334..00000000000 --- a/3rdparty/libflac/src/test_grabbag/cuesheet/test_cuesheet.dsp +++ /dev/null @@ -1,96 +0,0 @@ -# Microsoft Developer Studio Project File - Name="test_cuesheet" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=test_cuesheet - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "test_cuesheet.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "test_cuesheet.mak" CFG="test_cuesheet - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "test_cuesheet - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "test_cuesheet - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "test_cuesheet - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\..\obj\release\bin" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "NDEBUG" /D "FLAC__NO_DLL" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\..\..\obj\release\lib\grabbag_static.lib ..\..\..\obj\release\lib\replaygain_analysis_static.lib ..\..\..\obj\release\lib\libFLAC_static.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "test_cuesheet - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\..\obj\debug\bin" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\include" /D "_DEBUG" /D "DEBUG" /D "FLAC__NO_DLL" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\..\..\obj\debug\lib\grabbag_static.lib ..\..\..\obj\debug\lib\replaygain_analysis_static.lib ..\..\..\obj\debug\lib\libFLAC_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "test_cuesheet - Win32 Release" -# Name "test_cuesheet - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "c" -# Begin Source File - -SOURCE=.\main.c -# End Source File -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/test_grabbag/cuesheet/test_cuesheet.vcproj b/3rdparty/libflac/src/test_grabbag/cuesheet/test_cuesheet.vcproj deleted file mode 100644 index e916beed82b..00000000000 --- a/3rdparty/libflac/src/test_grabbag/cuesheet/test_cuesheet.vcproj +++ /dev/null @@ -1,202 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="test_cuesheet" - ProjectGUID="{4cefbc8b-c215-11db-8314-0800200c9a66}" - RootNamespace="test_cuesheet" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\..\obj\debug\bin" - IntermediateDirectory="Debug" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".;..\..\..\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;FLAC__NO_DLL;DEBUG" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="2" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\..\obj\release\bin" - IntermediateDirectory="Release" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".;..\..\..\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__NO_DLL" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="1" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" - LinkTimeCodeGeneration="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\main.c" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/test_grabbag/picture/Makefile.am b/3rdparty/libflac/src/test_grabbag/picture/Makefile.am deleted file mode 100644 index 1f5d6553da1..00000000000 --- a/3rdparty/libflac/src/test_grabbag/picture/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -# test_picture - Simple tester for picture routines in grabbag -# Copyright (C) 2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -EXTRA_DIST = \ - Makefile.lite \ - test_picture.dsp \ - test_picture.vcproj - -noinst_PROGRAMS = test_picture -test_picture_SOURCES = \ - main.c -test_picture_LDADD = \ - $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/libFLAC/libFLAC.la \ - @OGG_LIBS@ \ - -lm diff --git a/3rdparty/libflac/src/test_grabbag/picture/Makefile.in b/3rdparty/libflac/src/test_grabbag/picture/Makefile.in deleted file mode 100644 index ae08e49d64b..00000000000 --- a/3rdparty/libflac/src/test_grabbag/picture/Makefile.in +++ /dev/null @@ -1,515 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# test_picture - Simple tester for picture routines in grabbag -# Copyright (C) 2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -EXTRA_DIST = \ - Makefile.lite \ - test_picture.dsp \ - test_picture.vcproj - - -noinst_PROGRAMS = test_picture -test_picture_SOURCES = \ - main.c - -test_picture_LDADD = \ - $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/libFLAC/libFLAC.la \ - @OGG_LIBS@ \ - -lm - -subdir = src/test_grabbag/picture -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -noinst_PROGRAMS = test_picture$(EXEEXT) -PROGRAMS = $(noinst_PROGRAMS) - -am_test_picture_OBJECTS = main.$(OBJEXT) -test_picture_OBJECTS = $(am_test_picture_OBJECTS) -test_picture_DEPENDENCIES = \ - $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/libFLAC/libFLAC.la -test_picture_LDFLAGS = - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/main.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(test_picture_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(test_picture_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/test_grabbag/picture/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -test_picture$(EXEEXT): $(test_picture_OBJECTS) $(test_picture_DEPENDENCIES) - @rm -f test_picture$(EXEEXT) - $(LINK) $(test_picture_LDFLAGS) $(test_picture_OBJECTS) $(test_picture_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/test_grabbag/picture/Makefile.lite b/3rdparty/libflac/src/test_grabbag/picture/Makefile.lite deleted file mode 100644 index af7ab5fa5e5..00000000000 --- a/3rdparty/libflac/src/test_grabbag/picture/Makefile.lite +++ /dev/null @@ -1,40 +0,0 @@ -# test_picture - Simple tester for picture routines in grabbag -# Copyright (C) 2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# -# GNU makefile -# - -topdir = ../../.. -libdir = $(topdir)/obj/$(BUILD)/lib - -PROGRAM_NAME = test_picture - -INCLUDES = -I./include -I$(topdir)/include - -ifeq ($(DARWIN_BUILD),yes) -EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm -else -LIBS = -lgrabbag -lreplaygain_analysis -lFLAC -L$(OGG_LIB_DIR) -logg -lm -endif - -SRCS_C = \ - main.c - -include $(topdir)/build/exe.mk - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/3rdparty/libflac/src/test_grabbag/picture/main.c b/3rdparty/libflac/src/test_grabbag/picture/main.c deleted file mode 100644 index 2ca34a6519a..00000000000 --- a/3rdparty/libflac/src/test_grabbag/picture/main.c +++ /dev/null @@ -1,224 +0,0 @@ -/* test_picture - Simple tester for picture routines in grabbag - * Copyright (C) 2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <string.h> -#include "FLAC/assert.h" -#include "share/grabbag.h" - -typedef struct { - const char *path; - const char *mime_type; - const char *description; - FLAC__uint32 width; - FLAC__uint32 height; - FLAC__uint32 depth; - FLAC__uint32 colors; - FLAC__StreamMetadata_Picture_Type type; -} PictureFile; - -PictureFile picturefiles[] = { - { "0.gif", "image/gif" , "", 24, 24, 24, 2, FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER }, - { "1.gif", "image/gif" , "", 12, 8, 24, 256, FLAC__STREAM_METADATA_PICTURE_TYPE_BACK_COVER }, - { "2.gif", "image/gif" , "", 16, 14, 24, 128, FLAC__STREAM_METADATA_PICTURE_TYPE_OTHER }, - { "0.jpg", "image/jpeg", "", 30, 20, 8, 0, FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER }, - { "4.jpg", "image/jpeg", "", 31, 47, 24, 0, FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER }, - { "0.png", "image/png" , "", 30, 20, 8, 0, FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER }, - { "1.png", "image/png" , "", 30, 20, 8, 0, FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER }, - { "2.png", "image/png" , "", 30, 20, 24, 7, FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER }, - { "3.png", "image/png" , "", 30, 20, 24, 7, FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER }, - { "4.png", "image/png" , "", 31, 47, 24, 0, FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER }, - { "5.png", "image/png" , "", 31, 47, 24, 0, FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER }, - { "6.png", "image/png" , "", 31, 47, 24, 23, FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER }, - { "7.png", "image/png" , "", 31, 47, 24, 23, FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER }, - { "8.png", "image/png" , "", 32, 32, 32, 0, 999 } -}; - -static FLAC__bool debug_ = false; - -static FLAC__bool failed_(const char *msg) -{ - if(msg) - printf("FAILED, %s\n", msg); - else - printf("FAILED\n"); - - return false; -} - -static FLAC__bool test_one_picture(const char *prefix, const PictureFile *pf, const char *res, FLAC__bool fn_only) -{ - FLAC__StreamMetadata *obj; - const char *error; - char s[4096]; - if(fn_only) -#if defined _MSC_VER || defined __MINGW32__ - _snprintf(s, sizeof(s)-1, "%s/%s", prefix, pf->path); -#else - snprintf(s, sizeof(s)-1, "%s/%s", prefix, pf->path); -#endif - else -#if defined _MSC_VER || defined __MINGW32__ - _snprintf(s, sizeof(s)-1, "%u|%s|%s|%s|%s/%s", (unsigned)pf->type, pf->mime_type, pf->description, res, prefix, pf->path); -#else - snprintf(s, sizeof(s)-1, "%u|%s|%s|%s|%s/%s", (unsigned)pf->type, pf->mime_type, pf->description, res, prefix, pf->path); -#endif - - printf("testing grabbag__picture_parse_specification(\"%s\")... ", s); - if(0 == (obj = grabbag__picture_parse_specification(s, &error))) - return failed_(error); - if(debug_) { - printf("\ntype=%u (%s)\nmime_type=%s\ndescription=%s\nwidth=%u\nheight=%u\ndepth=%u\ncolors=%u\ndata_length=%u\n", - obj->data.picture.type, - obj->data.picture.type < FLAC__STREAM_METADATA_PICTURE_TYPE_UNDEFINED? - FLAC__StreamMetadata_Picture_TypeString[obj->data.picture.type] : "UNDEFINED", - obj->data.picture.mime_type, - obj->data.picture.description, - obj->data.picture.width, - obj->data.picture.height, - obj->data.picture.depth, - obj->data.picture.colors, - obj->data.picture.data_length - ); - } - if(obj->data.picture.type != (fn_only? FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER : pf->type)) - return failed_("picture type mismatch"); - if(strcmp(obj->data.picture.mime_type, pf->mime_type)) - return failed_("picture MIME type mismatch"); - if(strcmp((const char *)obj->data.picture.description, (const char *)pf->description)) - return failed_("picture description mismatch"); - if(obj->data.picture.width != pf->width) - return failed_("picture width mismatch"); - if(obj->data.picture.height != pf->height) - return failed_("picture height mismatch"); - if(obj->data.picture.depth != pf->depth) - return failed_("picture depth mismatch"); - if(obj->data.picture.colors != pf->colors) - return failed_("picture colors mismatch"); - printf("OK\n"); - FLAC__metadata_object_delete(obj); - return true; -} - -static FLAC__bool do_picture(const char *prefix) -{ - FLAC__StreamMetadata *obj; - const char *error; - size_t i; - - printf("\n+++ grabbag unit test: picture\n\n"); - - /* invalid spec: no filename */ - printf("testing grabbag__picture_parse_specification(\"\")... "); - if(0 != (obj = grabbag__picture_parse_specification("", &error))) - return failed_("expected error, got object"); - printf("OK (failed as expected, error: %s)\n", error); - - /* invalid spec: no filename */ - printf("testing grabbag__picture_parse_specification(\"||||\")... "); - if(0 != (obj = grabbag__picture_parse_specification("||||", &error))) - return failed_("expected error, got object"); - printf("OK (failed as expected: %s)\n", error); - - /* invalid spec: no filename */ - printf("testing grabbag__picture_parse_specification(\"|image/gif|||\")... "); - if(0 != (obj = grabbag__picture_parse_specification("|image/gif|||", &error))) - return failed_("expected error, got object"); - printf("OK (failed as expected: %s)\n", error); - - /* invalid spec: bad resolution */ - printf("testing grabbag__picture_parse_specification(\"|image/gif|desc|320|0.gif\")... "); - if(0 != (obj = grabbag__picture_parse_specification("|image/gif|desc|320|0.gif", &error))) - return failed_("expected error, got object"); - printf("OK (failed as expected: %s)\n", error); - - /* invalid spec: bad resolution */ - printf("testing grabbag__picture_parse_specification(\"|image/gif|desc|320x240|0.gif\")... "); - if(0 != (obj = grabbag__picture_parse_specification("|image/gif|desc|320x240|0.gif", &error))) - return failed_("expected error, got object"); - printf("OK (failed as expected: %s)\n", error); - - /* invalid spec: no filename */ - printf("testing grabbag__picture_parse_specification(\"|image/gif|desc|320x240x9|\")... "); - if(0 != (obj = grabbag__picture_parse_specification("|image/gif|desc|320x240x9|", &error))) - return failed_("expected error, got object"); - printf("OK (failed as expected: %s)\n", error); - - /* invalid spec: #colors exceeds color depth */ - printf("testing grabbag__picture_parse_specification(\"|image/gif|desc|320x240x9/2345|0.gif\")... "); - if(0 != (obj = grabbag__picture_parse_specification("|image/gif|desc|320x240x9/2345|0.gif", &error))) - return failed_("expected error, got object"); - printf("OK (failed as expected: %s)\n", error); - - /* invalid spec: standard icon has to be 32x32 PNG */ - printf("testing grabbag__picture_parse_specification(\"1|-->|desc|32x24x9|0.gif\")... "); - if(0 != (obj = grabbag__picture_parse_specification("1|-->|desc|32x24x9|0.gif", &error))) - return failed_("expected error, got object"); - printf("OK (failed as expected: %s)\n", error); - - /* invalid spec: need resolution for linked URL */ - printf("testing grabbag__picture_parse_specification(\"|-->|desc||http://blah.blah.blah/z.gif\")... "); - if(0 != (obj = grabbag__picture_parse_specification("|-->|desc||http://blah.blah.blah/z.gif", &error))) - return failed_("expected error, got object"); - printf("OK (failed as expected: %s)\n", error); - - printf("testing grabbag__picture_parse_specification(\"|-->|desc|320x240x9|http://blah.blah.blah/z.gif\")... "); - if(0 == (obj = grabbag__picture_parse_specification("|-->|desc|320x240x9|http://blah.blah.blah/z.gif", &error))) - return failed_(error); - printf("OK\n"); - FLAC__metadata_object_delete(obj); - - /* test automatic parsing of picture files from only the file name */ - for(i = 0; i < sizeof(picturefiles)/sizeof(picturefiles[0]); i++) - if(!test_one_picture(prefix, picturefiles+i, "", /*fn_only=*/true)) - return false; - - /* test automatic parsing of picture files to get resolution/color info */ - for(i = 0; i < sizeof(picturefiles)/sizeof(picturefiles[0]); i++) - if(!test_one_picture(prefix, picturefiles+i, "", /*fn_only=*/false)) - return false; - - picturefiles[0].width = 320; - picturefiles[0].height = 240; - picturefiles[0].depth = 3; - picturefiles[0].colors = 2; - if(!test_one_picture(prefix, picturefiles+0, "320x240x3/2", /*fn_only=*/false)) - return false; - - return true; -} - -int main(int argc, char *argv[]) -{ - const char *usage = "usage: test_pictures path_prefix\n"; - - if(argc > 1 && 0 == strcmp(argv[1], "-h")) { - printf(usage); - return 0; - } - - if(argc != 2) { - fprintf(stderr, usage); - return 255; - } - - return do_picture(argv[1])? 0 : 1; -} diff --git a/3rdparty/libflac/src/test_grabbag/picture/test_picture.dsp b/3rdparty/libflac/src/test_grabbag/picture/test_picture.dsp deleted file mode 100644 index 5d6454a4050..00000000000 --- a/3rdparty/libflac/src/test_grabbag/picture/test_picture.dsp +++ /dev/null @@ -1,96 +0,0 @@ -# Microsoft Developer Studio Project File - Name="test_picture" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=test_picture - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "test_picture.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "test_picture.mak" CFG="test_picture - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "test_picture - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "test_picture - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "test_picture - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\..\obj\release\bin" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\include" /D "NDEBUG" /D "FLAC__NO_DLL" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\..\..\obj\release\lib\grabbag_static.lib ..\..\..\obj\release\lib\replaygain_analysis_static.lib ..\..\..\obj\release\lib\libFLAC_static.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "test_picture - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\..\obj\debug\bin" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\include" /D "_DEBUG" /D "DEBUG" /D "FLAC__NO_DLL" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\..\..\obj\debug\lib\grabbag_static.lib ..\..\..\obj\debug\lib\replaygain_analysis_static.lib ..\..\..\obj\debug\lib\libFLAC_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "test_picture - Win32 Release" -# Name "test_picture - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "c" -# Begin Source File - -SOURCE=.\main.c -# End Source File -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/test_grabbag/picture/test_picture.vcproj b/3rdparty/libflac/src/test_grabbag/picture/test_picture.vcproj deleted file mode 100644 index bd300ec1b3f..00000000000 --- a/3rdparty/libflac/src/test_grabbag/picture/test_picture.vcproj +++ /dev/null @@ -1,202 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="test_picture" - ProjectGUID="{4cefbc8f-c215-11db-8314-0800200c9a66}" - RootNamespace="test_picture" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\..\obj\debug\bin" - IntermediateDirectory="Debug" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".;..\..\..\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;FLAC__NO_DLL;DEBUG" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="2" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\..\obj\release\bin" - IntermediateDirectory="Release" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".;..\..\..\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__NO_DLL" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="1" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" - LinkTimeCodeGeneration="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\main.c" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/test_libFLAC++/Makefile.am b/3rdparty/libflac/src/test_libFLAC++/Makefile.am deleted file mode 100644 index 462cbf2d798..00000000000 --- a/3rdparty/libflac/src/test_libFLAC++/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -# test_libFLAC++ - Unit tester for libFLAC++ -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -EXTRA_DIST = \ - Makefile.lite \ - test_libFLAC++.dsp \ - test_libFLAC++.vcproj - -noinst_PROGRAMS = test_libFLAC++ -test_libFLAC___LDADD = \ - $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \ - $(top_builddir)/src/test_libs_common/libtest_libs_common.la \ - $(top_builddir)/src/libFLAC++/libFLAC++.la \ - $(top_builddir)/src/libFLAC/libFLAC.la \ - @OGG_LIBS@ \ - @MINGW_WINSOCK_LIBS@ \ - -lm -test_libFLAC___SOURCES = \ - decoders.cpp \ - encoders.cpp \ - main.cpp \ - metadata.cpp \ - metadata_manip.cpp \ - metadata_object.cpp \ - decoders.h \ - encoders.h \ - metadata.h diff --git a/3rdparty/libflac/src/test_libFLAC++/Makefile.in b/3rdparty/libflac/src/test_libFLAC++/Makefile.in deleted file mode 100644 index 0d11f8b98c6..00000000000 --- a/3rdparty/libflac/src/test_libFLAC++/Makefile.in +++ /dev/null @@ -1,548 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# test_libFLAC++ - Unit tester for libFLAC++ -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -EXTRA_DIST = \ - Makefile.lite \ - test_libFLAC++.dsp \ - test_libFLAC++.vcproj - - -noinst_PROGRAMS = test_libFLAC++ -test_libFLAC___LDADD = \ - $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \ - $(top_builddir)/src/test_libs_common/libtest_libs_common.la \ - $(top_builddir)/src/libFLAC++/libFLAC++.la \ - $(top_builddir)/src/libFLAC/libFLAC.la \ - @OGG_LIBS@ \ - @MINGW_WINSOCK_LIBS@ \ - -lm - -test_libFLAC___SOURCES = \ - decoders.cpp \ - encoders.cpp \ - main.cpp \ - metadata.cpp \ - metadata_manip.cpp \ - metadata_object.cpp \ - decoders.h \ - encoders.h \ - metadata.h - -subdir = src/test_libFLAC++ -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -noinst_PROGRAMS = test_libFLAC++$(EXEEXT) -PROGRAMS = $(noinst_PROGRAMS) - -am_test_libFLAC___OBJECTS = decoders.$(OBJEXT) encoders.$(OBJEXT) \ - main.$(OBJEXT) metadata.$(OBJEXT) metadata_manip.$(OBJEXT) \ - metadata_object.$(OBJEXT) -test_libFLAC___OBJECTS = $(am_test_libFLAC___OBJECTS) -test_libFLAC___DEPENDENCIES = \ - $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \ - $(top_builddir)/src/test_libs_common/libtest_libs_common.la \ - $(top_builddir)/src/libFLAC++/libFLAC++.la \ - $(top_builddir)/src/libFLAC/libFLAC.la -test_libFLAC___LDFLAGS = - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/decoders.Po ./$(DEPDIR)/encoders.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/main.Po ./$(DEPDIR)/metadata.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/metadata_manip.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/metadata_object.Po -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(test_libFLAC___SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(test_libFLAC___SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/test_libFLAC++/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -test_libFLAC++$(EXEEXT): $(test_libFLAC___OBJECTS) $(test_libFLAC___DEPENDENCIES) - @rm -f test_libFLAC++$(EXEEXT) - $(CXXLINK) $(test_libFLAC___LDFLAGS) $(test_libFLAC___OBJECTS) $(test_libFLAC___LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decoders.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encoders.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metadata.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metadata_manip.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metadata_object.Po@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCXX_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -.cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCXX_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -.cpp.lo: -@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCXX_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/test_libFLAC++/Makefile.lite b/3rdparty/libflac/src/test_libFLAC++/Makefile.lite deleted file mode 100644 index cf7eb4b4e8d..00000000000 --- a/3rdparty/libflac/src/test_libFLAC++/Makefile.lite +++ /dev/null @@ -1,47 +0,0 @@ -# test_libFLAC++ - Unit tester for libFLAC++ -# Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# -# GNU makefile -# - -topdir = ../.. -libdir = $(topdir)/obj/$(BUILD)/lib - -PROGRAM_NAME = test_libFLAC++ - -INCLUDES = -I$(topdir)/include - -ifeq ($(DARWIN_BUILD),yes) -EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libtest_libs_common.a $(libdir)/libFLAC++.a $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm -else -LIBS = -lgrabbag -lreplaygain_analysis -ltest_libs_common -lFLAC++ -lFLAC -L$(OGG_LIB_DIR) -logg -lm -endif - -SRCS_CPP = \ - decoders.cpp \ - encoders.cpp \ - main.cpp \ - metadata.cpp \ - metadata_manip.cpp \ - metadata_object.cpp - -include $(topdir)/build/exe.mk - -LINK = $(CCC) $(LINKAGE) - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/3rdparty/libflac/src/test_libFLAC++/decoders.cpp b/3rdparty/libflac/src/test_libFLAC++/decoders.cpp deleted file mode 100644 index fc78c0d5614..00000000000 --- a/3rdparty/libflac/src/test_libFLAC++/decoders.cpp +++ /dev/null @@ -1,1179 +0,0 @@ -/* test_libFLAC++ - Unit tester for libFLAC++ - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <errno.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#if defined _MSC_VER || defined __MINGW32__ -#if _MSC_VER <= 1600 /* @@@ [2G limit] */ -#define fseeko fseek -#define ftello ftell -#endif -#endif -#include "decoders.h" -#include "FLAC/assert.h" -#include "FLAC/metadata.h" // for ::FLAC__metadata_object_is_equal() -#include "FLAC++/decoder.h" -#include "share/grabbag.h" -extern "C" { -#include "test_libs_common/file_utils_flac.h" -#include "test_libs_common/metadata_utils.h" -} - -#ifdef _MSC_VER -// warning C4800: 'int' : forcing to bool 'true' or 'false' (performance warning) -#pragma warning ( disable : 4800 ) -#endif - -typedef enum { - LAYER_STREAM = 0, /* FLAC__stream_decoder_init_stream() without seeking */ - LAYER_SEEKABLE_STREAM, /* FLAC__stream_decoder_init_stream() with seeking */ - LAYER_FILE, /* FLAC__stream_decoder_init_FILE() */ - LAYER_FILENAME /* FLAC__stream_decoder_init_file() */ -} Layer; - -static const char * const LayerString[] = { - "Stream", - "Seekable Stream", - "FILE*", - "Filename" -}; - -static ::FLAC__StreamMetadata streaminfo_, padding_, seektable_, application1_, application2_, vorbiscomment_, cuesheet_, picture_, unknown_; -static ::FLAC__StreamMetadata *expected_metadata_sequence_[9]; -static unsigned num_expected_; -static off_t flacfilesize_; - -static const char *flacfilename(bool is_ogg) -{ - return is_ogg? "metadata.oga" : "metadata.flac"; -} - -static bool die_(const char *msg) -{ - printf("ERROR: %s\n", msg); - return false; -} - -static FLAC__bool die_s_(const char *msg, const FLAC::Decoder::Stream *decoder) -{ - FLAC::Decoder::Stream::State state = decoder->get_state(); - - if(msg) - printf("FAILED, %s", msg); - else - printf("FAILED"); - - printf(", state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)state), state.as_cstring()); - - return false; -} - -static void init_metadata_blocks_() -{ - mutils__init_metadata_blocks(&streaminfo_, &padding_, &seektable_, &application1_, &application2_, &vorbiscomment_, &cuesheet_, &picture_, &unknown_); -} - -static void free_metadata_blocks_() -{ - mutils__free_metadata_blocks(&streaminfo_, &padding_, &seektable_, &application1_, &application2_, &vorbiscomment_, &cuesheet_, &picture_, &unknown_); -} - -static bool generate_file_(FLAC__bool is_ogg) -{ - printf("\n\ngenerating %sFLAC file for decoder tests...\n", is_ogg? "Ogg ":""); - - num_expected_ = 0; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &application1_; - expected_metadata_sequence_[num_expected_++] = &application2_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - /* WATCHOUT: for Ogg FLAC the encoder should move the VORBIS_COMMENT block to the front, right after STREAMINFO */ - - if(!file_utils__generate_flacfile(is_ogg, flacfilename(is_ogg), &flacfilesize_, 512 * 1024, &streaminfo_, expected_metadata_sequence_, num_expected_)) - return die_("creating the encoded file"); - - return true; -} - - -class DecoderCommon { -public: - Layer layer_; - unsigned current_metadata_number_; - bool ignore_errors_; - bool error_occurred_; - - DecoderCommon(Layer layer): layer_(layer), current_metadata_number_(0), ignore_errors_(false), error_occurred_(false) { } - ::FLAC__StreamDecoderWriteStatus common_write_callback_(const ::FLAC__Frame *frame); - void common_metadata_callback_(const ::FLAC__StreamMetadata *metadata); - void common_error_callback_(::FLAC__StreamDecoderErrorStatus status); -}; - -::FLAC__StreamDecoderWriteStatus DecoderCommon::common_write_callback_(const ::FLAC__Frame *frame) -{ - if(error_occurred_) - return ::FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - - if( - (frame->header.number_type == ::FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER && frame->header.number.frame_number == 0) || - (frame->header.number_type == ::FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER && frame->header.number.sample_number == 0) - ) { - printf("content... "); - fflush(stdout); - } - - return ::FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; -} - -void DecoderCommon::common_metadata_callback_(const ::FLAC__StreamMetadata *metadata) -{ - if(error_occurred_) - return; - - printf("%d... ", current_metadata_number_); - fflush(stdout); - - if(current_metadata_number_ >= num_expected_) { - (void)die_("got more metadata blocks than expected"); - error_occurred_ = true; - } - else { - if(!::FLAC__metadata_object_is_equal(expected_metadata_sequence_[current_metadata_number_], metadata)) { - (void)die_("metadata block mismatch"); - error_occurred_ = true; - } - } - current_metadata_number_++; -} - -void DecoderCommon::common_error_callback_(::FLAC__StreamDecoderErrorStatus status) -{ - if(!ignore_errors_) { - printf("ERROR: got error callback: err = %u (%s)\n", (unsigned)status, ::FLAC__StreamDecoderErrorStatusString[status]); - error_occurred_ = true; - } -} - -class StreamDecoder : public FLAC::Decoder::Stream, public DecoderCommon { -public: - FILE *file_; - - StreamDecoder(Layer layer): FLAC::Decoder::Stream(), DecoderCommon(layer), file_(0) { } - ~StreamDecoder() { } - - // from FLAC::Decoder::Stream - ::FLAC__StreamDecoderReadStatus read_callback(FLAC__byte buffer[], size_t *bytes); - ::FLAC__StreamDecoderSeekStatus seek_callback(FLAC__uint64 absolute_byte_offset); - ::FLAC__StreamDecoderTellStatus tell_callback(FLAC__uint64 *absolute_byte_offset); - ::FLAC__StreamDecoderLengthStatus length_callback(FLAC__uint64 *stream_length); - bool eof_callback(); - ::FLAC__StreamDecoderWriteStatus write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]); - void metadata_callback(const ::FLAC__StreamMetadata *metadata); - void error_callback(::FLAC__StreamDecoderErrorStatus status); - - bool test_respond(bool is_ogg); -}; - -::FLAC__StreamDecoderReadStatus StreamDecoder::read_callback(FLAC__byte buffer[], size_t *bytes) -{ - const size_t requested_bytes = *bytes; - - if(error_occurred_) - return ::FLAC__STREAM_DECODER_READ_STATUS_ABORT; - - if(feof(file_)) { - *bytes = 0; - return ::FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; - } - else if(requested_bytes > 0) { - *bytes = ::fread(buffer, 1, requested_bytes, file_); - if(*bytes == 0) { - if(feof(file_)) - return ::FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; - else - return ::FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; - } - else { - return ::FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; - } - } - else - return ::FLAC__STREAM_DECODER_READ_STATUS_ABORT; /* abort to avoid a deadlock */ -} - -::FLAC__StreamDecoderSeekStatus StreamDecoder::seek_callback(FLAC__uint64 absolute_byte_offset) -{ - if(layer_ == LAYER_STREAM) - return ::FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED; - - if(error_occurred_) - return ::FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; - - if(fseeko(file_, (off_t)absolute_byte_offset, SEEK_SET) < 0) { - error_occurred_ = true; - return ::FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; - } - - return ::FLAC__STREAM_DECODER_SEEK_STATUS_OK; -} - -::FLAC__StreamDecoderTellStatus StreamDecoder::tell_callback(FLAC__uint64 *absolute_byte_offset) -{ - if(layer_ == LAYER_STREAM) - return ::FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED; - - if(error_occurred_) - return ::FLAC__STREAM_DECODER_TELL_STATUS_ERROR; - - off_t offset = ftello(file_); - *absolute_byte_offset = (FLAC__uint64)offset; - - if(offset < 0) { - error_occurred_ = true; - return ::FLAC__STREAM_DECODER_TELL_STATUS_ERROR; - } - - return ::FLAC__STREAM_DECODER_TELL_STATUS_OK; -} - -::FLAC__StreamDecoderLengthStatus StreamDecoder::length_callback(FLAC__uint64 *stream_length) -{ - if(layer_ == LAYER_STREAM) - return ::FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED; - - if(error_occurred_) - return ::FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR; - - *stream_length = (FLAC__uint64)flacfilesize_; - return ::FLAC__STREAM_DECODER_LENGTH_STATUS_OK; -} - -bool StreamDecoder::eof_callback() -{ - if(layer_ == LAYER_STREAM) - return false; - - if(error_occurred_) - return true; - - return (bool)feof(file_); -} - -::FLAC__StreamDecoderWriteStatus StreamDecoder::write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]) -{ - (void)buffer; - - return common_write_callback_(frame); -} - -void StreamDecoder::metadata_callback(const ::FLAC__StreamMetadata *metadata) -{ - common_metadata_callback_(metadata); -} - -void StreamDecoder::error_callback(::FLAC__StreamDecoderErrorStatus status) -{ - common_error_callback_(status); -} - -bool StreamDecoder::test_respond(bool is_ogg) -{ - ::FLAC__StreamDecoderInitStatus init_status; - - if(!set_md5_checking(true)) { - printf("FAILED at set_md5_checking(), returned false\n"); - return false; - } - - printf("testing init%s()... ", is_ogg? "_ogg":""); - init_status = is_ogg? init_ogg() : init(); - if(init_status != ::FLAC__STREAM_DECODER_INIT_STATUS_OK) - return die_s_(0, this); - printf("OK\n"); - - current_metadata_number_ = 0; - - if(fseeko(file_, 0, SEEK_SET) < 0) { - printf("FAILED rewinding input, errno = %d\n", errno); - return false; - } - - printf("testing process_until_end_of_stream()... "); - if(!process_until_end_of_stream()) { - State state = get_state(); - printf("FAILED, returned false, state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)state), state.as_cstring()); - return false; - } - printf("OK\n"); - - printf("testing finish()... "); - if(!finish()) { - State state = get_state(); - printf("FAILED, returned false, state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)state), state.as_cstring()); - return false; - } - printf("OK\n"); - - return true; -} - -class FileDecoder : public FLAC::Decoder::File, public DecoderCommon { -public: - FileDecoder(Layer layer): FLAC::Decoder::File(), DecoderCommon(layer) { } - ~FileDecoder() { } - - // from FLAC::Decoder::Stream - ::FLAC__StreamDecoderWriteStatus write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]); - void metadata_callback(const ::FLAC__StreamMetadata *metadata); - void error_callback(::FLAC__StreamDecoderErrorStatus status); - - bool test_respond(bool is_ogg); -}; - -::FLAC__StreamDecoderWriteStatus FileDecoder::write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]) -{ - (void)buffer; - return common_write_callback_(frame); -} - -void FileDecoder::metadata_callback(const ::FLAC__StreamMetadata *metadata) -{ - common_metadata_callback_(metadata); -} - -void FileDecoder::error_callback(::FLAC__StreamDecoderErrorStatus status) -{ - common_error_callback_(status); -} - -bool FileDecoder::test_respond(bool is_ogg) -{ - ::FLAC__StreamDecoderInitStatus init_status; - - if(!set_md5_checking(true)) { - printf("FAILED at set_md5_checking(), returned false\n"); - return false; - } - - switch(layer_) { - case LAYER_FILE: - { - printf("opening %sFLAC file... ", is_ogg? "Ogg ":""); - FILE *file = ::fopen(flacfilename(is_ogg), "rb"); - if(0 == file) { - printf("ERROR (%s)\n", strerror(errno)); - return false; - } - printf("OK\n"); - - printf("testing init%s()... ", is_ogg? "_ogg":""); - init_status = is_ogg? init_ogg(file) : init(file); - } - break; - case LAYER_FILENAME: - printf("testing init%s()... ", is_ogg? "_ogg":""); - init_status = is_ogg? init_ogg(flacfilename(is_ogg)) : init(flacfilename(is_ogg)); - break; - default: - die_("internal error 001"); - return false; - } - if(init_status != ::FLAC__STREAM_DECODER_INIT_STATUS_OK) - return die_s_(0, this); - printf("OK\n"); - - current_metadata_number_ = 0; - - printf("testing process_until_end_of_stream()... "); - if(!process_until_end_of_stream()) { - State state = get_state(); - printf("FAILED, returned false, state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)state), state.as_cstring()); - return false; - } - printf("OK\n"); - - printf("testing finish()... "); - if(!finish()) { - State state = get_state(); - printf("FAILED, returned false, state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)state), state.as_cstring()); - return false; - } - printf("OK\n"); - - return true; -} - - -static FLAC::Decoder::Stream *new_by_layer(Layer layer) -{ - if(layer < LAYER_FILE) - return new StreamDecoder(layer); - else - return new FileDecoder(layer); -} - -static bool test_stream_decoder(Layer layer, bool is_ogg) -{ - FLAC::Decoder::Stream *decoder; - ::FLAC__StreamDecoderInitStatus init_status; - bool expect; - - printf("\n+++ libFLAC++ unit test: FLAC::Decoder::%s (layer: %s, format: %s)\n\n", layer<LAYER_FILE? "Stream":"File", LayerString[layer], is_ogg? "Ogg FLAC" : "FLAC"); - - // - // test new -> delete - // - printf("allocating decoder instance... "); - decoder = new_by_layer(layer); - if(0 == decoder) { - printf("FAILED, new returned NULL\n"); - return false; - } - printf("OK\n"); - - printf("testing is_valid()... "); - if(!decoder->is_valid()) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - printf("freeing decoder instance... "); - delete decoder; - printf("OK\n"); - - // - // test new -> init -> delete - // - printf("allocating decoder instance... "); - decoder = new_by_layer(layer); - if(0 == decoder) { - printf("FAILED, new returned NULL\n"); - return false; - } - printf("OK\n"); - - printf("testing is_valid()... "); - if(!decoder->is_valid()) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - printf("testing init%s()... ", is_ogg? "_ogg":""); - switch(layer) { - case LAYER_STREAM: - case LAYER_SEEKABLE_STREAM: - dynamic_cast<StreamDecoder*>(decoder)->file_ = stdin; - init_status = is_ogg? decoder->init_ogg() : decoder->init(); - break; - case LAYER_FILE: - init_status = is_ogg? - dynamic_cast<FLAC::Decoder::File*>(decoder)->init_ogg(stdin) : - dynamic_cast<FLAC::Decoder::File*>(decoder)->init(stdin); - break; - case LAYER_FILENAME: - init_status = is_ogg? - dynamic_cast<FLAC::Decoder::File*>(decoder)->init_ogg(flacfilename(is_ogg)) : - dynamic_cast<FLAC::Decoder::File*>(decoder)->init(flacfilename(is_ogg)); - break; - default: - die_("internal error 006"); - return false; - } - if(init_status != ::FLAC__STREAM_DECODER_INIT_STATUS_OK) - return die_s_(0, decoder); - printf("OK\n"); - - printf("freeing decoder instance... "); - delete decoder; - printf("OK\n"); - - // - // test normal usage - // - num_expected_ = 0; - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - - printf("allocating decoder instance... "); - decoder = new_by_layer(layer); - if(0 == decoder) { - printf("FAILED, new returned NULL\n"); - return false; - } - printf("OK\n"); - - printf("testing is_valid()... "); - if(!decoder->is_valid()) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - if(is_ogg) { - printf("testing set_ogg_serial_number()... "); - if(!decoder->set_ogg_serial_number(file_utils__ogg_serial_number)) - return die_s_("returned false", decoder); - printf("OK\n"); - } - - if(!decoder->set_md5_checking(true)) { - printf("FAILED at set_md5_checking(), returned false\n"); - return false; - } - - switch(layer) { - case LAYER_STREAM: - case LAYER_SEEKABLE_STREAM: - printf("opening %sFLAC file... ", is_ogg? "Ogg ":""); - dynamic_cast<StreamDecoder*>(decoder)->file_ = ::fopen(flacfilename(is_ogg), "rb"); - if(0 == dynamic_cast<StreamDecoder*>(decoder)->file_) { - printf("ERROR (%s)\n", strerror(errno)); - return false; - } - printf("OK\n"); - - printf("testing init%s()... ", is_ogg? "_ogg":""); - init_status = is_ogg? decoder->init_ogg() : decoder->init(); - break; - case LAYER_FILE: - { - printf("opening FLAC file... "); - FILE *file = ::fopen(flacfilename(is_ogg), "rb"); - if(0 == file) { - printf("ERROR (%s)\n", strerror(errno)); - return false; - } - printf("OK\n"); - - printf("testing init%s()... ", is_ogg? "_ogg":""); - init_status = is_ogg? - dynamic_cast<FLAC::Decoder::File*>(decoder)->init_ogg(file) : - dynamic_cast<FLAC::Decoder::File*>(decoder)->init(file); - } - break; - case LAYER_FILENAME: - printf("testing init%s()... ", is_ogg? "_ogg":""); - init_status = is_ogg? - dynamic_cast<FLAC::Decoder::File*>(decoder)->init_ogg(flacfilename(is_ogg)) : - dynamic_cast<FLAC::Decoder::File*>(decoder)->init(flacfilename(is_ogg)); - break; - default: - die_("internal error 009"); - return false; - } - if(init_status != ::FLAC__STREAM_DECODER_INIT_STATUS_OK) - return die_s_(0, decoder); - printf("OK\n"); - - printf("testing get_state()... "); - FLAC::Decoder::Stream::State state = decoder->get_state(); - printf("returned state = %u (%s)... OK\n", (unsigned)((::FLAC__StreamDecoderState)state), state.as_cstring()); - - dynamic_cast<DecoderCommon*>(decoder)->current_metadata_number_ = 0; - dynamic_cast<DecoderCommon*>(decoder)->ignore_errors_ = false; - dynamic_cast<DecoderCommon*>(decoder)->error_occurred_ = false; - - printf("testing get_md5_checking()... "); - if(!decoder->get_md5_checking()) { - printf("FAILED, returned false, expected true\n"); - return false; - } - printf("OK\n"); - - printf("testing process_until_end_of_metadata()... "); - if(!decoder->process_until_end_of_metadata()) - return die_s_("returned false", decoder); - printf("OK\n"); - - printf("testing process_single()... "); - if(!decoder->process_single()) - return die_s_("returned false", decoder); - printf("OK\n"); - - printf("testing skip_single_frame()... "); - if(!decoder->skip_single_frame()) - return die_s_("returned false", decoder); - printf("OK\n"); - - if(layer < LAYER_FILE) { - printf("testing flush()... "); - if(!decoder->flush()) - return die_s_("returned false", decoder); - printf("OK\n"); - - dynamic_cast<DecoderCommon*>(decoder)->ignore_errors_ = true; - printf("testing process_single()... "); - if(!decoder->process_single()) - return die_s_("returned false", decoder); - printf("OK\n"); - dynamic_cast<DecoderCommon*>(decoder)->ignore_errors_ = false; - } - - expect = (layer != LAYER_STREAM); - printf("testing seek_absolute()... "); - if(decoder->seek_absolute(0) != expect) - return die_s_(expect? "returned false" : "returned true", decoder); - printf("OK\n"); - - printf("testing process_until_end_of_stream()... "); - if(!decoder->process_until_end_of_stream()) - return die_s_("returned false", decoder); - printf("OK\n"); - - expect = (layer != LAYER_STREAM); - printf("testing seek_absolute()... "); - if(decoder->seek_absolute(0) != expect) - return die_s_(expect? "returned false" : "returned true", decoder); - printf("OK\n"); - - printf("testing get_channels()... "); - { - unsigned channels = decoder->get_channels(); - if(channels != streaminfo_.data.stream_info.channels) { - printf("FAILED, returned %u, expected %u\n", channels, streaminfo_.data.stream_info.channels); - return false; - } - } - printf("OK\n"); - - printf("testing get_bits_per_sample()... "); - { - unsigned bits_per_sample = decoder->get_bits_per_sample(); - if(bits_per_sample != streaminfo_.data.stream_info.bits_per_sample) { - printf("FAILED, returned %u, expected %u\n", bits_per_sample, streaminfo_.data.stream_info.bits_per_sample); - return false; - } - } - printf("OK\n"); - - printf("testing get_sample_rate()... "); - { - unsigned sample_rate = decoder->get_sample_rate(); - if(sample_rate != streaminfo_.data.stream_info.sample_rate) { - printf("FAILED, returned %u, expected %u\n", sample_rate, streaminfo_.data.stream_info.sample_rate); - return false; - } - } - printf("OK\n"); - - printf("testing get_blocksize()... "); - { - unsigned blocksize = decoder->get_blocksize(); - /* value could be anything since we're at the last block, so accept any reasonable answer */ - printf("returned %u... %s\n", blocksize, blocksize>0? "OK" : "FAILED"); - if(blocksize == 0) - return false; - } - - printf("testing get_channel_assignment()... "); - { - ::FLAC__ChannelAssignment ca = decoder->get_channel_assignment(); - printf("returned %u (%s)... OK\n", (unsigned)ca, ::FLAC__ChannelAssignmentString[ca]); - } - - if(layer < LAYER_FILE) { - printf("testing reset()... "); - if(!decoder->reset()) - return die_s_("returned false", decoder); - printf("OK\n"); - - if(layer == LAYER_STREAM) { - /* after a reset() we have to rewind the input ourselves */ - printf("rewinding input... "); - if(fseeko(dynamic_cast<StreamDecoder*>(decoder)->file_, 0, SEEK_SET) < 0) { - printf("FAILED, errno = %d\n", errno); - return false; - } - printf("OK\n"); - } - - dynamic_cast<DecoderCommon*>(decoder)->current_metadata_number_ = 0; - - printf("testing process_until_end_of_stream()... "); - if(!decoder->process_until_end_of_stream()) - return die_s_("returned false", decoder); - printf("OK\n"); - } - - printf("testing finish()... "); - if(!decoder->finish()) { - FLAC::Decoder::Stream::State state = decoder->get_state(); - printf("FAILED, returned false, state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)state), state.as_cstring()); - return false; - } - printf("OK\n"); - - /* - * respond all - */ - - printf("testing set_metadata_respond_all()... "); - if(!decoder->set_metadata_respond_all()) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - num_expected_ = 0; - if(is_ogg) { /* encoder moves vorbis comment after streaminfo according to ogg mapping */ - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &application1_; - expected_metadata_sequence_[num_expected_++] = &application2_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - else { - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &application1_; - expected_metadata_sequence_[num_expected_++] = &application2_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - - if(!(layer < LAYER_FILE? dynamic_cast<StreamDecoder*>(decoder)->test_respond(is_ogg) : dynamic_cast<FileDecoder*>(decoder)->test_respond(is_ogg))) - return false; - - /* - * ignore all - */ - - printf("testing set_metadata_ignore_all()... "); - if(!decoder->set_metadata_ignore_all()) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - num_expected_ = 0; - - if(!(layer < LAYER_FILE? dynamic_cast<StreamDecoder*>(decoder)->test_respond(is_ogg) : dynamic_cast<FileDecoder*>(decoder)->test_respond(is_ogg))) - return false; - - /* - * respond all, ignore VORBIS_COMMENT - */ - - printf("testing set_metadata_respond_all()... "); - if(!decoder->set_metadata_respond_all()) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - printf("testing set_metadata_ignore(VORBIS_COMMENT)... "); - if(!decoder->set_metadata_ignore(FLAC__METADATA_TYPE_VORBIS_COMMENT)) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - num_expected_ = 0; - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &application1_; - expected_metadata_sequence_[num_expected_++] = &application2_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - - if(!(layer < LAYER_FILE? dynamic_cast<StreamDecoder*>(decoder)->test_respond(is_ogg) : dynamic_cast<FileDecoder*>(decoder)->test_respond(is_ogg))) - return false; - - /* - * respond all, ignore APPLICATION - */ - - printf("testing set_metadata_respond_all()... "); - if(!decoder->set_metadata_respond_all()) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - printf("testing set_metadata_ignore(APPLICATION)... "); - if(!decoder->set_metadata_ignore(FLAC__METADATA_TYPE_APPLICATION)) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - num_expected_ = 0; - if(is_ogg) { /* encoder moves vorbis comment after streaminfo according to ogg mapping */ - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - else { - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - - if(!(layer < LAYER_FILE? dynamic_cast<StreamDecoder*>(decoder)->test_respond(is_ogg) : dynamic_cast<FileDecoder*>(decoder)->test_respond(is_ogg))) - return false; - - /* - * respond all, ignore APPLICATION id of app#1 - */ - - printf("testing set_metadata_respond_all()... "); - if(!decoder->set_metadata_respond_all()) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - printf("testing set_metadata_ignore_application(of app block #1)... "); - if(!decoder->set_metadata_ignore_application(application1_.data.application.id)) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - num_expected_ = 0; - if(is_ogg) { /* encoder moves vorbis comment after streaminfo according to ogg mapping */ - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &application2_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - else { - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &application2_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - - if(!(layer < LAYER_FILE? dynamic_cast<StreamDecoder*>(decoder)->test_respond(is_ogg) : dynamic_cast<FileDecoder*>(decoder)->test_respond(is_ogg))) - return false; - - /* - * respond all, ignore APPLICATION id of app#1 & app#2 - */ - - printf("testing set_metadata_respond_all()... "); - if(!decoder->set_metadata_respond_all()) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - printf("testing set_metadata_ignore_application(of app block #1)... "); - if(!decoder->set_metadata_ignore_application(application1_.data.application.id)) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - printf("testing set_metadata_ignore_application(of app block #2)... "); - if(!decoder->set_metadata_ignore_application(application2_.data.application.id)) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - num_expected_ = 0; - if(is_ogg) { /* encoder moves vorbis comment after streaminfo according to ogg mapping */ - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - else { - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - - if(!(layer < LAYER_FILE? dynamic_cast<StreamDecoder*>(decoder)->test_respond(is_ogg) : dynamic_cast<FileDecoder*>(decoder)->test_respond(is_ogg))) - return false; - - /* - * ignore all, respond VORBIS_COMMENT - */ - - printf("testing set_metadata_ignore_all()... "); - if(!decoder->set_metadata_ignore_all()) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - printf("testing set_metadata_respond(VORBIS_COMMENT)... "); - if(!decoder->set_metadata_respond(FLAC__METADATA_TYPE_VORBIS_COMMENT)) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - num_expected_ = 0; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - - if(!(layer < LAYER_FILE? dynamic_cast<StreamDecoder*>(decoder)->test_respond(is_ogg) : dynamic_cast<FileDecoder*>(decoder)->test_respond(is_ogg))) - return false; - - /* - * ignore all, respond APPLICATION - */ - - printf("testing set_metadata_ignore_all()... "); - if(!decoder->set_metadata_ignore_all()) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - printf("testing set_metadata_respond(APPLICATION)... "); - if(!decoder->set_metadata_respond(FLAC__METADATA_TYPE_APPLICATION)) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - num_expected_ = 0; - expected_metadata_sequence_[num_expected_++] = &application1_; - expected_metadata_sequence_[num_expected_++] = &application2_; - - if(!(layer < LAYER_FILE? dynamic_cast<StreamDecoder*>(decoder)->test_respond(is_ogg) : dynamic_cast<FileDecoder*>(decoder)->test_respond(is_ogg))) - return false; - - /* - * ignore all, respond APPLICATION id of app#1 - */ - - printf("testing set_metadata_ignore_all()... "); - if(!decoder->set_metadata_ignore_all()) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - printf("testing set_metadata_respond_application(of app block #1)... "); - if(!decoder->set_metadata_respond_application(application1_.data.application.id)) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - num_expected_ = 0; - expected_metadata_sequence_[num_expected_++] = &application1_; - - if(!(layer < LAYER_FILE? dynamic_cast<StreamDecoder*>(decoder)->test_respond(is_ogg) : dynamic_cast<FileDecoder*>(decoder)->test_respond(is_ogg))) - return false; - - /* - * ignore all, respond APPLICATION id of app#1 & app#2 - */ - - printf("testing set_metadata_ignore_all()... "); - if(!decoder->set_metadata_ignore_all()) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - printf("testing set_metadata_respond_application(of app block #1)... "); - if(!decoder->set_metadata_respond_application(application1_.data.application.id)) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - printf("testing set_metadata_respond_application(of app block #2)... "); - if(!decoder->set_metadata_respond_application(application2_.data.application.id)) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - num_expected_ = 0; - expected_metadata_sequence_[num_expected_++] = &application1_; - expected_metadata_sequence_[num_expected_++] = &application2_; - - if(!(layer < LAYER_FILE? dynamic_cast<StreamDecoder*>(decoder)->test_respond(is_ogg) : dynamic_cast<FileDecoder*>(decoder)->test_respond(is_ogg))) - return false; - - /* - * respond all, ignore APPLICATION, respond APPLICATION id of app#1 - */ - - printf("testing set_metadata_respond_all()... "); - if(!decoder->set_metadata_respond_all()) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - printf("testing set_metadata_ignore(APPLICATION)... "); - if(!decoder->set_metadata_ignore(FLAC__METADATA_TYPE_APPLICATION)) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - printf("testing set_metadata_respond_application(of app block #1)... "); - if(!decoder->set_metadata_respond_application(application1_.data.application.id)) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - num_expected_ = 0; - if(is_ogg) { /* encoder moves vorbis comment after streaminfo according to ogg mapping */ - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &application1_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - else { - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &application1_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - - if(!(layer < LAYER_FILE? dynamic_cast<StreamDecoder*>(decoder)->test_respond(is_ogg) : dynamic_cast<FileDecoder*>(decoder)->test_respond(is_ogg))) - return false; - - /* - * ignore all, respond APPLICATION, ignore APPLICATION id of app#1 - */ - - printf("testing set_metadata_ignore_all()... "); - if(!decoder->set_metadata_ignore_all()) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - printf("testing set_metadata_respond(APPLICATION)... "); - if(!decoder->set_metadata_respond(FLAC__METADATA_TYPE_APPLICATION)) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - printf("testing set_metadata_ignore_application(of app block #1)... "); - if(!decoder->set_metadata_ignore_application(application1_.data.application.id)) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - num_expected_ = 0; - expected_metadata_sequence_[num_expected_++] = &application2_; - - if(!(layer < LAYER_FILE? dynamic_cast<StreamDecoder*>(decoder)->test_respond(is_ogg) : dynamic_cast<FileDecoder*>(decoder)->test_respond(is_ogg))) - return false; - - if(layer < LAYER_FILE) /* for LAYER_FILE, FLAC__stream_decoder_finish() closes the file */ - ::fclose(dynamic_cast<StreamDecoder*>(decoder)->file_); - - printf("freeing decoder instance... "); - delete decoder; - printf("OK\n"); - - printf("\nPASSED!\n"); - - return true; -} - -bool test_decoders() -{ - FLAC__bool is_ogg = false; - - while(1) { - init_metadata_blocks_(); - - if(!generate_file_(is_ogg)) - return false; - - if(!test_stream_decoder(LAYER_STREAM, is_ogg)) - return false; - - if(!test_stream_decoder(LAYER_SEEKABLE_STREAM, is_ogg)) - return false; - - if(!test_stream_decoder(LAYER_FILE, is_ogg)) - return false; - - if(!test_stream_decoder(LAYER_FILENAME, is_ogg)) - return false; - - (void) grabbag__file_remove_file(flacfilename(is_ogg)); - - free_metadata_blocks_(); - - if(!FLAC_API_SUPPORTS_OGG_FLAC || is_ogg) - break; - is_ogg = true; - } - - return true; -} diff --git a/3rdparty/libflac/src/test_libFLAC++/decoders.h b/3rdparty/libflac/src/test_libFLAC++/decoders.h deleted file mode 100644 index 422c31c5ccd..00000000000 --- a/3rdparty/libflac/src/test_libFLAC++/decoders.h +++ /dev/null @@ -1,24 +0,0 @@ -/* test_libFLAC++ - Unit tester for libFLAC++ - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef FLAC__TEST_LIBFLACPP_DECODERS_H -#define FLAC__TEST_LIBFLACPP_DECODERS_H - -bool test_decoders(); - -#endif diff --git a/3rdparty/libflac/src/test_libFLAC++/encoders.cpp b/3rdparty/libflac/src/test_libFLAC++/encoders.cpp deleted file mode 100644 index 6b1ab69448e..00000000000 --- a/3rdparty/libflac/src/test_libFLAC++/encoders.cpp +++ /dev/null @@ -1,553 +0,0 @@ -/* test_libFLAC++ - Unit tester for libFLAC++ - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include "encoders.h" -#include "FLAC/assert.h" -#include "FLAC++/encoder.h" -#include "share/grabbag.h" -extern "C" { -#include "test_libs_common/file_utils_flac.h" -#include "test_libs_common/metadata_utils.h" -} -#include <errno.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -typedef enum { - LAYER_STREAM = 0, /* FLAC__stream_encoder_init_stream() without seeking */ - LAYER_SEEKABLE_STREAM, /* FLAC__stream_encoder_init_stream() with seeking */ - LAYER_FILE, /* FLAC__stream_encoder_init_FILE() */ - LAYER_FILENAME /* FLAC__stream_encoder_init_file() */ -} Layer; - -static const char * const LayerString[] = { - "Stream", - "Seekable Stream", - "FILE*", - "Filename" -}; - -static ::FLAC__StreamMetadata streaminfo_, padding_, seektable_, application1_, application2_, vorbiscomment_, cuesheet_, picture_, unknown_; -static ::FLAC__StreamMetadata *metadata_sequence_[] = { &vorbiscomment_, &padding_, &seektable_, &application1_, &application2_, &cuesheet_, &picture_, &unknown_ }; -static const unsigned num_metadata_ = sizeof(metadata_sequence_) / sizeof(metadata_sequence_[0]); - -static const char *flacfilename(bool is_ogg) -{ - return is_ogg? "metadata.oga" : "metadata.flac"; -} - -static bool die_(const char *msg) -{ - printf("ERROR: %s\n", msg); - return false; -} - -static bool die_s_(const char *msg, const FLAC::Encoder::Stream *encoder) -{ - FLAC::Encoder::Stream::State state = encoder->get_state(); - - if(msg) - printf("FAILED, %s", msg); - else - printf("FAILED"); - - printf(", state = %u (%s)\n", (unsigned)((::FLAC__StreamEncoderState)state), state.as_cstring()); - if(state == ::FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR) { - FLAC::Decoder::Stream::State dstate = encoder->get_verify_decoder_state(); - printf(" verify decoder state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)dstate), dstate.as_cstring()); - } - - return false; -} - -static void init_metadata_blocks_() -{ - mutils__init_metadata_blocks(&streaminfo_, &padding_, &seektable_, &application1_, &application2_, &vorbiscomment_, &cuesheet_, &picture_, &unknown_); -} - -static void free_metadata_blocks_() -{ - mutils__free_metadata_blocks(&streaminfo_, &padding_, &seektable_, &application1_, &application2_, &vorbiscomment_, &cuesheet_, &picture_, &unknown_); -} - -class StreamEncoder : public FLAC::Encoder::Stream { -public: - Layer layer_; - FILE *file_; - - StreamEncoder(Layer layer): FLAC::Encoder::Stream(), layer_(layer), file_(0) { } - ~StreamEncoder() { } - - // from FLAC::Encoder::Stream - ::FLAC__StreamEncoderReadStatus read_callback(FLAC__byte buffer[], size_t *bytes); - ::FLAC__StreamEncoderWriteStatus write_callback(const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame); - ::FLAC__StreamEncoderSeekStatus seek_callback(FLAC__uint64 absolute_byte_offset); - ::FLAC__StreamEncoderTellStatus tell_callback(FLAC__uint64 *absolute_byte_offset); - void metadata_callback(const ::FLAC__StreamMetadata *metadata); -}; - -::FLAC__StreamEncoderReadStatus StreamEncoder::read_callback(FLAC__byte buffer[], size_t *bytes) -{ - if(*bytes > 0) { - *bytes = fread(buffer, sizeof(FLAC__byte), *bytes, file_); - if(ferror(file_)) - return ::FLAC__STREAM_ENCODER_READ_STATUS_ABORT; - else if(*bytes == 0) - return ::FLAC__STREAM_ENCODER_READ_STATUS_END_OF_STREAM; - else - return ::FLAC__STREAM_ENCODER_READ_STATUS_CONTINUE; - } - else - return ::FLAC__STREAM_ENCODER_READ_STATUS_ABORT; -} - -::FLAC__StreamEncoderWriteStatus StreamEncoder::write_callback(const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame) -{ - (void)samples, (void)current_frame; - - if(fwrite(buffer, 1, bytes, file_) != bytes) - return ::FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR; - else - return ::FLAC__STREAM_ENCODER_WRITE_STATUS_OK; -} - -::FLAC__StreamEncoderSeekStatus StreamEncoder::seek_callback(FLAC__uint64 absolute_byte_offset) -{ - if(layer_==LAYER_STREAM) - return ::FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED; - else if(fseek(file_, (long)absolute_byte_offset, SEEK_SET) < 0) - return FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR; - else - return FLAC__STREAM_ENCODER_SEEK_STATUS_OK; -} - -::FLAC__StreamEncoderTellStatus StreamEncoder::tell_callback(FLAC__uint64 *absolute_byte_offset) -{ - long pos; - if(layer_==LAYER_STREAM) - return ::FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED; - else if((pos = ftell(file_)) < 0) - return FLAC__STREAM_ENCODER_TELL_STATUS_ERROR; - else { - *absolute_byte_offset = (FLAC__uint64)pos; - return FLAC__STREAM_ENCODER_TELL_STATUS_OK; - } -} - -void StreamEncoder::metadata_callback(const ::FLAC__StreamMetadata *metadata) -{ - (void)metadata; -} - -class FileEncoder : public FLAC::Encoder::File { -public: - Layer layer_; - - FileEncoder(Layer layer): FLAC::Encoder::File(), layer_(layer) { } - ~FileEncoder() { } - - // from FLAC::Encoder::File - void progress_callback(FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate); -}; - -void FileEncoder::progress_callback(FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate) -{ - (void)bytes_written, (void)samples_written, (void)frames_written, (void)total_frames_estimate; -} - -static FLAC::Encoder::Stream *new_by_layer(Layer layer) -{ - if(layer < LAYER_FILE) - return new StreamEncoder(layer); - else - return new FileEncoder(layer); -} - -static bool test_stream_encoder(Layer layer, bool is_ogg) -{ - FLAC::Encoder::Stream *encoder; - ::FLAC__StreamEncoderInitStatus init_status; - FILE *file = 0; - FLAC__int32 samples[1024]; - FLAC__int32 *samples_array[1] = { samples }; - unsigned i; - - printf("\n+++ libFLAC++ unit test: FLAC::Encoder::%s (layer: %s, format: %s)\n\n", layer<LAYER_FILE? "Stream":"File", LayerString[layer], is_ogg? "Ogg FLAC":"FLAC"); - - printf("allocating encoder instance... "); - encoder = new_by_layer(layer); - if(0 == encoder) { - printf("FAILED, new returned NULL\n"); - return false; - } - printf("OK\n"); - - printf("testing is_valid()... "); - if(!encoder->is_valid()) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - if(is_ogg) { - printf("testing set_ogg_serial_number()... "); - if(!encoder->set_ogg_serial_number(file_utils__ogg_serial_number)) - return die_s_("returned false", encoder); - printf("OK\n"); - } - - printf("testing set_verify()... "); - if(!encoder->set_verify(true)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing set_streamable_subset()... "); - if(!encoder->set_streamable_subset(true)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing set_channels()... "); - if(!encoder->set_channels(streaminfo_.data.stream_info.channels)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing set_bits_per_sample()... "); - if(!encoder->set_bits_per_sample(streaminfo_.data.stream_info.bits_per_sample)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing set_sample_rate()... "); - if(!encoder->set_sample_rate(streaminfo_.data.stream_info.sample_rate)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing set_compression_level()... "); - if(!encoder->set_compression_level((unsigned)(-1))) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing set_blocksize()... "); - if(!encoder->set_blocksize(streaminfo_.data.stream_info.min_blocksize)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing set_do_mid_side_stereo()... "); - if(!encoder->set_do_mid_side_stereo(false)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing set_loose_mid_side_stereo()... "); - if(!encoder->set_loose_mid_side_stereo(false)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing set_max_lpc_order()... "); - if(!encoder->set_max_lpc_order(0)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing set_qlp_coeff_precision()... "); - if(!encoder->set_qlp_coeff_precision(0)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing set_do_qlp_coeff_prec_search()... "); - if(!encoder->set_do_qlp_coeff_prec_search(false)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing set_do_escape_coding()... "); - if(!encoder->set_do_escape_coding(false)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing set_do_exhaustive_model_search()... "); - if(!encoder->set_do_exhaustive_model_search(false)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing set_min_residual_partition_order()... "); - if(!encoder->set_min_residual_partition_order(0)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing set_max_residual_partition_order()... "); - if(!encoder->set_max_residual_partition_order(0)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing set_rice_parameter_search_dist()... "); - if(!encoder->set_rice_parameter_search_dist(0)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing set_total_samples_estimate()... "); - if(!encoder->set_total_samples_estimate(streaminfo_.data.stream_info.total_samples)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing set_metadata()... "); - if(!encoder->set_metadata(metadata_sequence_, num_metadata_)) - return die_s_("returned false", encoder); - printf("OK\n"); - - if(layer < LAYER_FILENAME) { - printf("opening file for FLAC output... "); - file = ::fopen(flacfilename(is_ogg), "w+b"); - if(0 == file) { - printf("ERROR (%s)\n", strerror(errno)); - return false; - } - printf("OK\n"); - if(layer < LAYER_FILE) - dynamic_cast<StreamEncoder*>(encoder)->file_ = file; - } - - switch(layer) { - case LAYER_STREAM: - case LAYER_SEEKABLE_STREAM: - printf("testing init%s()... ", is_ogg? "_ogg":""); - init_status = is_ogg? encoder->init_ogg() : encoder->init(); - break; - case LAYER_FILE: - printf("testing init%s()... ", is_ogg? "_ogg":""); - init_status = is_ogg? - dynamic_cast<FLAC::Encoder::File*>(encoder)->init_ogg(file) : - dynamic_cast<FLAC::Encoder::File*>(encoder)->init(file); - break; - case LAYER_FILENAME: - printf("testing init%s()... ", is_ogg? "_ogg":""); - init_status = is_ogg? - dynamic_cast<FLAC::Encoder::File*>(encoder)->init_ogg(flacfilename(is_ogg)) : - dynamic_cast<FLAC::Encoder::File*>(encoder)->init(flacfilename(is_ogg)); - break; - default: - die_("internal error 001"); - return false; - } - if(init_status != ::FLAC__STREAM_ENCODER_INIT_STATUS_OK) - return die_s_(0, encoder); - printf("OK\n"); - - printf("testing get_state()... "); - FLAC::Encoder::Stream::State state = encoder->get_state(); - printf("returned state = %u (%s)... OK\n", (unsigned)((::FLAC__StreamEncoderState)state), state.as_cstring()); - - printf("testing get_verify_decoder_state()... "); - FLAC::Decoder::Stream::State dstate = encoder->get_verify_decoder_state(); - printf("returned state = %u (%s)... OK\n", (unsigned)((::FLAC__StreamDecoderState)dstate), dstate.as_cstring()); - - { - FLAC__uint64 absolute_sample; - unsigned frame_number; - unsigned channel; - unsigned sample; - FLAC__int32 expected; - FLAC__int32 got; - - printf("testing get_verify_decoder_error_stats()... "); - encoder->get_verify_decoder_error_stats(&absolute_sample, &frame_number, &channel, &sample, &expected, &got); - printf("OK\n"); - } - - printf("testing get_verify()... "); - if(encoder->get_verify() != true) { - printf("FAILED, expected true, got false\n"); - return false; - } - printf("OK\n"); - - printf("testing get_streamable_subset()... "); - if(encoder->get_streamable_subset() != true) { - printf("FAILED, expected true, got false\n"); - return false; - } - printf("OK\n"); - - printf("testing get_do_mid_side_stereo()... "); - if(encoder->get_do_mid_side_stereo() != false) { - printf("FAILED, expected false, got true\n"); - return false; - } - printf("OK\n"); - - printf("testing get_loose_mid_side_stereo()... "); - if(encoder->get_loose_mid_side_stereo() != false) { - printf("FAILED, expected false, got true\n"); - return false; - } - printf("OK\n"); - - printf("testing get_channels()... "); - if(encoder->get_channels() != streaminfo_.data.stream_info.channels) { - printf("FAILED, expected %u, got %u\n", streaminfo_.data.stream_info.channels, encoder->get_channels()); - return false; - } - printf("OK\n"); - - printf("testing get_bits_per_sample()... "); - if(encoder->get_bits_per_sample() != streaminfo_.data.stream_info.bits_per_sample) { - printf("FAILED, expected %u, got %u\n", streaminfo_.data.stream_info.bits_per_sample, encoder->get_bits_per_sample()); - return false; - } - printf("OK\n"); - - printf("testing get_sample_rate()... "); - if(encoder->get_sample_rate() != streaminfo_.data.stream_info.sample_rate) { - printf("FAILED, expected %u, got %u\n", streaminfo_.data.stream_info.sample_rate, encoder->get_sample_rate()); - return false; - } - printf("OK\n"); - - printf("testing get_blocksize()... "); - if(encoder->get_blocksize() != streaminfo_.data.stream_info.min_blocksize) { - printf("FAILED, expected %u, got %u\n", streaminfo_.data.stream_info.min_blocksize, encoder->get_blocksize()); - return false; - } - printf("OK\n"); - - printf("testing get_max_lpc_order()... "); - if(encoder->get_max_lpc_order() != 0) { - printf("FAILED, expected %u, got %u\n", 0, encoder->get_max_lpc_order()); - return false; - } - printf("OK\n"); - - printf("testing get_qlp_coeff_precision()... "); - (void)encoder->get_qlp_coeff_precision(); - /* we asked the encoder to auto select this so we accept anything */ - printf("OK\n"); - - printf("testing get_do_qlp_coeff_prec_search()... "); - if(encoder->get_do_qlp_coeff_prec_search() != false) { - printf("FAILED, expected false, got true\n"); - return false; - } - printf("OK\n"); - - printf("testing get_do_escape_coding()... "); - if(encoder->get_do_escape_coding() != false) { - printf("FAILED, expected false, got true\n"); - return false; - } - printf("OK\n"); - - printf("testing get_do_exhaustive_model_search()... "); - if(encoder->get_do_exhaustive_model_search() != false) { - printf("FAILED, expected false, got true\n"); - return false; - } - printf("OK\n"); - - printf("testing get_min_residual_partition_order()... "); - if(encoder->get_min_residual_partition_order() != 0) { - printf("FAILED, expected %u, got %u\n", 0, encoder->get_min_residual_partition_order()); - return false; - } - printf("OK\n"); - - printf("testing get_max_residual_partition_order()... "); - if(encoder->get_max_residual_partition_order() != 0) { - printf("FAILED, expected %u, got %u\n", 0, encoder->get_max_residual_partition_order()); - return false; - } - printf("OK\n"); - - printf("testing get_rice_parameter_search_dist()... "); - if(encoder->get_rice_parameter_search_dist() != 0) { - printf("FAILED, expected %u, got %u\n", 0, encoder->get_rice_parameter_search_dist()); - return false; - } - printf("OK\n"); - - printf("testing get_total_samples_estimate()... "); - if(encoder->get_total_samples_estimate() != streaminfo_.data.stream_info.total_samples) { -#ifdef _MSC_VER - printf("FAILED, expected %I64u, got %I64u\n", streaminfo_.data.stream_info.total_samples, encoder->get_total_samples_estimate()); -#else - printf("FAILED, expected %llu, got %llu\n", (unsigned long long)streaminfo_.data.stream_info.total_samples, (unsigned long long)encoder->get_total_samples_estimate()); -#endif - return false; - } - printf("OK\n"); - - /* init the dummy sample buffer */ - for(i = 0; i < sizeof(samples) / sizeof(FLAC__int32); i++) - samples[i] = i & 7; - - printf("testing process()... "); - if(!encoder->process(samples_array, sizeof(samples) / sizeof(FLAC__int32))) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing process_interleaved()... "); - if(!encoder->process_interleaved(samples, sizeof(samples) / sizeof(FLAC__int32))) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing finish()... "); - if(!encoder->finish()) { - FLAC::Encoder::Stream::State state = encoder->get_state(); - printf("FAILED, returned false, state = %u (%s)\n", (unsigned)((::FLAC__StreamEncoderState)state), state.as_cstring()); - return false; - } - printf("OK\n"); - - if(layer < LAYER_FILE) - ::fclose(dynamic_cast<StreamEncoder*>(encoder)->file_); - - printf("freeing encoder instance... "); - delete encoder; - printf("OK\n"); - - printf("\nPASSED!\n"); - - return true; -} - -bool test_encoders() -{ - FLAC__bool is_ogg = false; - - while(1) { - init_metadata_blocks_(); - - if(!test_stream_encoder(LAYER_STREAM, is_ogg)) - return false; - - if(!test_stream_encoder(LAYER_SEEKABLE_STREAM, is_ogg)) - return false; - - if(!test_stream_encoder(LAYER_FILE, is_ogg)) - return false; - - if(!test_stream_encoder(LAYER_FILENAME, is_ogg)) - return false; - - (void) grabbag__file_remove_file(flacfilename(is_ogg)); - - free_metadata_blocks_(); - - if(!FLAC_API_SUPPORTS_OGG_FLAC || is_ogg) - break; - is_ogg = true; - } - - return true; -} diff --git a/3rdparty/libflac/src/test_libFLAC++/encoders.h b/3rdparty/libflac/src/test_libFLAC++/encoders.h deleted file mode 100644 index 2b5c8c73971..00000000000 --- a/3rdparty/libflac/src/test_libFLAC++/encoders.h +++ /dev/null @@ -1,24 +0,0 @@ -/* test_libFLAC++ - Unit tester for libFLAC++ - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef FLAC__TEST_LIBFLACPP_ENCODERS_H -#define FLAC__TEST_LIBFLACPP_ENCODERS_H - -bool test_encoders(); - -#endif diff --git a/3rdparty/libflac/src/test_libFLAC++/main.cpp b/3rdparty/libflac/src/test_libFLAC++/main.cpp deleted file mode 100644 index 6a3a0a34e71..00000000000 --- a/3rdparty/libflac/src/test_libFLAC++/main.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* test_libFLAC++ - Unit tester for libFLAC++ - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include "decoders.h" -#include "encoders.h" -#include "metadata.h" - -int main(int argc, char *argv[]) -{ - (void)argc, (void)argv; - - if(!test_encoders()) - return 1; - - if(!test_decoders()) - return 1; - - if(!test_metadata()) - return 1; - - return 0; -} diff --git a/3rdparty/libflac/src/test_libFLAC++/metadata.cpp b/3rdparty/libflac/src/test_libFLAC++/metadata.cpp deleted file mode 100644 index 135f61eff56..00000000000 --- a/3rdparty/libflac/src/test_libFLAC++/metadata.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* test_libFLAC++ - Unit tester for libFLAC++ - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include "metadata.h" -#include <stdio.h> - -extern bool test_metadata_object(); -extern bool test_metadata_file_manipulation(); - -bool test_metadata() -{ - if(!test_metadata_object()) - return false; - - if(!test_metadata_file_manipulation()) - return false; - - printf("\nPASSED!\n"); - - return true; -} diff --git a/3rdparty/libflac/src/test_libFLAC++/metadata.h b/3rdparty/libflac/src/test_libFLAC++/metadata.h deleted file mode 100644 index 090dcc4b6a4..00000000000 --- a/3rdparty/libflac/src/test_libFLAC++/metadata.h +++ /dev/null @@ -1,24 +0,0 @@ -/* test_libFLAC++ - Unit tester for libFLAC++ - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef FLAC__TEST_LIBFLACPP_METADATA_H -#define FLAC__TEST_LIBFLACPP_METADATA_H - -bool test_metadata(); - -#endif diff --git a/3rdparty/libflac/src/test_libFLAC++/metadata_manip.cpp b/3rdparty/libflac/src/test_libFLAC++/metadata_manip.cpp deleted file mode 100644 index 27336f92a0c..00000000000 --- a/3rdparty/libflac/src/test_libFLAC++/metadata_manip.cpp +++ /dev/null @@ -1,2210 +0,0 @@ -/* test_libFLAC++ - Unit tester for libFLAC++ - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdio.h> -#include <stdlib.h> /* for malloc() */ -#include <string.h> /* for memcpy()/memset() */ -#if defined _MSC_VER || defined __MINGW32__ -#include <sys/utime.h> /* for utime() */ -#include <io.h> /* for chmod() */ -#if _MSC_VER <= 1600 /* @@@ [2G limit] */ -#define fseeko fseek -#define ftello ftell -#endif -#else -#include <sys/types.h> /* some flavors of BSD (like OS X) require this to get time_t */ -#include <utime.h> /* for utime() */ -#include <unistd.h> /* for chown(), unlink() */ -#endif -#include <sys/stat.h> /* for stat(), maybe chmod() */ -#include "FLAC/assert.h" -#include "FLAC++/decoder.h" -#include "FLAC++/metadata.h" -#include "share/grabbag.h" -extern "C" { -#include "test_libs_common/file_utils_flac.h" -} - -/****************************************************************************** - The general strategy of these tests (for interface levels 1 and 2) is - to create a dummy FLAC file with a known set of initial metadata - blocks, then keep a mirror locally of what we expect the metadata to be - after each operation. Then testing becomes a simple matter of running - a FLAC::Decoder::File over the dummy file after each operation, comparing - the decoded metadata to what's in our local copy. If there are any - differences in the metadata, or the actual audio data is corrupted, we - will catch it while decoding. -******************************************************************************/ - -class OurFileDecoder: public FLAC::Decoder::File { -public: - inline OurFileDecoder(bool ignore_metadata): ignore_metadata_(ignore_metadata), error_occurred_(false) { } - - bool ignore_metadata_; - bool error_occurred_; -protected: - ::FLAC__StreamDecoderWriteStatus write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]); - void metadata_callback(const ::FLAC__StreamMetadata *metadata); - void error_callback(::FLAC__StreamDecoderErrorStatus status); -}; - -struct OurMetadata { - FLAC::Metadata::Prototype *blocks[64]; - unsigned num_blocks; -}; - -/* our copy of the metadata in flacfilename() */ -static OurMetadata our_metadata_; - -/* the current block number that corresponds to the position of the iterator we are testing */ -static unsigned mc_our_block_number_ = 0; - -static const char *flacfilename(bool is_ogg) -{ - return is_ogg? "metadata.oga" : "metadata.flac"; -} - -static bool die_(const char *msg) -{ - printf("ERROR: %s\n", msg); - return false; -} - -static bool die_c_(const char *msg, FLAC::Metadata::Chain::Status status) -{ - printf("ERROR: %s\n", msg); - printf(" status=%u (%s)\n", (unsigned)((::FLAC__Metadata_ChainStatus)status), status.as_cstring()); - return false; -} - -static bool die_ss_(const char *msg, FLAC::Metadata::SimpleIterator &iterator) -{ - const FLAC::Metadata::SimpleIterator::Status status = iterator.status(); - printf("ERROR: %s\n", msg); - printf(" status=%u (%s)\n", (unsigned)((::FLAC__Metadata_SimpleIteratorStatus)status), status.as_cstring()); - return false; -} - -static void *malloc_or_die_(size_t size) -{ - void *x = malloc(size); - if(0 == x) { - fprintf(stderr, "ERROR: out of memory allocating %u bytes\n", (unsigned)size); - exit(1); - } - return x; -} - -static char *strdup_or_die_(const char *s) -{ - char *x = strdup(s); - if(0 == x) { - fprintf(stderr, "ERROR: out of memory copying string \"%s\"\n", s); - exit(1); - } - return x; -} - -/* functions for working with our metadata copy */ - -static bool replace_in_our_metadata_(FLAC::Metadata::Prototype *block, unsigned position, bool copy) -{ - unsigned i; - FLAC::Metadata::Prototype *obj = block; - FLAC__ASSERT(position < our_metadata_.num_blocks); - if(copy) { - if(0 == (obj = FLAC::Metadata::clone(block))) - return die_("during FLAC::Metadata::clone()"); - } - delete our_metadata_.blocks[position]; - our_metadata_.blocks[position] = obj; - - /* set the is_last flags */ - for(i = 0; i < our_metadata_.num_blocks - 1; i++) - our_metadata_.blocks[i]->set_is_last(false); - our_metadata_.blocks[i]->set_is_last(true); - - return true; -} - -static bool insert_to_our_metadata_(FLAC::Metadata::Prototype *block, unsigned position, bool copy) -{ - unsigned i; - FLAC::Metadata::Prototype *obj = block; - if(copy) { - if(0 == (obj = FLAC::Metadata::clone(block))) - return die_("during FLAC::Metadata::clone()"); - } - if(position > our_metadata_.num_blocks) { - position = our_metadata_.num_blocks; - } - else { - for(i = our_metadata_.num_blocks; i > position; i--) - our_metadata_.blocks[i] = our_metadata_.blocks[i-1]; - } - our_metadata_.blocks[position] = obj; - our_metadata_.num_blocks++; - - /* set the is_last flags */ - for(i = 0; i < our_metadata_.num_blocks - 1; i++) - our_metadata_.blocks[i]->set_is_last(false); - our_metadata_.blocks[i]->set_is_last(true); - - return true; -} - -static void delete_from_our_metadata_(unsigned position) -{ - unsigned i; - FLAC__ASSERT(position < our_metadata_.num_blocks); - delete our_metadata_.blocks[position]; - for(i = position; i < our_metadata_.num_blocks - 1; i++) - our_metadata_.blocks[i] = our_metadata_.blocks[i+1]; - our_metadata_.num_blocks--; - - /* set the is_last flags */ - if(our_metadata_.num_blocks > 0) { - for(i = 0; i < our_metadata_.num_blocks - 1; i++) - our_metadata_.blocks[i]->set_is_last(false); - our_metadata_.blocks[i]->set_is_last(true); - } -} - -void add_to_padding_length_(unsigned index, int delta) -{ - FLAC::Metadata::Padding *padding = dynamic_cast<FLAC::Metadata::Padding *>(our_metadata_.blocks[index]); - FLAC__ASSERT(0 != padding); - padding->set_length((unsigned)((int)padding->get_length() + delta)); -} - -/* - * This wad of functions supports filename- and callback-based chain reading/writing. - * Everything up to set_file_stats_() is copied from libFLAC/metadata_iterators.c - */ -bool open_tempfile_(const char *filename, FILE **tempfile, char **tempfilename) -{ - static const char *tempfile_suffix = ".metadata_edit"; - - if(0 == (*tempfilename = (char*)malloc(strlen(filename) + strlen(tempfile_suffix) + 1))) - return false; - strcpy(*tempfilename, filename); - strcat(*tempfilename, tempfile_suffix); - - if(0 == (*tempfile = fopen(*tempfilename, "wb"))) - return false; - - return true; -} - -void cleanup_tempfile_(FILE **tempfile, char **tempfilename) -{ - if(0 != *tempfile) { - (void)fclose(*tempfile); - *tempfile = 0; - } - - if(0 != *tempfilename) { - (void)unlink(*tempfilename); - free(*tempfilename); - *tempfilename = 0; - } -} - -bool transport_tempfile_(const char *filename, FILE **tempfile, char **tempfilename) -{ - FLAC__ASSERT(0 != filename); - FLAC__ASSERT(0 != tempfile); - FLAC__ASSERT(0 != tempfilename); - FLAC__ASSERT(0 != *tempfilename); - - if(0 != *tempfile) { - (void)fclose(*tempfile); - *tempfile = 0; - } - -#if defined _MSC_VER || defined __MINGW32__ || defined __EMX__ - /* on some flavors of windows, rename() will fail if the destination already exists */ - if(unlink(filename) < 0) { - cleanup_tempfile_(tempfile, tempfilename); - return false; - } -#endif - - if(0 != rename(*tempfilename, filename)) { - cleanup_tempfile_(tempfile, tempfilename); - return false; - } - - cleanup_tempfile_(tempfile, tempfilename); - - return true; -} - -bool get_file_stats_(const char *filename, struct stat *stats) -{ - FLAC__ASSERT(0 != filename); - FLAC__ASSERT(0 != stats); - return (0 == stat(filename, stats)); -} - -void set_file_stats_(const char *filename, struct stat *stats) -{ - struct utimbuf srctime; - - FLAC__ASSERT(0 != filename); - FLAC__ASSERT(0 != stats); - - srctime.actime = stats->st_atime; - srctime.modtime = stats->st_mtime; - (void)chmod(filename, stats->st_mode); - (void)utime(filename, &srctime); -#if !defined _MSC_VER && !defined __MINGW32__ && !defined __EMX__ - (void)chown(filename, stats->st_uid, (gid_t)(-1)); - (void)chown(filename, (uid_t)(-1), stats->st_gid); -#endif -} - -#ifdef FLAC__VALGRIND_TESTING -static size_t chain_write_cb_(const void *ptr, size_t size, size_t nmemb, ::FLAC__IOHandle handle) -{ - FILE *stream = (FILE*)handle; - size_t ret = fwrite(ptr, size, nmemb, stream); - if(!ferror(stream)) - fflush(stream); - return ret; -} -#endif - -static int chain_seek_cb_(::FLAC__IOHandle handle, FLAC__int64 offset, int whence) -{ - off_t o = (off_t)offset; - FLAC__ASSERT(offset == o); - return fseeko((FILE*)handle, o, whence); -} - -static FLAC__int64 chain_tell_cb_(::FLAC__IOHandle handle) -{ - return ftello((FILE*)handle); -} - -static int chain_eof_cb_(::FLAC__IOHandle handle) -{ - return feof((FILE*)handle); -} - -static bool write_chain_(FLAC::Metadata::Chain &chain, bool use_padding, bool preserve_file_stats, bool filename_based, const char *filename) -{ - if(filename_based) - return chain.write(use_padding, preserve_file_stats); - else { - ::FLAC__IOCallbacks callbacks; - - memset(&callbacks, 0, sizeof(callbacks)); - callbacks.read = (::FLAC__IOCallback_Read)fread; -#ifdef FLAC__VALGRIND_TESTING - callbacks.write = chain_write_cb_; -#else - callbacks.write = (::FLAC__IOCallback_Write)fwrite; -#endif - callbacks.seek = chain_seek_cb_; - callbacks.eof = chain_eof_cb_; - - if(chain.check_if_tempfile_needed(use_padding)) { - struct stat stats; - FILE *file, *tempfile; - char *tempfilename; - if(preserve_file_stats) { - if(!get_file_stats_(filename, &stats)) - return false; - } - if(0 == (file = fopen(filename, "rb"))) - return false; /*@@@@ chain status still says OK though */ - if(!open_tempfile_(filename, &tempfile, &tempfilename)) { - fclose(file); - cleanup_tempfile_(&tempfile, &tempfilename); - return false; /*@@@@ chain status still says OK though */ - } - if(!chain.write(use_padding, (::FLAC__IOHandle)file, callbacks, (::FLAC__IOHandle)tempfile, callbacks)) { - fclose(file); - fclose(tempfile); - return false; - } - fclose(file); - fclose(tempfile); - file = tempfile = 0; - if(!transport_tempfile_(filename, &tempfile, &tempfilename)) - return false; - if(preserve_file_stats) - set_file_stats_(filename, &stats); - } - else { - FILE *file = fopen(filename, "r+b"); - if(0 == file) - return false; /*@@@@ chain status still says OK though */ - if(!chain.write(use_padding, (::FLAC__IOHandle)file, callbacks)) - return false; - fclose(file); - } - } - - return true; -} - -static bool read_chain_(FLAC::Metadata::Chain &chain, const char *filename, bool filename_based, bool is_ogg) -{ - if(filename_based) - return chain.read(filename, is_ogg); - else { - ::FLAC__IOCallbacks callbacks; - - memset(&callbacks, 0, sizeof(callbacks)); - callbacks.read = (::FLAC__IOCallback_Read)fread; - callbacks.seek = chain_seek_cb_; - callbacks.tell = chain_tell_cb_; - - { - bool ret; - FILE *file = fopen(filename, "rb"); - if(0 == file) - return false; /*@@@@ chain status still says OK though */ - ret = chain.read((::FLAC__IOHandle)file, callbacks, is_ogg); - fclose(file); - return ret; - } - } -} - -/* function for comparing our metadata to a FLAC::Metadata::Chain */ - -static bool compare_chain_(FLAC::Metadata::Chain &chain, unsigned current_position, FLAC::Metadata::Prototype *current_block) -{ - unsigned i; - FLAC::Metadata::Iterator iterator; - bool next_ok = true; - - printf("\tcomparing chain... "); - fflush(stdout); - - if(!iterator.is_valid()) - return die_("allocating memory for iterator"); - - iterator.init(chain); - - i = 0; - do { - FLAC::Metadata::Prototype *block; - - printf("%u... ", i); - fflush(stdout); - - if(0 == (block = iterator.get_block())) - return die_("getting block from iterator"); - - if(*block != *our_metadata_.blocks[i]) - return die_("metadata block mismatch"); - - delete block; - i++; - next_ok = iterator.next(); - } while(i < our_metadata_.num_blocks && next_ok); - - if(next_ok) - return die_("chain has more blocks than expected"); - - if(i < our_metadata_.num_blocks) - return die_("short block count in chain"); - - if(0 != current_block) { - printf("CURRENT_POSITION... "); - fflush(stdout); - - if(*current_block != *our_metadata_.blocks[current_position]) - return die_("metadata block mismatch"); - } - - printf("PASSED\n"); - - return true; -} - -::FLAC__StreamDecoderWriteStatus OurFileDecoder::write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]) -{ - (void)buffer; - - if( - (frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER && frame->header.number.frame_number == 0) || - (frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER && frame->header.number.sample_number == 0) - ) { - printf("content... "); - fflush(stdout); - } - - return ::FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; -} - -void OurFileDecoder::metadata_callback(const ::FLAC__StreamMetadata *metadata) -{ - /* don't bother checking if we've already hit an error */ - if(error_occurred_) - return; - - printf("%d... ", mc_our_block_number_); - fflush(stdout); - - if(!ignore_metadata_) { - if(mc_our_block_number_ >= our_metadata_.num_blocks) { - (void)die_("got more metadata blocks than expected"); - error_occurred_ = true; - } - else { - if(*our_metadata_.blocks[mc_our_block_number_] != metadata) { - (void)die_("metadata block mismatch"); - error_occurred_ = true; - } - } - } - - mc_our_block_number_++; -} - -void OurFileDecoder::error_callback(::FLAC__StreamDecoderErrorStatus status) -{ - error_occurred_ = true; - printf("ERROR: got error callback, status = %s (%u)\n", FLAC__StreamDecoderErrorStatusString[status], (unsigned)status); -} - -static bool generate_file_(bool include_extras, bool is_ogg) -{ - ::FLAC__StreamMetadata streaminfo, vorbiscomment, *cuesheet, picture, padding; - ::FLAC__StreamMetadata *metadata[4]; - unsigned i = 0, n = 0; - - printf("generating %sFLAC file for test\n", is_ogg? "Ogg " : ""); - - while(our_metadata_.num_blocks > 0) - delete_from_our_metadata_(0); - - streaminfo.is_last = false; - streaminfo.type = ::FLAC__METADATA_TYPE_STREAMINFO; - streaminfo.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH; - streaminfo.data.stream_info.min_blocksize = 576; - streaminfo.data.stream_info.max_blocksize = 576; - streaminfo.data.stream_info.min_framesize = 0; - streaminfo.data.stream_info.max_framesize = 0; - streaminfo.data.stream_info.sample_rate = 44100; - streaminfo.data.stream_info.channels = 1; - streaminfo.data.stream_info.bits_per_sample = 8; - streaminfo.data.stream_info.total_samples = 0; - memset(streaminfo.data.stream_info.md5sum, 0, 16); - - { - const unsigned vendor_string_length = (unsigned)strlen(FLAC__VENDOR_STRING); - vorbiscomment.is_last = false; - vorbiscomment.type = ::FLAC__METADATA_TYPE_VORBIS_COMMENT; - vorbiscomment.length = (4 + vendor_string_length) + 4; - vorbiscomment.data.vorbis_comment.vendor_string.length = vendor_string_length; - vorbiscomment.data.vorbis_comment.vendor_string.entry = (FLAC__byte*)malloc_or_die_(vendor_string_length+1); - memcpy(vorbiscomment.data.vorbis_comment.vendor_string.entry, FLAC__VENDOR_STRING, vendor_string_length+1); - vorbiscomment.data.vorbis_comment.num_comments = 0; - vorbiscomment.data.vorbis_comment.comments = 0; - } - - { - if (0 == (cuesheet = ::FLAC__metadata_object_new(::FLAC__METADATA_TYPE_CUESHEET))) - return die_("priming our metadata"); - cuesheet->is_last = false; - strcpy(cuesheet->data.cue_sheet.media_catalog_number, "bogo-MCN"); - cuesheet->data.cue_sheet.lead_in = 123; - cuesheet->data.cue_sheet.is_cd = false; - if (!FLAC__metadata_object_cuesheet_insert_blank_track(cuesheet, 0)) - return die_("priming our metadata"); - cuesheet->data.cue_sheet.tracks[0].number = 1; - if (!FLAC__metadata_object_cuesheet_track_insert_blank_index(cuesheet, 0, 0)) - return die_("priming our metadata"); - } - - { - picture.is_last = false; - picture.type = ::FLAC__METADATA_TYPE_PICTURE; - picture.length = - ( - FLAC__STREAM_METADATA_PICTURE_TYPE_LEN + - FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN + /* will add the length for the string later */ - FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN + /* will add the length for the string later */ - FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN + - FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN + - FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN + - FLAC__STREAM_METADATA_PICTURE_COLORS_LEN + - FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN /* will add the length for the data later */ - ) / 8 - ; - picture.data.picture.type = ::FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER; - picture.data.picture.mime_type = strdup_or_die_("image/jpeg"); - picture.length += strlen(picture.data.picture.mime_type); - picture.data.picture.description = (FLAC__byte*)strdup_or_die_("desc"); - picture.length += strlen((const char *)picture.data.picture.description); - picture.data.picture.width = 300; - picture.data.picture.height = 300; - picture.data.picture.depth = 24; - picture.data.picture.colors = 0; - picture.data.picture.data = (FLAC__byte*)strdup_or_die_("SOMEJPEGDATA"); - picture.data.picture.data_length = strlen((const char *)picture.data.picture.data); - picture.length += picture.data.picture.data_length; - } - - padding.is_last = true; - padding.type = ::FLAC__METADATA_TYPE_PADDING; - padding.length = 1234; - - metadata[n++] = &vorbiscomment; - if(include_extras) { - metadata[n++] = cuesheet; - metadata[n++] = &picture; - } - metadata[n++] = &padding; - - FLAC::Metadata::StreamInfo s(&streaminfo); - FLAC::Metadata::VorbisComment v(&vorbiscomment); - FLAC::Metadata::CueSheet c(cuesheet, /*copy=*/false); - FLAC::Metadata::Picture pi(&picture); - FLAC::Metadata::Padding p(&padding); - if( - !insert_to_our_metadata_(&s, i++, /*copy=*/true) || - !insert_to_our_metadata_(&v, i++, /*copy=*/true) || - (include_extras && !insert_to_our_metadata_(&c, i++, /*copy=*/true)) || - (include_extras && !insert_to_our_metadata_(&pi, i++, /*copy=*/true)) || - !insert_to_our_metadata_(&p, i++, /*copy=*/true) - ) - return die_("priming our metadata"); - - if(!file_utils__generate_flacfile(is_ogg, flacfilename(is_ogg), 0, 512 * 1024, &streaminfo, metadata, n)) - return die_("creating the encoded file"); - - free(vorbiscomment.data.vorbis_comment.vendor_string.entry); - free(picture.data.picture.mime_type); - free(picture.data.picture.description); - free(picture.data.picture.data); - - return true; -} - -static bool test_file_(bool is_ogg, bool ignore_metadata) -{ - const char *filename = flacfilename(is_ogg); - OurFileDecoder decoder(ignore_metadata); - - mc_our_block_number_ = 0; - decoder.error_occurred_ = false; - - printf("\ttesting '%s'... ", filename); - fflush(stdout); - - if(!decoder.is_valid()) - return die_("couldn't allocate decoder instance"); - - decoder.set_md5_checking(true); - decoder.set_metadata_respond_all(); - if((is_ogg? decoder.init_ogg(filename) : decoder.init(filename)) != ::FLAC__STREAM_DECODER_INIT_STATUS_OK) { - (void)decoder.finish(); - return die_("initializing decoder\n"); - } - if(!decoder.process_until_end_of_stream()) { - (void)decoder.finish(); - return die_("decoding file\n"); - } - - (void)decoder.finish(); - - if(decoder.error_occurred_) - return false; - - if(mc_our_block_number_ != our_metadata_.num_blocks) - return die_("short metadata block count"); - - printf("PASSED\n"); - return true; -} - -static bool change_stats_(const char *filename, bool read_only) -{ - if(!grabbag__file_change_stats(filename, read_only)) - return die_("during grabbag__file_change_stats()"); - - return true; -} - -static bool remove_file_(const char *filename) -{ - while(our_metadata_.num_blocks > 0) - delete_from_our_metadata_(0); - - if(!grabbag__file_remove_file(filename)) - return die_("removing file"); - - return true; -} - -static bool test_level_0_() -{ - FLAC::Metadata::StreamInfo streaminfo; - - printf("\n\n++++++ testing level 0 interface\n"); - - if(!generate_file_(/*include_extras=*/true, /*is_ogg=*/false)) - return false; - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/true)) - return false; - - printf("testing FLAC::Metadata::get_streaminfo()... "); - - if(!FLAC::Metadata::get_streaminfo(flacfilename(/*is_ogg=*/false), streaminfo)) - return die_("during FLAC::Metadata::get_streaminfo()"); - - /* check to see if some basic data matches (c.f. generate_file_()) */ - if(streaminfo.get_channels() != 1) - return die_("mismatch in streaminfo.get_channels()"); - if(streaminfo.get_bits_per_sample() != 8) - return die_("mismatch in streaminfo.get_bits_per_sample()"); - if(streaminfo.get_sample_rate() != 44100) - return die_("mismatch in streaminfo.get_sample_rate()"); - if(streaminfo.get_min_blocksize() != 576) - return die_("mismatch in streaminfo.get_min_blocksize()"); - if(streaminfo.get_max_blocksize() != 576) - return die_("mismatch in streaminfo.get_max_blocksize()"); - - printf("OK\n"); - - { - printf("testing FLAC::Metadata::get_tags(VorbisComment *&)... "); - - FLAC::Metadata::VorbisComment *tags = 0; - - if(!FLAC::Metadata::get_tags(flacfilename(/*is_ogg=*/false), tags)) - return die_("during FLAC::Metadata::get_tags()"); - - /* check to see if some basic data matches (c.f. generate_file_()) */ - if(tags->get_num_comments() != 0) - return die_("mismatch in tags->get_num_comments()"); - - printf("OK\n"); - - delete tags; - } - - { - printf("testing FLAC::Metadata::get_tags(VorbisComment &)... "); - - FLAC::Metadata::VorbisComment tags; - - if(!FLAC::Metadata::get_tags(flacfilename(/*is_ogg=*/false), tags)) - return die_("during FLAC::Metadata::get_tags()"); - - /* check to see if some basic data matches (c.f. generate_file_()) */ - if(tags.get_num_comments() != 0) - return die_("mismatch in tags.get_num_comments()"); - - printf("OK\n"); - } - - { - printf("testing FLAC::Metadata::get_cuesheet(CueSheet *&)... "); - - FLAC::Metadata::CueSheet *cuesheet = 0; - - if(!FLAC::Metadata::get_cuesheet(flacfilename(/*is_ogg=*/false), cuesheet)) - return die_("during FLAC::Metadata::get_cuesheet()"); - - /* check to see if some basic data matches (c.f. generate_file_()) */ - if(cuesheet->get_lead_in() != 123) - return die_("mismatch in cuesheet->get_lead_in()"); - - printf("OK\n"); - - delete cuesheet; - } - - { - printf("testing FLAC::Metadata::get_cuesheet(CueSheet &)... "); - - FLAC::Metadata::CueSheet cuesheet; - - if(!FLAC::Metadata::get_cuesheet(flacfilename(/*is_ogg=*/false), cuesheet)) - return die_("during FLAC::Metadata::get_cuesheet()"); - - /* check to see if some basic data matches (c.f. generate_file_()) */ - if(cuesheet.get_lead_in() != 123) - return die_("mismatch in cuesheet.get_lead_in()"); - - printf("OK\n"); - } - - { - printf("testing FLAC::Metadata::get_picture(Picture *&)... "); - - FLAC::Metadata::Picture *picture = 0; - - if(!FLAC::Metadata::get_picture(flacfilename(/*is_ogg=*/false), picture, /*type=*/(::FLAC__StreamMetadata_Picture_Type)(-1), /*mime_type=*/0, /*description=*/0, /*max_width=*/(unsigned)(-1), /*max_height=*/(unsigned)(-1), /*max_depth=*/(unsigned)(-1), /*max_colors=*/(unsigned)(-1))) - return die_("during FLAC::Metadata::get_picture()"); - - /* check to see if some basic data matches (c.f. generate_file_()) */ - if(picture->get_type () != ::FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER) - return die_("mismatch in picture->get_type ()"); - - printf("OK\n"); - - delete picture; - } - - { - printf("testing FLAC::Metadata::get_picture(Picture &)... "); - - FLAC::Metadata::Picture picture; - - if(!FLAC::Metadata::get_picture(flacfilename(/*is_ogg=*/false), picture, /*type=*/(::FLAC__StreamMetadata_Picture_Type)(-1), /*mime_type=*/0, /*description=*/0, /*max_width=*/(unsigned)(-1), /*max_height=*/(unsigned)(-1), /*max_depth=*/(unsigned)(-1), /*max_colors=*/(unsigned)(-1))) - return die_("during FLAC::Metadata::get_picture()"); - - /* check to see if some basic data matches (c.f. generate_file_()) */ - if(picture.get_type () != ::FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER) - return die_("mismatch in picture->get_type ()"); - - printf("OK\n"); - } - - if(!remove_file_(flacfilename(/*is_ogg=*/false))) - return false; - - return true; -} - -static bool test_level_1_() -{ - FLAC::Metadata::Prototype *block; - FLAC::Metadata::StreamInfo *streaminfo; - FLAC::Metadata::Padding *padding; - FLAC::Metadata::Application *app; - FLAC__byte data[1000]; - unsigned our_current_position = 0; - - // initialize 'data' to avoid Valgrind errors - memset(data, 0, sizeof(data)); - - printf("\n\n++++++ testing level 1 interface\n"); - - /************************************************************/ - { - printf("simple iterator on read-only file\n"); - - if(!generate_file_(/*include_extras=*/false, /*is_ogg=*/false)) - return false; - - if(!change_stats_(flacfilename(/*is_ogg=*/false), /*read_only=*/true)) - return false; - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/true)) - return false; - - FLAC::Metadata::SimpleIterator iterator; - - if(!iterator.is_valid()) - return die_("iterator.is_valid() returned false"); - - if(!iterator.init(flacfilename(/*is_ogg=*/false), /*read_only=*/false, /*preserve_file_stats=*/false)) - return die_("iterator.init() returned false"); - - printf("is writable = %u\n", (unsigned)iterator.is_writable()); - if(iterator.is_writable()) - return die_("iterator claims file is writable when tester thinks it should not be; are you running as root?\n"); - - printf("iterate forwards\n"); - - if(iterator.get_block_type() != ::FLAC__METADATA_TYPE_STREAMINFO) - return die_("expected STREAMINFO type from iterator.get_block_type()"); - if(0 == (block = iterator.get_block())) - return die_("getting block 0"); - if(block->get_type() != ::FLAC__METADATA_TYPE_STREAMINFO) - return die_("expected STREAMINFO type"); - if(block->get_is_last()) - return die_("expected is_last to be false"); - if(block->get_length() != FLAC__STREAM_METADATA_STREAMINFO_LENGTH) - return die_("bad STREAMINFO length"); - /* check to see if some basic data matches (c.f. generate_file_()) */ - streaminfo = dynamic_cast<FLAC::Metadata::StreamInfo *>(block); - FLAC__ASSERT(0 != streaminfo); - if(streaminfo->get_channels() != 1) - return die_("mismatch in channels"); - if(streaminfo->get_bits_per_sample() != 8) - return die_("mismatch in bits_per_sample"); - if(streaminfo->get_sample_rate() != 44100) - return die_("mismatch in sample_rate"); - if(streaminfo->get_min_blocksize() != 576) - return die_("mismatch in min_blocksize"); - if(streaminfo->get_max_blocksize() != 576) - return die_("mismatch in max_blocksize"); - // we will delete streaminfo a little later when we're really done with it... - - if(!iterator.next()) - return die_("forward iterator ended early"); - our_current_position++; - - if(!iterator.next()) - return die_("forward iterator ended early"); - our_current_position++; - - if(iterator.get_block_type() != ::FLAC__METADATA_TYPE_PADDING) - return die_("expected PADDING type from iterator.get_block_type()"); - if(0 == (block = iterator.get_block())) - return die_("getting block 1"); - if(block->get_type() != ::FLAC__METADATA_TYPE_PADDING) - return die_("expected PADDING type"); - if(!block->get_is_last()) - return die_("expected is_last to be true"); - /* check to see if some basic data matches (c.f. generate_file_()) */ - if(block->get_length() != 1234) - return die_("bad PADDING length"); - delete block; - - if(iterator.next()) - return die_("forward iterator returned true but should have returned false"); - - printf("iterate backwards\n"); - if(!iterator.prev()) - return die_("reverse iterator ended early"); - if(!iterator.prev()) - return die_("reverse iterator ended early"); - if(iterator.prev()) - return die_("reverse iterator returned true but should have returned false"); - - printf("testing iterator.set_block() on read-only file...\n"); - - if(!iterator.set_block(streaminfo, false)) - printf("PASSED. iterator.set_block() returned false like it should\n"); - else - return die_("iterator.set_block() returned true but shouldn't have"); - delete streaminfo; - } - - /************************************************************/ - { - printf("simple iterator on writable file\n"); - - if(!change_stats_(flacfilename(/*is_ogg=*/false), /*read-only=*/false)) - return false; - - printf("creating APPLICATION block\n"); - - if(0 == (app = new FLAC::Metadata::Application())) - return die_("new FLAC::Metadata::Application()"); - app->set_id((const unsigned char *)"duh"); - - printf("creating PADDING block\n"); - - if(0 == (padding = new FLAC::Metadata::Padding())) - return die_("new FLAC::Metadata::Padding()"); - padding->set_length(20); - - FLAC::Metadata::SimpleIterator iterator; - - if(!iterator.is_valid()) - return die_("iterator.is_valid() returned false"); - - if(!iterator.init(flacfilename(/*is_ogg=*/false), /*read_only=*/false, /*preserve_file_stats=*/false)) - return die_("iterator.init() returned false"); - our_current_position = 0; - - printf("is writable = %u\n", (unsigned)iterator.is_writable()); - - printf("[S]VP\ttry to write over STREAMINFO block...\n"); - if(!iterator.set_block(app, false)) - printf("\titerator.set_block() returned false like it should\n"); - else - return die_("iterator.set_block() returned true but shouldn't have"); - - printf("[S]VP\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("S[V]P\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[P]\tinsert PADDING after, don't expand into padding\n"); - padding->set_length(25); - if(!iterator.insert_block_after(padding, false)) - return die_ss_("iterator.insert_block_after(padding, false)", iterator); - if(!insert_to_our_metadata_(padding, ++our_current_position, /*copy=*/true)) - return false; - - printf("SVP[P]\tprev\n"); - if(!iterator.prev()) - return die_("iterator ended early\n"); - our_current_position--; - - printf("SV[P]P\tprev\n"); - if(!iterator.prev()) - return die_("iterator ended early\n"); - our_current_position--; - - printf("S[V]PP\tinsert PADDING after, don't expand into padding\n"); - padding->set_length(30); - if(!iterator.insert_block_after(padding, false)) - return die_ss_("iterator.insert_block_after(padding, false)", iterator); - if(!insert_to_our_metadata_(padding, ++our_current_position, /*copy=*/true)) - return false; - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SV[P]PP\tprev\n"); - if(!iterator.prev()) - return die_("iterator ended early\n"); - our_current_position--; - - printf("S[V]PPP\tprev\n"); - if(!iterator.prev()) - return die_("iterator ended early\n"); - our_current_position--; - - printf("[S]VPPP\tdelete (STREAMINFO block), must fail\n"); - if(iterator.delete_block(false)) - return die_ss_("iterator.delete_block(false) should have returned false", iterator); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("[S]VPPP\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("S[V]PPP\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[P]PP\tdelete (middle block), replace with padding\n"); - if(!iterator.delete_block(true)) - return die_ss_("iterator.delete_block(true)", iterator); - our_current_position--; - - printf("S[V]PPP\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[P]PP\tdelete (middle block), don't replace with padding\n"); - if(!iterator.delete_block(false)) - return die_ss_("iterator.delete_block(false)", iterator); - delete_from_our_metadata_(our_current_position--); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("S[V]PP\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[P]P\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SVP[P]\tdelete (last block), replace with padding\n"); - if(!iterator.delete_block(true)) - return die_ss_("iterator.delete_block(false)", iterator); - our_current_position--; - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SV[P]P\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SVP[P]\tdelete (last block), don't replace with padding\n"); - if(!iterator.delete_block(false)) - return die_ss_("iterator.delete_block(false)", iterator); - delete_from_our_metadata_(our_current_position--); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SV[P]\tprev\n"); - if(!iterator.prev()) - return die_("iterator ended early\n"); - our_current_position--; - - printf("S[V]P\tprev\n"); - if(!iterator.prev()) - return die_("iterator ended early\n"); - our_current_position--; - - printf("[S]VP\tset STREAMINFO (change sample rate)\n"); - FLAC__ASSERT(our_current_position == 0); - block = iterator.get_block(); - streaminfo = dynamic_cast<FLAC::Metadata::StreamInfo *>(block); - FLAC__ASSERT(0 != streaminfo); - streaminfo->set_sample_rate(32000); - if(!replace_in_our_metadata_(block, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!iterator.set_block(block, false)) - return die_ss_("iterator.set_block(block, false)", iterator); - delete block; - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("[S]VP\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("S[V]P\tinsert APPLICATION after, expand into padding of exceeding size\n"); - app->set_id((const unsigned char *)"euh"); /* twiddle the id so that our comparison doesn't miss transposition */ - if(!iterator.insert_block_after(app, true)) - return die_ss_("iterator.insert_block_after(app, true)", iterator); - if(!insert_to_our_metadata_(app, ++our_current_position, /*copy=*/true)) - return false; - add_to_padding_length_(our_current_position+1, -((int)(FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8) + (int)app->get_length())); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]P\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SVA[P]\tset APPLICATION, expand into padding of exceeding size\n"); - app->set_id((const unsigned char *)"fuh"); /* twiddle the id */ - if(!iterator.set_block(app, true)) - return die_ss_("iterator.set_block(app, true)", iterator); - if(!insert_to_our_metadata_(app, our_current_position, /*copy=*/true)) - return false; - add_to_padding_length_(our_current_position+1, -((int)(FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8) + (int)app->get_length())); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SVA[A]P\tset APPLICATION (grow), don't expand into padding\n"); - app->set_id((const unsigned char *)"guh"); /* twiddle the id */ - if(!app->set_data(data, sizeof(data), true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!iterator.set_block(app, false)) - return die_ss_("iterator.set_block(app, false)", iterator); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SVA[A]P\tset APPLICATION (shrink), don't fill in with padding\n"); - app->set_id((const unsigned char *)"huh"); /* twiddle the id */ - if(!app->set_data(data, 12, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!iterator.set_block(app, false)) - return die_ss_("iterator.set_block(app, false)", iterator); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SVA[A]P\tset APPLICATION (grow), expand into padding of exceeding size\n"); - app->set_id((const unsigned char *)"iuh"); /* twiddle the id */ - if(!app->set_data(data, sizeof(data), true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - add_to_padding_length_(our_current_position+1, -((int)sizeof(data) - 12)); - if(!iterator.set_block(app, true)) - return die_ss_("iterator.set_block(app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SVA[A]P\tset APPLICATION (shrink), fill in with padding\n"); - app->set_id((const unsigned char *)"juh"); /* twiddle the id */ - if(!app->set_data(data, 23, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!insert_to_our_metadata_(padding, our_current_position+1, /*copy=*/true)) - return die_("copying object"); - dynamic_cast<FLAC::Metadata::Padding *>(our_metadata_.blocks[our_current_position+1])->set_length(sizeof(data) - 23 - FLAC__STREAM_METADATA_HEADER_LENGTH); - if(!iterator.set_block(app, true)) - return die_ss_("iterator.set_block(app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SVA[A]PP\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SVAA[P]P\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SVAAP[P]\tset PADDING (shrink), don't fill in with padding\n"); - padding->set_length(5); - if(!replace_in_our_metadata_(padding, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!iterator.set_block(padding, false)) - return die_ss_("iterator.set_block(padding, false)", iterator); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SVAAP[P]\tset APPLICATION (grow)\n"); - app->set_id((const unsigned char *)"kuh"); /* twiddle the id */ - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!iterator.set_block(app, false)) - return die_ss_("iterator.set_block(app, false)", iterator); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SVAAP[A]\tset PADDING (equal)\n"); - padding->set_length(27); - if(!replace_in_our_metadata_(padding, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!iterator.set_block(padding, false)) - return die_ss_("iterator.set_block(padding, false)", iterator); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SVAAP[P]\tprev\n"); - if(!iterator.prev()) - return die_("iterator ended early\n"); - our_current_position--; - - printf("SVAA[P]P\tdelete (middle block), don't replace with padding\n"); - if(!iterator.delete_block(false)) - return die_ss_("iterator.delete_block(false)", iterator); - delete_from_our_metadata_(our_current_position--); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SVA[A]P\tdelete (middle block), don't replace with padding\n"); - if(!iterator.delete_block(false)) - return die_ss_("iterator.delete_block(false)", iterator); - delete_from_our_metadata_(our_current_position--); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]P\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SVA[P]\tinsert PADDING after\n"); - padding->set_length(5); - if(!iterator.insert_block_after(padding, false)) - return die_ss_("iterator.insert_block_after(padding, false)", iterator); - if(!insert_to_our_metadata_(padding, ++our_current_position, /*copy=*/true)) - return false; - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SVAP[P]\tprev\n"); - if(!iterator.prev()) - return die_("iterator ended early\n"); - our_current_position--; - - printf("SVA[P]P\tprev\n"); - if(!iterator.prev()) - return die_("iterator ended early\n"); - our_current_position--; - - printf("SV[A]PP\tset APPLICATION (grow), try to expand into padding which is too small\n"); - if(!app->set_data(data, 32, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!iterator.set_block(app, true)) - return die_ss_("iterator.set_block(app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]PP\tset APPLICATION (grow), try to expand into padding which is 'close' but still too small\n"); - if(!app->set_data(data, 60, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!iterator.set_block(app, true)) - return die_ss_("iterator.set_block(app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]PP\tset APPLICATION (grow), expand into padding which will leave 0-length pad\n"); - if(!app->set_data(data, 87, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - dynamic_cast<FLAC::Metadata::Padding *>(our_metadata_.blocks[our_current_position+1])->set_length(0); - if(!iterator.set_block(app, true)) - return die_ss_("iterator.set_block(app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]PP\tset APPLICATION (grow), expand into padding which is exactly consumed\n"); - if(!app->set_data(data, 91, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - delete_from_our_metadata_(our_current_position+1); - if(!iterator.set_block(app, true)) - return die_ss_("iterator.set_block(app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]P\tset APPLICATION (grow), expand into padding which is exactly consumed\n"); - if(!app->set_data(data, 100, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - delete_from_our_metadata_(our_current_position+1); - our_metadata_.blocks[our_current_position]->set_is_last(true); - if(!iterator.set_block(app, true)) - return die_ss_("iterator.set_block(app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]\tset PADDING (equal size)\n"); - padding->set_length(app->get_length()); - if(!replace_in_our_metadata_(padding, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!iterator.set_block(padding, true)) - return die_ss_("iterator.set_block(padding, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SV[P]\tinsert PADDING after\n"); - if(!iterator.insert_block_after(padding, false)) - return die_ss_("iterator.insert_block_after(padding, false)", iterator); - if(!insert_to_our_metadata_(padding, ++our_current_position, /*copy=*/true)) - return false; - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SVP[P]\tinsert PADDING after\n"); - padding->set_length(5); - if(!iterator.insert_block_after(padding, false)) - return die_ss_("iterator.insert_block_after(padding, false)", iterator); - if(!insert_to_our_metadata_(padding, ++our_current_position, /*copy=*/true)) - return false; - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SVPP[P]\tprev\n"); - if(!iterator.prev()) - return die_("iterator ended early\n"); - our_current_position--; - - printf("SVP[P]P\tprev\n"); - if(!iterator.prev()) - return die_("iterator ended early\n"); - our_current_position--; - - printf("SV[P]PP\tprev\n"); - if(!iterator.prev()) - return die_("iterator ended early\n"); - our_current_position--; - - printf("S[V]PPP\tinsert APPLICATION after, try to expand into padding which is too small\n"); - if(!app->set_data(data, 101, true)) - return die_("setting APPLICATION data"); - if(!insert_to_our_metadata_(app, ++our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!iterator.insert_block_after(app, true)) - return die_ss_("iterator.insert_block_after(app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]PPP\tdelete (middle block), don't replace with padding\n"); - if(!iterator.delete_block(false)) - return die_ss_("iterator.delete_block(false)", iterator); - delete_from_our_metadata_(our_current_position--); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("S[V]PPP\tinsert APPLICATION after, try to expand into padding which is 'close' but still too small\n"); - if(!app->set_data(data, 97, true)) - return die_("setting APPLICATION data"); - if(!insert_to_our_metadata_(app, ++our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!iterator.insert_block_after(app, true)) - return die_ss_("iterator.insert_block_after(app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]PPP\tdelete (middle block), don't replace with padding\n"); - if(!iterator.delete_block(false)) - return die_ss_("iterator.delete_block(false)", iterator); - delete_from_our_metadata_(our_current_position--); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("S[V]PPP\tinsert APPLICATION after, expand into padding which is exactly consumed\n"); - if(!app->set_data(data, 100, true)) - return die_("setting APPLICATION data"); - if(!insert_to_our_metadata_(app, ++our_current_position, /*copy=*/true)) - return die_("copying object"); - delete_from_our_metadata_(our_current_position+1); - if(!iterator.insert_block_after(app, true)) - return die_ss_("iterator.insert_block_after(app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]PP\tdelete (middle block), don't replace with padding\n"); - if(!iterator.delete_block(false)) - return die_ss_("iterator.delete_block(false)", iterator); - delete_from_our_metadata_(our_current_position--); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("S[V]PP\tinsert APPLICATION after, expand into padding which will leave 0-length pad\n"); - if(!app->set_data(data, 96, true)) - return die_("setting APPLICATION data"); - if(!insert_to_our_metadata_(app, ++our_current_position, /*copy=*/true)) - return die_("copying object"); - dynamic_cast<FLAC::Metadata::Padding *>(our_metadata_.blocks[our_current_position+1])->set_length(0); - if(!iterator.insert_block_after(app, true)) - return die_ss_("iterator.insert_block_after(app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]PP\tdelete (middle block), don't replace with padding\n"); - if(!iterator.delete_block(false)) - return die_ss_("iterator.delete_block(false)", iterator); - delete_from_our_metadata_(our_current_position--); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("S[V]PP\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[P]P\tdelete (middle block), don't replace with padding\n"); - if(!iterator.delete_block(false)) - return die_ss_("iterator.delete_block(false)", iterator); - delete_from_our_metadata_(our_current_position--); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - - printf("S[V]P\tinsert APPLICATION after, expand into padding which is exactly consumed\n"); - if(!app->set_data(data, 1, true)) - return die_("setting APPLICATION data"); - if(!insert_to_our_metadata_(app, ++our_current_position, /*copy=*/true)) - return die_("copying object"); - delete_from_our_metadata_(our_current_position+1); - if(!iterator.insert_block_after(app, true)) - return die_ss_("iterator.insert_block_after(app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, /*ignore_metadata=*/false)) - return false; - } - - delete app; - delete padding; - - if(!remove_file_(flacfilename(/*is_ogg=*/false))) - return false; - - return true; -} - -static bool test_level_2_(bool filename_based, bool is_ogg) -{ - FLAC::Metadata::Prototype *block; - FLAC::Metadata::StreamInfo *streaminfo; - FLAC::Metadata::Application *app; - FLAC::Metadata::Padding *padding; - FLAC__byte data[2000]; - unsigned our_current_position; - - // initialize 'data' to avoid Valgrind errors - memset(data, 0, sizeof(data)); - - printf("\n\n++++++ testing level 2 interface (%s-based, %s FLAC)\n", filename_based? "filename":"callback", is_ogg? "Ogg":"native"); - - printf("generate read-only file\n"); - - if(!generate_file_(/*include_extras=*/false, is_ogg)) - return false; - - if(!change_stats_(flacfilename(is_ogg), /*read_only=*/true)) - return false; - - printf("create chain\n"); - FLAC::Metadata::Chain chain; - if(!chain.is_valid()) - return die_("allocating memory for chain"); - - printf("read chain\n"); - - if(!read_chain_(chain, flacfilename(is_ogg), filename_based, is_ogg)) - return die_c_("reading chain", chain.status()); - - printf("[S]VP\ttest initial metadata\n"); - - if(!compare_chain_(chain, 0, 0)) - return false; - if(!test_file_(is_ogg, /*ignore_metadata=*/false)) - return false; - - if(is_ogg) - goto end; - - printf("switch file to read-write\n"); - - if(!change_stats_(flacfilename(is_ogg), /*read-only=*/false)) - return false; - - printf("create iterator\n"); - { - FLAC::Metadata::Iterator iterator; - if(!iterator.is_valid()) - return die_("allocating memory for iterator"); - - our_current_position = 0; - - iterator.init(chain); - - if(0 == (block = iterator.get_block())) - return die_("getting block from iterator"); - - FLAC__ASSERT(block->get_type() == FLAC__METADATA_TYPE_STREAMINFO); - - printf("[S]VP\tmodify STREAMINFO, write\n"); - - streaminfo = dynamic_cast<FLAC::Metadata::StreamInfo *>(block); - FLAC__ASSERT(0 != streaminfo); - streaminfo->set_sample_rate(32000); - if(!replace_in_our_metadata_(block, our_current_position, /*copy=*/true)) - return die_("copying object"); - delete block; - - if(!write_chain_(chain, /*use_padding=*/false, /*preserve_file_stats=*/true, filename_based, flacfilename(is_ogg))) - return die_c_("during chain.write(false, true)", chain.status()); - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - if(!test_file_(is_ogg, /*ignore_metadata=*/false)) - return false; - - printf("[S]VP\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("S[V]P\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[P]\treplace PADDING with identical-size APPLICATION\n"); - if(0 == (block = iterator.get_block())) - return die_("getting block from iterator"); - if(0 == (app = new FLAC::Metadata::Application())) - return die_("new FLAC::Metadata::Application()"); - app->set_id((const unsigned char *)"duh"); - if(!app->set_data(data, block->get_length()-(FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8), true)) - return die_("setting APPLICATION data"); - delete block; - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!iterator.set_block(app)) - return die_c_("iterator.set_block(app)", chain.status()); - - if(!write_chain_(chain, /*use_padding=*/false, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during chain.write(false, false)", chain.status()); - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - if(!test_file_(is_ogg, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]\tshrink APPLICATION, don't use padding\n"); - if(0 == (app = dynamic_cast<FLAC::Metadata::Application *>(FLAC::Metadata::clone(our_metadata_.blocks[our_current_position])))) - return die_("copying object"); - if(!app->set_data(data, 26, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!iterator.set_block(app)) - return die_c_("iterator.set_block(app)", chain.status()); - - if(!write_chain_(chain, /*use_padding=*/false, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during chain.write(false, false)", chain.status()); - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - if(!test_file_(is_ogg, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]\tgrow APPLICATION, don't use padding\n"); - if(0 == (app = dynamic_cast<FLAC::Metadata::Application *>(FLAC::Metadata::clone(our_metadata_.blocks[our_current_position])))) - return die_("copying object"); - if(!app->set_data(data, 28, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!iterator.set_block(app)) - return die_c_("iterator.set_block(app)", chain.status()); - - if(!write_chain_(chain, /*use_padding=*/false, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during chain.write(false, false)", chain.status()); - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - if(!test_file_(is_ogg, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]\tgrow APPLICATION, use padding, but last block is not padding\n"); - if(0 == (app = dynamic_cast<FLAC::Metadata::Application *>(FLAC::Metadata::clone(our_metadata_.blocks[our_current_position])))) - return die_("copying object"); - if(!app->set_data(data, 36, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!iterator.set_block(app)) - return die_c_("iterator.set_block(app)", chain.status()); - - if(!write_chain_(chain, /*use_padding=*/false, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during chain.write(false, false)", chain.status()); - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - if(!test_file_(is_ogg, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]\tshrink APPLICATION, use padding, last block is not padding, but delta is too small for new PADDING block\n"); - if(0 == (app = dynamic_cast<FLAC::Metadata::Application *>(FLAC::Metadata::clone(our_metadata_.blocks[our_current_position])))) - return die_("copying object"); - if(!app->set_data(data, 33, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!iterator.set_block(app)) - return die_c_("iterator.set_block(app)", chain.status()); - - if(!write_chain_(chain, /*use_padding=*/true, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during chain.write(true, false)", chain.status()); - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - if(!test_file_(is_ogg, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]\tshrink APPLICATION, use padding, last block is not padding, delta is enough for new PADDING block\n"); - if(0 == (padding = new FLAC::Metadata::Padding())) - return die_("creating PADDING block"); - if(0 == (app = dynamic_cast<FLAC::Metadata::Application *>(FLAC::Metadata::clone(our_metadata_.blocks[our_current_position])))) - return die_("copying object"); - if(!app->set_data(data, 29, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - padding->set_length(0); - if(!insert_to_our_metadata_(padding, our_current_position+1, /*copy=*/false)) - return die_("internal error"); - if(!iterator.set_block(app)) - return die_c_("iterator.set_block(app)", chain.status()); - - if(!write_chain_(chain, /*use_padding=*/true, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during chain.write(true, false)", chain.status()); - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - if(!test_file_(is_ogg, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]P\tshrink APPLICATION, use padding, last block is padding\n"); - if(0 == (app = dynamic_cast<FLAC::Metadata::Application *>(FLAC::Metadata::clone(our_metadata_.blocks[our_current_position])))) - return die_("copying object"); - if(!app->set_data(data, 16, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - dynamic_cast<FLAC::Metadata::Padding *>(our_metadata_.blocks[our_current_position+1])->set_length(13); - if(!iterator.set_block(app)) - return die_c_("iterator.set_block(app)", chain.status()); - - if(!write_chain_(chain, /*use_padding=*/true, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during chain.write(true, false)", chain.status()); - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - if(!test_file_(is_ogg, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]P\tgrow APPLICATION, use padding, last block is padding, but delta is too small\n"); - if(0 == (app = dynamic_cast<FLAC::Metadata::Application *>(FLAC::Metadata::clone(our_metadata_.blocks[our_current_position])))) - return die_("copying object"); - if(!app->set_data(data, 50, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!iterator.set_block(app)) - return die_c_("iterator.set_block(app)", chain.status()); - - if(!write_chain_(chain, /*use_padding=*/true, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during chain.write(true, false)", chain.status()); - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - if(!test_file_(is_ogg, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]P\tgrow APPLICATION, use padding, last block is padding of exceeding size\n"); - if(0 == (app = dynamic_cast<FLAC::Metadata::Application *>(FLAC::Metadata::clone(our_metadata_.blocks[our_current_position])))) - return die_("copying object"); - if(!app->set_data(data, 56, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - add_to_padding_length_(our_current_position+1, -(56 - 50)); - if(!iterator.set_block(app)) - return die_c_("iterator.set_block(app)", chain.status()); - - if(!write_chain_(chain, /*use_padding=*/true, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during chain.write(true, false)", chain.status()); - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - if(!test_file_(is_ogg, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]P\tgrow APPLICATION, use padding, last block is padding of exact size\n"); - if(0 == (app = dynamic_cast<FLAC::Metadata::Application *>(FLAC::Metadata::clone(our_metadata_.blocks[our_current_position])))) - return die_("copying object"); - if(!app->set_data(data, 67, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - delete_from_our_metadata_(our_current_position+1); - if(!iterator.set_block(app)) - return die_c_("iterator.set_block(app)", chain.status()); - - if(!write_chain_(chain, /*use_padding=*/true, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during chain.write(true, false)", chain.status()); - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - if(!test_file_(is_ogg, /*ignore_metadata=*/false)) - return false; - - printf("SV[A]\tprev\n"); - if(!iterator.prev()) - return die_("iterator ended early\n"); - our_current_position--; - - printf("S[V]A\tprev\n"); - if(!iterator.prev()) - return die_("iterator ended early\n"); - our_current_position--; - - printf("[S]VA\tinsert PADDING before STREAMINFO (should fail)\n"); - if(0 == (padding = new FLAC::Metadata::Padding())) - return die_("creating PADDING block"); - padding->set_length(30); - if(!iterator.insert_block_before(padding)) - printf("\titerator.insert_block_before() returned false like it should\n"); - else - return die_("iterator.insert_block_before() should have returned false"); - - printf("[S]VA\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("S[V]A\tinsert PADDING after\n"); - if(!insert_to_our_metadata_(padding, ++our_current_position, /*copy=*/true)) - return die_("copying metadata"); - if(!iterator.insert_block_after(padding)) - return die_("iterator.insert_block_after(padding)"); - - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - - printf("SV[P]A\tinsert PADDING before\n"); - if(0 == (padding = dynamic_cast<FLAC::Metadata::Padding *>(FLAC::Metadata::clone(our_metadata_.blocks[our_current_position])))) - return die_("creating PADDING block"); - padding->set_length(17); - if(!insert_to_our_metadata_(padding, our_current_position, /*copy=*/true)) - return die_("copying metadata"); - if(!iterator.insert_block_before(padding)) - return die_("iterator.insert_block_before(padding)"); - - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - - printf("SV[P]PA\tinsert PADDING before\n"); - if(0 == (padding = dynamic_cast<FLAC::Metadata::Padding *>(FLAC::Metadata::clone(our_metadata_.blocks[our_current_position])))) - return die_("creating PADDING block"); - padding->set_length(0); - if(!insert_to_our_metadata_(padding, our_current_position, /*copy=*/true)) - return die_("copying metadata"); - if(!iterator.insert_block_before(padding)) - return die_("iterator.insert_block_before(padding)"); - - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - - printf("SV[P]PPA\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SVP[P]PA\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SVPP[P]A\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SVPPP[A]\tinsert PADDING after\n"); - if(0 == (padding = dynamic_cast<FLAC::Metadata::Padding *>(FLAC::Metadata::clone(our_metadata_.blocks[2])))) - return die_("creating PADDING block"); - padding->set_length(57); - if(!insert_to_our_metadata_(padding, ++our_current_position, /*copy=*/true)) - return die_("copying metadata"); - if(!iterator.insert_block_after(padding)) - return die_("iterator.insert_block_after(padding)"); - - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - - printf("SVPPPA[P]\tinsert PADDING before\n"); - if(0 == (padding = dynamic_cast<FLAC::Metadata::Padding *>(FLAC::Metadata::clone(our_metadata_.blocks[2])))) - return die_("creating PADDING block"); - padding->set_length(99); - if(!insert_to_our_metadata_(padding, our_current_position, /*copy=*/true)) - return die_("copying metadata"); - if(!iterator.insert_block_before(padding)) - return die_("iterator.insert_block_before(padding)"); - - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - - } - our_current_position = 0; - - printf("SVPPPAPP\tmerge padding\n"); - chain.merge_padding(); - add_to_padding_length_(2, FLAC__STREAM_METADATA_HEADER_LENGTH + our_metadata_.blocks[3]->get_length()); - add_to_padding_length_(2, FLAC__STREAM_METADATA_HEADER_LENGTH + our_metadata_.blocks[4]->get_length()); - add_to_padding_length_(6, FLAC__STREAM_METADATA_HEADER_LENGTH + our_metadata_.blocks[7]->get_length()); - delete_from_our_metadata_(7); - delete_from_our_metadata_(4); - delete_from_our_metadata_(3); - - if(!write_chain_(chain, /*use_padding=*/true, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during chain.write(true, false)", chain.status()); - if(!compare_chain_(chain, 0, 0)) - return false; - if(!test_file_(is_ogg, /*ignore_metadata=*/false)) - return false; - - printf("SVPAP\tsort padding\n"); - chain.sort_padding(); - add_to_padding_length_(4, FLAC__STREAM_METADATA_HEADER_LENGTH + our_metadata_.blocks[2]->get_length()); - delete_from_our_metadata_(2); - - if(!write_chain_(chain, /*use_padding=*/true, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during chain.write(true, false)", chain.status()); - if(!compare_chain_(chain, 0, 0)) - return false; - if(!test_file_(is_ogg, /*ignore_metadata=*/false)) - return false; - - printf("create iterator\n"); - { - FLAC::Metadata::Iterator iterator; - if(!iterator.is_valid()) - return die_("allocating memory for iterator"); - - our_current_position = 0; - - iterator.init(chain); - - printf("[S]VAP\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("S[V]AP\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[A]P\tdelete middle block, replace with padding\n"); - if(0 == (padding = new FLAC::Metadata::Padding())) - return die_("creating PADDING block"); - padding->set_length(71); - if(!replace_in_our_metadata_(padding, our_current_position--, /*copy=*/false)) - return die_("copying object"); - if(!iterator.delete_block(/*replace_with_padding=*/true)) - return die_c_("iterator.delete_block(true)", chain.status()); - - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - - printf("S[V]PP\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[P]P\tdelete middle block, don't replace with padding\n"); - delete_from_our_metadata_(our_current_position--); - if(!iterator.delete_block(/*replace_with_padding=*/false)) - return die_c_("iterator.delete_block(false)", chain.status()); - - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - - printf("S[V]P\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[P]\tdelete last block, replace with padding\n"); - if(0 == (padding = new FLAC::Metadata::Padding())) - return die_("creating PADDING block"); - padding->set_length(219); - if(!replace_in_our_metadata_(padding, our_current_position--, /*copy=*/false)) - return die_("copying object"); - if(!iterator.delete_block(/*replace_with_padding=*/true)) - return die_c_("iterator.delete_block(true)", chain.status()); - - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - - printf("S[V]P\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[P]\tdelete last block, don't replace with padding\n"); - delete_from_our_metadata_(our_current_position--); - if(!iterator.delete_block(/*replace_with_padding=*/false)) - return die_c_("iterator.delete_block(false)", chain.status()); - - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - - printf("S[V]\tprev\n"); - if(!iterator.prev()) - return die_("iterator ended early\n"); - our_current_position--; - - printf("[S]V\tdelete STREAMINFO block, should fail\n"); - if(iterator.delete_block(/*replace_with_padding=*/false)) - return die_("iterator.delete_block() on STREAMINFO should have failed but didn't"); - - block = iterator.get_block(); - if(!compare_chain_(chain, our_current_position, block)) - return false; - delete block; - - } // delete iterator - our_current_position = 0; - - printf("SV\tmerge padding\n"); - chain.merge_padding(); - - if(!write_chain_(chain, /*use_padding=*/false, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during chain.write(false, false)", chain.status()); - if(!compare_chain_(chain, 0, 0)) - return false; - if(!test_file_(is_ogg, /*ignore_metadata=*/false)) - return false; - - printf("SV\tsort padding\n"); - chain.sort_padding(); - - if(!write_chain_(chain, /*use_padding=*/false, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during chain.write(false, false)", chain.status()); - if(!compare_chain_(chain, 0, 0)) - return false; - if(!test_file_(is_ogg, /*ignore_metadata=*/false)) - return false; - -end: - if(!remove_file_(flacfilename(is_ogg))) - return false; - - return true; -} - -static bool test_level_2_misc_(bool is_ogg) -{ - ::FLAC__IOCallbacks callbacks; - - memset(&callbacks, 0, sizeof(callbacks)); - callbacks.read = (::FLAC__IOCallback_Read)fread; -#ifdef FLAC__VALGRIND_TESTING - callbacks.write = chain_write_cb_; -#else - callbacks.write = (::FLAC__IOCallback_Write)fwrite; -#endif - callbacks.seek = chain_seek_cb_; - callbacks.tell = chain_tell_cb_; - callbacks.eof = chain_eof_cb_; - - printf("\n\n++++++ testing level 2 interface (mismatched read/write protections)\n"); - - printf("generate file\n"); - - if(!generate_file_(/*include_extras=*/false, is_ogg)) - return false; - - printf("create chain\n"); - FLAC::Metadata::Chain chain; - if(!chain.is_valid()) - return die_("allocating chain"); - - printf("read chain (filename-based)\n"); - - if(!chain.read(flacfilename(is_ogg))) - return die_c_("reading chain", chain.status()); - - printf("write chain with wrong method Chain::write(with callbacks)\n"); - { - if(chain.write(/*use_padding=*/false, 0, callbacks)) - return die_c_("mismatched write should have failed", chain.status()); - if(chain.status() != ::FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH) - return die_c_("expected FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH", chain.status()); - printf(" OK: Chain::write(with callbacks) returned false,FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH like it should\n"); - } - - printf("read chain (filename-based)\n"); - - if(!chain.read(flacfilename(is_ogg))) - return die_c_("reading chain", chain.status()); - - printf("write chain with wrong method Chain::write(with callbacks and tempfile)\n"); - { - if(chain.write(/*use_padding=*/false, 0, callbacks, 0, callbacks)) - return die_c_("mismatched write should have failed", chain.status()); - if(chain.status() != ::FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH) - return die_c_("expected FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH", chain.status()); - printf(" OK: Chain::write(with callbacks and tempfile) returned false,FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH like it should\n"); - } - - printf("read chain (callback-based)\n"); - { - FILE *file = fopen(flacfilename(is_ogg), "rb"); - if(0 == file) - return die_("opening file"); - if(!chain.read((::FLAC__IOHandle)file, callbacks)) { - fclose(file); - return die_c_("reading chain", chain.status()); - } - fclose(file); - } - - printf("write chain with wrong method write()\n"); - { - if(chain.write(/*use_padding=*/false, /*preserve_file_stats=*/false)) - return die_c_("mismatched write should have failed", chain.status()); - if(chain.status() != ::FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH) - return die_c_("expected FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH", chain.status()); - printf(" OK: write() returned false,FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH like it should\n"); - } - - printf("read chain (callback-based)\n"); - { - FILE *file = fopen(flacfilename(is_ogg), "rb"); - if(0 == file) - return die_("opening file"); - if(!chain.read((::FLAC__IOHandle)file, callbacks)) { - fclose(file); - return die_c_("reading chain", chain.status()); - } - fclose(file); - } - - printf("testing Chain::check_if_tempfile_needed()... "); - - if(!chain.check_if_tempfile_needed(/*use_padding=*/false)) - printf("OK: Chain::check_if_tempfile_needed() returned false like it should\n"); - else - return die_("Chain::check_if_tempfile_needed() returned true but shouldn't have"); - - printf("write chain with wrong method Chain::write(with callbacks and tempfile)\n"); - { - if(chain.write(/*use_padding=*/false, 0, callbacks, 0, callbacks)) - return die_c_("mismatched write should have failed", chain.status()); - if(chain.status() != ::FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL) - return die_c_("expected FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL", chain.status()); - printf(" OK: Chain::write(with callbacks and tempfile) returned false,FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL like it should\n"); - } - - printf("read chain (callback-based)\n"); - { - FILE *file = fopen(flacfilename(is_ogg), "rb"); - if(0 == file) - return die_("opening file"); - if(!chain.read((::FLAC__IOHandle)file, callbacks)) { - fclose(file); - return die_c_("reading chain", chain.status()); - } - fclose(file); - } - - printf("create iterator\n"); - { - FLAC::Metadata::Iterator iterator; - if(!iterator.is_valid()) - return die_("allocating memory for iterator"); - - iterator.init(chain); - - printf("[S]VP\tnext\n"); - if(!iterator.next()) - return die_("iterator ended early\n"); - - printf("S[V]P\tdelete VORBIS_COMMENT, write\n"); - if(!iterator.delete_block(/*replace_with_padding=*/false)) - return die_c_("block delete failed\n", chain.status()); - - printf("testing Chain::check_if_tempfile_needed()... "); - - if(chain.check_if_tempfile_needed(/*use_padding=*/false)) - printf("OK: Chain::check_if_tempfile_needed() returned true like it should\n"); - else - return die_("Chain::check_if_tempfile_needed() returned false but shouldn't have"); - - printf("write chain with wrong method Chain::write(with callbacks)\n"); - { - if(chain.write(/*use_padding=*/false, 0, callbacks)) - return die_c_("mismatched write should have failed", chain.status()); - if(chain.status() != ::FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL) - return die_c_("expected FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL", chain.status()); - printf(" OK: Chain::write(with callbacks) returned false,FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL like it should\n"); - } - - } // delete iterator - - if(!remove_file_(flacfilename(is_ogg))) - return false; - - return true; -} - -bool test_metadata_file_manipulation() -{ - printf("\n+++ libFLAC++ unit test: metadata manipulation\n\n"); - - our_metadata_.num_blocks = 0; - - if(!test_level_0_()) - return false; - - if(!test_level_1_()) - return false; - - if(!test_level_2_(/*filename_based=*/true, /*is_ogg=*/false)) /* filename-based */ - return false; - if(!test_level_2_(/*filename_based=*/false, /*is_ogg=*/false)) /* callback-based */ - return false; - if(!test_level_2_misc_(/*is_ogg=*/false)) - return false; - - if(FLAC_API_SUPPORTS_OGG_FLAC) { - if(!test_level_2_(/*filename_based=*/true, /*is_ogg=*/true)) /* filename-based */ - return false; - if(!test_level_2_(/*filename_based=*/false, /*is_ogg=*/true)) /* callback-based */ - return false; -#if 0 - /* when ogg flac write is supported, will have to add this: */ - if(!test_level_2_misc_(/*is_ogg=*/true)) - return false; -#endif - } - - return true; -} diff --git a/3rdparty/libflac/src/test_libFLAC++/metadata_object.cpp b/3rdparty/libflac/src/test_libFLAC++/metadata_object.cpp deleted file mode 100644 index 9e9aec440ff..00000000000 --- a/3rdparty/libflac/src/test_libFLAC++/metadata_object.cpp +++ /dev/null @@ -1,2093 +0,0 @@ -/* test_libFLAC++ - Unit tester for libFLAC++ - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include "FLAC/assert.h" -#include "FLAC++/metadata.h" -#include <stdio.h> -#include <stdlib.h> /* for malloc() */ -#include <string.h> /* for memcmp() */ - -static ::FLAC__StreamMetadata streaminfo_, padding_, seektable_, application_, vorbiscomment_, cuesheet_, picture_; - -static bool die_(const char *msg) -{ - printf("FAILED, %s\n", msg); - return false; -} - -static void *malloc_or_die_(size_t size) -{ - void *x = malloc(size); - if(0 == x) { - fprintf(stderr, "ERROR: out of memory allocating %u bytes\n", (unsigned)size); - exit(1); - } - return x; -} - -static char *strdup_or_die_(const char *s) -{ - char *x = strdup(s); - if(0 == x) { - fprintf(stderr, "ERROR: out of memory copying string \"%s\"\n", s); - exit(1); - } - return x; -} - -static bool index_is_equal_(const ::FLAC__StreamMetadata_CueSheet_Index &index, const ::FLAC__StreamMetadata_CueSheet_Index &indexcopy) -{ - if(indexcopy.offset != index.offset) - return false; - if(indexcopy.number != index.number) - return false; - return true; -} - -static bool track_is_equal_(const ::FLAC__StreamMetadata_CueSheet_Track *track, const ::FLAC__StreamMetadata_CueSheet_Track *trackcopy) -{ - unsigned i; - - if(trackcopy->offset != track->offset) - return false; - if(trackcopy->number != track->number) - return false; - if(0 != strcmp(trackcopy->isrc, track->isrc)) - return false; - if(trackcopy->type != track->type) - return false; - if(trackcopy->pre_emphasis != track->pre_emphasis) - return false; - if(trackcopy->num_indices != track->num_indices) - return false; - if(0 == track->indices || 0 == trackcopy->indices) { - if(track->indices != trackcopy->indices) - return false; - } - else { - for(i = 0; i < track->num_indices; i++) { - if(!index_is_equal_(trackcopy->indices[i], track->indices[i])) - return false; - } - } - return true; -} - -static void init_metadata_blocks_() -{ - streaminfo_.is_last = false; - streaminfo_.type = ::FLAC__METADATA_TYPE_STREAMINFO; - streaminfo_.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH; - streaminfo_.data.stream_info.min_blocksize = 576; - streaminfo_.data.stream_info.max_blocksize = 576; - streaminfo_.data.stream_info.min_framesize = 0; - streaminfo_.data.stream_info.max_framesize = 0; - streaminfo_.data.stream_info.sample_rate = 44100; - streaminfo_.data.stream_info.channels = 1; - streaminfo_.data.stream_info.bits_per_sample = 8; - streaminfo_.data.stream_info.total_samples = 0; - memset(streaminfo_.data.stream_info.md5sum, 0, 16); - - padding_.is_last = false; - padding_.type = ::FLAC__METADATA_TYPE_PADDING; - padding_.length = 1234; - - seektable_.is_last = false; - seektable_.type = ::FLAC__METADATA_TYPE_SEEKTABLE; - seektable_.data.seek_table.num_points = 2; - seektable_.length = seektable_.data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH; - seektable_.data.seek_table.points = (::FLAC__StreamMetadata_SeekPoint*)malloc_or_die_(seektable_.data.seek_table.num_points * sizeof(::FLAC__StreamMetadata_SeekPoint)); - seektable_.data.seek_table.points[0].sample_number = 0; - seektable_.data.seek_table.points[0].stream_offset = 0; - seektable_.data.seek_table.points[0].frame_samples = streaminfo_.data.stream_info.min_blocksize; - seektable_.data.seek_table.points[1].sample_number = ::FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER; - seektable_.data.seek_table.points[1].stream_offset = 1000; - seektable_.data.seek_table.points[1].frame_samples = streaminfo_.data.stream_info.min_blocksize; - - application_.is_last = false; - application_.type = ::FLAC__METADATA_TYPE_APPLICATION; - application_.length = 8; - memcpy(application_.data.application.id, "\xfe\xdc\xba\x98", 4); - application_.data.application.data = (FLAC__byte*)malloc_or_die_(4); - memcpy(application_.data.application.data, "\xf0\xe1\xd2\xc3", 4); - - vorbiscomment_.is_last = false; - vorbiscomment_.type = ::FLAC__METADATA_TYPE_VORBIS_COMMENT; - vorbiscomment_.length = (4 + 5) + 4 + (4 + 12) + (4 + 12); - vorbiscomment_.data.vorbis_comment.vendor_string.length = 5; - vorbiscomment_.data.vorbis_comment.vendor_string.entry = (FLAC__byte*)malloc_or_die_(5+1); - memcpy(vorbiscomment_.data.vorbis_comment.vendor_string.entry, "name0", 5+1); - vorbiscomment_.data.vorbis_comment.num_comments = 2; - vorbiscomment_.data.vorbis_comment.comments = (::FLAC__StreamMetadata_VorbisComment_Entry*)malloc_or_die_(vorbiscomment_.data.vorbis_comment.num_comments * sizeof(::FLAC__StreamMetadata_VorbisComment_Entry)); - vorbiscomment_.data.vorbis_comment.comments[0].length = 12; - vorbiscomment_.data.vorbis_comment.comments[0].entry = (FLAC__byte*)malloc_or_die_(12+1); - memcpy(vorbiscomment_.data.vorbis_comment.comments[0].entry, "name2=value2", 12+1); - vorbiscomment_.data.vorbis_comment.comments[1].length = 12; - vorbiscomment_.data.vorbis_comment.comments[1].entry = (FLAC__byte*)malloc_or_die_(12+1); - memcpy(vorbiscomment_.data.vorbis_comment.comments[1].entry, "name3=value3", 12+1); - - cuesheet_.is_last = false; - cuesheet_.type = ::FLAC__METADATA_TYPE_CUESHEET; - cuesheet_.length = - /* cuesheet guts */ - ( - FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN + - FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN + - FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN + - FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN + - FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN - ) / 8 + - /* 2 tracks */ - 2 * ( - FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN - ) / 8 + - /* 3 index points */ - 3 * ( - FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN + - FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN + - FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN - ) / 8 - ; - memset(cuesheet_.data.cue_sheet.media_catalog_number, 0, sizeof(cuesheet_.data.cue_sheet.media_catalog_number)); - cuesheet_.data.cue_sheet.media_catalog_number[0] = 'j'; - cuesheet_.data.cue_sheet.media_catalog_number[1] = 'C'; - cuesheet_.data.cue_sheet.lead_in = 159; - cuesheet_.data.cue_sheet.is_cd = true; - cuesheet_.data.cue_sheet.num_tracks = 2; - cuesheet_.data.cue_sheet.tracks = (FLAC__StreamMetadata_CueSheet_Track*)malloc_or_die_(cuesheet_.data.cue_sheet.num_tracks * sizeof(FLAC__StreamMetadata_CueSheet_Track)); - cuesheet_.data.cue_sheet.tracks[0].offset = 1; - cuesheet_.data.cue_sheet.tracks[0].number = 1; - memcpy(cuesheet_.data.cue_sheet.tracks[0].isrc, "ACBDE1234567", sizeof(cuesheet_.data.cue_sheet.tracks[0].isrc)); - cuesheet_.data.cue_sheet.tracks[0].type = 0; - cuesheet_.data.cue_sheet.tracks[0].pre_emphasis = 1; - cuesheet_.data.cue_sheet.tracks[0].num_indices = 2; - cuesheet_.data.cue_sheet.tracks[0].indices = (FLAC__StreamMetadata_CueSheet_Index*)malloc_or_die_(cuesheet_.data.cue_sheet.tracks[0].num_indices * sizeof(FLAC__StreamMetadata_CueSheet_Index)); - cuesheet_.data.cue_sheet.tracks[0].indices[0].offset = 0; - cuesheet_.data.cue_sheet.tracks[0].indices[0].number = 0; - cuesheet_.data.cue_sheet.tracks[0].indices[1].offset = 1234567890; - cuesheet_.data.cue_sheet.tracks[0].indices[1].number = 1; - cuesheet_.data.cue_sheet.tracks[1].offset = 2345678901u; - cuesheet_.data.cue_sheet.tracks[1].number = 2; - memcpy(cuesheet_.data.cue_sheet.tracks[1].isrc, "ACBDE7654321", sizeof(cuesheet_.data.cue_sheet.tracks[1].isrc)); - cuesheet_.data.cue_sheet.tracks[1].type = 1; - cuesheet_.data.cue_sheet.tracks[1].pre_emphasis = 0; - cuesheet_.data.cue_sheet.tracks[1].num_indices = 1; - cuesheet_.data.cue_sheet.tracks[1].indices = (FLAC__StreamMetadata_CueSheet_Index*)malloc_or_die_(cuesheet_.data.cue_sheet.tracks[1].num_indices * sizeof(FLAC__StreamMetadata_CueSheet_Index)); - cuesheet_.data.cue_sheet.tracks[1].indices[0].offset = 0; - cuesheet_.data.cue_sheet.tracks[1].indices[0].number = 1; - - picture_.is_last = true; - picture_.type = FLAC__METADATA_TYPE_PICTURE; - picture_.length = - ( - FLAC__STREAM_METADATA_PICTURE_TYPE_LEN + - FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN + /* will add the length for the string later */ - FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN + /* will add the length for the string later */ - FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN + - FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN + - FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN + - FLAC__STREAM_METADATA_PICTURE_COLORS_LEN + - FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN /* will add the length for the data later */ - ) / 8 - ; - picture_.data.picture.type = FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER; - picture_.data.picture.mime_type = strdup_or_die_("image/jpeg"); - picture_.length += strlen(picture_.data.picture.mime_type); - picture_.data.picture.description = (FLAC__byte*)strdup_or_die_("desc"); - picture_.length += strlen((const char *)picture_.data.picture.description); - picture_.data.picture.width = 300; - picture_.data.picture.height = 300; - picture_.data.picture.depth = 24; - picture_.data.picture.colors = 0; - picture_.data.picture.data = (FLAC__byte*)strdup_or_die_("SOMEJPEGDATA"); - picture_.data.picture.data_length = strlen((const char *)picture_.data.picture.data); - picture_.length += picture_.data.picture.data_length; -} - -static void free_metadata_blocks_() -{ - free(seektable_.data.seek_table.points); - free(application_.data.application.data); - free(vorbiscomment_.data.vorbis_comment.vendor_string.entry); - free(vorbiscomment_.data.vorbis_comment.comments[0].entry); - free(vorbiscomment_.data.vorbis_comment.comments[1].entry); - free(vorbiscomment_.data.vorbis_comment.comments); - free(cuesheet_.data.cue_sheet.tracks[0].indices); - free(cuesheet_.data.cue_sheet.tracks[1].indices); - free(cuesheet_.data.cue_sheet.tracks); - free(picture_.data.picture.mime_type); - free(picture_.data.picture.description); - free(picture_.data.picture.data); -} - -bool test_metadata_object_streaminfo() -{ - unsigned expected_length; - - printf("testing class FLAC::Metadata::StreamInfo\n"); - - printf("testing StreamInfo::StreamInfo()... "); - FLAC::Metadata::StreamInfo block; - if(!block.is_valid()) - return die_("!block.is_valid()"); - expected_length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH; - if(block.get_length() != expected_length) { - printf("FAILED, bad length, expected %u, got %u\n", expected_length, block.get_length()); - return false; - } - printf("OK\n"); - - printf("testing StreamInfo::StreamInfo(const StreamInfo &)... +\n"); - printf(" StreamInfo::operator!=(const StreamInfo &)... "); - { - FLAC::Metadata::StreamInfo blockcopy(block); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != block) - return die_("copy is not identical to original"); - printf("OK\n"); - - printf("testing StreamInfo::~StreamInfo()... "); - } - printf("OK\n"); - - printf("testing StreamInfo::StreamInfo(const ::FLAC__StreamMetadata &)... +\n"); - printf(" StreamInfo::operator!=(const ::FLAC__StreamMetadata &)... "); - { - FLAC::Metadata::StreamInfo blockcopy(streaminfo_); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != streaminfo_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing StreamInfo::StreamInfo(const ::FLAC__StreamMetadata *)... +\n"); - printf(" StreamInfo::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::StreamInfo blockcopy(&streaminfo_); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != streaminfo_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing StreamInfo::StreamInfo(const ::FLAC__StreamMetadata *, copy=true)... +\n"); - printf(" StreamInfo::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::StreamInfo blockcopy(&streaminfo_, /*copy=*/true); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != streaminfo_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing StreamInfo::StreamInfo(const ::FLAC__StreamMetadata *, copy=false)... +\n"); - printf(" StreamInfo::operator!=(const ::FLAC__StreamMetadata *)... "); - { - ::FLAC__StreamMetadata *copy = ::FLAC__metadata_object_clone(&streaminfo_); - FLAC::Metadata::StreamInfo blockcopy(copy, /*copy=*/false); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != streaminfo_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing StreamInfo::assign(const ::FLAC__StreamMetadata *, copy=true)... +\n"); - printf(" StreamInfo::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::StreamInfo blockcopy; - blockcopy.assign(&streaminfo_, /*copy=*/true); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != streaminfo_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing StreamInfo::assign(const ::FLAC__StreamMetadata *, copy=false)... +\n"); - printf(" StreamInfo::operator!=(const ::FLAC__StreamMetadata *)... "); - { - ::FLAC__StreamMetadata *copy = ::FLAC__metadata_object_clone(&streaminfo_); - FLAC::Metadata::StreamInfo blockcopy; - blockcopy.assign(copy, /*copy=*/false); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != streaminfo_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing StreamInfo::operator=(const StreamInfo &)... +\n"); - printf(" StreamInfo::operator==(const StreamInfo &)... "); - { - FLAC::Metadata::StreamInfo blockcopy = block; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == block)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing StreamInfo::operator=(const ::FLAC__StreamMetadata &)... +\n"); - printf(" StreamInfo::operator==(const ::FLAC__StreamMetadata &)... "); - { - FLAC::Metadata::StreamInfo blockcopy = streaminfo_; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == streaminfo_)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing StreamInfo::operator=(const ::FLAC__StreamMetadata *)... +\n"); - printf(" StreamInfo::operator==(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::StreamInfo blockcopy = &streaminfo_; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == streaminfo_)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing StreamInfo::set_min_blocksize()... "); - block.set_min_blocksize(streaminfo_.data.stream_info.min_blocksize); - printf("OK\n"); - - printf("testing StreamInfo::set_max_blocksize()... "); - block.set_max_blocksize(streaminfo_.data.stream_info.max_blocksize); - printf("OK\n"); - - printf("testing StreamInfo::set_min_framesize()... "); - block.set_min_framesize(streaminfo_.data.stream_info.min_framesize); - printf("OK\n"); - - printf("testing StreamInfo::set_max_framesize()... "); - block.set_max_framesize(streaminfo_.data.stream_info.max_framesize); - printf("OK\n"); - - printf("testing StreamInfo::set_sample_rate()... "); - block.set_sample_rate(streaminfo_.data.stream_info.sample_rate); - printf("OK\n"); - - printf("testing StreamInfo::set_channels()... "); - block.set_channels(streaminfo_.data.stream_info.channels); - printf("OK\n"); - - printf("testing StreamInfo::set_bits_per_sample()... "); - block.set_bits_per_sample(streaminfo_.data.stream_info.bits_per_sample); - printf("OK\n"); - - printf("testing StreamInfo::set_total_samples()... "); - block.set_total_samples(streaminfo_.data.stream_info.total_samples); - printf("OK\n"); - - printf("testing StreamInfo::set_md5sum()... "); - block.set_md5sum(streaminfo_.data.stream_info.md5sum); - printf("OK\n"); - - printf("testing StreamInfo::get_min_blocksize()... "); - if(block.get_min_blocksize() != streaminfo_.data.stream_info.min_blocksize) - return die_("value mismatch, doesn't match previously set value"); - printf("OK\n"); - - printf("testing StreamInfo::get_max_blocksize()... "); - if(block.get_max_blocksize() != streaminfo_.data.stream_info.max_blocksize) - return die_("value mismatch, doesn't match previously set value"); - printf("OK\n"); - - printf("testing StreamInfo::get_min_framesize()... "); - if(block.get_min_framesize() != streaminfo_.data.stream_info.min_framesize) - return die_("value mismatch, doesn't match previously set value"); - printf("OK\n"); - - printf("testing StreamInfo::get_max_framesize()... "); - if(block.get_max_framesize() != streaminfo_.data.stream_info.max_framesize) - return die_("value mismatch, doesn't match previously set value"); - printf("OK\n"); - - printf("testing StreamInfo::get_sample_rate()... "); - if(block.get_sample_rate() != streaminfo_.data.stream_info.sample_rate) - return die_("value mismatch, doesn't match previously set value"); - printf("OK\n"); - - printf("testing StreamInfo::get_channels()... "); - if(block.get_channels() != streaminfo_.data.stream_info.channels) - return die_("value mismatch, doesn't match previously set value"); - printf("OK\n"); - - printf("testing StreamInfo::get_bits_per_sample()... "); - if(block.get_bits_per_sample() != streaminfo_.data.stream_info.bits_per_sample) - return die_("value mismatch, doesn't match previously set value"); - printf("OK\n"); - - printf("testing StreamInfo::get_total_samples()... "); - if(block.get_total_samples() != streaminfo_.data.stream_info.total_samples) - return die_("value mismatch, doesn't match previously set value"); - printf("OK\n"); - - printf("testing StreamInfo::get_md5sum()... "); - if(0 != memcmp(block.get_md5sum(), streaminfo_.data.stream_info.md5sum, 16)) - return die_("value mismatch, doesn't match previously set value"); - printf("OK\n"); - - printf("testing FLAC::Metadata::clone(const FLAC::Metadata::Prototype *)... "); - FLAC::Metadata::Prototype *clone_ = FLAC::Metadata::clone(&block); - if(0 == clone_) - return die_("returned NULL"); - if(0 == dynamic_cast<FLAC::Metadata::StreamInfo *>(clone_)) - return die_("downcast is NULL"); - if(*dynamic_cast<FLAC::Metadata::StreamInfo *>(clone_) != block) - return die_("clone is not identical"); - printf("OK\n"); - printf("testing StreamInfo::~StreamInfo()... "); - delete clone_; - printf("OK\n"); - - - printf("PASSED\n\n"); - return true; -} - -bool test_metadata_object_padding() -{ - unsigned expected_length; - - printf("testing class FLAC::Metadata::Padding\n"); - - printf("testing Padding::Padding()... "); - FLAC::Metadata::Padding block; - if(!block.is_valid()) - return die_("!block.is_valid()"); - expected_length = 0; - if(block.get_length() != expected_length) { - printf("FAILED, bad length, expected %u, got %u\n", expected_length, block.get_length()); - return false; - } - printf("OK\n"); - - printf("testing Padding::Padding(const Padding &)... +\n"); - printf(" Padding::operator!=(const Padding &)... "); - { - FLAC::Metadata::Padding blockcopy(block); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != block) - return die_("copy is not identical to original"); - printf("OK\n"); - - printf("testing Padding::~Padding()... "); - } - printf("OK\n"); - - printf("testing Padding::Padding(const ::FLAC__StreamMetadata &)... +\n"); - printf(" Padding::operator!=(const ::FLAC__StreamMetadata &)... "); - { - FLAC::Metadata::Padding blockcopy(padding_); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != padding_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Padding::Padding(const ::FLAC__StreamMetadata *)... +\n"); - printf(" Padding::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::Padding blockcopy(&padding_); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != padding_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Padding::Padding(const ::FLAC__StreamMetadata *, copy=true)... +\n"); - printf(" Padding::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::Padding blockcopy(&padding_, /*copy=*/true); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != padding_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Padding::Padding(const ::FLAC__StreamMetadata *, copy=false)... +\n"); - printf(" Padding::operator!=(const ::FLAC__StreamMetadata *)... "); - { - ::FLAC__StreamMetadata *copy = ::FLAC__metadata_object_clone(&padding_); - FLAC::Metadata::Padding blockcopy(copy, /*copy=*/false); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != padding_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Padding::assign(const ::FLAC__StreamMetadata *, copy=true)... +\n"); - printf(" Padding::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::Padding blockcopy; - blockcopy.assign(&padding_, /*copy=*/true); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != padding_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Padding::assign(const ::FLAC__StreamMetadata *, copy=false)... +\n"); - printf(" Padding::operator!=(const ::FLAC__StreamMetadata *)... "); - { - ::FLAC__StreamMetadata *copy = ::FLAC__metadata_object_clone(&padding_); - FLAC::Metadata::Padding blockcopy; - blockcopy.assign(copy, /*copy=*/false); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != padding_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Padding::operator=(const Padding &)... +\n"); - printf(" Padding::operator==(const Padding &)... "); - { - FLAC::Metadata::Padding blockcopy = block; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == block)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Padding::operator=(const ::FLAC__StreamMetadata &)... +\n"); - printf(" Padding::operator==(const ::FLAC__StreamMetadata &)... "); - { - FLAC::Metadata::Padding blockcopy = padding_; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == padding_)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Padding::operator=(const ::FLAC__StreamMetadata *)... +\n"); - printf(" Padding::operator==(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::Padding blockcopy = &padding_; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == padding_)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Padding::set_length()... "); - block.set_length(padding_.length); - printf("OK\n"); - - printf("testing Prototype::get_length()... "); - if(block.get_length() != padding_.length) - return die_("value mismatch, doesn't match previously set value"); - printf("OK\n"); - - printf("testing FLAC::Metadata::clone(const FLAC::Metadata::Prototype *)... "); - FLAC::Metadata::Prototype *clone_ = FLAC::Metadata::clone(&block); - if(0 == clone_) - return die_("returned NULL"); - if(0 == dynamic_cast<FLAC::Metadata::Padding *>(clone_)) - return die_("downcast is NULL"); - if(*dynamic_cast<FLAC::Metadata::Padding *>(clone_) != block) - return die_("clone is not identical"); - printf("OK\n"); - printf("testing Padding::~Padding()... "); - delete clone_; - printf("OK\n"); - - - printf("PASSED\n\n"); - return true; -} - -bool test_metadata_object_application() -{ - unsigned expected_length; - - printf("testing class FLAC::Metadata::Application\n"); - - printf("testing Application::Application()... "); - FLAC::Metadata::Application block; - if(!block.is_valid()) - return die_("!block.is_valid()"); - expected_length = FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8; - if(block.get_length() != expected_length) { - printf("FAILED, bad length, expected %u, got %u\n", expected_length, block.get_length()); - return false; - } - printf("OK\n"); - - printf("testing Application::Application(const Application &)... +\n"); - printf(" Application::operator!=(const Application &)... "); - { - FLAC::Metadata::Application blockcopy(block); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != block) - return die_("copy is not identical to original"); - printf("OK\n"); - - printf("testing Application::~Application()... "); - } - printf("OK\n"); - - printf("testing Application::Application(const ::FLAC__StreamMetadata &)... +\n"); - printf(" Application::operator!=(const ::FLAC__StreamMetadata &)... "); - { - FLAC::Metadata::Application blockcopy(application_); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != application_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Application::Application(const ::FLAC__StreamMetadata *)... +\n"); - printf(" Application::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::Application blockcopy(&application_); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != application_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Application::Application(const ::FLAC__StreamMetadata *, copy=true)... +\n"); - printf(" Application::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::Application blockcopy(&application_, /*copy=*/true); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != application_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Application::Application(const ::FLAC__StreamMetadata *, copy=false)... +\n"); - printf(" Application::operator!=(const ::FLAC__StreamMetadata *)... "); - { - ::FLAC__StreamMetadata *copy = ::FLAC__metadata_object_clone(&application_); - FLAC::Metadata::Application blockcopy(copy, /*copy=*/false); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != application_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Application::assign(const ::FLAC__StreamMetadata *, copy=true)... +\n"); - printf(" Application::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::Application blockcopy; - blockcopy.assign(&application_, /*copy=*/true); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != application_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Application::assign(const ::FLAC__StreamMetadata *, copy=false)... +\n"); - printf(" Application::operator!=(const ::FLAC__StreamMetadata *)... "); - { - ::FLAC__StreamMetadata *copy = ::FLAC__metadata_object_clone(&application_); - FLAC::Metadata::Application blockcopy; - blockcopy.assign(copy, /*copy=*/false); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != application_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Application::operator=(const Application &)... +\n"); - printf(" Application::operator==(const Application &)... "); - { - FLAC::Metadata::Application blockcopy = block; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == block)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Application::operator=(const ::FLAC__StreamMetadata &)... +\n"); - printf(" Application::operator==(const ::FLAC__StreamMetadata &)... "); - { - FLAC::Metadata::Application blockcopy = application_; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == application_)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Application::operator=(const ::FLAC__StreamMetadata *)... +\n"); - printf(" Application::operator==(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::Application blockcopy = &application_; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == application_)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Application::set_id()... "); - block.set_id(application_.data.application.id); - printf("OK\n"); - - printf("testing Application::set_data()... "); - block.set_data(application_.data.application.data, application_.length - sizeof(application_.data.application.id), /*copy=*/true); - printf("OK\n"); - - printf("testing Application::get_id()... "); - if(0 != memcmp(block.get_id(), application_.data.application.id, sizeof(application_.data.application.id))) - return die_("value mismatch, doesn't match previously set value"); - printf("OK\n"); - - printf("testing Application::get_data()... "); - if(0 != memcmp(block.get_data(), application_.data.application.data, application_.length - sizeof(application_.data.application.id))) - return die_("value mismatch, doesn't match previously set value"); - printf("OK\n"); - - printf("testing FLAC::Metadata::clone(const FLAC::Metadata::Prototype *)... "); - FLAC::Metadata::Prototype *clone_ = FLAC::Metadata::clone(&block); - if(0 == clone_) - return die_("returned NULL"); - if(0 == dynamic_cast<FLAC::Metadata::Application *>(clone_)) - return die_("downcast is NULL"); - if(*dynamic_cast<FLAC::Metadata::Application *>(clone_) != block) - return die_("clone is not identical"); - printf("OK\n"); - printf("testing Application::~Application()... "); - delete clone_; - printf("OK\n"); - - - printf("PASSED\n\n"); - return true; -} - -bool test_metadata_object_seektable() -{ - unsigned expected_length; - - printf("testing class FLAC::Metadata::SeekTable\n"); - - printf("testing SeekTable::SeekTable()... "); - FLAC::Metadata::SeekTable block; - if(!block.is_valid()) - return die_("!block.is_valid()"); - expected_length = 0; - if(block.get_length() != expected_length) { - printf("FAILED, bad length, expected %u, got %u\n", expected_length, block.get_length()); - return false; - } - printf("OK\n"); - - printf("testing SeekTable::SeekTable(const SeekTable &)... +\n"); - printf(" SeekTable::operator!=(const SeekTable &)... "); - { - FLAC::Metadata::SeekTable blockcopy(block); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != block) - return die_("copy is not identical to original"); - printf("OK\n"); - - printf("testing SeekTable::~SeekTable()... "); - } - printf("OK\n"); - - printf("testing SeekTable::SeekTable(const ::FLAC__StreamMetadata &)... +\n"); - printf(" SeekTable::operator!=(const ::FLAC__StreamMetadata &)... "); - { - FLAC::Metadata::SeekTable blockcopy(seektable_); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != seektable_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing SeekTable::SeekTable(const ::FLAC__StreamMetadata *)... +\n"); - printf(" SeekTable::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::SeekTable blockcopy(&seektable_); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != seektable_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing SeekTable::SeekTable(const ::FLAC__StreamMetadata *, copy=true)... +\n"); - printf(" SeekTable::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::SeekTable blockcopy(&seektable_, /*copy=*/true); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != seektable_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing SeekTable::SeekTable(const ::FLAC__StreamMetadata *, copy=false)... +\n"); - printf(" SeekTable::operator!=(const ::FLAC__StreamMetadata *)... "); - { - ::FLAC__StreamMetadata *copy = ::FLAC__metadata_object_clone(&seektable_); - FLAC::Metadata::SeekTable blockcopy(copy, /*copy=*/false); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != seektable_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing SeekTable::assign(const ::FLAC__StreamMetadata *, copy=true)... +\n"); - printf(" SeekTable::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::SeekTable blockcopy; - blockcopy.assign(&seektable_, /*copy=*/true); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != seektable_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing SeekTable::assign(const ::FLAC__StreamMetadata *, copy=false)... +\n"); - printf(" SeekTable::operator!=(const ::FLAC__StreamMetadata *)... "); - { - ::FLAC__StreamMetadata *copy = ::FLAC__metadata_object_clone(&seektable_); - FLAC::Metadata::SeekTable blockcopy; - blockcopy.assign(copy, /*copy=*/false); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != seektable_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing SeekTable::operator=(const SeekTable &)... +\n"); - printf(" SeekTable::operator==(const SeekTable &)... "); - { - FLAC::Metadata::SeekTable blockcopy = block; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == block)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing SeekTable::operator=(const ::FLAC__StreamMetadata &)... +\n"); - printf(" SeekTable::operator==(const ::FLAC__StreamMetadata &)... "); - { - FLAC::Metadata::SeekTable blockcopy = seektable_; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == seektable_)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing SeekTable::operator=(const ::FLAC__StreamMetadata *)... +\n"); - printf(" SeekTable::operator==(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::SeekTable blockcopy = &seektable_; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == seektable_)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing SeekTable::insert_point() x 3... "); - if(!block.insert_point(0, seektable_.data.seek_table.points[1])) - return die_("returned false"); - if(!block.insert_point(0, seektable_.data.seek_table.points[1])) - return die_("returned false"); - if(!block.insert_point(1, seektable_.data.seek_table.points[0])) - return die_("returned false"); - printf("OK\n"); - - printf("testing SeekTable::is_legal()... "); - if(block.is_legal()) - return die_("returned true"); - printf("OK\n"); - - printf("testing SeekTable::set_point()... "); - block.set_point(0, seektable_.data.seek_table.points[0]); - printf("OK\n"); - - printf("testing SeekTable::delete_point()... "); - if(!block.delete_point(0)) - return die_("returned false"); - printf("OK\n"); - - printf("testing SeekTable::is_legal()... "); - if(!block.is_legal()) - return die_("returned false"); - printf("OK\n"); - - printf("testing SeekTable::get_num_points()... "); - if(block.get_num_points() != seektable_.data.seek_table.num_points) - return die_("number mismatch"); - printf("OK\n"); - - printf("testing SeekTable::operator!=(const ::FLAC__StreamMetadata &)... "); - if(block != seektable_) - return die_("data mismatch"); - printf("OK\n"); - - printf("testing SeekTable::get_point()... "); - if( - block.get_point(1).sample_number != seektable_.data.seek_table.points[1].sample_number || - block.get_point(1).stream_offset != seektable_.data.seek_table.points[1].stream_offset || - block.get_point(1).frame_samples != seektable_.data.seek_table.points[1].frame_samples - ) - return die_("point mismatch"); - printf("OK\n"); - - printf("testing FLAC::Metadata::clone(const FLAC::Metadata::Prototype *)... "); - FLAC::Metadata::Prototype *clone_ = FLAC::Metadata::clone(&block); - if(0 == clone_) - return die_("returned NULL"); - if(0 == dynamic_cast<FLAC::Metadata::SeekTable *>(clone_)) - return die_("downcast is NULL"); - if(*dynamic_cast<FLAC::Metadata::SeekTable *>(clone_) != block) - return die_("clone is not identical"); - printf("OK\n"); - printf("testing SeekTable::~SeekTable()... "); - delete clone_; - printf("OK\n"); - - - printf("PASSED\n\n"); - return true; -} - -bool test_metadata_object_vorbiscomment() -{ - unsigned expected_length; - - printf("testing class FLAC::Metadata::VorbisComment::Entry\n"); - - printf("testing Entry::Entry()... "); - { - FLAC::Metadata::VorbisComment::Entry entry1; - if(!entry1.is_valid()) - return die_("!is_valid()"); - printf("OK\n"); - - printf("testing Entry::~Entry()... "); - } - printf("OK\n"); - - printf("testing Entry::Entry(const char *field, unsigned field_length)... "); - FLAC::Metadata::VorbisComment::Entry entry2("name2=value2", strlen("name2=value2")); - if(!entry2.is_valid()) - return die_("!is_valid()"); - printf("OK\n"); - - { - printf("testing Entry::Entry(const char *field)... "); - FLAC::Metadata::VorbisComment::Entry entry2z("name2=value2"); - if(!entry2z.is_valid()) - return die_("!is_valid()"); - if(strcmp(entry2.get_field(), entry2z.get_field())) - return die_("bad value"); - printf("OK\n"); - } - - printf("testing Entry::Entry(const char *field_name, const char *field_value, unsigned field_value_length)... "); - FLAC::Metadata::VorbisComment::Entry entry3("name3", "value3", strlen("value3")); - if(!entry3.is_valid()) - return die_("!is_valid()"); - printf("OK\n"); - - { - printf("testing Entry::Entry(const char *field_name, const char *field_value)... "); - FLAC::Metadata::VorbisComment::Entry entry3z("name3", "value3"); - if(!entry3z.is_valid()) - return die_("!is_valid()"); - if(strcmp(entry3.get_field(), entry3z.get_field())) - return die_("bad value"); - printf("OK\n"); - } - - printf("testing Entry::Entry(const Entry &entry)... "); - { - FLAC::Metadata::VorbisComment::Entry entry2copy(entry2); - if(!entry2copy.is_valid()) - return die_("!is_valid()"); - printf("OK\n"); - - printf("testing Entry::~Entry()... "); - } - printf("OK\n"); - - printf("testing Entry::operator=(const Entry &entry)... "); - FLAC::Metadata::VorbisComment::Entry entry1 = entry2; - if(!entry2.is_valid()) - return die_("!is_valid()"); - printf("OK\n"); - - printf("testing Entry::get_field_length()... "); - if(entry1.get_field_length() != strlen("name2=value2")) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing Entry::get_field_name_length()... "); - if(entry1.get_field_name_length() != strlen("name2")) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing Entry::get_field_value_length()... "); - if(entry1.get_field_value_length() != strlen("value2")) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing Entry::get_entry()... "); - { - ::FLAC__StreamMetadata_VorbisComment_Entry entry = entry1.get_entry(); - if(entry.length != strlen("name2=value2")) - return die_("entry length mismatch"); - if(0 != memcmp(entry.entry, "name2=value2", entry.length)) - return die_("entry value mismatch"); - } - printf("OK\n"); - - printf("testing Entry::get_field()... "); - if(0 != memcmp(entry1.get_field(), "name2=value2", strlen("name2=value2"))) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing Entry::get_field_name()... "); - if(0 != memcmp(entry1.get_field_name(), "name2", strlen("name2"))) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing Entry::get_field_value()... "); - if(0 != memcmp(entry1.get_field_value(), "value2", strlen("value2"))) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing Entry::set_field_name()... "); - if(!entry1.set_field_name("name1")) - return die_("returned false"); - if(0 != memcmp(entry1.get_field_name(), "name1", strlen("name1"))) - return die_("value mismatch"); - if(0 != memcmp(entry1.get_field(), "name1=value2", strlen("name1=value2"))) - return die_("entry mismatch"); - printf("OK\n"); - - printf("testing Entry::set_field_value(const char *field_value, unsigned field_value_length)... "); - if(!entry1.set_field_value("value1", strlen("value1"))) - return die_("returned false"); - if(0 != memcmp(entry1.get_field_value(), "value1", strlen("value1"))) - return die_("value mismatch"); - if(0 != memcmp(entry1.get_field(), "name1=value1", strlen("name1=value1"))) - return die_("entry mismatch"); - printf("OK\n"); - - printf("testing Entry::set_field_value(const char *field_value)... "); - if(!entry1.set_field_value("value1")) - return die_("returned false"); - if(0 != memcmp(entry1.get_field_value(), "value1", strlen("value1"))) - return die_("value mismatch"); - if(0 != memcmp(entry1.get_field(), "name1=value1", strlen("name1=value1"))) - return die_("entry mismatch"); - printf("OK\n"); - - printf("testing Entry::set_field(const char *field, unsigned field_length)... "); - if(!entry1.set_field("name0=value0", strlen("name0=value0"))) - return die_("returned false"); - if(0 != memcmp(entry1.get_field_name(), "name0", strlen("name0"))) - return die_("value mismatch"); - if(0 != memcmp(entry1.get_field_value(), "value0", strlen("value0"))) - return die_("value mismatch"); - if(0 != memcmp(entry1.get_field(), "name0=value0", strlen("name0=value0"))) - return die_("entry mismatch"); - printf("OK\n"); - - printf("testing Entry::set_field(const char *field)... "); - if(!entry1.set_field("name0=value0")) - return die_("returned false"); - if(0 != memcmp(entry1.get_field_name(), "name0", strlen("name0"))) - return die_("value mismatch"); - if(0 != memcmp(entry1.get_field_value(), "value0", strlen("value0"))) - return die_("value mismatch"); - if(0 != memcmp(entry1.get_field(), "name0=value0", strlen("name0=value0"))) - return die_("entry mismatch"); - printf("OK\n"); - - printf("PASSED\n\n"); - - - printf("testing class FLAC::Metadata::VorbisComment\n"); - - printf("testing VorbisComment::VorbisComment()... "); - FLAC::Metadata::VorbisComment block; - if(!block.is_valid()) - return die_("!block.is_valid()"); - expected_length = (FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN/8 + strlen(::FLAC__VENDOR_STRING) + FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN/8); - if(block.get_length() != expected_length) { - printf("FAILED, bad length, expected %u, got %u\n", expected_length, block.get_length()); - return false; - } - printf("OK\n"); - - printf("testing VorbisComment::VorbisComment(const VorbisComment &)... +\n"); - printf(" VorbisComment::operator!=(const VorbisComment &)... "); - { - FLAC::Metadata::VorbisComment blockcopy(block); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != block) - return die_("copy is not identical to original"); - printf("OK\n"); - - printf("testing VorbisComment::~VorbisComment()... "); - } - printf("OK\n"); - - printf("testing VorbisComment::VorbisComment(const ::FLAC__StreamMetadata &)... +\n"); - printf(" VorbisComment::operator!=(const ::FLAC__StreamMetadata &)... "); - { - FLAC::Metadata::VorbisComment blockcopy(vorbiscomment_); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != vorbiscomment_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing VorbisComment::VorbisComment(const ::FLAC__StreamMetadata *)... +\n"); - printf(" VorbisComment::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::VorbisComment blockcopy(&vorbiscomment_); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != vorbiscomment_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing VorbisComment::VorbisComment(const ::FLAC__StreamMetadata *, copy=true)... +\n"); - printf(" VorbisComment::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::VorbisComment blockcopy(&vorbiscomment_, /*copy=*/true); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != vorbiscomment_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing VorbisComment::VorbisComment(const ::FLAC__StreamMetadata *, copy=false)... +\n"); - printf(" VorbisComment::operator!=(const ::FLAC__StreamMetadata *)... "); - { - ::FLAC__StreamMetadata *copy = ::FLAC__metadata_object_clone(&vorbiscomment_); - FLAC::Metadata::VorbisComment blockcopy(copy, /*copy=*/false); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != vorbiscomment_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing VorbisComment::assign(const ::FLAC__StreamMetadata *, copy=true)... +\n"); - printf(" VorbisComment::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::VorbisComment blockcopy; - blockcopy.assign(&vorbiscomment_, /*copy=*/true); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != vorbiscomment_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing VorbisComment::assign(const ::FLAC__StreamMetadata *, copy=false)... +\n"); - printf(" VorbisComment::operator!=(const ::FLAC__StreamMetadata *)... "); - { - ::FLAC__StreamMetadata *copy = ::FLAC__metadata_object_clone(&vorbiscomment_); - FLAC::Metadata::VorbisComment blockcopy; - blockcopy.assign(copy, /*copy=*/false); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != vorbiscomment_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing VorbisComment::operator=(const VorbisComment &)... +\n"); - printf(" VorbisComment::operator==(const VorbisComment &)... "); - { - FLAC::Metadata::VorbisComment blockcopy = block; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == block)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing VorbisComment::operator=(const ::FLAC__StreamMetadata &)... +\n"); - printf(" VorbisComment::operator==(const ::FLAC__StreamMetadata &)... "); - { - FLAC::Metadata::VorbisComment blockcopy = vorbiscomment_; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == vorbiscomment_)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing VorbisComment::operator=(const ::FLAC__StreamMetadata *)... +\n"); - printf(" VorbisComment::operator==(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::VorbisComment blockcopy = &vorbiscomment_; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == vorbiscomment_)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing VorbisComment::get_num_comments()... "); - if(block.get_num_comments() != 0) - return die_("value mismatch, expected 0"); - printf("OK\n"); - - printf("testing VorbisComment::set_vendor_string()... "); - if(!block.set_vendor_string((const FLAC__byte *)"mame0")) - return die_("returned false"); - printf("OK\n"); - vorbiscomment_.data.vorbis_comment.vendor_string.entry[0] = 'm'; - - printf("testing VorbisComment::get_vendor_string()... "); - if(strlen((const char *)block.get_vendor_string()) != vorbiscomment_.data.vorbis_comment.vendor_string.length) - return die_("length mismatch"); - if(0 != memcmp(block.get_vendor_string(), vorbiscomment_.data.vorbis_comment.vendor_string.entry, vorbiscomment_.data.vorbis_comment.vendor_string.length)) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing VorbisComment::append_comment()... +\n"); - printf(" VorbisComment::get_comment()... "); - if(!block.append_comment(entry3)) - return die_("returned false"); - if(block.get_comment(0).get_field_length() != vorbiscomment_.data.vorbis_comment.comments[1].length) - return die_("length mismatch"); - if(0 != memcmp(block.get_comment(0).get_field(), vorbiscomment_.data.vorbis_comment.comments[1].entry, vorbiscomment_.data.vorbis_comment.comments[1].length)) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing VorbisComment::append_comment()... +\n"); - printf(" VorbisComment::get_comment()... "); - if(!block.append_comment(entry2)) - return die_("returned false"); - if(block.get_comment(1).get_field_length() != vorbiscomment_.data.vorbis_comment.comments[0].length) - return die_("length mismatch"); - if(0 != memcmp(block.get_comment(1).get_field(), vorbiscomment_.data.vorbis_comment.comments[0].entry, vorbiscomment_.data.vorbis_comment.comments[0].length)) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing VorbisComment::delete_comment()... +\n"); - printf(" VorbisComment::get_comment()... "); - if(!block.delete_comment(0)) - return die_("returned false"); - if(block.get_comment(0).get_field_length() != vorbiscomment_.data.vorbis_comment.comments[0].length) - return die_("length[0] mismatch"); - if(0 != memcmp(block.get_comment(0).get_field(), vorbiscomment_.data.vorbis_comment.comments[0].entry, vorbiscomment_.data.vorbis_comment.comments[0].length)) - return die_("value[0] mismatch"); - printf("OK\n"); - - printf("testing VorbisComment::delete_comment()... +\n"); - printf(" VorbisComment::get_comment()... "); - if(!block.delete_comment(0)) - return die_("returned false"); - if(block.get_num_comments() != 0) - return die_("block mismatch, expected num_comments = 0"); - printf("OK\n"); - - printf("testing VorbisComment::insert_comment()... +\n"); - printf(" VorbisComment::get_comment()... "); - if(!block.insert_comment(0, entry3)) - return die_("returned false"); - if(block.get_comment(0).get_field_length() != vorbiscomment_.data.vorbis_comment.comments[1].length) - return die_("length mismatch"); - if(0 != memcmp(block.get_comment(0).get_field(), vorbiscomment_.data.vorbis_comment.comments[1].entry, vorbiscomment_.data.vorbis_comment.comments[1].length)) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing VorbisComment::insert_comment()... +\n"); - printf(" VorbisComment::get_comment()... "); - if(!block.insert_comment(0, entry3)) - return die_("returned false"); - if(block.get_comment(0).get_field_length() != vorbiscomment_.data.vorbis_comment.comments[1].length) - return die_("length mismatch"); - if(0 != memcmp(block.get_comment(0).get_field(), vorbiscomment_.data.vorbis_comment.comments[1].entry, vorbiscomment_.data.vorbis_comment.comments[1].length)) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing VorbisComment::insert_comment()... +\n"); - printf(" VorbisComment::get_comment()... "); - if(!block.insert_comment(1, entry2)) - return die_("returned false"); - if(block.get_comment(1).get_field_length() != vorbiscomment_.data.vorbis_comment.comments[0].length) - return die_("length mismatch"); - if(0 != memcmp(block.get_comment(1).get_field(), vorbiscomment_.data.vorbis_comment.comments[0].entry, vorbiscomment_.data.vorbis_comment.comments[0].length)) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing VorbisComment::set_comment()... +\n"); - printf(" VorbisComment::get_comment()... "); - if(!block.set_comment(0, entry2)) - return die_("returned false"); - if(block.get_comment(0).get_field_length() != vorbiscomment_.data.vorbis_comment.comments[0].length) - return die_("length mismatch"); - if(0 != memcmp(block.get_comment(0).get_field(), vorbiscomment_.data.vorbis_comment.comments[0].entry, vorbiscomment_.data.vorbis_comment.comments[0].length)) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing VorbisComment::delete_comment()... +\n"); - printf(" VorbisComment::get_comment()... "); - if(!block.delete_comment(0)) - return die_("returned false"); - if(block.get_comment(0).get_field_length() != vorbiscomment_.data.vorbis_comment.comments[0].length) - return die_("length[0] mismatch"); - if(0 != memcmp(block.get_comment(0).get_field(), vorbiscomment_.data.vorbis_comment.comments[0].entry, vorbiscomment_.data.vorbis_comment.comments[0].length)) - return die_("value[0] mismatch"); - if(block.get_comment(1).get_field_length() != vorbiscomment_.data.vorbis_comment.comments[1].length) - return die_("length[1] mismatch"); - if(0 != memcmp(block.get_comment(1).get_field(), vorbiscomment_.data.vorbis_comment.comments[1].entry, vorbiscomment_.data.vorbis_comment.comments[1].length)) - return die_("value[0] mismatch"); - printf("OK\n"); - - printf("testing FLAC::Metadata::clone(const FLAC::Metadata::Prototype *)... "); - FLAC::Metadata::Prototype *clone_ = FLAC::Metadata::clone(&block); - if(0 == clone_) - return die_("returned NULL"); - if(0 == dynamic_cast<FLAC::Metadata::VorbisComment *>(clone_)) - return die_("downcast is NULL"); - if(*dynamic_cast<FLAC::Metadata::VorbisComment *>(clone_) != block) - return die_("clone is not identical"); - printf("OK\n"); - printf("testing VorbisComment::~VorbisComment()... "); - delete clone_; - printf("OK\n"); - - - printf("PASSED\n\n"); - return true; -} - -bool test_metadata_object_cuesheet() -{ - unsigned expected_length; - - printf("testing class FLAC::Metadata::CueSheet::Track\n"); - - printf("testing Track::Track()... "); - FLAC::Metadata::CueSheet::Track track0; - if(!track0.is_valid()) - return die_("!is_valid()"); - printf("OK\n"); - - { - printf("testing Track::get_track()... "); - const ::FLAC__StreamMetadata_CueSheet_Track *trackp = track0.get_track(); - if(0 == trackp) - return die_("returned pointer is NULL"); - printf("OK\n"); - - printf("testing Track::Track(const ::FLAC__StreamMetadata_CueSheet_Track*)... "); - FLAC::Metadata::CueSheet::Track track2(trackp); - if(!track2.is_valid()) - return die_("!is_valid()"); - if(!track_is_equal_(track2.get_track(), trackp)) - return die_("copy is not equal"); - printf("OK\n"); - - printf("testing Track::~Track()... "); - } - printf("OK\n"); - - printf("testing Track::Track(const Track &track)... "); - { - FLAC::Metadata::CueSheet::Track track0copy(track0); - if(!track0copy.is_valid()) - return die_("!is_valid()"); - if(!track_is_equal_(track0copy.get_track(), track0.get_track())) - return die_("copy is not equal"); - printf("OK\n"); - - printf("testing Track::~Track()... "); - } - printf("OK\n"); - - printf("testing Track::operator=(const Track &track)... "); - FLAC::Metadata::CueSheet::Track track1 = track0; - if(!track0.is_valid()) - return die_("!is_valid()"); - if(!track_is_equal_(track1.get_track(), track0.get_track())) - return die_("copy is not equal"); - printf("OK\n"); - - printf("testing Track::get_offset()... "); - if(track1.get_offset() != 0) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing Track::get_number()... "); - if(track1.get_number() != 0) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing Track::get_isrc()... "); - if(0 != memcmp(track1.get_isrc(), "\0\0\0\0\0\0\0\0\0\0\0\0\0", 13)) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing Track::get_type()... "); - if(track1.get_type() != 0) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing Track::get_pre_emphasis()... "); - if(track1.get_pre_emphasis() != 0) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing Track::get_num_indices()... "); - if(track1.get_num_indices() != 0) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing Track::set_offset()... "); - track1.set_offset(588); - if(track1.get_offset() != 588) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing Track::set_number()... "); - track1.set_number(1); - if(track1.get_number() != 1) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing Track::set_isrc()... "); - track1.set_isrc("ABCDE1234567"); - if(0 != memcmp(track1.get_isrc(), "ABCDE1234567", 13)) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing Track::set_type()... "); - track1.set_type(1); - if(track1.get_type() != 1) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing Track::set_pre_emphasis()... "); - track1.set_pre_emphasis(1); - if(track1.get_pre_emphasis() != 1) - return die_("value mismatch"); - printf("OK\n"); - - printf("PASSED\n\n"); - - printf("testing class FLAC::Metadata::CueSheet\n"); - - printf("testing CueSheet::CueSheet()... "); - FLAC::Metadata::CueSheet block; - if(!block.is_valid()) - return die_("!block.is_valid()"); - expected_length = ( - FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN + - FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN + - FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN + - FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN + - FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN - ) / 8; - if(block.get_length() != expected_length) { - printf("FAILED, bad length, expected %u, got %u\n", expected_length, block.get_length()); - return false; - } - printf("OK\n"); - - printf("testing CueSheet::CueSheet(const CueSheet &)... +\n"); - printf(" CueSheet::operator!=(const CueSheet &)... "); - { - FLAC::Metadata::CueSheet blockcopy(block); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != block) - return die_("copy is not identical to original"); - printf("OK\n"); - - printf("testing CueSheet::~CueSheet()... "); - } - printf("OK\n"); - - printf("testing CueSheet::CueSheet(const ::FLAC__StreamMetadata &)... +\n"); - printf(" CueSheet::operator!=(const ::FLAC__StreamMetadata &)... "); - { - FLAC::Metadata::CueSheet blockcopy(cuesheet_); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != cuesheet_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing CueSheet::CueSheet(const ::FLAC__StreamMetadata *)... +\n"); - printf(" CueSheet::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::CueSheet blockcopy(&cuesheet_); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != cuesheet_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing CueSheet::CueSheet(const ::FLAC__StreamMetadata *, copy=true)... +\n"); - printf(" CueSheet::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::CueSheet blockcopy(&cuesheet_, /*copy=*/true); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != cuesheet_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing CueSheet::CueSheet(const ::FLAC__StreamMetadata *, copy=false)... +\n"); - printf(" CueSheet::operator!=(const ::FLAC__StreamMetadata *)... "); - { - ::FLAC__StreamMetadata *copy = ::FLAC__metadata_object_clone(&cuesheet_); - FLAC::Metadata::CueSheet blockcopy(copy, /*copy=*/false); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != cuesheet_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing CueSheet::assign(const ::FLAC__StreamMetadata *, copy=true)... +\n"); - printf(" CueSheet::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::CueSheet blockcopy; - blockcopy.assign(&cuesheet_, /*copy=*/true); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != cuesheet_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing CueSheet::assign(const ::FLAC__StreamMetadata *, copy=false)... +\n"); - printf(" CueSheet::operator!=(const ::FLAC__StreamMetadata *)... "); - { - ::FLAC__StreamMetadata *copy = ::FLAC__metadata_object_clone(&cuesheet_); - FLAC::Metadata::CueSheet blockcopy; - blockcopy.assign(copy, /*copy=*/false); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != cuesheet_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing CueSheet::operator=(const CueSheet &)... +\n"); - printf(" CueSheet::operator==(const CueSheet &)... "); - { - FLAC::Metadata::CueSheet blockcopy = block; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == block)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing CueSheet::operator=(const ::FLAC__StreamMetadata &)... +\n"); - printf(" CueSheet::operator==(const ::FLAC__StreamMetadata &)... "); - { - FLAC::Metadata::CueSheet blockcopy = cuesheet_; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == cuesheet_)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing CueSheet::operator=(const ::FLAC__StreamMetadata *)... +\n"); - printf(" CueSheet::operator==(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::CueSheet blockcopy = &cuesheet_; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == cuesheet_)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing CueSheet::get_media_catalog_number()... "); - if(0 != strcmp(block.get_media_catalog_number(), "")) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing CueSheet::get_lead_in()... "); - if(block.get_lead_in() != 0) - return die_("value mismatch, expected 0"); - printf("OK\n"); - - printf("testing CueSheet::get_is_cd()... "); - if(block.get_is_cd()) - return die_("value mismatch, expected false"); - printf("OK\n"); - - printf("testing CueSheet::get_num_tracks()... "); - if(block.get_num_tracks() != 0) - return die_("value mismatch, expected 0"); - printf("OK\n"); - - printf("testing CueSheet::set_media_catalog_number()... "); - { - char mcn[129]; - memset(mcn, 0, sizeof(mcn)); - strcpy(mcn, "1234567890123"); - block.set_media_catalog_number(mcn); - if(0 != memcmp(block.get_media_catalog_number(), mcn, sizeof(mcn))) - return die_("value mismatch"); - } - printf("OK\n"); - - printf("testing CueSheet::set_lead_in()... "); - block.set_lead_in(588); - if(block.get_lead_in() != 588) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing CueSheet::set_is_cd()... "); - block.set_is_cd(true); - if(!block.get_is_cd()) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing CueSheet::insert_track()... +\n"); - printf(" CueSheet::get_track()... "); - if(!block.insert_track(0, track0)) - return die_("returned false"); - if(!track_is_equal_(block.get_track(0).get_track(), track0.get_track())) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing CueSheet::insert_track()... +\n"); - printf(" CueSheet::get_track()... "); - if(!block.insert_track(1, track1)) - return die_("returned false"); - if(!track_is_equal_(block.get_track(1).get_track(), track1.get_track())) - return die_("value mismatch"); - printf("OK\n"); - - ::FLAC__StreamMetadata_CueSheet_Index index0; - index0.offset = 588*4; - index0.number = 1; - - printf("testing CueSheet::insert_index(0)... +\n"); - printf(" CueSheet::get_track()... +\n"); - printf(" CueSheet::Track::get_index()... "); - if(!block.insert_index(0, 0, index0)) - return die_("returned false"); - if(!index_is_equal_(block.get_track(0).get_index(0), index0)) - return die_("value mismatch"); - printf("OK\n"); - - index0.offset = 588*5; - printf("testing CueSheet::Track::set_index()... "); - { - FLAC::Metadata::CueSheet::Track track_ = block.get_track(0); - track_.set_index(0, index0); - if(!index_is_equal_(track_.get_index(0), index0)) - return die_("value mismatch"); - } - printf("OK\n"); - - index0.offset = 588*6; - printf("testing CueSheet::set_index()... "); - block.set_index(0, 0, index0); - if(!index_is_equal_(block.get_track(0).get_index(0), index0)) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing CueSheet::delete_index()... "); - if(!block.delete_index(0, 0)) - return die_("returned false"); - if(block.get_track(0).get_num_indices() != 0) - return die_("num_indices mismatch"); - printf("OK\n"); - - - printf("testing CueSheet::set_track()... +\n"); - printf(" CueSheet::get_track()... "); - if(!block.set_track(0, track1)) - return die_("returned false"); - if(!track_is_equal_(block.get_track(0).get_track(), track1.get_track())) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing CueSheet::delete_track()... "); - if(!block.delete_track(0)) - return die_("returned false"); - if(block.get_num_tracks() != 1) - return die_("num_tracks mismatch"); - printf("OK\n"); - - printf("testing FLAC::Metadata::clone(const FLAC::Metadata::Prototype *)... "); - FLAC::Metadata::Prototype *clone_ = FLAC::Metadata::clone(&block); - if(0 == clone_) - return die_("returned NULL"); - if(0 == dynamic_cast<FLAC::Metadata::CueSheet *>(clone_)) - return die_("downcast is NULL"); - if(*dynamic_cast<FLAC::Metadata::CueSheet *>(clone_) != block) - return die_("clone is not identical"); - printf("OK\n"); - printf("testing CueSheet::~CueSheet()... "); - delete clone_; - printf("OK\n"); - - printf("PASSED\n\n"); - return true; -} - -bool test_metadata_object_picture() -{ - unsigned expected_length; - - printf("testing class FLAC::Metadata::Picture\n"); - - printf("testing Picture::Picture()... "); - FLAC::Metadata::Picture block; - if(!block.is_valid()) - return die_("!block.is_valid()"); - expected_length = ( - FLAC__STREAM_METADATA_PICTURE_TYPE_LEN + - FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN + - FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN + - FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN + - FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN + - FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN + - FLAC__STREAM_METADATA_PICTURE_COLORS_LEN + - FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN - ) / 8; - if(block.get_length() != expected_length) { - printf("FAILED, bad length, expected %u, got %u\n", expected_length, block.get_length()); - return false; - } - printf("OK\n"); - - printf("testing Picture::Picture(const Picture &)... +\n"); - printf(" Picture::operator!=(const Picture &)... "); - { - FLAC::Metadata::Picture blockcopy(block); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != block) - return die_("copy is not identical to original"); - printf("OK\n"); - - printf("testing Picture::~Picture()... "); - } - printf("OK\n"); - - printf("testing Picture::Picture(const ::FLAC__StreamMetadata &)... +\n"); - printf(" Picture::operator!=(const ::FLAC__StreamMetadata &)... "); - { - FLAC::Metadata::Picture blockcopy(picture_); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != picture_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Picture::Picture(const ::FLAC__StreamMetadata *)... +\n"); - printf(" Picture::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::Picture blockcopy(&picture_); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != picture_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Picture::Picture(const ::FLAC__StreamMetadata *, copy=true)... +\n"); - printf(" Picture::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::Picture blockcopy(&picture_, /*copy=*/true); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != picture_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Picture::Picture(const ::FLAC__StreamMetadata *, copy=false)... +\n"); - printf(" Picture::operator!=(const ::FLAC__StreamMetadata *)... "); - { - ::FLAC__StreamMetadata *copy = ::FLAC__metadata_object_clone(&picture_); - FLAC::Metadata::Picture blockcopy(copy, /*copy=*/false); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != picture_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Picture::assign(const ::FLAC__StreamMetadata *, copy=true)... +\n"); - printf(" Picture::operator!=(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::Picture blockcopy; - blockcopy.assign(&picture_, /*copy=*/true); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != picture_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Picture::assign(const ::FLAC__StreamMetadata *, copy=false)... +\n"); - printf(" Picture::operator!=(const ::FLAC__StreamMetadata *)... "); - { - ::FLAC__StreamMetadata *copy = ::FLAC__metadata_object_clone(&picture_); - FLAC::Metadata::Picture blockcopy; - blockcopy.assign(copy, /*copy=*/false); - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(blockcopy != picture_) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Picture::operator=(const Picture &)... +\n"); - printf(" Picture::operator==(const Picture &)... "); - { - FLAC::Metadata::Picture blockcopy = block; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == block)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Picture::operator=(const ::FLAC__StreamMetadata &)... +\n"); - printf(" Picture::operator==(const ::FLAC__StreamMetadata &)... "); - { - FLAC::Metadata::Picture blockcopy = picture_; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == picture_)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Picture::operator=(const ::FLAC__StreamMetadata *)... +\n"); - printf(" Picture::operator==(const ::FLAC__StreamMetadata *)... "); - { - FLAC::Metadata::Picture blockcopy = &picture_; - if(!blockcopy.is_valid()) - return die_("!blockcopy.is_valid()"); - if(!(blockcopy == picture_)) - return die_("copy is not identical to original"); - printf("OK\n"); - } - - printf("testing Picture::get_type()... "); - if(block.get_type() != ::FLAC__STREAM_METADATA_PICTURE_TYPE_OTHER) - return die_("value mismatch, expected ::FLAC__STREAM_METADATA_PICTURE_TYPE_OTHER"); - printf("OK\n"); - - printf("testing Picture::set_type()... +\n"); - printf(" Picture::get_type()... "); - block.set_type(::FLAC__STREAM_METADATA_PICTURE_TYPE_MEDIA); - if(block.get_type() != ::FLAC__STREAM_METADATA_PICTURE_TYPE_MEDIA) - return die_("value mismatch, expected ::FLAC__STREAM_METADATA_PICTURE_TYPE_MEDIA"); - printf("OK\n"); - - printf("testing Picture::set_mime_type()... "); - if(!block.set_mime_type("qmage/jpeg")) - return die_("returned false"); - printf("OK\n"); - picture_.data.picture.mime_type[0] = 'q'; - - printf("testing Picture::get_mime_type()... "); - if(0 != strcmp(block.get_mime_type(), picture_.data.picture.mime_type)) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing Picture::set_description()... "); - if(!block.set_description((const FLAC__byte*)"qesc")) - return die_("returned false"); - printf("OK\n"); - picture_.data.picture.description[0] = 'q'; - - printf("testing Picture::get_description()... "); - if(0 != strcmp((const char *)block.get_description(), (const char *)picture_.data.picture.description)) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing Picture::get_width()... "); - if(block.get_width() != 0) - return die_("value mismatch, expected 0"); - printf("OK\n"); - - printf("testing Picture::set_width()... +\n"); - printf(" Picture::get_width()... "); - block.set_width(400); - if(block.get_width() != 400) - return die_("value mismatch, expected 400"); - printf("OK\n"); - - printf("testing Picture::get_height()... "); - if(block.get_height() != 0) - return die_("value mismatch, expected 0"); - printf("OK\n"); - - printf("testing Picture::set_height()... +\n"); - printf(" Picture::get_height()... "); - block.set_height(200); - if(block.get_height() != 200) - return die_("value mismatch, expected 200"); - printf("OK\n"); - - printf("testing Picture::get_depth()... "); - if(block.get_depth() != 0) - return die_("value mismatch, expected 0"); - printf("OK\n"); - - printf("testing Picture::set_depth()... +\n"); - printf(" Picture::get_depth()... "); - block.set_depth(16); - if(block.get_depth() != 16) - return die_("value mismatch, expected 16"); - printf("OK\n"); - - printf("testing Picture::get_colors()... "); - if(block.get_colors() != 0) - return die_("value mismatch, expected 0"); - printf("OK\n"); - - printf("testing Picture::set_colors()... +\n"); - printf(" Picture::get_colors()... "); - block.set_colors(1u>16); - if(block.get_colors() != 1u>16) - return die_("value mismatch, expected 2^16"); - printf("OK\n"); - - printf("testing Picture::get_data_length()... "); - if(block.get_data_length() != 0) - return die_("value mismatch, expected 0"); - printf("OK\n"); - - printf("testing Picture::set_data()... "); - if(!block.set_data((const FLAC__byte*)"qOMEJPEGDATA", strlen("qOMEJPEGDATA"))) - return die_("returned false"); - printf("OK\n"); - picture_.data.picture.data[0] = 'q'; - - printf("testing Picture::get_data()... "); - if(block.get_data_length() != picture_.data.picture.data_length) - return die_("length mismatch"); - if(0 != memcmp(block.get_data(), picture_.data.picture.data, picture_.data.picture.data_length)) - return die_("value mismatch"); - printf("OK\n"); - - printf("testing FLAC::Metadata::clone(const FLAC::Metadata::Prototype *)... "); - FLAC::Metadata::Prototype *clone_ = FLAC::Metadata::clone(&block); - if(0 == clone_) - return die_("returned NULL"); - if(0 == dynamic_cast<FLAC::Metadata::Picture *>(clone_)) - return die_("downcast is NULL"); - if(*dynamic_cast<FLAC::Metadata::Picture *>(clone_) != block) - return die_("clone is not identical"); - printf("OK\n"); - printf("testing Picture::~Picture()... "); - delete clone_; - printf("OK\n"); - - - printf("PASSED\n\n"); - return true; -} - -bool test_metadata_object() -{ - printf("\n+++ libFLAC++ unit test: metadata objects\n\n"); - - init_metadata_blocks_(); - - if(!test_metadata_object_streaminfo()) - return false; - - if(!test_metadata_object_padding()) - return false; - - if(!test_metadata_object_application()) - return false; - - if(!test_metadata_object_seektable()) - return false; - - if(!test_metadata_object_vorbiscomment()) - return false; - - if(!test_metadata_object_cuesheet()) - return false; - - if(!test_metadata_object_picture()) - return false; - - free_metadata_blocks_(); - - return true; -} diff --git a/3rdparty/libflac/src/test_libFLAC++/test_libFLAC++.dsp b/3rdparty/libflac/src/test_libFLAC++/test_libFLAC++.dsp deleted file mode 100644 index 0d256024d02..00000000000 --- a/3rdparty/libflac/src/test_libFLAC++/test_libFLAC++.dsp +++ /dev/null @@ -1,136 +0,0 @@ -# Microsoft Developer Studio Project File - Name="test_libFLAC++" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=test_libFLAC++ - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "test_libFLAC++.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "test_libFLAC++.mak" CFG="test_libFLAC++ - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "test_libFLAC++ - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "test_libFLAC++ - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "test_libFLAC++ - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\obj\release\bin" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "..\..\include" /D "NDEBUG" /D "FLAC__NO_DLL" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\..\obj\release\lib\grabbag_static.lib ..\..\obj\release\lib\replaygain_analysis_static.lib ..\..\obj\release\lib\test_libs_common_static.lib ..\..\obj\release\lib\libFLAC++_static.lib ..\..\obj\release\lib\libFLAC_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "test_libFLAC++ - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\obj\debug\bin" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "..\..\include" /D "_DEBUG" /D "DEBUG" /D "FLAC__NO_DLL" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\..\obj\debug\lib\grabbag_static.lib ..\..\obj\debug\lib\replaygain_analysis_static.lib ..\..\obj\debug\lib\test_libs_common_static.lib ..\..\obj\debug\lib\libFLAC++_static.lib ..\..\obj\debug\lib\libFLAC_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "test_libFLAC++ - Win32 Release" -# Name "test_libFLAC++ - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\decoders.cpp -# End Source File -# Begin Source File - -SOURCE=.\encoders.cpp -# End Source File -# Begin Source File - -SOURCE=.\main.cpp -# End Source File -# Begin Source File - -SOURCE=.\metadata.cpp -# End Source File -# Begin Source File - -SOURCE=.\metadata_manip.cpp -# End Source File -# Begin Source File - -SOURCE=.\metadata_object.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\decoders.h -# End Source File -# Begin Source File - -SOURCE=.\encoders.h -# End Source File -# Begin Source File - -SOURCE=.\metadata.h -# End Source File -# End Group -# Begin Source File - -SOURCE=.\README -# End Source File -# End Target -# End Project diff --git a/3rdparty/libflac/src/test_libFLAC++/test_libFLAC++.vcproj b/3rdparty/libflac/src/test_libFLAC++/test_libFLAC++.vcproj deleted file mode 100644 index ed392ab4d0e..00000000000 --- a/3rdparty/libflac/src/test_libFLAC++/test_libFLAC++.vcproj +++ /dev/null @@ -1,234 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="test_libFLAC++" - ProjectGUID="{4cefbc8d-c215-11db-8314-0800200c9a66}" - RootNamespace="test_libFLAC++" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\obj\debug\bin" - IntermediateDirectory="Debug" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".;..\..\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;FLAC__NO_DLL;DEBUG" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="..\..\obj\release\lib\ogg_static.lib" - LinkIncremental="2" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\obj\release\bin" - IntermediateDirectory="Release" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".;..\..\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__NO_DLL" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="..\..\obj\release\lib\ogg_static.lib" - LinkIncremental="1" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" - LinkTimeCodeGeneration="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath=".\decoders.h" - > - </File> - <File - RelativePath=".\encoders.h" - > - </File> - <File - RelativePath=".\metadata.h" - > - </File> - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\decoders.cpp" - > - </File> - <File - RelativePath=".\encoders.cpp" - > - </File> - <File - RelativePath=".\main.cpp" - > - </File> - <File - RelativePath=".\metadata.cpp" - > - </File> - <File - RelativePath=".\metadata_manip.cpp" - > - </File> - <File - RelativePath=".\metadata_object.cpp" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/test_libFLAC/Makefile.am b/3rdparty/libflac/src/test_libFLAC/Makefile.am deleted file mode 100644 index d38f2999a7b..00000000000 --- a/3rdparty/libflac/src/test_libFLAC/Makefile.am +++ /dev/null @@ -1,47 +0,0 @@ -# test_libFLAC - Unit tester for libFLAC -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -EXTRA_DIST = \ - Makefile.lite \ - test_libFLAC.dsp \ - test_libFLAC.vcproj - -INCLUDES = -I$(top_srcdir)/src/libFLAC/include - -noinst_PROGRAMS = test_libFLAC -test_libFLAC_LDADD = \ - $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \ - $(top_builddir)/src/test_libs_common/libtest_libs_common.la \ - $(top_builddir)/src/libFLAC/libFLAC.la \ - @OGG_LIBS@ \ - @MINGW_WINSOCK_LIBS@ \ - -lm -test_libFLAC_SOURCES = \ - bitwriter.c \ - decoders.c \ - encoders.c \ - format.c \ - main.c \ - metadata.c \ - metadata_manip.c \ - metadata_object.c \ - bitwriter.h \ - decoders.h \ - encoders.h \ - format.h \ - metadata.h diff --git a/3rdparty/libflac/src/test_libFLAC/Makefile.in b/3rdparty/libflac/src/test_libFLAC/Makefile.in deleted file mode 100644 index b43bc65b6df..00000000000 --- a/3rdparty/libflac/src/test_libFLAC/Makefile.in +++ /dev/null @@ -1,548 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# test_libFLAC - Unit tester for libFLAC -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -EXTRA_DIST = \ - Makefile.lite \ - test_libFLAC.dsp \ - test_libFLAC.vcproj - - -INCLUDES = -I$(top_srcdir)/src/libFLAC/include - -noinst_PROGRAMS = test_libFLAC -test_libFLAC_LDADD = \ - $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \ - $(top_builddir)/src/test_libs_common/libtest_libs_common.la \ - $(top_builddir)/src/libFLAC/libFLAC.la \ - @OGG_LIBS@ \ - @MINGW_WINSOCK_LIBS@ \ - -lm - -test_libFLAC_SOURCES = \ - bitwriter.c \ - decoders.c \ - encoders.c \ - format.c \ - main.c \ - metadata.c \ - metadata_manip.c \ - metadata_object.c \ - bitwriter.h \ - decoders.h \ - encoders.h \ - format.h \ - metadata.h - -subdir = src/test_libFLAC -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -noinst_PROGRAMS = test_libFLAC$(EXEEXT) -PROGRAMS = $(noinst_PROGRAMS) - -am_test_libFLAC_OBJECTS = bitwriter.$(OBJEXT) decoders.$(OBJEXT) \ - encoders.$(OBJEXT) format.$(OBJEXT) main.$(OBJEXT) \ - metadata.$(OBJEXT) metadata_manip.$(OBJEXT) \ - metadata_object.$(OBJEXT) -test_libFLAC_OBJECTS = $(am_test_libFLAC_OBJECTS) -test_libFLAC_DEPENDENCIES = \ - $(top_builddir)/src/share/grabbag/libgrabbag.la \ - $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \ - $(top_builddir)/src/test_libs_common/libtest_libs_common.la \ - $(top_builddir)/src/libFLAC/libFLAC.la -test_libFLAC_LDFLAGS = - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/bitwriter.Po ./$(DEPDIR)/decoders.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/encoders.Po ./$(DEPDIR)/format.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/main.Po ./$(DEPDIR)/metadata.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/metadata_manip.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/metadata_object.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(test_libFLAC_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(test_libFLAC_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/test_libFLAC/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -test_libFLAC$(EXEEXT): $(test_libFLAC_OBJECTS) $(test_libFLAC_DEPENDENCIES) - @rm -f test_libFLAC$(EXEEXT) - $(LINK) $(test_libFLAC_LDFLAGS) $(test_libFLAC_OBJECTS) $(test_libFLAC_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitwriter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decoders.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encoders.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/format.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metadata.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metadata_manip.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metadata_object.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/test_libFLAC/Makefile.lite b/3rdparty/libflac/src/test_libFLAC/Makefile.lite deleted file mode 100644 index 60d9920316e..00000000000 --- a/3rdparty/libflac/src/test_libFLAC/Makefile.lite +++ /dev/null @@ -1,47 +0,0 @@ -# test_libFLAC - Unit tester for libFLAC -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# -# GNU makefile -# - -topdir = ../.. -libdir = $(topdir)/obj/$(BUILD)/lib - -PROGRAM_NAME = test_libFLAC - -INCLUDES = -I../libFLAC/include -I$(topdir)/include - -ifeq ($(DARWIN_BUILD),yes) -EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libtest_libs_common.a $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm -else -LIBS = -lgrabbag -lreplaygain_analysis -ltest_libs_common -lFLAC -L$(OGG_LIB_DIR) -logg -lm -endif - -SRCS_C = \ - bitwriter.c \ - decoders.c \ - encoders.c \ - format.c \ - main.c \ - metadata.c \ - metadata_manip.c \ - metadata_object.c - -include $(topdir)/build/exe.mk - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/3rdparty/libflac/src/test_libFLAC/bitwriter.c b/3rdparty/libflac/src/test_libFLAC/bitwriter.c deleted file mode 100644 index 7bc23a87ce3..00000000000 --- a/3rdparty/libflac/src/test_libFLAC/bitwriter.c +++ /dev/null @@ -1,584 +0,0 @@ -/* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "FLAC/assert.h" -#include "private/bitwriter.h" /* from the libFLAC private include area */ -#include "bitwriter.h" -#include <stdio.h> -#include <string.h> /* for memcmp() */ - -/* adjust for compilers that can't understand using LLU suffix for uint64_t literals */ -#ifdef _MSC_VER -#define FLAC__U64L(x) x -#else -#define FLAC__U64L(x) x##LLU -#endif - -/* - * WATCHOUT! Since FLAC__BitWriter is a private structure, we use a copy of - * the definition here to get at the internals. Make sure this is kept up - * to date with what is in ../libFLAC/bitwriter.c - */ -typedef FLAC__uint32 bwword; - -struct FLAC__BitWriter { - bwword *buffer; - bwword accum; /* accumulator; when full, accum is appended to buffer */ - unsigned capacity; /* of buffer in words */ - unsigned words; /* # of complete words in buffer */ - unsigned bits; /* # of used bits in accum */ -}; - -#define TOTAL_BITS(bw) ((bw)->words*sizeof(bwword)*8 + (bw)->bits) - - -FLAC__bool test_bitwriter(void) -{ - FLAC__BitWriter *bw; - FLAC__bool ok; - unsigned i, j; -#if WORDS_BIGENDIAN - static bwword test_pattern1[5] = { 0xaaf0aabe, 0xaaaaaaa8, 0x300aaaaa, 0xaaadeadb, 0x00eeface }; -#else - static bwword test_pattern1[5] = { 0xbeaaf0aa, 0xa8aaaaaa, 0xaaaa0a30, 0xdbeaadaa, 0x00eeface }; -#endif - unsigned words, bits; /* what we think bw->words and bw->bits should be */ - - printf("\n+++ libFLAC unit test: bitwriter\n\n"); - - /* - * test new -> delete - */ - printf("testing new... "); - bw = FLAC__bitwriter_new(); - if(0 == bw) { - printf("FAILED, returned NULL\n"); - return false; - } - printf("OK\n"); - - printf("testing delete... "); - FLAC__bitwriter_delete(bw); - printf("OK\n"); - - /* - * test new -> init -> delete - */ - printf("testing new... "); - bw = FLAC__bitwriter_new(); - if(0 == bw) { - printf("FAILED, returned NULL\n"); - return false; - } - printf("OK\n"); - - printf("testing init... "); - FLAC__bitwriter_init(bw); - if(0 == bw) { - printf("FAILED, returned NULL\n"); - return false; - } - printf("OK\n"); - - printf("testing delete... "); - FLAC__bitwriter_delete(bw); - printf("OK\n"); - - /* - * test new -> init -> clear -> delete - */ - printf("testing new... "); - bw = FLAC__bitwriter_new(); - if(0 == bw) { - printf("FAILED, returned NULL\n"); - return false; - } - printf("OK\n"); - - printf("testing init... "); - FLAC__bitwriter_init(bw); - if(0 == bw) { - printf("FAILED, returned NULL\n"); - return false; - } - printf("OK\n"); - - printf("testing clear... "); - FLAC__bitwriter_clear(bw); - if(0 == bw) { - printf("FAILED, returned NULL\n"); - return false; - } - printf("OK\n"); - - printf("testing delete... "); - FLAC__bitwriter_delete(bw); - printf("OK\n"); - - /* - * test normal usage - */ - printf("testing new... "); - bw = FLAC__bitwriter_new(); - if(0 == bw) { - printf("FAILED, returned NULL\n"); - return false; - } - printf("OK\n"); - - printf("testing init... "); - ok = FLAC__bitwriter_init(bw); - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) - return false; - - printf("testing clear... "); - FLAC__bitwriter_clear(bw); - printf("OK\n"); - - words = bits = 0; - - printf("capacity = %u\n", bw->capacity); - - printf("testing zeroes, raw_uint32*... "); - ok = - FLAC__bitwriter_write_raw_uint32(bw, 0x1, 1) && - FLAC__bitwriter_write_raw_uint32(bw, 0x1, 2) && - FLAC__bitwriter_write_raw_uint32(bw, 0xa, 5) && - FLAC__bitwriter_write_raw_uint32(bw, 0xf0, 8) && - FLAC__bitwriter_write_raw_uint32(bw, 0x2aa, 10) && - FLAC__bitwriter_write_raw_uint32(bw, 0xf, 4) && - FLAC__bitwriter_write_raw_uint32(bw, 0xaaaaaaaa, 32) && - FLAC__bitwriter_write_zeroes(bw, 4) && - FLAC__bitwriter_write_raw_uint32(bw, 0x3, 2) && - FLAC__bitwriter_write_zeroes(bw, 8) && - FLAC__bitwriter_write_raw_uint64(bw, FLAC__U64L(0xaaaaaaaadeadbeef), 64) && - FLAC__bitwriter_write_raw_uint32(bw, 0xace, 12) - ; - if(!ok) { - printf("FAILED\n"); - FLAC__bitwriter_dump(bw, stdout); - return false; - } - words = 4; - bits = 24; - if(bw->words != words) { - printf("FAILED byte count %u != %u\n", bw->words, words); - FLAC__bitwriter_dump(bw, stdout); - return false; - } - if(bw->bits != bits) { - printf("FAILED bit count %u != %u\n", bw->bits, bits); - FLAC__bitwriter_dump(bw, stdout); - return false; - } - if(memcmp(bw->buffer, test_pattern1, sizeof(bwword)*words) != 0) { - printf("FAILED pattern match (buffer)\n"); - FLAC__bitwriter_dump(bw, stdout); - return false; - } - if((bw->accum & 0x00ffffff) != test_pattern1[words]) { - printf("FAILED pattern match (bw->accum=%08X != %08X)\n", bw->accum&0x00ffffff, test_pattern1[words]); - FLAC__bitwriter_dump(bw, stdout); - return false; - } - printf("OK\n"); - FLAC__bitwriter_dump(bw, stdout); - - printf("testing raw_uint32 some more... "); - ok = FLAC__bitwriter_write_raw_uint32(bw, 0x3d, 6); - if(!ok) { - printf("FAILED\n"); - FLAC__bitwriter_dump(bw, stdout); - return false; - } - bits += 6; - test_pattern1[words] <<= 6; - test_pattern1[words] |= 0x3d; - if(bw->words != words) { - printf("FAILED byte count %u != %u\n", bw->words, words); - FLAC__bitwriter_dump(bw, stdout); - return false; - } - if(bw->bits != bits) { - printf("FAILED bit count %u != %u\n", bw->bits, bits); - FLAC__bitwriter_dump(bw, stdout); - return false; - } - if(memcmp(bw->buffer, test_pattern1, sizeof(bwword)*words) != 0) { - printf("FAILED pattern match (buffer)\n"); - FLAC__bitwriter_dump(bw, stdout); - return false; - } - if((bw->accum & 0x3fffffff) != test_pattern1[words]) { - printf("FAILED pattern match (bw->accum=%08X != %08X)\n", bw->accum&0x3fffffff, test_pattern1[words]); - FLAC__bitwriter_dump(bw, stdout); - return false; - } - printf("OK\n"); - FLAC__bitwriter_dump(bw, stdout); - - printf("testing utf8_uint32(0x00000000)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint32(bw, 0x00000000); - ok = TOTAL_BITS(bw) == 8 && (bw->accum & 0xff) == 0; - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint32(0x0000007F)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint32(bw, 0x0000007F); - ok = TOTAL_BITS(bw) == 8 && (bw->accum & 0xff) == 0x7F; - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint32(0x00000080)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint32(bw, 0x00000080); - ok = TOTAL_BITS(bw) == 16 && (bw->accum & 0xffff) == 0xC280; - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint32(0x000007FF)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint32(bw, 0x000007FF); - ok = TOTAL_BITS(bw) == 16 && (bw->accum & 0xffff) == 0xDFBF; - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint32(0x00000800)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint32(bw, 0x00000800); - ok = TOTAL_BITS(bw) == 24 && (bw->accum & 0xffffff) == 0xE0A080; - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint32(0x0000FFFF)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint32(bw, 0x0000FFFF); - ok = TOTAL_BITS(bw) == 24 && (bw->accum & 0xffffff) == 0xEFBFBF; - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint32(0x00010000)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint32(bw, 0x00010000); -#if WORDS_BIGENDIAN - ok = TOTAL_BITS(bw) == 32 && bw->buffer[0] == 0xF0908080; -#else - ok = TOTAL_BITS(bw) == 32 && bw->buffer[0] == 0x808090F0; -#endif - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint32(0x001FFFFF)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint32(bw, 0x001FFFFF); -#if WORDS_BIGENDIAN - ok = TOTAL_BITS(bw) == 32 && bw->buffer[0] == 0xF7BFBFBF; -#else - ok = TOTAL_BITS(bw) == 32 && bw->buffer[0] == 0xBFBFBFF7; -#endif - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint32(0x00200000)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint32(bw, 0x00200000); -#if WORDS_BIGENDIAN - ok = TOTAL_BITS(bw) == 40 && bw->buffer[0] == 0xF8888080 && (bw->accum & 0xff) == 0x80; -#else - ok = TOTAL_BITS(bw) == 40 && bw->buffer[0] == 0x808088F8 && (bw->accum & 0xff) == 0x80; -#endif - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint32(0x03FFFFFF)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint32(bw, 0x03FFFFFF); -#if WORDS_BIGENDIAN - ok = TOTAL_BITS(bw) == 40 && bw->buffer[0] == 0xFBBFBFBF && (bw->accum & 0xff) == 0xBF; -#else - ok = TOTAL_BITS(bw) == 40 && bw->buffer[0] == 0xBFBFBFFB && (bw->accum & 0xff) == 0xBF; -#endif - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint32(0x04000000)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint32(bw, 0x04000000); -#if WORDS_BIGENDIAN - ok = TOTAL_BITS(bw) == 48 && bw->buffer[0] == 0xFC848080 && (bw->accum & 0xffff) == 0x8080; -#else - ok = TOTAL_BITS(bw) == 48 && bw->buffer[0] == 0x808084FC && (bw->accum & 0xffff) == 0x8080; -#endif - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint32(0x7FFFFFFF)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint32(bw, 0x7FFFFFFF); -#if WORDS_BIGENDIAN - ok = TOTAL_BITS(bw) == 48 && bw->buffer[0] == 0xFDBFBFBF && (bw->accum & 0xffff) == 0xBFBF; -#else - ok = TOTAL_BITS(bw) == 48 && bw->buffer[0] == 0xBFBFBFFD && (bw->accum & 0xffff) == 0xBFBF; -#endif - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint64(0x0000000000000000)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint64(bw, 0x0000000000000000); - ok = TOTAL_BITS(bw) == 8 && (bw->accum & 0xff) == 0; - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint64(0x000000000000007F)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint64(bw, 0x000000000000007F); - ok = TOTAL_BITS(bw) == 8 && (bw->accum & 0xff) == 0x7F; - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint64(0x0000000000000080)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint64(bw, 0x0000000000000080); - ok = TOTAL_BITS(bw) == 16 && (bw->accum & 0xffff) == 0xC280; - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint64(0x00000000000007FF)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint64(bw, 0x00000000000007FF); - ok = TOTAL_BITS(bw) == 16 && (bw->accum & 0xffff) == 0xDFBF; - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint64(0x0000000000000800)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint64(bw, 0x0000000000000800); - ok = TOTAL_BITS(bw) == 24 && (bw->accum & 0xffffff) == 0xE0A080; - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint64(0x000000000000FFFF)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint64(bw, 0x000000000000FFFF); - ok = TOTAL_BITS(bw) == 24 && (bw->accum & 0xffffff) == 0xEFBFBF; - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint64(0x0000000000010000)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint64(bw, 0x0000000000010000); -#if WORDS_BIGENDIAN - ok = TOTAL_BITS(bw) == 32 && bw->buffer[0] == 0xF0908080; -#else - ok = TOTAL_BITS(bw) == 32 && bw->buffer[0] == 0x808090F0; -#endif - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint64(0x00000000001FFFFF)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint64(bw, 0x00000000001FFFFF); -#if WORDS_BIGENDIAN - ok = TOTAL_BITS(bw) == 32 && bw->buffer[0] == 0xF7BFBFBF; -#else - ok = TOTAL_BITS(bw) == 32 && bw->buffer[0] == 0xBFBFBFF7; -#endif - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint64(0x0000000000200000)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint64(bw, 0x0000000000200000); -#if WORDS_BIGENDIAN - ok = TOTAL_BITS(bw) == 40 && bw->buffer[0] == 0xF8888080 && (bw->accum & 0xff) == 0x80; -#else - ok = TOTAL_BITS(bw) == 40 && bw->buffer[0] == 0x808088F8 && (bw->accum & 0xff) == 0x80; -#endif - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint64(0x0000000003FFFFFF)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint64(bw, 0x0000000003FFFFFF); -#if WORDS_BIGENDIAN - ok = TOTAL_BITS(bw) == 40 && bw->buffer[0] == 0xFBBFBFBF && (bw->accum & 0xff) == 0xBF; -#else - ok = TOTAL_BITS(bw) == 40 && bw->buffer[0] == 0xBFBFBFFB && (bw->accum & 0xff) == 0xBF; -#endif - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint64(0x0000000004000000)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint64(bw, 0x0000000004000000); -#if WORDS_BIGENDIAN - ok = TOTAL_BITS(bw) == 48 && bw->buffer[0] == 0xFC848080 && (bw->accum & 0xffff) == 0x8080; -#else - ok = TOTAL_BITS(bw) == 48 && bw->buffer[0] == 0x808084FC && (bw->accum & 0xffff) == 0x8080; -#endif - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint64(0x000000007FFFFFFF)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint64(bw, 0x000000007FFFFFFF); -#if WORDS_BIGENDIAN - ok = TOTAL_BITS(bw) == 48 && bw->buffer[0] == 0xFDBFBFBF && (bw->accum & 0xffff) == 0xBFBF; -#else - ok = TOTAL_BITS(bw) == 48 && bw->buffer[0] == 0xBFBFBFFD && (bw->accum & 0xffff) == 0xBFBF; -#endif - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint64(0x0000000080000000)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint64(bw, 0x0000000080000000); -#if WORDS_BIGENDIAN - ok = TOTAL_BITS(bw) == 56 && bw->buffer[0] == 0xFE828080 && (bw->accum & 0xffffff) == 0x808080; -#else - ok = TOTAL_BITS(bw) == 56 && bw->buffer[0] == 0x808082FE && (bw->accum & 0xffffff) == 0x808080; -#endif - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing utf8_uint64(0x0000000FFFFFFFFF)... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_utf8_uint64(bw, FLAC__U64L(0x0000000FFFFFFFFF)); -#if WORDS_BIGENDIAN - ok = TOTAL_BITS(bw) == 56 && bw->buffer[0] == 0xFEBFBFBF && (bw->accum & 0xffffff) == 0xBFBFBF; -#else - ok = TOTAL_BITS(bw) == 56 && bw->buffer[0] == 0xBFBFBFFE && (bw->accum & 0xffffff) == 0xBFBFBF; -#endif - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - - printf("testing grow... "); - FLAC__bitwriter_clear(bw); - FLAC__bitwriter_write_raw_uint32(bw, 0x5, 4); - j = bw->capacity; - for(i = 0; i < j; i++) - FLAC__bitwriter_write_raw_uint32(bw, 0xaaaaaaaa, 32); -#if WORDS_BIGENDIAN - ok = TOTAL_BITS(bw) == i*32+4 && bw->buffer[0] == 0x5aaaaaaa && (bw->accum & 0xf) == 0xa; -#else - ok = TOTAL_BITS(bw) == i*32+4 && bw->buffer[0] == 0xaaaaaa5a && (bw->accum & 0xf) == 0xa; -#endif - printf("%s\n", ok?"OK":"FAILED"); - if(!ok) { - FLAC__bitwriter_dump(bw, stdout); - return false; - } - printf("capacity = %u\n", bw->capacity); - - printf("testing free... "); - FLAC__bitwriter_free(bw); - printf("OK\n"); - - printf("testing delete... "); - FLAC__bitwriter_delete(bw); - printf("OK\n"); - - printf("\nPASSED!\n"); - return true; -} diff --git a/3rdparty/libflac/src/test_libFLAC/bitwriter.h b/3rdparty/libflac/src/test_libFLAC/bitwriter.h deleted file mode 100644 index 44b6ade55bd..00000000000 --- a/3rdparty/libflac/src/test_libFLAC/bitwriter.h +++ /dev/null @@ -1,26 +0,0 @@ -/* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef FLAC__TEST_LIBFLAC_BITBUFFER_H -#define FLAC__TEST_LIBFLAC_BITBUFFER_H - -#include "FLAC/ordinals.h" - -FLAC__bool test_bitwriter(void); - -#endif diff --git a/3rdparty/libflac/src/test_libFLAC/decoders.c b/3rdparty/libflac/src/test_libFLAC/decoders.c deleted file mode 100644 index 1d731cd484d..00000000000 --- a/3rdparty/libflac/src/test_libFLAC/decoders.c +++ /dev/null @@ -1,1048 +0,0 @@ -/* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <errno.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#if defined _MSC_VER || defined __MINGW32__ -#if _MSC_VER <= 1600 /* @@@ [2G limit] */ -#define fseeko fseek -#define ftello ftell -#endif -#endif -#include "decoders.h" -#include "FLAC/assert.h" -#include "FLAC/stream_decoder.h" -#include "share/grabbag.h" -#include "test_libs_common/file_utils_flac.h" -#include "test_libs_common/metadata_utils.h" - -typedef enum { - LAYER_STREAM = 0, /* FLAC__stream_decoder_init_[ogg_]stream() without seeking */ - LAYER_SEEKABLE_STREAM, /* FLAC__stream_decoder_init_[ogg_]stream() with seeking */ - LAYER_FILE, /* FLAC__stream_decoder_init_[ogg_]FILE() */ - LAYER_FILENAME /* FLAC__stream_decoder_init_[ogg_]file() */ -} Layer; - -static const char * const LayerString[] = { - "Stream", - "Seekable Stream", - "FILE*", - "Filename" -}; - -typedef struct { - Layer layer; - FILE *file; - unsigned current_metadata_number; - FLAC__bool ignore_errors; - FLAC__bool error_occurred; -} StreamDecoderClientData; - -static FLAC__StreamMetadata streaminfo_, padding_, seektable_, application1_, application2_, vorbiscomment_, cuesheet_, picture_, unknown_; -static FLAC__StreamMetadata *expected_metadata_sequence_[9]; -static unsigned num_expected_; -static off_t flacfilesize_; - -static const char *flacfilename(FLAC__bool is_ogg) -{ - return is_ogg? "metadata.oga" : "metadata.flac"; -} - -static FLAC__bool die_(const char *msg) -{ - printf("ERROR: %s\n", msg); - return false; -} - -static FLAC__bool die_s_(const char *msg, const FLAC__StreamDecoder *decoder) -{ - FLAC__StreamDecoderState state = FLAC__stream_decoder_get_state(decoder); - - if(msg) - printf("FAILED, %s", msg); - else - printf("FAILED"); - - printf(", state = %u (%s)\n", (unsigned)state, FLAC__StreamDecoderStateString[state]); - - return false; -} - -static void init_metadata_blocks_(void) -{ - mutils__init_metadata_blocks(&streaminfo_, &padding_, &seektable_, &application1_, &application2_, &vorbiscomment_, &cuesheet_, &picture_, &unknown_); -} - -static void free_metadata_blocks_(void) -{ - mutils__free_metadata_blocks(&streaminfo_, &padding_, &seektable_, &application1_, &application2_, &vorbiscomment_, &cuesheet_, &picture_, &unknown_); -} - -static FLAC__bool generate_file_(FLAC__bool is_ogg) -{ - printf("\n\ngenerating %sFLAC file for decoder tests...\n", is_ogg? "Ogg ":""); - - num_expected_ = 0; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &application1_; - expected_metadata_sequence_[num_expected_++] = &application2_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - /* WATCHOUT: for Ogg FLAC the encoder should move the VORBIS_COMMENT block to the front, right after STREAMINFO */ - - if(!file_utils__generate_flacfile(is_ogg, flacfilename(is_ogg), &flacfilesize_, 512 * 1024, &streaminfo_, expected_metadata_sequence_, num_expected_)) - return die_("creating the encoded file"); - - return true; -} - -static FLAC__StreamDecoderReadStatus stream_decoder_read_callback_(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data) -{ - StreamDecoderClientData *dcd = (StreamDecoderClientData*)client_data; - const size_t requested_bytes = *bytes; - - (void)decoder; - - if(0 == dcd) { - printf("ERROR: client_data in read callback is NULL\n"); - return FLAC__STREAM_DECODER_READ_STATUS_ABORT; - } - - if(dcd->error_occurred) - return FLAC__STREAM_DECODER_READ_STATUS_ABORT; - - if(feof(dcd->file)) { - *bytes = 0; - return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; - } - else if(requested_bytes > 0) { - *bytes = fread(buffer, 1, requested_bytes, dcd->file); - if(*bytes == 0) { - if(feof(dcd->file)) - return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; - else - return FLAC__STREAM_DECODER_READ_STATUS_ABORT; - } - else { - return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; - } - } - else - return FLAC__STREAM_DECODER_READ_STATUS_ABORT; /* abort to avoid a deadlock */ -} - -static FLAC__StreamDecoderSeekStatus stream_decoder_seek_callback_(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) -{ - StreamDecoderClientData *dcd = (StreamDecoderClientData*)client_data; - - (void)decoder; - - if(0 == dcd) { - printf("ERROR: client_data in seek callback is NULL\n"); - return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; - } - - if(dcd->error_occurred) - return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; - - if(fseeko(dcd->file, (off_t)absolute_byte_offset, SEEK_SET) < 0) { - dcd->error_occurred = true; - return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; - } - - return FLAC__STREAM_DECODER_SEEK_STATUS_OK; -} - -static FLAC__StreamDecoderTellStatus stream_decoder_tell_callback_(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data) -{ - StreamDecoderClientData *dcd = (StreamDecoderClientData*)client_data; - off_t offset; - - (void)decoder; - - if(0 == dcd) { - printf("ERROR: client_data in tell callback is NULL\n"); - return FLAC__STREAM_DECODER_TELL_STATUS_ERROR; - } - - if(dcd->error_occurred) - return FLAC__STREAM_DECODER_TELL_STATUS_ERROR; - - offset = ftello(dcd->file); - *absolute_byte_offset = (FLAC__uint64)offset; - - if(offset < 0) { - dcd->error_occurred = true; - return FLAC__STREAM_DECODER_TELL_STATUS_ERROR; - } - - return FLAC__STREAM_DECODER_TELL_STATUS_OK; -} - -static FLAC__StreamDecoderLengthStatus stream_decoder_length_callback_(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data) -{ - StreamDecoderClientData *dcd = (StreamDecoderClientData*)client_data; - - (void)decoder; - - if(0 == dcd) { - printf("ERROR: client_data in length callback is NULL\n"); - return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR; - } - - if(dcd->error_occurred) - return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR; - - *stream_length = (FLAC__uint64)flacfilesize_; - return FLAC__STREAM_DECODER_LENGTH_STATUS_OK; -} - -static FLAC__bool stream_decoder_eof_callback_(const FLAC__StreamDecoder *decoder, void *client_data) -{ - StreamDecoderClientData *dcd = (StreamDecoderClientData*)client_data; - - (void)decoder; - - if(0 == dcd) { - printf("ERROR: client_data in eof callback is NULL\n"); - return true; - } - - if(dcd->error_occurred) - return true; - - return feof(dcd->file); -} - -static FLAC__StreamDecoderWriteStatus stream_decoder_write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data) -{ - StreamDecoderClientData *dcd = (StreamDecoderClientData*)client_data; - - (void)decoder, (void)buffer; - - if(0 == dcd) { - printf("ERROR: client_data in write callback is NULL\n"); - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - } - - if(dcd->error_occurred) - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - - if( - (frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER && frame->header.number.frame_number == 0) || - (frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER && frame->header.number.sample_number == 0) - ) { - printf("content... "); - fflush(stdout); - } - - return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; -} - -static void stream_decoder_metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) -{ - StreamDecoderClientData *dcd = (StreamDecoderClientData*)client_data; - - (void)decoder; - - if(0 == dcd) { - printf("ERROR: client_data in metadata callback is NULL\n"); - return; - } - - if(dcd->error_occurred) - return; - - printf("%d... ", dcd->current_metadata_number); - fflush(stdout); - - if(dcd->current_metadata_number >= num_expected_) { - (void)die_("got more metadata blocks than expected"); - dcd->error_occurred = true; - } - else { - if(!mutils__compare_block(expected_metadata_sequence_[dcd->current_metadata_number], metadata)) { - (void)die_("metadata block mismatch"); - dcd->error_occurred = true; - } - } - dcd->current_metadata_number++; -} - -static void stream_decoder_error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) -{ - StreamDecoderClientData *dcd = (StreamDecoderClientData*)client_data; - - (void)decoder; - - if(0 == dcd) { - printf("ERROR: client_data in error callback is NULL\n"); - return; - } - - if(!dcd->ignore_errors) { - printf("ERROR: got error callback: err = %u (%s)\n", (unsigned)status, FLAC__StreamDecoderErrorStatusString[status]); - dcd->error_occurred = true; - } -} - -static FLAC__bool stream_decoder_test_respond_(FLAC__StreamDecoder *decoder, StreamDecoderClientData *dcd, FLAC__bool is_ogg) -{ - FLAC__StreamDecoderInitStatus init_status; - - if(!FLAC__stream_decoder_set_md5_checking(decoder, true)) - return die_s_("at FLAC__stream_decoder_set_md5_checking(), returned false", decoder); - - /* for FLAC__stream_encoder_init_FILE(), the FLAC__stream_encoder_finish() closes the file so we have to keep re-opening: */ - if(dcd->layer == LAYER_FILE) { - printf("opening %sFLAC file... ", is_ogg? "Ogg ":""); - dcd->file = fopen(flacfilename(is_ogg), "rb"); - if(0 == dcd->file) { - printf("ERROR (%s)\n", strerror(errno)); - return false; - } - printf("OK\n"); - } - - switch(dcd->layer) { - case LAYER_STREAM: - printf("testing FLAC__stream_decoder_init_%sstream()... ", is_ogg? "ogg_":""); - init_status = is_ogg? - FLAC__stream_decoder_init_ogg_stream(decoder, stream_decoder_read_callback_, /*seek_callback=*/0, /*tell_callback=*/0, /*length_callback=*/0, /*eof_callback=*/0, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, dcd) : - FLAC__stream_decoder_init_stream(decoder, stream_decoder_read_callback_, /*seek_callback=*/0, /*tell_callback=*/0, /*length_callback=*/0, /*eof_callback=*/0, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, dcd) - ; - break; - case LAYER_SEEKABLE_STREAM: - printf("testing FLAC__stream_decoder_init_%sstream()... ", is_ogg? "ogg_":""); - init_status = is_ogg? - FLAC__stream_decoder_init_ogg_stream(decoder, stream_decoder_read_callback_, stream_decoder_seek_callback_, stream_decoder_tell_callback_, stream_decoder_length_callback_, stream_decoder_eof_callback_, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, dcd) : - FLAC__stream_decoder_init_stream(decoder, stream_decoder_read_callback_, stream_decoder_seek_callback_, stream_decoder_tell_callback_, stream_decoder_length_callback_, stream_decoder_eof_callback_, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, dcd); - break; - case LAYER_FILE: - printf("testing FLAC__stream_decoder_init_%sFILE()... ", is_ogg? "ogg_":""); - init_status = is_ogg? - FLAC__stream_decoder_init_ogg_FILE(decoder, dcd->file, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, dcd) : - FLAC__stream_decoder_init_FILE(decoder, dcd->file, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, dcd); - break; - case LAYER_FILENAME: - printf("testing FLAC__stream_decoder_init_%sfile()... ", is_ogg? "ogg_":""); - init_status = is_ogg? - FLAC__stream_decoder_init_ogg_file(decoder, flacfilename(is_ogg), stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, dcd) : - FLAC__stream_decoder_init_file(decoder, flacfilename(is_ogg), stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, dcd); - break; - default: - die_("internal error 000"); - return false; - } - if(init_status != FLAC__STREAM_DECODER_INIT_STATUS_OK) - return die_s_(0, decoder); - printf("OK\n"); - - dcd->current_metadata_number = 0; - - if(dcd->layer < LAYER_FILE && fseeko(dcd->file, 0, SEEK_SET) < 0) { - printf("FAILED rewinding input, errno = %d\n", errno); - return false; - } - - printf("testing FLAC__stream_decoder_process_until_end_of_stream()... "); - if(!FLAC__stream_decoder_process_until_end_of_stream(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_finish()... "); - if(!FLAC__stream_decoder_finish(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - return true; -} - -static FLAC__bool test_stream_decoder(Layer layer, FLAC__bool is_ogg) -{ - FLAC__StreamDecoder *decoder; - FLAC__StreamDecoderInitStatus init_status; - FLAC__StreamDecoderState state; - StreamDecoderClientData decoder_client_data; - FLAC__bool expect; - - decoder_client_data.layer = layer; - - printf("\n+++ libFLAC unit test: FLAC__StreamDecoder (layer: %s, format: %s)\n\n", LayerString[layer], is_ogg? "Ogg FLAC" : "FLAC"); - - printf("testing FLAC__stream_decoder_new()... "); - decoder = FLAC__stream_decoder_new(); - if(0 == decoder) { - printf("FAILED, returned NULL\n"); - return false; - } - printf("OK\n"); - - printf("testing FLAC__stream_decoder_delete()... "); - FLAC__stream_decoder_delete(decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_new()... "); - decoder = FLAC__stream_decoder_new(); - if(0 == decoder) { - printf("FAILED, returned NULL\n"); - return false; - } - printf("OK\n"); - - switch(layer) { - case LAYER_STREAM: - case LAYER_SEEKABLE_STREAM: - printf("testing FLAC__stream_decoder_init_%sstream()... ", is_ogg? "ogg_":""); - init_status = is_ogg? - FLAC__stream_decoder_init_ogg_stream(decoder, 0, 0, 0, 0, 0, 0, 0, 0, 0) : - FLAC__stream_decoder_init_stream(decoder, 0, 0, 0, 0, 0, 0, 0, 0, 0); - break; - case LAYER_FILE: - printf("testing FLAC__stream_decoder_init_%sFILE()... ", is_ogg? "ogg_":""); - init_status = is_ogg? - FLAC__stream_decoder_init_ogg_FILE(decoder, stdin, 0, 0, 0, 0) : - FLAC__stream_decoder_init_FILE(decoder, stdin, 0, 0, 0, 0); - break; - case LAYER_FILENAME: - printf("testing FLAC__stream_decoder_init_%sfile()... ", is_ogg? "ogg_":""); - init_status = is_ogg? - FLAC__stream_decoder_init_ogg_file(decoder, flacfilename(is_ogg), 0, 0, 0, 0) : - FLAC__stream_decoder_init_file(decoder, flacfilename(is_ogg), 0, 0, 0, 0); - break; - default: - die_("internal error 003"); - return false; - } - if(init_status != FLAC__STREAM_DECODER_INIT_STATUS_INVALID_CALLBACKS) - return die_s_(0, decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_delete()... "); - FLAC__stream_decoder_delete(decoder); - printf("OK\n"); - - num_expected_ = 0; - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - - printf("testing FLAC__stream_decoder_new()... "); - decoder = FLAC__stream_decoder_new(); - if(0 == decoder) { - printf("FAILED, returned NULL\n"); - return false; - } - printf("OK\n"); - - if(is_ogg) { - printf("testing FLAC__stream_decoder_set_ogg_serial_number()... "); - if(!FLAC__stream_decoder_set_ogg_serial_number(decoder, file_utils__ogg_serial_number)) - return die_s_("returned false", decoder); - printf("OK\n"); - } - - printf("testing FLAC__stream_decoder_set_md5_checking()... "); - if(!FLAC__stream_decoder_set_md5_checking(decoder, true)) - return die_s_("returned false", decoder); - printf("OK\n"); - - if(layer < LAYER_FILENAME) { - printf("opening %sFLAC file... ", is_ogg? "Ogg ":""); - decoder_client_data.file = fopen(flacfilename(is_ogg), "rb"); - if(0 == decoder_client_data.file) { - printf("ERROR (%s)\n", strerror(errno)); - return false; - } - printf("OK\n"); - } - - switch(layer) { - case LAYER_STREAM: - printf("testing FLAC__stream_decoder_init_%sstream()... ", is_ogg? "ogg_":""); - init_status = is_ogg? - FLAC__stream_decoder_init_ogg_stream(decoder, stream_decoder_read_callback_, /*seek_callback=*/0, /*tell_callback=*/0, /*length_callback=*/0, /*eof_callback=*/0, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, &decoder_client_data) : - FLAC__stream_decoder_init_stream(decoder, stream_decoder_read_callback_, /*seek_callback=*/0, /*tell_callback=*/0, /*length_callback=*/0, /*eof_callback=*/0, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, &decoder_client_data); - break; - case LAYER_SEEKABLE_STREAM: - printf("testing FLAC__stream_decoder_init_%sstream()... ", is_ogg? "ogg_":""); - init_status = is_ogg? - FLAC__stream_decoder_init_ogg_stream(decoder, stream_decoder_read_callback_, stream_decoder_seek_callback_, stream_decoder_tell_callback_, stream_decoder_length_callback_, stream_decoder_eof_callback_, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, &decoder_client_data) : - FLAC__stream_decoder_init_stream(decoder, stream_decoder_read_callback_, stream_decoder_seek_callback_, stream_decoder_tell_callback_, stream_decoder_length_callback_, stream_decoder_eof_callback_, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, &decoder_client_data); - break; - case LAYER_FILE: - printf("testing FLAC__stream_decoder_init_%sFILE()... ", is_ogg? "ogg_":""); - init_status = is_ogg? - FLAC__stream_decoder_init_ogg_FILE(decoder, decoder_client_data.file, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, &decoder_client_data) : - FLAC__stream_decoder_init_FILE(decoder, decoder_client_data.file, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, &decoder_client_data); - break; - case LAYER_FILENAME: - printf("testing FLAC__stream_decoder_init_%sfile()... ", is_ogg? "ogg_":""); - init_status = is_ogg? - FLAC__stream_decoder_init_ogg_file(decoder, flacfilename(is_ogg), stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, &decoder_client_data) : - FLAC__stream_decoder_init_file(decoder, flacfilename(is_ogg), stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, &decoder_client_data); - break; - default: - die_("internal error 009"); - return false; - } - if(init_status != FLAC__STREAM_DECODER_INIT_STATUS_OK) - return die_s_(0, decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_get_state()... "); - state = FLAC__stream_decoder_get_state(decoder); - printf("returned state = %u (%s)... OK\n", state, FLAC__StreamDecoderStateString[state]); - - decoder_client_data.current_metadata_number = 0; - decoder_client_data.ignore_errors = false; - decoder_client_data.error_occurred = false; - - printf("testing FLAC__stream_decoder_get_md5_checking()... "); - if(!FLAC__stream_decoder_get_md5_checking(decoder)) { - printf("FAILED, returned false, expected true\n"); - return false; - } - printf("OK\n"); - - printf("testing FLAC__stream_decoder_process_until_end_of_metadata()... "); - if(!FLAC__stream_decoder_process_until_end_of_metadata(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_process_single()... "); - if(!FLAC__stream_decoder_process_single(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_skip_single_frame()... "); - if(!FLAC__stream_decoder_skip_single_frame(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - if(layer < LAYER_FILE) { - printf("testing FLAC__stream_decoder_flush()... "); - if(!FLAC__stream_decoder_flush(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - decoder_client_data.ignore_errors = true; - printf("testing FLAC__stream_decoder_process_single()... "); - if(!FLAC__stream_decoder_process_single(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - decoder_client_data.ignore_errors = false; - } - - expect = (layer != LAYER_STREAM); - printf("testing FLAC__stream_decoder_seek_absolute()... "); - if(FLAC__stream_decoder_seek_absolute(decoder, 0) != expect) - return die_s_(expect? "returned false" : "returned true", decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_process_until_end_of_stream()... "); - if(!FLAC__stream_decoder_process_until_end_of_stream(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - expect = (layer != LAYER_STREAM); - printf("testing FLAC__stream_decoder_seek_absolute()... "); - if(FLAC__stream_decoder_seek_absolute(decoder, 0) != expect) - return die_s_(expect? "returned false" : "returned true", decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_get_channels()... "); - { - unsigned channels = FLAC__stream_decoder_get_channels(decoder); - if(channels != streaminfo_.data.stream_info.channels) { - printf("FAILED, returned %u, expected %u\n", channels, streaminfo_.data.stream_info.channels); - return false; - } - } - printf("OK\n"); - - printf("testing FLAC__stream_decoder_get_bits_per_sample()... "); - { - unsigned bits_per_sample = FLAC__stream_decoder_get_bits_per_sample(decoder); - if(bits_per_sample != streaminfo_.data.stream_info.bits_per_sample) { - printf("FAILED, returned %u, expected %u\n", bits_per_sample, streaminfo_.data.stream_info.bits_per_sample); - return false; - } - } - printf("OK\n"); - - printf("testing FLAC__stream_decoder_get_sample_rate()... "); - { - unsigned sample_rate = FLAC__stream_decoder_get_sample_rate(decoder); - if(sample_rate != streaminfo_.data.stream_info.sample_rate) { - printf("FAILED, returned %u, expected %u\n", sample_rate, streaminfo_.data.stream_info.sample_rate); - return false; - } - } - printf("OK\n"); - - printf("testing FLAC__stream_decoder_get_blocksize()... "); - { - unsigned blocksize = FLAC__stream_decoder_get_blocksize(decoder); - /* value could be anything since we're at the last block, so accept any reasonable answer */ - printf("returned %u... %s\n", blocksize, blocksize>0? "OK" : "FAILED"); - if(blocksize == 0) - return false; - } - - printf("testing FLAC__stream_decoder_get_channel_assignment()... "); - { - FLAC__ChannelAssignment ca = FLAC__stream_decoder_get_channel_assignment(decoder); - printf("returned %u (%s)... OK\n", (unsigned)ca, FLAC__ChannelAssignmentString[ca]); - } - - if(layer < LAYER_FILE) { - printf("testing FLAC__stream_decoder_reset()... "); - if(!FLAC__stream_decoder_reset(decoder)) { - state = FLAC__stream_decoder_get_state(decoder); - printf("FAILED, returned false, state = %u (%s)\n", state, FLAC__StreamDecoderStateString[state]); - return false; - } - printf("OK\n"); - - if(layer == LAYER_STREAM) { - /* after a reset() we have to rewind the input ourselves */ - printf("rewinding input... "); - if(fseeko(decoder_client_data.file, 0, SEEK_SET) < 0) { - printf("FAILED, errno = %d\n", errno); - return false; - } - printf("OK\n"); - } - - decoder_client_data.current_metadata_number = 0; - - printf("testing FLAC__stream_decoder_process_until_end_of_stream()... "); - if(!FLAC__stream_decoder_process_until_end_of_stream(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - } - - printf("testing FLAC__stream_decoder_finish()... "); - if(!FLAC__stream_decoder_finish(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - /* - * respond all - */ - - printf("testing FLAC__stream_decoder_set_metadata_respond_all()... "); - if(!FLAC__stream_decoder_set_metadata_respond_all(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - num_expected_ = 0; - if(is_ogg) { /* encoder moves vorbis comment after streaminfo according to ogg mapping */ - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &application1_; - expected_metadata_sequence_[num_expected_++] = &application2_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - else { - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &application1_; - expected_metadata_sequence_[num_expected_++] = &application2_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - - if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg)) - return false; - - /* - * ignore all - */ - - printf("testing FLAC__stream_decoder_set_metadata_ignore_all()... "); - if(!FLAC__stream_decoder_set_metadata_ignore_all(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - num_expected_ = 0; - - if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg)) - return false; - - /* - * respond all, ignore VORBIS_COMMENT - */ - - printf("testing FLAC__stream_decoder_set_metadata_respond_all()... "); - if(!FLAC__stream_decoder_set_metadata_respond_all(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_set_metadata_ignore(VORBIS_COMMENT)... "); - if(!FLAC__stream_decoder_set_metadata_ignore(decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT)) - return die_s_("returned false", decoder); - printf("OK\n"); - - num_expected_ = 0; - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &application1_; - expected_metadata_sequence_[num_expected_++] = &application2_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - - if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg)) - return false; - - /* - * respond all, ignore APPLICATION - */ - - printf("testing FLAC__stream_decoder_set_metadata_respond_all()... "); - if(!FLAC__stream_decoder_set_metadata_respond_all(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_set_metadata_ignore(APPLICATION)... "); - if(!FLAC__stream_decoder_set_metadata_ignore(decoder, FLAC__METADATA_TYPE_APPLICATION)) - return die_s_("returned false", decoder); - printf("OK\n"); - - num_expected_ = 0; - if(is_ogg) { /* encoder moves vorbis comment after streaminfo according to ogg mapping */ - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - else { - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - - if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg)) - return false; - - /* - * respond all, ignore APPLICATION id of app#1 - */ - - printf("testing FLAC__stream_decoder_set_metadata_respond_all()... "); - if(!FLAC__stream_decoder_set_metadata_respond_all(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_set_metadata_ignore_application(of app block #1)... "); - if(!FLAC__stream_decoder_set_metadata_ignore_application(decoder, application1_.data.application.id)) - return die_s_("returned false", decoder); - printf("OK\n"); - - num_expected_ = 0; - if(is_ogg) { /* encoder moves vorbis comment after streaminfo according to ogg mapping */ - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &application2_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - else { - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &application2_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - - if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg)) - return false; - - /* - * respond all, ignore APPLICATION id of app#1 & app#2 - */ - - printf("testing FLAC__stream_decoder_set_metadata_respond_all()... "); - if(!FLAC__stream_decoder_set_metadata_respond_all(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_set_metadata_ignore_application(of app block #1)... "); - if(!FLAC__stream_decoder_set_metadata_ignore_application(decoder, application1_.data.application.id)) - return die_s_("returned false", decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_set_metadata_ignore_application(of app block #2)... "); - if(!FLAC__stream_decoder_set_metadata_ignore_application(decoder, application2_.data.application.id)) - return die_s_("returned false", decoder); - printf("OK\n"); - - num_expected_ = 0; - if(is_ogg) { /* encoder moves vorbis comment after streaminfo according to ogg mapping */ - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - else { - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - - if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg)) - return false; - - /* - * ignore all, respond VORBIS_COMMENT - */ - - printf("testing FLAC__stream_decoder_set_metadata_ignore_all()... "); - if(!FLAC__stream_decoder_set_metadata_ignore_all(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_set_metadata_respond(VORBIS_COMMENT)... "); - if(!FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT)) - return die_s_("returned false", decoder); - printf("OK\n"); - - num_expected_ = 0; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - - if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg)) - return false; - - /* - * ignore all, respond APPLICATION - */ - - printf("testing FLAC__stream_decoder_set_metadata_ignore_all()... "); - if(!FLAC__stream_decoder_set_metadata_ignore_all(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_set_metadata_respond(APPLICATION)... "); - if(!FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_APPLICATION)) - return die_s_("returned false", decoder); - printf("OK\n"); - - num_expected_ = 0; - expected_metadata_sequence_[num_expected_++] = &application1_; - expected_metadata_sequence_[num_expected_++] = &application2_; - - if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg)) - return false; - - /* - * ignore all, respond APPLICATION id of app#1 - */ - - printf("testing FLAC__stream_decoder_set_metadata_ignore_all()... "); - if(!FLAC__stream_decoder_set_metadata_ignore_all(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_set_metadata_respond_application(of app block #1)... "); - if(!FLAC__stream_decoder_set_metadata_respond_application(decoder, application1_.data.application.id)) - return die_s_("returned false", decoder); - printf("OK\n"); - - num_expected_ = 0; - expected_metadata_sequence_[num_expected_++] = &application1_; - - if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg)) - return false; - - /* - * ignore all, respond APPLICATION id of app#1 & app#2 - */ - - printf("testing FLAC__stream_decoder_set_metadata_ignore_all()... "); - if(!FLAC__stream_decoder_set_metadata_ignore_all(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_set_metadata_respond_application(of app block #1)... "); - if(!FLAC__stream_decoder_set_metadata_respond_application(decoder, application1_.data.application.id)) - return die_s_("returned false", decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_set_metadata_respond_application(of app block #2)... "); - if(!FLAC__stream_decoder_set_metadata_respond_application(decoder, application2_.data.application.id)) - return die_s_("returned false", decoder); - printf("OK\n"); - - num_expected_ = 0; - expected_metadata_sequence_[num_expected_++] = &application1_; - expected_metadata_sequence_[num_expected_++] = &application2_; - - if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg)) - return false; - - /* - * respond all, ignore APPLICATION, respond APPLICATION id of app#1 - */ - - printf("testing FLAC__stream_decoder_set_metadata_respond_all()... "); - if(!FLAC__stream_decoder_set_metadata_respond_all(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_set_metadata_ignore(APPLICATION)... "); - if(!FLAC__stream_decoder_set_metadata_ignore(decoder, FLAC__METADATA_TYPE_APPLICATION)) - return die_s_("returned false", decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_set_metadata_respond_application(of app block #1)... "); - if(!FLAC__stream_decoder_set_metadata_respond_application(decoder, application1_.data.application.id)) - return die_s_("returned false", decoder); - printf("OK\n"); - - num_expected_ = 0; - if(is_ogg) { /* encoder moves vorbis comment after streaminfo according to ogg mapping */ - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &application1_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - else { - expected_metadata_sequence_[num_expected_++] = &streaminfo_; - expected_metadata_sequence_[num_expected_++] = &padding_; - expected_metadata_sequence_[num_expected_++] = &seektable_; - expected_metadata_sequence_[num_expected_++] = &application1_; - expected_metadata_sequence_[num_expected_++] = &vorbiscomment_; - expected_metadata_sequence_[num_expected_++] = &cuesheet_; - expected_metadata_sequence_[num_expected_++] = &picture_; - expected_metadata_sequence_[num_expected_++] = &unknown_; - } - - if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg)) - return false; - - /* - * ignore all, respond APPLICATION, ignore APPLICATION id of app#1 - */ - - printf("testing FLAC__stream_decoder_set_metadata_ignore_all()... "); - if(!FLAC__stream_decoder_set_metadata_ignore_all(decoder)) - return die_s_("returned false", decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_set_metadata_respond(APPLICATION)... "); - if(!FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_APPLICATION)) - return die_s_("returned false", decoder); - printf("OK\n"); - - printf("testing FLAC__stream_decoder_set_metadata_ignore_application(of app block #1)... "); - if(!FLAC__stream_decoder_set_metadata_ignore_application(decoder, application1_.data.application.id)) - return die_s_("returned false", decoder); - printf("OK\n"); - - num_expected_ = 0; - expected_metadata_sequence_[num_expected_++] = &application2_; - - if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg)) - return false; - - if(layer < LAYER_FILE) /* for LAYER_FILE, FLAC__stream_decoder_finish() closes the file */ - fclose(decoder_client_data.file); - - printf("testing FLAC__stream_decoder_delete()... "); - FLAC__stream_decoder_delete(decoder); - printf("OK\n"); - - printf("\nPASSED!\n"); - - return true; -} - -FLAC__bool test_decoders(void) -{ - FLAC__bool is_ogg = false; - - while(1) { - init_metadata_blocks_(); - - if(!generate_file_(is_ogg)) - return false; - - if(!test_stream_decoder(LAYER_STREAM, is_ogg)) - return false; - - if(!test_stream_decoder(LAYER_SEEKABLE_STREAM, is_ogg)) - return false; - - if(!test_stream_decoder(LAYER_FILE, is_ogg)) - return false; - - if(!test_stream_decoder(LAYER_FILENAME, is_ogg)) - return false; - - (void) grabbag__file_remove_file(flacfilename(is_ogg)); - - free_metadata_blocks_(); - - if(!FLAC_API_SUPPORTS_OGG_FLAC || is_ogg) - break; - is_ogg = true; - } - - return true; -} diff --git a/3rdparty/libflac/src/test_libFLAC/decoders.h b/3rdparty/libflac/src/test_libFLAC/decoders.h deleted file mode 100644 index 11df1062752..00000000000 --- a/3rdparty/libflac/src/test_libFLAC/decoders.h +++ /dev/null @@ -1,26 +0,0 @@ -/* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef FLAC__TEST_LIBFLAC_DECODERS_H -#define FLAC__TEST_LIBFLAC_DECODERS_H - -#include "FLAC/ordinals.h" - -FLAC__bool test_decoders(void); - -#endif diff --git a/3rdparty/libflac/src/test_libFLAC/encoders.c b/3rdparty/libflac/src/test_libFLAC/encoders.c deleted file mode 100644 index 5927cb832d2..00000000000 --- a/3rdparty/libflac/src/test_libFLAC/encoders.c +++ /dev/null @@ -1,521 +0,0 @@ -/* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <errno.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "encoders.h" -#include "FLAC/assert.h" -#include "FLAC/stream_encoder.h" -#include "share/grabbag.h" -#include "test_libs_common/file_utils_flac.h" -#include "test_libs_common/metadata_utils.h" - -typedef enum { - LAYER_STREAM = 0, /* FLAC__stream_encoder_init_[ogg_]stream() without seeking */ - LAYER_SEEKABLE_STREAM, /* FLAC__stream_encoder_init_[ogg_]stream() with seeking */ - LAYER_FILE, /* FLAC__stream_encoder_init_[ogg_]FILE() */ - LAYER_FILENAME /* FLAC__stream_encoder_init_[ogg_]file() */ -} Layer; - -static const char * const LayerString[] = { - "Stream", - "Seekable Stream", - "FILE*", - "Filename" -}; - -static FLAC__StreamMetadata streaminfo_, padding_, seektable_, application1_, application2_, vorbiscomment_, cuesheet_, picture_, unknown_; -static FLAC__StreamMetadata *metadata_sequence_[] = { &vorbiscomment_, &padding_, &seektable_, &application1_, &application2_, &cuesheet_, &picture_, &unknown_ }; -static const unsigned num_metadata_ = sizeof(metadata_sequence_) / sizeof(metadata_sequence_[0]); - -static const char *flacfilename(FLAC__bool is_ogg) -{ - return is_ogg? "metadata.oga" : "metadata.flac"; -} - -static FLAC__bool die_(const char *msg) -{ - printf("ERROR: %s\n", msg); - return false; -} - -static FLAC__bool die_s_(const char *msg, const FLAC__StreamEncoder *encoder) -{ - FLAC__StreamEncoderState state = FLAC__stream_encoder_get_state(encoder); - - if(msg) - printf("FAILED, %s", msg); - else - printf("FAILED"); - - printf(", state = %u (%s)\n", (unsigned)state, FLAC__StreamEncoderStateString[state]); - if(state == FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR) { - FLAC__StreamDecoderState dstate = FLAC__stream_encoder_get_verify_decoder_state(encoder); - printf(" verify decoder state = %u (%s)\n", (unsigned)dstate, FLAC__StreamDecoderStateString[dstate]); - } - - return false; -} - -static void init_metadata_blocks_(void) -{ - mutils__init_metadata_blocks(&streaminfo_, &padding_, &seektable_, &application1_, &application2_, &vorbiscomment_, &cuesheet_, &picture_, &unknown_); -} - -static void free_metadata_blocks_(void) -{ - mutils__free_metadata_blocks(&streaminfo_, &padding_, &seektable_, &application1_, &application2_, &vorbiscomment_, &cuesheet_, &picture_, &unknown_); -} - -static FLAC__StreamEncoderReadStatus stream_encoder_read_callback_(const FLAC__StreamEncoder *encoder, FLAC__byte buffer[], size_t *bytes, void *client_data) -{ - FILE *f = (FILE*)client_data; - (void)encoder; - if(*bytes > 0) { - *bytes = fread(buffer, sizeof(FLAC__byte), *bytes, f); - if(ferror(f)) - return FLAC__STREAM_ENCODER_READ_STATUS_ABORT; - else if(*bytes == 0) - return FLAC__STREAM_ENCODER_READ_STATUS_END_OF_STREAM; - else - return FLAC__STREAM_ENCODER_READ_STATUS_CONTINUE; - } - else - return FLAC__STREAM_ENCODER_READ_STATUS_ABORT; -} - -static FLAC__StreamEncoderWriteStatus stream_encoder_write_callback_(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data) -{ - FILE *f = (FILE*)client_data; - (void)encoder, (void)samples, (void)current_frame; - if(fwrite(buffer, 1, bytes, f) != bytes) - return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR; - else - return FLAC__STREAM_ENCODER_WRITE_STATUS_OK; -} - -static FLAC__StreamEncoderSeekStatus stream_encoder_seek_callback_(const FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data) -{ - FILE *f = (FILE*)client_data; - (void)encoder; - if(fseek(f, (long)absolute_byte_offset, SEEK_SET) < 0) - return FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR; - else - return FLAC__STREAM_ENCODER_SEEK_STATUS_OK; -} - -static FLAC__StreamEncoderTellStatus stream_encoder_tell_callback_(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data) -{ - FILE *f = (FILE*)client_data; - long pos; - (void)encoder; - if((pos = ftell(f)) < 0) - return FLAC__STREAM_ENCODER_TELL_STATUS_ERROR; - else { - *absolute_byte_offset = (FLAC__uint64)pos; - return FLAC__STREAM_ENCODER_TELL_STATUS_OK; - } -} - -static void stream_encoder_metadata_callback_(const FLAC__StreamEncoder *encoder, const FLAC__StreamMetadata *metadata, void *client_data) -{ - (void)encoder, (void)metadata, (void)client_data; -} - -static void stream_encoder_progress_callback_(const FLAC__StreamEncoder *encoder, FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate, void *client_data) -{ - (void)encoder, (void)bytes_written, (void)samples_written, (void)frames_written, (void)total_frames_estimate, (void)client_data; -} - -static FLAC__bool test_stream_encoder(Layer layer, FLAC__bool is_ogg) -{ - FLAC__StreamEncoder *encoder; - FLAC__StreamEncoderInitStatus init_status; - FLAC__StreamEncoderState state; - FLAC__StreamDecoderState dstate; - FILE *file = 0; - FLAC__int32 samples[1024]; - FLAC__int32 *samples_array[1]; - unsigned i; - - samples_array[0] = samples; - - printf("\n+++ libFLAC unit test: FLAC__StreamEncoder (layer: %s, format: %s)\n\n", LayerString[layer], is_ogg? "Ogg FLAC":"FLAC"); - - printf("testing FLAC__stream_encoder_new()... "); - encoder = FLAC__stream_encoder_new(); - if(0 == encoder) { - printf("FAILED, returned NULL\n"); - return false; - } - printf("OK\n"); - - if(is_ogg) { - printf("testing FLAC__stream_encoder_set_ogg_serial_number()... "); - if(!FLAC__stream_encoder_set_ogg_serial_number(encoder, file_utils__ogg_serial_number)) - return die_s_("returned false", encoder); - printf("OK\n"); - } - - printf("testing FLAC__stream_encoder_set_verify()... "); - if(!FLAC__stream_encoder_set_verify(encoder, true)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_set_streamable_subset()... "); - if(!FLAC__stream_encoder_set_streamable_subset(encoder, true)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_set_channels()... "); - if(!FLAC__stream_encoder_set_channels(encoder, streaminfo_.data.stream_info.channels)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_set_bits_per_sample()... "); - if(!FLAC__stream_encoder_set_bits_per_sample(encoder, streaminfo_.data.stream_info.bits_per_sample)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_set_sample_rate()... "); - if(!FLAC__stream_encoder_set_sample_rate(encoder, streaminfo_.data.stream_info.sample_rate)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_set_compression_level()... "); - if(!FLAC__stream_encoder_set_compression_level(encoder, (unsigned)(-1))) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_set_blocksize()... "); - if(!FLAC__stream_encoder_set_blocksize(encoder, streaminfo_.data.stream_info.min_blocksize)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_set_do_mid_side_stereo()... "); - if(!FLAC__stream_encoder_set_do_mid_side_stereo(encoder, false)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_set_loose_mid_side_stereo()... "); - if(!FLAC__stream_encoder_set_loose_mid_side_stereo(encoder, false)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_set_max_lpc_order()... "); - if(!FLAC__stream_encoder_set_max_lpc_order(encoder, 0)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_set_qlp_coeff_precision()... "); - if(!FLAC__stream_encoder_set_qlp_coeff_precision(encoder, 0)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_set_do_qlp_coeff_prec_search()... "); - if(!FLAC__stream_encoder_set_do_qlp_coeff_prec_search(encoder, false)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_set_do_escape_coding()... "); - if(!FLAC__stream_encoder_set_do_escape_coding(encoder, false)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_set_do_exhaustive_model_search()... "); - if(!FLAC__stream_encoder_set_do_exhaustive_model_search(encoder, false)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_set_min_residual_partition_order()... "); - if(!FLAC__stream_encoder_set_min_residual_partition_order(encoder, 0)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_set_max_residual_partition_order()... "); - if(!FLAC__stream_encoder_set_max_residual_partition_order(encoder, 0)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_set_rice_parameter_search_dist()... "); - if(!FLAC__stream_encoder_set_rice_parameter_search_dist(encoder, 0)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_set_total_samples_estimate()... "); - if(!FLAC__stream_encoder_set_total_samples_estimate(encoder, streaminfo_.data.stream_info.total_samples)) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_set_metadata()... "); - if(!FLAC__stream_encoder_set_metadata(encoder, metadata_sequence_, num_metadata_)) - return die_s_("returned false", encoder); - printf("OK\n"); - - if(layer < LAYER_FILENAME) { - printf("opening file for FLAC output... "); - file = fopen(flacfilename(is_ogg), "w+b"); - if(0 == file) { - printf("ERROR (%s)\n", strerror(errno)); - return false; - } - printf("OK\n"); - } - - switch(layer) { - case LAYER_STREAM: - printf("testing FLAC__stream_encoder_init_%sstream()... ", is_ogg? "ogg_":""); - init_status = is_ogg? - FLAC__stream_encoder_init_ogg_stream(encoder, /*read_callback=*/0, stream_encoder_write_callback_, /*seek_callback=*/0, /*tell_callback=*/0, stream_encoder_metadata_callback_, /*client_data=*/file) : - FLAC__stream_encoder_init_stream(encoder, stream_encoder_write_callback_, /*seek_callback=*/0, /*tell_callback=*/0, stream_encoder_metadata_callback_, /*client_data=*/file); - break; - case LAYER_SEEKABLE_STREAM: - printf("testing FLAC__stream_encoder_init_%sstream()... ", is_ogg? "ogg_":""); - init_status = is_ogg? - FLAC__stream_encoder_init_ogg_stream(encoder, stream_encoder_read_callback_, stream_encoder_write_callback_, stream_encoder_seek_callback_, stream_encoder_tell_callback_, /*metadata_callback=*/0, /*client_data=*/file) : - FLAC__stream_encoder_init_stream(encoder, stream_encoder_write_callback_, stream_encoder_seek_callback_, stream_encoder_tell_callback_, /*metadata_callback=*/0, /*client_data=*/file); - break; - case LAYER_FILE: - printf("testing FLAC__stream_encoder_init_%sFILE()... ", is_ogg? "ogg_":""); - init_status = is_ogg? - FLAC__stream_encoder_init_ogg_FILE(encoder, file, stream_encoder_progress_callback_, /*client_data=*/0) : - FLAC__stream_encoder_init_FILE(encoder, file, stream_encoder_progress_callback_, /*client_data=*/0); - break; - case LAYER_FILENAME: - printf("testing FLAC__stream_encoder_init_%sfile()... ", is_ogg? "ogg_":""); - init_status = is_ogg? - FLAC__stream_encoder_init_ogg_file(encoder, flacfilename(is_ogg), stream_encoder_progress_callback_, /*client_data=*/0) : - FLAC__stream_encoder_init_file(encoder, flacfilename(is_ogg), stream_encoder_progress_callback_, /*client_data=*/0); - break; - default: - die_("internal error 001"); - return false; - } - if(init_status != FLAC__STREAM_ENCODER_INIT_STATUS_OK) - return die_s_(0, encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_get_state()... "); - state = FLAC__stream_encoder_get_state(encoder); - printf("returned state = %u (%s)... OK\n", (unsigned)state, FLAC__StreamEncoderStateString[state]); - - printf("testing FLAC__stream_encoder_get_verify_decoder_state()... "); - dstate = FLAC__stream_encoder_get_verify_decoder_state(encoder); - printf("returned state = %u (%s)... OK\n", (unsigned)dstate, FLAC__StreamDecoderStateString[dstate]); - - { - FLAC__uint64 absolute_sample; - unsigned frame_number; - unsigned channel; - unsigned sample; - FLAC__int32 expected; - FLAC__int32 got; - - printf("testing FLAC__stream_encoder_get_verify_decoder_error_stats()... "); - FLAC__stream_encoder_get_verify_decoder_error_stats(encoder, &absolute_sample, &frame_number, &channel, &sample, &expected, &got); - printf("OK\n"); - } - - printf("testing FLAC__stream_encoder_get_verify()... "); - if(FLAC__stream_encoder_get_verify(encoder) != true) { - printf("FAILED, expected true, got false\n"); - return false; - } - printf("OK\n"); - - printf("testing FLAC__stream_encoder_get_streamable_subset()... "); - if(FLAC__stream_encoder_get_streamable_subset(encoder) != true) { - printf("FAILED, expected true, got false\n"); - return false; - } - printf("OK\n"); - - printf("testing FLAC__stream_encoder_get_do_mid_side_stereo()... "); - if(FLAC__stream_encoder_get_do_mid_side_stereo(encoder) != false) { - printf("FAILED, expected false, got true\n"); - return false; - } - printf("OK\n"); - - printf("testing FLAC__stream_encoder_get_loose_mid_side_stereo()... "); - if(FLAC__stream_encoder_get_loose_mid_side_stereo(encoder) != false) { - printf("FAILED, expected false, got true\n"); - return false; - } - printf("OK\n"); - - printf("testing FLAC__stream_encoder_get_channels()... "); - if(FLAC__stream_encoder_get_channels(encoder) != streaminfo_.data.stream_info.channels) { - printf("FAILED, expected %u, got %u\n", streaminfo_.data.stream_info.channels, FLAC__stream_encoder_get_channels(encoder)); - return false; - } - printf("OK\n"); - - printf("testing FLAC__stream_encoder_get_bits_per_sample()... "); - if(FLAC__stream_encoder_get_bits_per_sample(encoder) != streaminfo_.data.stream_info.bits_per_sample) { - printf("FAILED, expected %u, got %u\n", streaminfo_.data.stream_info.bits_per_sample, FLAC__stream_encoder_get_bits_per_sample(encoder)); - return false; - } - printf("OK\n"); - - printf("testing FLAC__stream_encoder_get_sample_rate()... "); - if(FLAC__stream_encoder_get_sample_rate(encoder) != streaminfo_.data.stream_info.sample_rate) { - printf("FAILED, expected %u, got %u\n", streaminfo_.data.stream_info.sample_rate, FLAC__stream_encoder_get_sample_rate(encoder)); - return false; - } - printf("OK\n"); - - printf("testing FLAC__stream_encoder_get_blocksize()... "); - if(FLAC__stream_encoder_get_blocksize(encoder) != streaminfo_.data.stream_info.min_blocksize) { - printf("FAILED, expected %u, got %u\n", streaminfo_.data.stream_info.min_blocksize, FLAC__stream_encoder_get_blocksize(encoder)); - return false; - } - printf("OK\n"); - - printf("testing FLAC__stream_encoder_get_max_lpc_order()... "); - if(FLAC__stream_encoder_get_max_lpc_order(encoder) != 0) { - printf("FAILED, expected %u, got %u\n", 0, FLAC__stream_encoder_get_max_lpc_order(encoder)); - return false; - } - printf("OK\n"); - - printf("testing FLAC__stream_encoder_get_qlp_coeff_precision()... "); - (void)FLAC__stream_encoder_get_qlp_coeff_precision(encoder); - /* we asked the encoder to auto select this so we accept anything */ - printf("OK\n"); - - printf("testing FLAC__stream_encoder_get_do_qlp_coeff_prec_search()... "); - if(FLAC__stream_encoder_get_do_qlp_coeff_prec_search(encoder) != false) { - printf("FAILED, expected false, got true\n"); - return false; - } - printf("OK\n"); - - printf("testing FLAC__stream_encoder_get_do_escape_coding()... "); - if(FLAC__stream_encoder_get_do_escape_coding(encoder) != false) { - printf("FAILED, expected false, got true\n"); - return false; - } - printf("OK\n"); - - printf("testing FLAC__stream_encoder_get_do_exhaustive_model_search()... "); - if(FLAC__stream_encoder_get_do_exhaustive_model_search(encoder) != false) { - printf("FAILED, expected false, got true\n"); - return false; - } - printf("OK\n"); - - printf("testing FLAC__stream_encoder_get_min_residual_partition_order()... "); - if(FLAC__stream_encoder_get_min_residual_partition_order(encoder) != 0) { - printf("FAILED, expected %u, got %u\n", 0, FLAC__stream_encoder_get_min_residual_partition_order(encoder)); - return false; - } - printf("OK\n"); - - printf("testing FLAC__stream_encoder_get_max_residual_partition_order()... "); - if(FLAC__stream_encoder_get_max_residual_partition_order(encoder) != 0) { - printf("FAILED, expected %u, got %u\n", 0, FLAC__stream_encoder_get_max_residual_partition_order(encoder)); - return false; - } - printf("OK\n"); - - printf("testing FLAC__stream_encoder_get_rice_parameter_search_dist()... "); - if(FLAC__stream_encoder_get_rice_parameter_search_dist(encoder) != 0) { - printf("FAILED, expected %u, got %u\n", 0, FLAC__stream_encoder_get_rice_parameter_search_dist(encoder)); - return false; - } - printf("OK\n"); - - printf("testing FLAC__stream_encoder_get_total_samples_estimate()... "); - if(FLAC__stream_encoder_get_total_samples_estimate(encoder) != streaminfo_.data.stream_info.total_samples) { -#ifdef _MSC_VER - printf("FAILED, expected %I64u, got %I64u\n", streaminfo_.data.stream_info.total_samples, FLAC__stream_encoder_get_total_samples_estimate(encoder)); -#else - printf("FAILED, expected %llu, got %llu\n", (unsigned long long)streaminfo_.data.stream_info.total_samples, (unsigned long long)FLAC__stream_encoder_get_total_samples_estimate(encoder)); -#endif - return false; - } - printf("OK\n"); - - /* init the dummy sample buffer */ - for(i = 0; i < sizeof(samples) / sizeof(FLAC__int32); i++) - samples[i] = i & 7; - - printf("testing FLAC__stream_encoder_process()... "); - if(!FLAC__stream_encoder_process(encoder, (const FLAC__int32 * const *)samples_array, sizeof(samples) / sizeof(FLAC__int32))) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_process_interleaved()... "); - if(!FLAC__stream_encoder_process_interleaved(encoder, samples, sizeof(samples) / sizeof(FLAC__int32))) - return die_s_("returned false", encoder); - printf("OK\n"); - - printf("testing FLAC__stream_encoder_finish()... "); - if(!FLAC__stream_encoder_finish(encoder)) - return die_s_("returned false", encoder); - printf("OK\n"); - - if(layer < LAYER_FILE) - fclose(file); - - printf("testing FLAC__stream_encoder_delete()... "); - FLAC__stream_encoder_delete(encoder); - printf("OK\n"); - - printf("\nPASSED!\n"); - - return true; -} - -FLAC__bool test_encoders(void) -{ - FLAC__bool is_ogg = false; - - while(1) { - init_metadata_blocks_(); - - if(!test_stream_encoder(LAYER_STREAM, is_ogg)) - return false; - - if(!test_stream_encoder(LAYER_SEEKABLE_STREAM, is_ogg)) - return false; - - if(!test_stream_encoder(LAYER_FILE, is_ogg)) - return false; - - if(!test_stream_encoder(LAYER_FILENAME, is_ogg)) - return false; - - (void) grabbag__file_remove_file(flacfilename(is_ogg)); - - free_metadata_blocks_(); - - if(!FLAC_API_SUPPORTS_OGG_FLAC || is_ogg) - break; - is_ogg = true; - } - - return true; -} diff --git a/3rdparty/libflac/src/test_libFLAC/encoders.h b/3rdparty/libflac/src/test_libFLAC/encoders.h deleted file mode 100644 index 86c3690943c..00000000000 --- a/3rdparty/libflac/src/test_libFLAC/encoders.h +++ /dev/null @@ -1,26 +0,0 @@ -/* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef FLAC__TEST_LIBFLAC_ENCODERS_H -#define FLAC__TEST_LIBFLAC_ENCODERS_H - -#include "FLAC/ordinals.h" - -FLAC__bool test_encoders(void); - -#endif diff --git a/3rdparty/libflac/src/test_libFLAC/format.c b/3rdparty/libflac/src/test_libFLAC/format.c deleted file mode 100644 index 7ac115d0f20..00000000000 --- a/3rdparty/libflac/src/test_libFLAC/format.c +++ /dev/null @@ -1,256 +0,0 @@ -/* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "FLAC/assert.h" -#include "FLAC/format.h" -#include "format.h" -#include <stdio.h> - -static const char *true_false_string_[2] = { "false", "true" }; - -static struct { - unsigned rate; - FLAC__bool valid; - FLAC__bool subset; -} SAMPLE_RATES[] = { - { 0 , false, false }, - { 1 , true , true }, - { 9 , true , true }, - { 10 , true , true }, - { 4000 , true , true }, - { 8000 , true , true }, - { 11025 , true , true }, - { 12000 , true , true }, - { 16000 , true , true }, - { 22050 , true , true }, - { 24000 , true , true }, - { 32000 , true , true }, - { 32768 , true , true }, - { 44100 , true , true }, - { 48000 , true , true }, - { 65000 , true , true }, - { 65535 , true , true }, - { 65536 , true , false }, - { 65540 , true , true }, - { 65550 , true , true }, - { 65555 , true , false }, - { 66000 , true , true }, - { 66001 , true , false }, - { 96000 , true , true }, - { 100000 , true , true }, - { 100001 , true , false }, - { 192000 , true , true }, - { 500000 , true , true }, - { 500001 , true , false }, - { 500010 , true , true }, - { 655349 , true , false }, - { 655350 , true , true }, - { 655351 , false, false }, - { 655360 , false, false }, - { 700000 , false, false }, - { 700010 , false, false }, - { 1000000, false, false }, - { 1100000, false, false } -}; - -static struct { - const char *string; - FLAC__bool valid; -} VCENTRY_NAMES[] = { - { "" , true }, - { "a" , true }, - { "=" , false }, - { "a=" , false }, - { "\x01", false }, - { "\x1f", false }, - { "\x7d", true }, - { "\x7e", false }, - { "\xff", false } -}; - -static struct { - unsigned length; - const FLAC__byte *string; - FLAC__bool valid; -} VCENTRY_VALUES[] = { - { 0, (const FLAC__byte*)"" , true }, - { 1, (const FLAC__byte*)"" , true }, - { 1, (const FLAC__byte*)"\x01" , true }, - { 1, (const FLAC__byte*)"\x7f" , true }, - { 1, (const FLAC__byte*)"\x80" , false }, - { 1, (const FLAC__byte*)"\x81" , false }, - { 1, (const FLAC__byte*)"\xc0" , false }, - { 1, (const FLAC__byte*)"\xe0" , false }, - { 1, (const FLAC__byte*)"\xf0" , false }, - { 2, (const FLAC__byte*)"\xc0\x41" , false }, - { 2, (const FLAC__byte*)"\xc1\x41" , false }, - { 2, (const FLAC__byte*)"\xc0\x85" , false }, /* non-shortest form */ - { 2, (const FLAC__byte*)"\xc1\x85" , false }, /* non-shortest form */ - { 2, (const FLAC__byte*)"\xc2\x85" , true }, - { 2, (const FLAC__byte*)"\xe0\x41" , false }, - { 2, (const FLAC__byte*)"\xe1\x41" , false }, - { 2, (const FLAC__byte*)"\xe0\x85" , false }, - { 2, (const FLAC__byte*)"\xe1\x85" , false }, - { 3, (const FLAC__byte*)"\xe0\x85\x41", false }, - { 3, (const FLAC__byte*)"\xe1\x85\x41", false }, - { 3, (const FLAC__byte*)"\xe0\x85\x80", false }, /* non-shortest form */ - { 3, (const FLAC__byte*)"\xe0\x95\x80", false }, /* non-shortest form */ - { 3, (const FLAC__byte*)"\xe0\xa5\x80", true }, - { 3, (const FLAC__byte*)"\xe1\x85\x80", true }, - { 3, (const FLAC__byte*)"\xe1\x95\x80", true }, - { 3, (const FLAC__byte*)"\xe1\xa5\x80", true } -}; - -static struct { - const FLAC__byte *string; - FLAC__bool valid; -} VCENTRY_VALUES_NT[] = { - { (const FLAC__byte*)"" , true }, - { (const FLAC__byte*)"\x01" , true }, - { (const FLAC__byte*)"\x7f" , true }, - { (const FLAC__byte*)"\x80" , false }, - { (const FLAC__byte*)"\x81" , false }, - { (const FLAC__byte*)"\xc0" , false }, - { (const FLAC__byte*)"\xe0" , false }, - { (const FLAC__byte*)"\xf0" , false }, - { (const FLAC__byte*)"\xc0\x41" , false }, - { (const FLAC__byte*)"\xc1\x41" , false }, - { (const FLAC__byte*)"\xc0\x85" , false }, /* non-shortest form */ - { (const FLAC__byte*)"\xc1\x85" , false }, /* non-shortest form */ - { (const FLAC__byte*)"\xc2\x85" , true }, - { (const FLAC__byte*)"\xe0\x41" , false }, - { (const FLAC__byte*)"\xe1\x41" , false }, - { (const FLAC__byte*)"\xe0\x85" , false }, - { (const FLAC__byte*)"\xe1\x85" , false }, - { (const FLAC__byte*)"\xe0\x85\x41", false }, - { (const FLAC__byte*)"\xe1\x85\x41", false }, - { (const FLAC__byte*)"\xe0\x85\x80", false }, /* non-shortest form */ - { (const FLAC__byte*)"\xe0\x95\x80", false }, /* non-shortest form */ - { (const FLAC__byte*)"\xe0\xa5\x80", true }, - { (const FLAC__byte*)"\xe1\x85\x80", true }, - { (const FLAC__byte*)"\xe1\x95\x80", true }, - { (const FLAC__byte*)"\xe1\xa5\x80", true } -}; - -static struct { - unsigned length; - const FLAC__byte *string; - FLAC__bool valid; -} VCENTRIES[] = { - { 0, (const FLAC__byte*)"" , false }, - { 1, (const FLAC__byte*)"a" , false }, - { 1, (const FLAC__byte*)"=" , true }, - { 2, (const FLAC__byte*)"a=" , true }, - { 2, (const FLAC__byte*)"\x01=" , false }, - { 2, (const FLAC__byte*)"\x1f=" , false }, - { 2, (const FLAC__byte*)"\x7d=" , true }, - { 2, (const FLAC__byte*)"\x7e=" , false }, - { 2, (const FLAC__byte*)"\xff=" , false }, - { 3, (const FLAC__byte*)"a=\x01" , true }, - { 3, (const FLAC__byte*)"a=\x7f" , true }, - { 3, (const FLAC__byte*)"a=\x80" , false }, - { 3, (const FLAC__byte*)"a=\x81" , false }, - { 3, (const FLAC__byte*)"a=\xc0" , false }, - { 3, (const FLAC__byte*)"a=\xe0" , false }, - { 3, (const FLAC__byte*)"a=\xf0" , false }, - { 4, (const FLAC__byte*)"a=\xc0\x41" , false }, - { 4, (const FLAC__byte*)"a=\xc1\x41" , false }, - { 4, (const FLAC__byte*)"a=\xc0\x85" , false }, /* non-shortest form */ - { 4, (const FLAC__byte*)"a=\xc1\x85" , false }, /* non-shortest form */ - { 4, (const FLAC__byte*)"a=\xc2\x85" , true }, - { 4, (const FLAC__byte*)"a=\xe0\x41" , false }, - { 4, (const FLAC__byte*)"a=\xe1\x41" , false }, - { 4, (const FLAC__byte*)"a=\xe0\x85" , false }, - { 4, (const FLAC__byte*)"a=\xe1\x85" , false }, - { 5, (const FLAC__byte*)"a=\xe0\x85\x41", false }, - { 5, (const FLAC__byte*)"a=\xe1\x85\x41", false }, - { 5, (const FLAC__byte*)"a=\xe0\x85\x80", false }, /* non-shortest form */ - { 5, (const FLAC__byte*)"a=\xe0\x95\x80", false }, /* non-shortest form */ - { 5, (const FLAC__byte*)"a=\xe0\xa5\x80", true }, - { 5, (const FLAC__byte*)"a=\xe1\x85\x80", true }, - { 5, (const FLAC__byte*)"a=\xe1\x95\x80", true }, - { 5, (const FLAC__byte*)"a=\xe1\xa5\x80", true } -}; - -FLAC__bool test_format(void) -{ - unsigned i; - - printf("\n+++ libFLAC unit test: format\n\n"); - - for(i = 0; i < sizeof(SAMPLE_RATES)/sizeof(SAMPLE_RATES[0]); i++) { - printf("testing FLAC__format_sample_rate_is_valid(%u)... ", SAMPLE_RATES[i].rate); - if(FLAC__format_sample_rate_is_valid(SAMPLE_RATES[i].rate) != SAMPLE_RATES[i].valid) { - printf("FAILED, expected %s, got %s\n", true_false_string_[SAMPLE_RATES[i].valid], true_false_string_[!SAMPLE_RATES[i].valid]); - return false; - } - printf("OK\n"); - } - - for(i = 0; i < sizeof(SAMPLE_RATES)/sizeof(SAMPLE_RATES[0]); i++) { - printf("testing FLAC__format_sample_rate_is_subset(%u)... ", SAMPLE_RATES[i].rate); - if(FLAC__format_sample_rate_is_subset(SAMPLE_RATES[i].rate) != SAMPLE_RATES[i].subset) { - printf("FAILED, expected %s, got %s\n", true_false_string_[SAMPLE_RATES[i].subset], true_false_string_[!SAMPLE_RATES[i].subset]); - return false; - } - printf("OK\n"); - } - - for(i = 0; i < sizeof(VCENTRY_NAMES)/sizeof(VCENTRY_NAMES[0]); i++) { - printf("testing FLAC__format_vorbiscomment_entry_name_is_legal(\"%s\")... ", VCENTRY_NAMES[i].string); - if(FLAC__format_vorbiscomment_entry_name_is_legal(VCENTRY_NAMES[i].string) != VCENTRY_NAMES[i].valid) { - printf("FAILED, expected %s, got %s\n", true_false_string_[VCENTRY_NAMES[i].valid], true_false_string_[!VCENTRY_NAMES[i].valid]); - return false; - } - printf("OK\n"); - } - - for(i = 0; i < sizeof(VCENTRY_VALUES)/sizeof(VCENTRY_VALUES[0]); i++) { - printf("testing FLAC__format_vorbiscomment_entry_value_is_legal(\"%s\", %u)... ", VCENTRY_VALUES[i].string, VCENTRY_VALUES[i].length); - if(FLAC__format_vorbiscomment_entry_value_is_legal(VCENTRY_VALUES[i].string, VCENTRY_VALUES[i].length) != VCENTRY_VALUES[i].valid) { - printf("FAILED, expected %s, got %s\n", true_false_string_[VCENTRY_VALUES[i].valid], true_false_string_[!VCENTRY_VALUES[i].valid]); - return false; - } - printf("OK\n"); - } - - for(i = 0; i < sizeof(VCENTRY_VALUES_NT)/sizeof(VCENTRY_VALUES_NT[0]); i++) { - printf("testing FLAC__format_vorbiscomment_entry_value_is_legal(\"%s\", -1)... ", VCENTRY_VALUES_NT[i].string); - if(FLAC__format_vorbiscomment_entry_value_is_legal(VCENTRY_VALUES_NT[i].string, (unsigned)(-1)) != VCENTRY_VALUES_NT[i].valid) { - printf("FAILED, expected %s, got %s\n", true_false_string_[VCENTRY_VALUES_NT[i].valid], true_false_string_[!VCENTRY_VALUES_NT[i].valid]); - return false; - } - printf("OK\n"); - } - - for(i = 0; i < sizeof(VCENTRIES)/sizeof(VCENTRIES[0]); i++) { - printf("testing FLAC__format_vorbiscomment_entry_is_legal(\"%s\", %u)... ", VCENTRIES[i].string, VCENTRIES[i].length); - if(FLAC__format_vorbiscomment_entry_is_legal(VCENTRIES[i].string, VCENTRIES[i].length) != VCENTRIES[i].valid) { - printf("FAILED, expected %s, got %s\n", true_false_string_[VCENTRIES[i].valid], true_false_string_[!VCENTRIES[i].valid]); - return false; - } - printf("OK\n"); - } - - printf("\nPASSED!\n"); - return true; -} diff --git a/3rdparty/libflac/src/test_libFLAC/format.h b/3rdparty/libflac/src/test_libFLAC/format.h deleted file mode 100644 index e48a0e09299..00000000000 --- a/3rdparty/libflac/src/test_libFLAC/format.h +++ /dev/null @@ -1,26 +0,0 @@ -/* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef FLAC__TEST_LIBFLAC_FORMAT_H -#define FLAC__TEST_LIBFLAC_FORMAT_H - -#include "FLAC/ordinals.h" - -FLAC__bool test_format(void); - -#endif diff --git a/3rdparty/libflac/src/test_libFLAC/main.c b/3rdparty/libflac/src/test_libFLAC/main.c deleted file mode 100644 index 1807ff583c1..00000000000 --- a/3rdparty/libflac/src/test_libFLAC/main.c +++ /dev/null @@ -1,49 +0,0 @@ -/* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "bitwriter.h" -#include "decoders.h" -#include "encoders.h" -#include "format.h" -#include "metadata.h" - -int main(int argc, char *argv[]) -{ - (void)argc, (void)argv; - - if(!test_bitwriter()) - return 1; - - if(!test_format()) - return 1; - - if(!test_encoders()) - return 1; - - if(!test_decoders()) - return 1; - - if(!test_metadata()) - return 1; - - return 0; -} diff --git a/3rdparty/libflac/src/test_libFLAC/metadata.c b/3rdparty/libflac/src/test_libFLAC/metadata.c deleted file mode 100644 index aacb6bfd28c..00000000000 --- a/3rdparty/libflac/src/test_libFLAC/metadata.c +++ /dev/null @@ -1,40 +0,0 @@ -/* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "metadata.h" -#include <stdio.h> - -extern FLAC__bool test_metadata_object(void); -extern FLAC__bool test_metadata_file_manipulation(void); - -FLAC__bool test_metadata(void) -{ - if(!test_metadata_object()) - return false; - - if(!test_metadata_file_manipulation()) - return false; - - printf("\nPASSED!\n"); - - return true; -} diff --git a/3rdparty/libflac/src/test_libFLAC/metadata.h b/3rdparty/libflac/src/test_libFLAC/metadata.h deleted file mode 100644 index 055156405dc..00000000000 --- a/3rdparty/libflac/src/test_libFLAC/metadata.h +++ /dev/null @@ -1,28 +0,0 @@ -/* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef FLAC__TEST_LIBFLAC_METADATA_H -#define FLAC__TEST_LIBFLAC_METADATA_H - -#include "FLAC/ordinals.h" - -FLAC__bool test_metadata(void); -FLAC__bool test_metadata_file_manipulation(void); -FLAC__bool test_metadata_object(void); - -#endif diff --git a/3rdparty/libflac/src/test_libFLAC/metadata_manip.c b/3rdparty/libflac/src/test_libFLAC/metadata_manip.c deleted file mode 100644 index b3875318af0..00000000000 --- a/3rdparty/libflac/src/test_libFLAC/metadata_manip.c +++ /dev/null @@ -1,2133 +0,0 @@ -/* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdio.h> -#include <stdlib.h> /* for malloc() */ -#include <string.h> /* for memcpy()/memset() */ -#if defined _MSC_VER || defined __MINGW32__ -#include <sys/utime.h> /* for utime() */ -#include <io.h> /* for chmod() */ -#if _MSC_VER <= 1600 /* @@@ [2G limit] */ -#define fseeko fseek -#define ftello ftell -#endif -#else -#include <sys/types.h> /* some flavors of BSD (like OS X) require this to get time_t */ -#include <utime.h> /* for utime() */ -#include <unistd.h> /* for chown(), unlink() */ -#endif -#include <sys/stat.h> /* for stat(), maybe chmod() */ -#include "FLAC/assert.h" -#include "FLAC/stream_decoder.h" -#include "FLAC/metadata.h" -#include "share/grabbag.h" -#include "test_libs_common/file_utils_flac.h" -#include "test_libs_common/metadata_utils.h" -#include "metadata.h" - - -/****************************************************************************** - The general strategy of these tests (for interface levels 1 and 2) is - to create a dummy FLAC file with a known set of initial metadata - blocks, then keep a mirror locally of what we expect the metadata to be - after each operation. Then testing becomes a simple matter of running - a FLAC__StreamDecoder over the dummy file after each operation, comparing - the decoded metadata to what's in our local copy. If there are any - differences in the metadata, or the actual audio data is corrupted, we - will catch it while decoding. -******************************************************************************/ - -typedef struct { - FLAC__bool error_occurred; -} decoder_client_struct; - -typedef struct { - FLAC__StreamMetadata *blocks[64]; - unsigned num_blocks; -} our_metadata_struct; - -/* our copy of the metadata in flacfilename() */ -static our_metadata_struct our_metadata_; - -/* the current block number that corresponds to the position of the iterator we are testing */ -static unsigned mc_our_block_number_ = 0; - -static const char *flacfilename(FLAC__bool is_ogg) -{ - return is_ogg? "metadata.oga" : "metadata.flac"; -} - -static FLAC__bool die_(const char *msg) -{ - printf("ERROR: %s\n", msg); - return false; -} - -static FLAC__bool die_c_(const char *msg, FLAC__Metadata_ChainStatus status) -{ - printf("ERROR: %s\n", msg); - printf(" status=%s\n", FLAC__Metadata_ChainStatusString[status]); - return false; -} - -static FLAC__bool die_ss_(const char *msg, FLAC__Metadata_SimpleIterator *iterator) -{ - printf("ERROR: %s\n", msg); - printf(" status=%s\n", FLAC__Metadata_SimpleIteratorStatusString[FLAC__metadata_simple_iterator_status(iterator)]); - return false; -} - -static void *malloc_or_die_(size_t size) -{ - void *x = malloc(size); - if(0 == x) { - fprintf(stderr, "ERROR: out of memory allocating %u bytes\n", (unsigned)size); - exit(1); - } - return x; -} - -static char *strdup_or_die_(const char *s) -{ - char *x = strdup(s); - if(0 == x) { - fprintf(stderr, "ERROR: out of memory copying string \"%s\"\n", s); - exit(1); - } - return x; -} - -/* functions for working with our metadata copy */ - -static FLAC__bool replace_in_our_metadata_(FLAC__StreamMetadata *block, unsigned position, FLAC__bool copy) -{ - unsigned i; - FLAC__StreamMetadata *obj = block; - FLAC__ASSERT(position < our_metadata_.num_blocks); - if(copy) { - if(0 == (obj = FLAC__metadata_object_clone(block))) - return die_("during FLAC__metadata_object_clone()"); - } - FLAC__metadata_object_delete(our_metadata_.blocks[position]); - our_metadata_.blocks[position] = obj; - - /* set the is_last flags */ - for(i = 0; i < our_metadata_.num_blocks - 1; i++) - our_metadata_.blocks[i]->is_last = false; - our_metadata_.blocks[i]->is_last = true; - - return true; -} - -static FLAC__bool insert_to_our_metadata_(FLAC__StreamMetadata *block, unsigned position, FLAC__bool copy) -{ - unsigned i; - FLAC__StreamMetadata *obj = block; - if(copy) { - if(0 == (obj = FLAC__metadata_object_clone(block))) - return die_("during FLAC__metadata_object_clone()"); - } - if(position > our_metadata_.num_blocks) { - position = our_metadata_.num_blocks; - } - else { - for(i = our_metadata_.num_blocks; i > position; i--) - our_metadata_.blocks[i] = our_metadata_.blocks[i-1]; - } - our_metadata_.blocks[position] = obj; - our_metadata_.num_blocks++; - - /* set the is_last flags */ - for(i = 0; i < our_metadata_.num_blocks - 1; i++) - our_metadata_.blocks[i]->is_last = false; - our_metadata_.blocks[i]->is_last = true; - - return true; -} - -static void delete_from_our_metadata_(unsigned position) -{ - unsigned i; - FLAC__ASSERT(position < our_metadata_.num_blocks); - FLAC__metadata_object_delete(our_metadata_.blocks[position]); - for(i = position; i < our_metadata_.num_blocks - 1; i++) - our_metadata_.blocks[i] = our_metadata_.blocks[i+1]; - our_metadata_.num_blocks--; - - /* set the is_last flags */ - if(our_metadata_.num_blocks > 0) { - for(i = 0; i < our_metadata_.num_blocks - 1; i++) - our_metadata_.blocks[i]->is_last = false; - our_metadata_.blocks[i]->is_last = true; - } -} - -/* - * This wad of functions supports filename- and callback-based chain reading/writing. - * Everything up to set_file_stats_() is copied from libFLAC/metadata_iterators.c - */ -static FLAC__bool open_tempfile_(const char *filename, FILE **tempfile, char **tempfilename) -{ - static const char *tempfile_suffix = ".metadata_edit"; - - if(0 == (*tempfilename = (char*)malloc(strlen(filename) + strlen(tempfile_suffix) + 1))) - return false; - strcpy(*tempfilename, filename); - strcat(*tempfilename, tempfile_suffix); - - if(0 == (*tempfile = fopen(*tempfilename, "wb"))) - return false; - - return true; -} - -static void cleanup_tempfile_(FILE **tempfile, char **tempfilename) -{ - if(0 != *tempfile) { - (void)fclose(*tempfile); - *tempfile = 0; - } - - if(0 != *tempfilename) { - (void)unlink(*tempfilename); - free(*tempfilename); - *tempfilename = 0; - } -} - -static FLAC__bool transport_tempfile_(const char *filename, FILE **tempfile, char **tempfilename) -{ - FLAC__ASSERT(0 != filename); - FLAC__ASSERT(0 != tempfile); - FLAC__ASSERT(0 != tempfilename); - FLAC__ASSERT(0 != *tempfilename); - - if(0 != *tempfile) { - (void)fclose(*tempfile); - *tempfile = 0; - } - -#if defined _MSC_VER || defined __MINGW32__ || defined __EMX__ - /* on some flavors of windows, rename() will fail if the destination already exists */ - if(unlink(filename) < 0) { - cleanup_tempfile_(tempfile, tempfilename); - return false; - } -#endif - - if(0 != rename(*tempfilename, filename)) { - cleanup_tempfile_(tempfile, tempfilename); - return false; - } - - cleanup_tempfile_(tempfile, tempfilename); - - return true; -} - -static FLAC__bool get_file_stats_(const char *filename, struct stat *stats) -{ - FLAC__ASSERT(0 != filename); - FLAC__ASSERT(0 != stats); - return (0 == stat(filename, stats)); -} - -static void set_file_stats_(const char *filename, struct stat *stats) -{ - struct utimbuf srctime; - - FLAC__ASSERT(0 != filename); - FLAC__ASSERT(0 != stats); - - srctime.actime = stats->st_atime; - srctime.modtime = stats->st_mtime; - (void)chmod(filename, stats->st_mode); - (void)utime(filename, &srctime); -#if !defined _MSC_VER && !defined __MINGW32__ && !defined __EMX__ - (void)chown(filename, stats->st_uid, -1); - (void)chown(filename, -1, stats->st_gid); -#endif -} - -#ifdef FLAC__VALGRIND_TESTING -static size_t chain_write_cb_(const void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle) -{ - FILE *stream = (FILE*)handle; - size_t ret = fwrite(ptr, size, nmemb, stream); - if(!ferror(stream)) - fflush(stream); - return ret; -} -#endif - -static int chain_seek_cb_(FLAC__IOHandle handle, FLAC__int64 offset, int whence) -{ - off_t o = (off_t)offset; - FLAC__ASSERT(offset == o); - return fseeko((FILE*)handle, o, whence); -} - -static FLAC__int64 chain_tell_cb_(FLAC__IOHandle handle) -{ - return ftello((FILE*)handle); -} - -static int chain_eof_cb_(FLAC__IOHandle handle) -{ - return feof((FILE*)handle); -} - -static FLAC__bool write_chain_(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__bool preserve_file_stats, FLAC__bool filename_based, const char *filename) -{ - if(filename_based) - return FLAC__metadata_chain_write(chain, use_padding, preserve_file_stats); - else { - FLAC__IOCallbacks callbacks; - - memset(&callbacks, 0, sizeof(callbacks)); - callbacks.read = (FLAC__IOCallback_Read)fread; -#ifdef FLAC__VALGRIND_TESTING - callbacks.write = chain_write_cb_; -#else - callbacks.write = (FLAC__IOCallback_Write)fwrite; -#endif - callbacks.seek = chain_seek_cb_; - callbacks.eof = chain_eof_cb_; - - if(FLAC__metadata_chain_check_if_tempfile_needed(chain, use_padding)) { - struct stat stats; - FILE *file, *tempfile = 0; - char *tempfilename; - if(preserve_file_stats) { - if(!get_file_stats_(filename, &stats)) - return false; - } - if(0 == (file = fopen(filename, "rb"))) - return false; /*@@@@ chain status still says OK though */ - if(!open_tempfile_(filename, &tempfile, &tempfilename)) { - fclose(file); - cleanup_tempfile_(&tempfile, &tempfilename); - return false; /*@@@@ chain status still says OK though */ - } - if(!FLAC__metadata_chain_write_with_callbacks_and_tempfile(chain, use_padding, (FLAC__IOHandle)file, callbacks, (FLAC__IOHandle)tempfile, callbacks)) { - fclose(file); - fclose(tempfile); - return false; - } - fclose(file); - fclose(tempfile); - file = tempfile = 0; - if(!transport_tempfile_(filename, &tempfile, &tempfilename)) - return false; - if(preserve_file_stats) - set_file_stats_(filename, &stats); - } - else { - FILE *file = fopen(filename, "r+b"); - if(0 == file) - return false; /*@@@@ chain status still says OK though */ - if(!FLAC__metadata_chain_write_with_callbacks(chain, use_padding, (FLAC__IOHandle)file, callbacks)) - return false; - fclose(file); - } - } - - return true; -} - -static FLAC__bool read_chain_(FLAC__Metadata_Chain *chain, const char *filename, FLAC__bool filename_based, FLAC__bool is_ogg) -{ - if(filename_based) - return is_ogg? - FLAC__metadata_chain_read_ogg(chain, flacfilename(is_ogg)) : - FLAC__metadata_chain_read(chain, flacfilename(is_ogg)) - ; - else { - FLAC__IOCallbacks callbacks; - - memset(&callbacks, 0, sizeof(callbacks)); - callbacks.read = (FLAC__IOCallback_Read)fread; - callbacks.seek = chain_seek_cb_; - callbacks.tell = chain_tell_cb_; - - { - FLAC__bool ret; - FILE *file = fopen(filename, "rb"); - if(0 == file) - return false; /*@@@@ chain status still says OK though */ - ret = is_ogg? - FLAC__metadata_chain_read_ogg_with_callbacks(chain, (FLAC__IOHandle)file, callbacks) : - FLAC__metadata_chain_read_with_callbacks(chain, (FLAC__IOHandle)file, callbacks) - ; - fclose(file); - return ret; - } - } -} - -/* function for comparing our metadata to a FLAC__Metadata_Chain */ - -static FLAC__bool compare_chain_(FLAC__Metadata_Chain *chain, unsigned current_position, FLAC__StreamMetadata *current_block) -{ - unsigned i; - FLAC__Metadata_Iterator *iterator; - FLAC__StreamMetadata *block; - FLAC__bool next_ok = true; - - FLAC__ASSERT(0 != chain); - - printf("\tcomparing chain... "); - fflush(stdout); - - if(0 == (iterator = FLAC__metadata_iterator_new())) - return die_("allocating memory for iterator"); - - FLAC__metadata_iterator_init(iterator, chain); - - i = 0; - do { - printf("%u... ", i); - fflush(stdout); - - if(0 == (block = FLAC__metadata_iterator_get_block(iterator))) { - FLAC__metadata_iterator_delete(iterator); - return die_("getting block from iterator"); - } - - if(!mutils__compare_block(our_metadata_.blocks[i], block)) { - FLAC__metadata_iterator_delete(iterator); - return die_("metadata block mismatch"); - } - - i++; - next_ok = FLAC__metadata_iterator_next(iterator); - } while(i < our_metadata_.num_blocks && next_ok); - - FLAC__metadata_iterator_delete(iterator); - - if(next_ok) - return die_("chain has more blocks than expected"); - - if(i < our_metadata_.num_blocks) - return die_("short block count in chain"); - - if(0 != current_block) { - printf("CURRENT_POSITION... "); - fflush(stdout); - - if(!mutils__compare_block(our_metadata_.blocks[current_position], current_block)) - return die_("metadata block mismatch"); - } - - printf("PASSED\n"); - - return true; -} - -/* decoder callbacks for checking the file */ - -static FLAC__StreamDecoderWriteStatus decoder_write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data) -{ - (void)decoder, (void)buffer, (void)client_data; - - if( - (frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER && frame->header.number.frame_number == 0) || - (frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER && frame->header.number.sample_number == 0) - ) { - printf("content... "); - fflush(stdout); - } - - return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; -} - -/* this version pays no attention to the metadata */ -static void decoder_metadata_callback_null_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) -{ - (void)decoder, (void)metadata, (void)client_data; - - printf("%d... ", mc_our_block_number_); - fflush(stdout); - - mc_our_block_number_++; -} - -/* this version is used when we want to compare to our metadata copy */ -static void decoder_metadata_callback_compare_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) -{ - decoder_client_struct *dcd = (decoder_client_struct*)client_data; - - (void)decoder; - - /* don't bother checking if we've already hit an error */ - if(dcd->error_occurred) - return; - - printf("%d... ", mc_our_block_number_); - fflush(stdout); - - if(mc_our_block_number_ >= our_metadata_.num_blocks) { - (void)die_("got more metadata blocks than expected"); - dcd->error_occurred = true; - } - else { - if(!mutils__compare_block(our_metadata_.blocks[mc_our_block_number_], metadata)) { - (void)die_("metadata block mismatch"); - dcd->error_occurred = true; - } - } - mc_our_block_number_++; -} - -static void decoder_error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) -{ - decoder_client_struct *dcd = (decoder_client_struct*)client_data; - (void)decoder; - - dcd->error_occurred = true; - printf("ERROR: got error callback, status = %s (%u)\n", FLAC__StreamDecoderErrorStatusString[status], (unsigned)status); -} - -static FLAC__bool generate_file_(FLAC__bool include_extras, FLAC__bool is_ogg) -{ - FLAC__StreamMetadata streaminfo, vorbiscomment, *cuesheet, picture, padding; - FLAC__StreamMetadata *metadata[4]; - unsigned i = 0, n = 0; - - printf("generating %sFLAC file for test\n", is_ogg? "Ogg " : ""); - - while(our_metadata_.num_blocks > 0) - delete_from_our_metadata_(0); - - streaminfo.is_last = false; - streaminfo.type = FLAC__METADATA_TYPE_STREAMINFO; - streaminfo.length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH; - streaminfo.data.stream_info.min_blocksize = 576; - streaminfo.data.stream_info.max_blocksize = 576; - streaminfo.data.stream_info.min_framesize = 0; - streaminfo.data.stream_info.max_framesize = 0; - streaminfo.data.stream_info.sample_rate = 44100; - streaminfo.data.stream_info.channels = 1; - streaminfo.data.stream_info.bits_per_sample = 8; - streaminfo.data.stream_info.total_samples = 0; - memset(streaminfo.data.stream_info.md5sum, 0, 16); - - { - const unsigned vendor_string_length = (unsigned)strlen(FLAC__VENDOR_STRING); - vorbiscomment.is_last = false; - vorbiscomment.type = FLAC__METADATA_TYPE_VORBIS_COMMENT; - vorbiscomment.length = (4 + vendor_string_length) + 4; - vorbiscomment.data.vorbis_comment.vendor_string.length = vendor_string_length; - vorbiscomment.data.vorbis_comment.vendor_string.entry = malloc_or_die_(vendor_string_length+1); - memcpy(vorbiscomment.data.vorbis_comment.vendor_string.entry, FLAC__VENDOR_STRING, vendor_string_length+1); - vorbiscomment.data.vorbis_comment.num_comments = 0; - vorbiscomment.data.vorbis_comment.comments = 0; - } - - { - if (0 == (cuesheet = FLAC__metadata_object_new(FLAC__METADATA_TYPE_CUESHEET))) - return die_("priming our metadata"); - cuesheet->is_last = false; - strcpy(cuesheet->data.cue_sheet.media_catalog_number, "bogo-MCN"); - cuesheet->data.cue_sheet.lead_in = 123; - cuesheet->data.cue_sheet.is_cd = false; - if (!FLAC__metadata_object_cuesheet_insert_blank_track(cuesheet, 0)) - return die_("priming our metadata"); - cuesheet->data.cue_sheet.tracks[0].number = 1; - if (!FLAC__metadata_object_cuesheet_track_insert_blank_index(cuesheet, 0, 0)) - return die_("priming our metadata"); - } - - { - picture.is_last = false; - picture.type = FLAC__METADATA_TYPE_PICTURE; - picture.length = - ( - FLAC__STREAM_METADATA_PICTURE_TYPE_LEN + - FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN + /* will add the length for the string later */ - FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN + /* will add the length for the string later */ - FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN + - FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN + - FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN + - FLAC__STREAM_METADATA_PICTURE_COLORS_LEN + - FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN /* will add the length for the data later */ - ) / 8 - ; - picture.data.picture.type = FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER; - picture.data.picture.mime_type = strdup_or_die_("image/jpeg"); - picture.length += strlen(picture.data.picture.mime_type); - picture.data.picture.description = (FLAC__byte*)strdup_or_die_("desc"); - picture.length += strlen((const char *)picture.data.picture.description); - picture.data.picture.width = 300; - picture.data.picture.height = 300; - picture.data.picture.depth = 24; - picture.data.picture.colors = 0; - picture.data.picture.data = (FLAC__byte*)strdup_or_die_("SOMEJPEGDATA"); - picture.data.picture.data_length = strlen((const char *)picture.data.picture.data); - picture.length += picture.data.picture.data_length; - } - - padding.is_last = true; - padding.type = FLAC__METADATA_TYPE_PADDING; - padding.length = 1234; - - metadata[n++] = &vorbiscomment; - if(include_extras) { - metadata[n++] = cuesheet; - metadata[n++] = &picture; - } - metadata[n++] = &padding; - - if( - !insert_to_our_metadata_(&streaminfo, i++, /*copy=*/true) || - !insert_to_our_metadata_(&vorbiscomment, i++, /*copy=*/true) || - (include_extras && !insert_to_our_metadata_(cuesheet, i++, /*copy=*/false)) || - (include_extras && !insert_to_our_metadata_(&picture, i++, /*copy=*/true)) || - !insert_to_our_metadata_(&padding, i++, /*copy=*/true) - ) - return die_("priming our metadata"); - - if(!file_utils__generate_flacfile(is_ogg, flacfilename(is_ogg), 0, 512 * 1024, &streaminfo, metadata, n)) - return die_("creating the encoded file"); - - free(vorbiscomment.data.vorbis_comment.vendor_string.entry); - free(picture.data.picture.mime_type); - free(picture.data.picture.description); - free(picture.data.picture.data); - if(!include_extras) - FLAC__metadata_object_delete(cuesheet); - - return true; -} - -static FLAC__bool test_file_(FLAC__bool is_ogg, FLAC__StreamDecoderMetadataCallback metadata_callback) -{ - const char *filename = flacfilename(is_ogg); - FLAC__StreamDecoder *decoder; - decoder_client_struct decoder_client_data; - - FLAC__ASSERT(0 != metadata_callback); - - mc_our_block_number_ = 0; - decoder_client_data.error_occurred = false; - - printf("\ttesting '%s'... ", filename); - fflush(stdout); - - if(0 == (decoder = FLAC__stream_decoder_new())) - return die_("couldn't allocate decoder instance"); - - FLAC__stream_decoder_set_md5_checking(decoder, true); - FLAC__stream_decoder_set_metadata_respond_all(decoder); - if( - (is_ogg? - FLAC__stream_decoder_init_ogg_file(decoder, filename, decoder_write_callback_, metadata_callback, decoder_error_callback_, &decoder_client_data) : - FLAC__stream_decoder_init_file(decoder, filename, decoder_write_callback_, metadata_callback, decoder_error_callback_, &decoder_client_data) - ) != FLAC__STREAM_DECODER_INIT_STATUS_OK - ) { - (void)FLAC__stream_decoder_finish(decoder); - FLAC__stream_decoder_delete(decoder); - return die_("initializing decoder\n"); - } - if(!FLAC__stream_decoder_process_until_end_of_stream(decoder)) { - (void)FLAC__stream_decoder_finish(decoder); - FLAC__stream_decoder_delete(decoder); - return die_("decoding file\n"); - } - - (void)FLAC__stream_decoder_finish(decoder); - FLAC__stream_decoder_delete(decoder); - - if(decoder_client_data.error_occurred) - return false; - - if(mc_our_block_number_ != our_metadata_.num_blocks) - return die_("short metadata block count"); - - printf("PASSED\n"); - return true; -} - -static FLAC__bool change_stats_(const char *filename, FLAC__bool read_only) -{ - if(!grabbag__file_change_stats(filename, read_only)) - return die_("during grabbag__file_change_stats()"); - - return true; -} - -static FLAC__bool remove_file_(const char *filename) -{ - while(our_metadata_.num_blocks > 0) - delete_from_our_metadata_(0); - - if(!grabbag__file_remove_file(filename)) - return die_("removing file"); - - return true; -} - -static FLAC__bool test_level_0_(void) -{ - FLAC__StreamMetadata streaminfo; - FLAC__StreamMetadata *tags = 0; - FLAC__StreamMetadata *cuesheet = 0; - FLAC__StreamMetadata *picture = 0; - - printf("\n\n++++++ testing level 0 interface\n"); - - if(!generate_file_(/*include_extras=*/true, /*is_ogg=*/false)) - return false; - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_null_)) - return false; - - printf("testing FLAC__metadata_get_streaminfo()... "); - - if(!FLAC__metadata_get_streaminfo(flacfilename(/*is_ogg=*/false), &streaminfo)) - return die_("during FLAC__metadata_get_streaminfo()"); - - /* check to see if some basic data matches (c.f. generate_file_()) */ - if(streaminfo.data.stream_info.channels != 1) - return die_("mismatch in streaminfo.data.stream_info.channels"); - if(streaminfo.data.stream_info.bits_per_sample != 8) - return die_("mismatch in streaminfo.data.stream_info.bits_per_sample"); - if(streaminfo.data.stream_info.sample_rate != 44100) - return die_("mismatch in streaminfo.data.stream_info.sample_rate"); - if(streaminfo.data.stream_info.min_blocksize != 576) - return die_("mismatch in streaminfo.data.stream_info.min_blocksize"); - if(streaminfo.data.stream_info.max_blocksize != 576) - return die_("mismatch in streaminfo.data.stream_info.max_blocksize"); - - printf("OK\n"); - - printf("testing FLAC__metadata_get_tags()... "); - - if(!FLAC__metadata_get_tags(flacfilename(/*is_ogg=*/false), &tags)) - return die_("during FLAC__metadata_get_tags()"); - - /* check to see if some basic data matches (c.f. generate_file_()) */ - if(tags->data.vorbis_comment.num_comments != 0) - return die_("mismatch in tags->data.vorbis_comment.num_comments"); - - printf("OK\n"); - - FLAC__metadata_object_delete(tags); - - printf("testing FLAC__metadata_get_cuesheet()... "); - - if(!FLAC__metadata_get_cuesheet(flacfilename(/*is_ogg=*/false), &cuesheet)) - return die_("during FLAC__metadata_get_cuesheet()"); - - /* check to see if some basic data matches (c.f. generate_file_()) */ - if(cuesheet->data.cue_sheet.lead_in != 123) - return die_("mismatch in cuesheet->data.cue_sheet.lead_in"); - - printf("OK\n"); - - FLAC__metadata_object_delete(cuesheet); - - printf("testing FLAC__metadata_get_picture()... "); - - if(!FLAC__metadata_get_picture(flacfilename(/*is_ogg=*/false), &picture, /*type=*/(FLAC__StreamMetadata_Picture_Type)(-1), /*mime_type=*/0, /*description=*/0, /*max_width=*/(unsigned)(-1), /*max_height=*/(unsigned)(-1), /*max_depth=*/(unsigned)(-1), /*max_colors=*/(unsigned)(-1))) - return die_("during FLAC__metadata_get_picture()"); - - /* check to see if some basic data matches (c.f. generate_file_()) */ - if(picture->data.picture.type != FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER) - return die_("mismatch in picture->data.picture.type"); - - printf("OK\n"); - - FLAC__metadata_object_delete(picture); - - if(!remove_file_(flacfilename(/*is_ogg=*/false))) - return false; - - return true; -} - -static FLAC__bool test_level_1_(void) -{ - FLAC__Metadata_SimpleIterator *iterator; - FLAC__StreamMetadata *block, *app, *padding; - FLAC__byte data[1000]; - unsigned our_current_position = 0; - - /* initialize 'data' to avoid Valgrind errors */ - memset(data, 0, sizeof(data)); - - printf("\n\n++++++ testing level 1 interface\n"); - - /************************************************************/ - - printf("simple iterator on read-only file\n"); - - if(!generate_file_(/*include_extras=*/false, /*is_ogg=*/false)) - return false; - - if(!change_stats_(flacfilename(/*is_ogg=*/false), /*read_only=*/true)) - return false; - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_null_)) - return false; - - if(0 == (iterator = FLAC__metadata_simple_iterator_new())) - return die_("FLAC__metadata_simple_iterator_new()"); - - if(!FLAC__metadata_simple_iterator_init(iterator, flacfilename(/*is_ogg=*/false), /*read_only=*/false, /*preserve_file_stats=*/false)) - return die_("FLAC__metadata_simple_iterator_init() returned false"); - - printf("is writable = %u\n", (unsigned)FLAC__metadata_simple_iterator_is_writable(iterator)); - if(FLAC__metadata_simple_iterator_is_writable(iterator)) - return die_("iterator claims file is writable when tester thinks it should not be; are you running as root?\n"); - - printf("iterate forwards\n"); - - if(FLAC__metadata_simple_iterator_get_block_type(iterator) != FLAC__METADATA_TYPE_STREAMINFO) - return die_("expected STREAMINFO type from FLAC__metadata_simple_iterator_get_block_type()"); - if(0 == (block = FLAC__metadata_simple_iterator_get_block(iterator))) - return die_("getting block 0"); - if(block->type != FLAC__METADATA_TYPE_STREAMINFO) - return die_("expected STREAMINFO type"); - if(block->is_last) - return die_("expected is_last to be false"); - if(block->length != FLAC__STREAM_METADATA_STREAMINFO_LENGTH) - return die_("bad STREAMINFO length"); - /* check to see if some basic data matches (c.f. generate_file_()) */ - if(block->data.stream_info.channels != 1) - return die_("mismatch in channels"); - if(block->data.stream_info.bits_per_sample != 8) - return die_("mismatch in bits_per_sample"); - if(block->data.stream_info.sample_rate != 44100) - return die_("mismatch in sample_rate"); - if(block->data.stream_info.min_blocksize != 576) - return die_("mismatch in min_blocksize"); - if(block->data.stream_info.max_blocksize != 576) - return die_("mismatch in max_blocksize"); - FLAC__metadata_object_delete(block); - - if(!FLAC__metadata_simple_iterator_next(iterator)) - return die_("forward iterator ended early"); - our_current_position++; - - if(!FLAC__metadata_simple_iterator_next(iterator)) - return die_("forward iterator ended early"); - our_current_position++; - - if(FLAC__metadata_simple_iterator_get_block_type(iterator) != FLAC__METADATA_TYPE_PADDING) - return die_("expected PADDING type from FLAC__metadata_simple_iterator_get_block_type()"); - if(0 == (block = FLAC__metadata_simple_iterator_get_block(iterator))) - return die_("getting block 2"); - if(block->type != FLAC__METADATA_TYPE_PADDING) - return die_("expected PADDING type"); - if(!block->is_last) - return die_("expected is_last to be true"); - /* check to see if some basic data matches (c.f. generate_file_()) */ - if(block->length != 1234) - return die_("bad PADDING length"); - FLAC__metadata_object_delete(block); - - if(FLAC__metadata_simple_iterator_next(iterator)) - return die_("forward iterator returned true but should have returned false"); - - printf("iterate backwards\n"); - if(!FLAC__metadata_simple_iterator_prev(iterator)) - return die_("reverse iterator ended early"); - if(!FLAC__metadata_simple_iterator_prev(iterator)) - return die_("reverse iterator ended early"); - if(FLAC__metadata_simple_iterator_prev(iterator)) - return die_("reverse iterator returned true but should have returned false"); - - printf("testing FLAC__metadata_simple_iterator_set_block() on read-only file...\n"); - - if(!FLAC__metadata_simple_iterator_set_block(iterator, (FLAC__StreamMetadata*)99, false)) - printf("OK: FLAC__metadata_simple_iterator_set_block() returned false like it should\n"); - else - return die_("FLAC__metadata_simple_iterator_set_block() returned true but shouldn't have"); - - FLAC__metadata_simple_iterator_delete(iterator); - - /************************************************************/ - - printf("simple iterator on writable file\n"); - - if(!change_stats_(flacfilename(/*is_ogg=*/false), /*read-only=*/false)) - return false; - - printf("creating APPLICATION block\n"); - - if(0 == (app = FLAC__metadata_object_new(FLAC__METADATA_TYPE_APPLICATION))) - return die_("FLAC__metadata_object_new(FLAC__METADATA_TYPE_APPLICATION)"); - memcpy(app->data.application.id, "duh", (FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8)); - - printf("creating PADDING block\n"); - - if(0 == (padding = FLAC__metadata_object_new(FLAC__METADATA_TYPE_PADDING))) - return die_("FLAC__metadata_object_new(FLAC__METADATA_TYPE_PADDING)"); - padding->length = 20; - - if(0 == (iterator = FLAC__metadata_simple_iterator_new())) - return die_("FLAC__metadata_simple_iterator_new()"); - - if(!FLAC__metadata_simple_iterator_init(iterator, flacfilename(/*is_ogg=*/false), /*read_only=*/false, /*preserve_file_stats=*/false)) - return die_("FLAC__metadata_simple_iterator_init() returned false"); - our_current_position = 0; - - printf("is writable = %u\n", (unsigned)FLAC__metadata_simple_iterator_is_writable(iterator)); - - printf("[S]VP\ttry to write over STREAMINFO block...\n"); - if(!FLAC__metadata_simple_iterator_set_block(iterator, app, false)) - printf("\tFLAC__metadata_simple_iterator_set_block() returned false like it should\n"); - else - return die_("FLAC__metadata_simple_iterator_set_block() returned true but shouldn't have"); - - printf("[S]VP\tnext\n"); - if(!FLAC__metadata_simple_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("S[V]P\tnext\n"); - if(!FLAC__metadata_simple_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[P]\tinsert PADDING after, don't expand into padding\n"); - padding->length = 25; - if(!FLAC__metadata_simple_iterator_insert_block_after(iterator, padding, false)) - return die_ss_("FLAC__metadata_simple_iterator_insert_block_after(iterator, padding, false)", iterator); - if(!insert_to_our_metadata_(padding, ++our_current_position, /*copy=*/true)) - return false; - - printf("SVP[P]\tprev\n"); - if(!FLAC__metadata_simple_iterator_prev(iterator)) - return die_("iterator ended early\n"); - our_current_position--; - - printf("SV[P]P\tprev\n"); - if(!FLAC__metadata_simple_iterator_prev(iterator)) - return die_("iterator ended early\n"); - our_current_position--; - - printf("S[V]PP\tinsert PADDING after, don't expand into padding\n"); - padding->length = 30; - if(!FLAC__metadata_simple_iterator_insert_block_after(iterator, padding, false)) - return die_ss_("FLAC__metadata_simple_iterator_insert_block_after(iterator, padding, false)", iterator); - if(!insert_to_our_metadata_(padding, ++our_current_position, /*copy=*/true)) - return false; - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SV[P]PP\tprev\n"); - if(!FLAC__metadata_simple_iterator_prev(iterator)) - return die_("iterator ended early\n"); - our_current_position--; - - printf("S[V]PPP\tprev\n"); - if(!FLAC__metadata_simple_iterator_prev(iterator)) - return die_("iterator ended early\n"); - our_current_position--; - - printf("[S]VPPP\tdelete (STREAMINFO block), must fail\n"); - if(FLAC__metadata_simple_iterator_delete_block(iterator, false)) - return die_ss_("FLAC__metadata_simple_iterator_delete_block(iterator, false) should have returned false", iterator); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("[S]VPPP\tnext\n"); - if(!FLAC__metadata_simple_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("S[V]PPP\tnext\n"); - if(!FLAC__metadata_simple_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[P]PP\tdelete (middle block), replace with padding\n"); - if(!FLAC__metadata_simple_iterator_delete_block(iterator, true)) - return die_ss_("FLAC__metadata_simple_iterator_delete_block(iterator, true)", iterator); - our_current_position--; - - printf("S[V]PPP\tnext\n"); - if(!FLAC__metadata_simple_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[P]PP\tdelete (middle block), don't replace with padding\n"); - if(!FLAC__metadata_simple_iterator_delete_block(iterator, false)) - return die_ss_("FLAC__metadata_simple_iterator_delete_block(iterator, false)", iterator); - delete_from_our_metadata_(our_current_position--); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("S[V]PP\tnext\n"); - if(!FLAC__metadata_simple_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[P]P\tnext\n"); - if(!FLAC__metadata_simple_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SVP[P]\tdelete (last block), replace with padding\n"); - if(!FLAC__metadata_simple_iterator_delete_block(iterator, true)) - return die_ss_("FLAC__metadata_simple_iterator_delete_block(iterator, false)", iterator); - our_current_position--; - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SV[P]P\tnext\n"); - if(!FLAC__metadata_simple_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SVP[P]\tdelete (last block), don't replace with padding\n"); - if(!FLAC__metadata_simple_iterator_delete_block(iterator, false)) - return die_ss_("FLAC__metadata_simple_iterator_delete_block(iterator, false)", iterator); - delete_from_our_metadata_(our_current_position--); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SV[P]\tprev\n"); - if(!FLAC__metadata_simple_iterator_prev(iterator)) - return die_("iterator ended early\n"); - our_current_position--; - - printf("S[V]P\tprev\n"); - if(!FLAC__metadata_simple_iterator_prev(iterator)) - return die_("iterator ended early\n"); - our_current_position--; - - printf("[S]VP\tset STREAMINFO (change sample rate)\n"); - FLAC__ASSERT(our_current_position == 0); - block = FLAC__metadata_simple_iterator_get_block(iterator); - block->data.stream_info.sample_rate = 32000; - if(!replace_in_our_metadata_(block, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!FLAC__metadata_simple_iterator_set_block(iterator, block, false)) - return die_ss_("FLAC__metadata_simple_iterator_set_block(iterator, block, false)", iterator); - FLAC__metadata_object_delete(block); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("[S]VP\tnext\n"); - if(!FLAC__metadata_simple_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("S[V]P\tinsert APPLICATION after, expand into padding of exceeding size\n"); - app->data.application.id[0] = 'e'; /* twiddle the id so that our comparison doesn't miss transposition */ - if(!FLAC__metadata_simple_iterator_insert_block_after(iterator, app, true)) - return die_ss_("FLAC__metadata_simple_iterator_insert_block_after(iterator, app, true)", iterator); - if(!insert_to_our_metadata_(app, ++our_current_position, /*copy=*/true)) - return false; - our_metadata_.blocks[our_current_position+1]->length -= (FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8) + app->length; - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]P\tnext\n"); - if(!FLAC__metadata_simple_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SVA[P]\tset APPLICATION, expand into padding of exceeding size\n"); - app->data.application.id[0] = 'f'; /* twiddle the id */ - if(!FLAC__metadata_simple_iterator_set_block(iterator, app, true)) - return die_ss_("FLAC__metadata_simple_iterator_set_block(iterator, app, true)", iterator); - if(!insert_to_our_metadata_(app, our_current_position, /*copy=*/true)) - return false; - our_metadata_.blocks[our_current_position+1]->length -= (FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8) + app->length; - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SVA[A]P\tset APPLICATION (grow), don't expand into padding\n"); - app->data.application.id[0] = 'g'; /* twiddle the id */ - if(!FLAC__metadata_object_application_set_data(app, data, sizeof(data), true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!FLAC__metadata_simple_iterator_set_block(iterator, app, false)) - return die_ss_("FLAC__metadata_simple_iterator_set_block(iterator, app, false)", iterator); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SVA[A]P\tset APPLICATION (shrink), don't fill in with padding\n"); - app->data.application.id[0] = 'h'; /* twiddle the id */ - if(!FLAC__metadata_object_application_set_data(app, data, 12, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!FLAC__metadata_simple_iterator_set_block(iterator, app, false)) - return die_ss_("FLAC__metadata_simple_iterator_set_block(iterator, app, false)", iterator); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SVA[A]P\tset APPLICATION (grow), expand into padding of exceeding size\n"); - app->data.application.id[0] = 'i'; /* twiddle the id */ - if(!FLAC__metadata_object_application_set_data(app, data, sizeof(data), true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - our_metadata_.blocks[our_current_position+1]->length -= (sizeof(data) - 12); - if(!FLAC__metadata_simple_iterator_set_block(iterator, app, true)) - return die_ss_("FLAC__metadata_simple_iterator_set_block(iterator, app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SVA[A]P\tset APPLICATION (shrink), fill in with padding\n"); - app->data.application.id[0] = 'j'; /* twiddle the id */ - if(!FLAC__metadata_object_application_set_data(app, data, 23, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!insert_to_our_metadata_(padding, our_current_position+1, /*copy=*/true)) - return die_("copying object"); - our_metadata_.blocks[our_current_position+1]->length = sizeof(data) - 23 - FLAC__STREAM_METADATA_HEADER_LENGTH; - if(!FLAC__metadata_simple_iterator_set_block(iterator, app, true)) - return die_ss_("FLAC__metadata_simple_iterator_set_block(iterator, app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SVA[A]PP\tnext\n"); - if(!FLAC__metadata_simple_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SVAA[P]P\tnext\n"); - if(!FLAC__metadata_simple_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SVAAP[P]\tset PADDING (shrink), don't fill in with padding\n"); - padding->length = 5; - if(!replace_in_our_metadata_(padding, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!FLAC__metadata_simple_iterator_set_block(iterator, padding, false)) - return die_ss_("FLAC__metadata_simple_iterator_set_block(iterator, padding, false)", iterator); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SVAAP[P]\tset APPLICATION (grow)\n"); - app->data.application.id[0] = 'k'; /* twiddle the id */ - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!FLAC__metadata_simple_iterator_set_block(iterator, app, false)) - return die_ss_("FLAC__metadata_simple_iterator_set_block(iterator, app, false)", iterator); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SVAAP[A]\tset PADDING (equal)\n"); - padding->length = 27; - if(!replace_in_our_metadata_(padding, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!FLAC__metadata_simple_iterator_set_block(iterator, padding, false)) - return die_ss_("FLAC__metadata_simple_iterator_set_block(iterator, padding, false)", iterator); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SVAAP[P]\tprev\n"); - if(!FLAC__metadata_simple_iterator_prev(iterator)) - return die_("iterator ended early\n"); - our_current_position--; - - printf("SVAA[P]P\tdelete (middle block), don't replace with padding\n"); - if(!FLAC__metadata_simple_iterator_delete_block(iterator, false)) - return die_ss_("FLAC__metadata_simple_iterator_delete_block(iterator, false)", iterator); - delete_from_our_metadata_(our_current_position--); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SVA[A]P\tdelete (middle block), don't replace with padding\n"); - if(!FLAC__metadata_simple_iterator_delete_block(iterator, false)) - return die_ss_("FLAC__metadata_simple_iterator_delete_block(iterator, false)", iterator); - delete_from_our_metadata_(our_current_position--); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]P\tnext\n"); - if(!FLAC__metadata_simple_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SVA[P]\tinsert PADDING after\n"); - padding->length = 5; - if(!FLAC__metadata_simple_iterator_insert_block_after(iterator, padding, false)) - return die_ss_("FLAC__metadata_simple_iterator_insert_block_after(iterator, padding, false)", iterator); - if(!insert_to_our_metadata_(padding, ++our_current_position, /*copy=*/true)) - return false; - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SVAP[P]\tprev\n"); - if(!FLAC__metadata_simple_iterator_prev(iterator)) - return die_("iterator ended early\n"); - our_current_position--; - - printf("SVA[P]P\tprev\n"); - if(!FLAC__metadata_simple_iterator_prev(iterator)) - return die_("iterator ended early\n"); - our_current_position--; - - printf("SV[A]PP\tset APPLICATION (grow), try to expand into padding which is too small\n"); - if(!FLAC__metadata_object_application_set_data(app, data, 32, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!FLAC__metadata_simple_iterator_set_block(iterator, app, true)) - return die_ss_("FLAC__metadata_simple_iterator_set_block(iterator, app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]PP\tset APPLICATION (grow), try to expand into padding which is 'close' but still too small\n"); - if(!FLAC__metadata_object_application_set_data(app, data, 60, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!FLAC__metadata_simple_iterator_set_block(iterator, app, true)) - return die_ss_("FLAC__metadata_simple_iterator_set_block(iterator, app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]PP\tset APPLICATION (grow), expand into padding which will leave 0-length pad\n"); - if(!FLAC__metadata_object_application_set_data(app, data, 87, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - our_metadata_.blocks[our_current_position+1]->length = 0; - if(!FLAC__metadata_simple_iterator_set_block(iterator, app, true)) - return die_ss_("FLAC__metadata_simple_iterator_set_block(iterator, app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]PP\tset APPLICATION (grow), expand into padding which is exactly consumed\n"); - if(!FLAC__metadata_object_application_set_data(app, data, 91, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - delete_from_our_metadata_(our_current_position+1); - if(!FLAC__metadata_simple_iterator_set_block(iterator, app, true)) - return die_ss_("FLAC__metadata_simple_iterator_set_block(iterator, app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]P\tset APPLICATION (grow), expand into padding which is exactly consumed\n"); - if(!FLAC__metadata_object_application_set_data(app, data, 100, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - delete_from_our_metadata_(our_current_position+1); - our_metadata_.blocks[our_current_position]->is_last = true; - if(!FLAC__metadata_simple_iterator_set_block(iterator, app, true)) - return die_ss_("FLAC__metadata_simple_iterator_set_block(iterator, app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]\tset PADDING (equal size)\n"); - padding->length = app->length; - if(!replace_in_our_metadata_(padding, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!FLAC__metadata_simple_iterator_set_block(iterator, padding, true)) - return die_ss_("FLAC__metadata_simple_iterator_set_block(iterator, padding, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SV[P]\tinsert PADDING after\n"); - if(!FLAC__metadata_simple_iterator_insert_block_after(iterator, padding, false)) - return die_ss_("FLAC__metadata_simple_iterator_insert_block_after(iterator, padding, false)", iterator); - if(!insert_to_our_metadata_(padding, ++our_current_position, /*copy=*/true)) - return false; - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SVP[P]\tinsert PADDING after\n"); - padding->length = 5; - if(!FLAC__metadata_simple_iterator_insert_block_after(iterator, padding, false)) - return die_ss_("FLAC__metadata_simple_iterator_insert_block_after(iterator, padding, false)", iterator); - if(!insert_to_our_metadata_(padding, ++our_current_position, /*copy=*/true)) - return false; - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SVPP[P]\tprev\n"); - if(!FLAC__metadata_simple_iterator_prev(iterator)) - return die_("iterator ended early\n"); - our_current_position--; - - printf("SVP[P]P\tprev\n"); - if(!FLAC__metadata_simple_iterator_prev(iterator)) - return die_("iterator ended early\n"); - our_current_position--; - - printf("SV[P]PP\tprev\n"); - if(!FLAC__metadata_simple_iterator_prev(iterator)) - return die_("iterator ended early\n"); - our_current_position--; - - printf("S[V]PPP\tinsert APPLICATION after, try to expand into padding which is too small\n"); - if(!FLAC__metadata_object_application_set_data(app, data, 101, true)) - return die_("setting APPLICATION data"); - if(!insert_to_our_metadata_(app, ++our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!FLAC__metadata_simple_iterator_insert_block_after(iterator, app, true)) - return die_ss_("FLAC__metadata_simple_iterator_insert_block_after(iterator, app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]PPP\tdelete (middle block), don't replace with padding\n"); - if(!FLAC__metadata_simple_iterator_delete_block(iterator, false)) - return die_ss_("FLAC__metadata_simple_iterator_delete_block(iterator, false)", iterator); - delete_from_our_metadata_(our_current_position--); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("S[V]PPP\tinsert APPLICATION after, try to expand into padding which is 'close' but still too small\n"); - if(!FLAC__metadata_object_application_set_data(app, data, 97, true)) - return die_("setting APPLICATION data"); - if(!insert_to_our_metadata_(app, ++our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!FLAC__metadata_simple_iterator_insert_block_after(iterator, app, true)) - return die_ss_("FLAC__metadata_simple_iterator_insert_block_after(iterator, app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]PPP\tdelete (middle block), don't replace with padding\n"); - if(!FLAC__metadata_simple_iterator_delete_block(iterator, false)) - return die_ss_("FLAC__metadata_simple_iterator_delete_block(iterator, false)", iterator); - delete_from_our_metadata_(our_current_position--); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("S[V]PPP\tinsert APPLICATION after, expand into padding which is exactly consumed\n"); - if(!FLAC__metadata_object_application_set_data(app, data, 100, true)) - return die_("setting APPLICATION data"); - if(!insert_to_our_metadata_(app, ++our_current_position, /*copy=*/true)) - return die_("copying object"); - delete_from_our_metadata_(our_current_position+1); - if(!FLAC__metadata_simple_iterator_insert_block_after(iterator, app, true)) - return die_ss_("FLAC__metadata_simple_iterator_insert_block_after(iterator, app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]PP\tdelete (middle block), don't replace with padding\n"); - if(!FLAC__metadata_simple_iterator_delete_block(iterator, false)) - return die_ss_("FLAC__metadata_simple_iterator_delete_block(iterator, false)", iterator); - delete_from_our_metadata_(our_current_position--); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("S[V]PP\tinsert APPLICATION after, expand into padding which will leave 0-length pad\n"); - if(!FLAC__metadata_object_application_set_data(app, data, 96, true)) - return die_("setting APPLICATION data"); - if(!insert_to_our_metadata_(app, ++our_current_position, /*copy=*/true)) - return die_("copying object"); - our_metadata_.blocks[our_current_position+1]->length = 0; - if(!FLAC__metadata_simple_iterator_insert_block_after(iterator, app, true)) - return die_ss_("FLAC__metadata_simple_iterator_insert_block_after(iterator, app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]PP\tdelete (middle block), don't replace with padding\n"); - if(!FLAC__metadata_simple_iterator_delete_block(iterator, false)) - return die_ss_("FLAC__metadata_simple_iterator_delete_block(iterator, false)", iterator); - delete_from_our_metadata_(our_current_position--); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("S[V]PP\tnext\n"); - if(!FLAC__metadata_simple_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[P]P\tdelete (middle block), don't replace with padding\n"); - if(!FLAC__metadata_simple_iterator_delete_block(iterator, false)) - return die_ss_("FLAC__metadata_simple_iterator_delete_block(iterator, false)", iterator); - delete_from_our_metadata_(our_current_position--); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("S[V]P\tinsert APPLICATION after, expand into padding which is exactly consumed\n"); - if(!FLAC__metadata_object_application_set_data(app, data, 1, true)) - return die_("setting APPLICATION data"); - if(!insert_to_our_metadata_(app, ++our_current_position, /*copy=*/true)) - return die_("copying object"); - delete_from_our_metadata_(our_current_position+1); - if(!FLAC__metadata_simple_iterator_insert_block_after(iterator, app, true)) - return die_ss_("FLAC__metadata_simple_iterator_insert_block_after(iterator, app, true)", iterator); - - if(!test_file_(/*is_ogg=*/false, decoder_metadata_callback_compare_)) - return false; - - printf("delete simple iterator\n"); - - FLAC__metadata_simple_iterator_delete(iterator); - - FLAC__metadata_object_delete(app); - FLAC__metadata_object_delete(padding); - - if(!remove_file_(flacfilename(/*is_ogg=*/false))) - return false; - - return true; -} - -static FLAC__bool test_level_2_(FLAC__bool filename_based, FLAC__bool is_ogg) -{ - FLAC__Metadata_Iterator *iterator; - FLAC__Metadata_Chain *chain; - FLAC__StreamMetadata *block, *app, *padding; - FLAC__byte data[2000]; - unsigned our_current_position; - - /* initialize 'data' to avoid Valgrind errors */ - memset(data, 0, sizeof(data)); - - printf("\n\n++++++ testing level 2 interface (%s-based, %s FLAC)\n", filename_based? "filename":"callback", is_ogg? "Ogg":"native"); - - printf("generate read-only file\n"); - - if(!generate_file_(/*include_extras=*/false, is_ogg)) - return false; - - if(!change_stats_(flacfilename(is_ogg), /*read_only=*/true)) - return false; - - printf("create chain\n"); - - if(0 == (chain = FLAC__metadata_chain_new())) - return die_("allocating chain"); - - printf("read chain\n"); - - if(!read_chain_(chain, flacfilename(is_ogg), filename_based, is_ogg)) - return die_c_("reading chain", FLAC__metadata_chain_status(chain)); - - printf("[S]VP\ttest initial metadata\n"); - - if(!compare_chain_(chain, 0, 0)) - return false; - if(!test_file_(is_ogg, decoder_metadata_callback_compare_)) - return false; - - if(is_ogg) - goto end; - - printf("switch file to read-write\n"); - - if(!change_stats_(flacfilename(is_ogg), /*read-only=*/false)) - return false; - - printf("create iterator\n"); - if(0 == (iterator = FLAC__metadata_iterator_new())) - return die_("allocating memory for iterator"); - - our_current_position = 0; - - FLAC__metadata_iterator_init(iterator, chain); - - if(0 == (block = FLAC__metadata_iterator_get_block(iterator))) - return die_("getting block from iterator"); - - FLAC__ASSERT(block->type == FLAC__METADATA_TYPE_STREAMINFO); - - printf("[S]VP\tmodify STREAMINFO, write\n"); - - block->data.stream_info.sample_rate = 32000; - if(!replace_in_our_metadata_(block, our_current_position, /*copy=*/true)) - return die_("copying object"); - - if(!write_chain_(chain, /*use_padding=*/false, /*preserve_file_stats=*/true, filename_based, flacfilename(is_ogg))) - return die_c_("during FLAC__metadata_chain_write(chain, false, true)", FLAC__metadata_chain_status(chain)); - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - if(!test_file_(is_ogg, decoder_metadata_callback_compare_)) - return false; - - printf("[S]VP\tnext\n"); - if(!FLAC__metadata_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("S[V]P\tnext\n"); - if(!FLAC__metadata_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[P]\treplace PADDING with identical-size APPLICATION\n"); - if(0 == (block = FLAC__metadata_iterator_get_block(iterator))) - return die_("getting block from iterator"); - if(0 == (app = FLAC__metadata_object_new(FLAC__METADATA_TYPE_APPLICATION))) - return die_("FLAC__metadata_object_new(FLAC__METADATA_TYPE_APPLICATION)"); - memcpy(app->data.application.id, "duh", (FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8)); - if(!FLAC__metadata_object_application_set_data(app, data, block->length-(FLAC__STREAM_METADATA_APPLICATION_ID_LEN/8), true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!FLAC__metadata_iterator_set_block(iterator, app)) - return die_c_("FLAC__metadata_iterator_set_block(iterator, app)", FLAC__metadata_chain_status(chain)); - - if(!write_chain_(chain, /*use_padding=*/false, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during FLAC__metadata_chain_write(chain, false, false)", FLAC__metadata_chain_status(chain)); - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - if(!test_file_(is_ogg, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]\tshrink APPLICATION, don't use padding\n"); - if(0 == (app = FLAC__metadata_object_clone(our_metadata_.blocks[our_current_position]))) - return die_("copying object"); - if(!FLAC__metadata_object_application_set_data(app, data, 26, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!FLAC__metadata_iterator_set_block(iterator, app)) - return die_c_("FLAC__metadata_iterator_set_block(iterator, app)", FLAC__metadata_chain_status(chain)); - - if(!write_chain_(chain, /*use_padding=*/false, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during FLAC__metadata_chain_write(chain, false, false)", FLAC__metadata_chain_status(chain)); - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - if(!test_file_(is_ogg, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]\tgrow APPLICATION, don't use padding\n"); - if(0 == (app = FLAC__metadata_object_clone(our_metadata_.blocks[our_current_position]))) - return die_("copying object"); - if(!FLAC__metadata_object_application_set_data(app, data, 28, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!FLAC__metadata_iterator_set_block(iterator, app)) - return die_c_("FLAC__metadata_iterator_set_block(iterator, app)", FLAC__metadata_chain_status(chain)); - - if(!write_chain_(chain, /*use_padding=*/false, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during FLAC__metadata_chain_write(chain, false, false)", FLAC__metadata_chain_status(chain)); - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - if(!test_file_(is_ogg, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]\tgrow APPLICATION, use padding, but last block is not padding\n"); - if(0 == (app = FLAC__metadata_object_clone(our_metadata_.blocks[our_current_position]))) - return die_("copying object"); - if(!FLAC__metadata_object_application_set_data(app, data, 36, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!FLAC__metadata_iterator_set_block(iterator, app)) - return die_c_("FLAC__metadata_iterator_set_block(iterator, app)", FLAC__metadata_chain_status(chain)); - - if(!write_chain_(chain, /*use_padding=*/false, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during FLAC__metadata_chain_write(chain, false, false)", FLAC__metadata_chain_status(chain)); - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - if(!test_file_(is_ogg, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]\tshrink APPLICATION, use padding, last block is not padding, but delta is too small for new PADDING block\n"); - if(0 == (app = FLAC__metadata_object_clone(our_metadata_.blocks[our_current_position]))) - return die_("copying object"); - if(!FLAC__metadata_object_application_set_data(app, data, 33, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!FLAC__metadata_iterator_set_block(iterator, app)) - return die_c_("FLAC__metadata_iterator_set_block(iterator, app)", FLAC__metadata_chain_status(chain)); - - if(!write_chain_(chain, /*use_padding=*/true, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during FLAC__metadata_chain_write(chain, true, false)", FLAC__metadata_chain_status(chain)); - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - if(!test_file_(is_ogg, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]\tshrink APPLICATION, use padding, last block is not padding, delta is enough for new PADDING block\n"); - if(0 == (padding = FLAC__metadata_object_new(FLAC__METADATA_TYPE_PADDING))) - return die_("creating PADDING block"); - if(0 == (app = FLAC__metadata_object_clone(our_metadata_.blocks[our_current_position]))) - return die_("copying object"); - if(!FLAC__metadata_object_application_set_data(app, data, 29, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - padding->length = 0; - if(!insert_to_our_metadata_(padding, our_current_position+1, /*copy=*/false)) - return die_("internal error"); - if(!FLAC__metadata_iterator_set_block(iterator, app)) - return die_c_("FLAC__metadata_iterator_set_block(iterator, app)", FLAC__metadata_chain_status(chain)); - - if(!write_chain_(chain, /*use_padding=*/true, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during FLAC__metadata_chain_write(chain, true, false)", FLAC__metadata_chain_status(chain)); - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - if(!test_file_(is_ogg, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]P\tshrink APPLICATION, use padding, last block is padding\n"); - if(0 == (app = FLAC__metadata_object_clone(our_metadata_.blocks[our_current_position]))) - return die_("copying object"); - if(!FLAC__metadata_object_application_set_data(app, data, 16, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - our_metadata_.blocks[our_current_position+1]->length = 13; - if(!FLAC__metadata_iterator_set_block(iterator, app)) - return die_c_("FLAC__metadata_iterator_set_block(iterator, app)", FLAC__metadata_chain_status(chain)); - - if(!write_chain_(chain, /*use_padding=*/true, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during FLAC__metadata_chain_write(chain, true, false)", FLAC__metadata_chain_status(chain)); - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - if(!test_file_(is_ogg, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]P\tgrow APPLICATION, use padding, last block is padding, but delta is too small\n"); - if(0 == (app = FLAC__metadata_object_clone(our_metadata_.blocks[our_current_position]))) - return die_("copying object"); - if(!FLAC__metadata_object_application_set_data(app, data, 50, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - if(!FLAC__metadata_iterator_set_block(iterator, app)) - return die_c_("FLAC__metadata_iterator_set_block(iterator, app)", FLAC__metadata_chain_status(chain)); - - if(!write_chain_(chain, /*use_padding=*/true, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during FLAC__metadata_chain_write(chain, true, false)", FLAC__metadata_chain_status(chain)); - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - if(!test_file_(is_ogg, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]P\tgrow APPLICATION, use padding, last block is padding of exceeding size\n"); - if(0 == (app = FLAC__metadata_object_clone(our_metadata_.blocks[our_current_position]))) - return die_("copying object"); - if(!FLAC__metadata_object_application_set_data(app, data, 56, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - our_metadata_.blocks[our_current_position+1]->length -= (56 - 50); - if(!FLAC__metadata_iterator_set_block(iterator, app)) - return die_c_("FLAC__metadata_iterator_set_block(iterator, app)", FLAC__metadata_chain_status(chain)); - - if(!write_chain_(chain, /*use_padding=*/true, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during FLAC__metadata_chain_write(chain, true, false)", FLAC__metadata_chain_status(chain)); - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - if(!test_file_(is_ogg, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]P\tgrow APPLICATION, use padding, last block is padding of exact size\n"); - if(0 == (app = FLAC__metadata_object_clone(our_metadata_.blocks[our_current_position]))) - return die_("copying object"); - if(!FLAC__metadata_object_application_set_data(app, data, 67, true)) - return die_("setting APPLICATION data"); - if(!replace_in_our_metadata_(app, our_current_position, /*copy=*/true)) - return die_("copying object"); - delete_from_our_metadata_(our_current_position+1); - if(!FLAC__metadata_iterator_set_block(iterator, app)) - return die_c_("FLAC__metadata_iterator_set_block(iterator, app)", FLAC__metadata_chain_status(chain)); - - if(!write_chain_(chain, /*use_padding=*/true, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during FLAC__metadata_chain_write(chain, true, false)", FLAC__metadata_chain_status(chain)); - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - if(!test_file_(is_ogg, decoder_metadata_callback_compare_)) - return false; - - printf("SV[A]\tprev\n"); - if(!FLAC__metadata_iterator_prev(iterator)) - return die_("iterator ended early\n"); - our_current_position--; - - printf("S[V]A\tprev\n"); - if(!FLAC__metadata_iterator_prev(iterator)) - return die_("iterator ended early\n"); - our_current_position--; - - printf("[S]VA\tinsert PADDING before STREAMINFO (should fail)\n"); - if(0 == (padding = FLAC__metadata_object_new(FLAC__METADATA_TYPE_PADDING))) - return die_("creating PADDING block"); - padding->length = 30; - if(!FLAC__metadata_iterator_insert_block_before(iterator, padding)) - printf("\tFLAC__metadata_iterator_insert_block_before() returned false like it should\n"); - else - return die_("FLAC__metadata_iterator_insert_block_before() should have returned false"); - - printf("[S]VP\tnext\n"); - if(!FLAC__metadata_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("S[V]A\tinsert PADDING after\n"); - if(!insert_to_our_metadata_(padding, ++our_current_position, /*copy=*/true)) - return die_("copying metadata"); - if(!FLAC__metadata_iterator_insert_block_after(iterator, padding)) - return die_("FLAC__metadata_iterator_insert_block_after(iterator, padding)"); - - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - - printf("SV[P]A\tinsert PADDING before\n"); - if(0 == (padding = FLAC__metadata_object_clone(our_metadata_.blocks[our_current_position]))) - return die_("creating PADDING block"); - padding->length = 17; - if(!insert_to_our_metadata_(padding, our_current_position, /*copy=*/true)) - return die_("copying metadata"); - if(!FLAC__metadata_iterator_insert_block_before(iterator, padding)) - return die_("FLAC__metadata_iterator_insert_block_before(iterator, padding)"); - - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - - printf("SV[P]PA\tinsert PADDING before\n"); - if(0 == (padding = FLAC__metadata_object_clone(our_metadata_.blocks[our_current_position]))) - return die_("creating PADDING block"); - padding->length = 0; - if(!insert_to_our_metadata_(padding, our_current_position, /*copy=*/true)) - return die_("copying metadata"); - if(!FLAC__metadata_iterator_insert_block_before(iterator, padding)) - return die_("FLAC__metadata_iterator_insert_block_before(iterator, padding)"); - - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - - printf("SV[P]PPA\tnext\n"); - if(!FLAC__metadata_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SVP[P]PA\tnext\n"); - if(!FLAC__metadata_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SVPP[P]A\tnext\n"); - if(!FLAC__metadata_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SVPPP[A]\tinsert PADDING after\n"); - if(0 == (padding = FLAC__metadata_object_clone(our_metadata_.blocks[2]))) - return die_("creating PADDING block"); - padding->length = 57; - if(!insert_to_our_metadata_(padding, ++our_current_position, /*copy=*/true)) - return die_("copying metadata"); - if(!FLAC__metadata_iterator_insert_block_after(iterator, padding)) - return die_("FLAC__metadata_iterator_insert_block_after(iterator, padding)"); - - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - - printf("SVPPPA[P]\tinsert PADDING before\n"); - if(0 == (padding = FLAC__metadata_object_clone(our_metadata_.blocks[2]))) - return die_("creating PADDING block"); - padding->length = 99; - if(!insert_to_our_metadata_(padding, our_current_position, /*copy=*/true)) - return die_("copying metadata"); - if(!FLAC__metadata_iterator_insert_block_before(iterator, padding)) - return die_("FLAC__metadata_iterator_insert_block_before(iterator, padding)"); - - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - - printf("delete iterator\n"); - FLAC__metadata_iterator_delete(iterator); - our_current_position = 0; - - printf("SVPPPAPP\tmerge padding\n"); - FLAC__metadata_chain_merge_padding(chain); - our_metadata_.blocks[2]->length += (FLAC__STREAM_METADATA_HEADER_LENGTH + our_metadata_.blocks[3]->length); - our_metadata_.blocks[2]->length += (FLAC__STREAM_METADATA_HEADER_LENGTH + our_metadata_.blocks[4]->length); - our_metadata_.blocks[6]->length += (FLAC__STREAM_METADATA_HEADER_LENGTH + our_metadata_.blocks[7]->length); - delete_from_our_metadata_(7); - delete_from_our_metadata_(4); - delete_from_our_metadata_(3); - - if(!write_chain_(chain, /*use_padding=*/true, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during FLAC__metadata_chain_write(chain, true, false)", FLAC__metadata_chain_status(chain)); - if(!compare_chain_(chain, 0, 0)) - return false; - if(!test_file_(is_ogg, decoder_metadata_callback_compare_)) - return false; - - printf("SVPAP\tsort padding\n"); - FLAC__metadata_chain_sort_padding(chain); - our_metadata_.blocks[4]->length += (FLAC__STREAM_METADATA_HEADER_LENGTH + our_metadata_.blocks[2]->length); - delete_from_our_metadata_(2); - - if(!write_chain_(chain, /*use_padding=*/true, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during FLAC__metadata_chain_write(chain, true, false)", FLAC__metadata_chain_status(chain)); - if(!compare_chain_(chain, 0, 0)) - return false; - if(!test_file_(is_ogg, decoder_metadata_callback_compare_)) - return false; - - printf("create iterator\n"); - if(0 == (iterator = FLAC__metadata_iterator_new())) - return die_("allocating memory for iterator"); - - our_current_position = 0; - - FLAC__metadata_iterator_init(iterator, chain); - - printf("[S]VAP\tnext\n"); - if(!FLAC__metadata_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("S[V]AP\tnext\n"); - if(!FLAC__metadata_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[A]P\tdelete middle block, replace with padding\n"); - if(0 == (padding = FLAC__metadata_object_new(FLAC__METADATA_TYPE_PADDING))) - return die_("creating PADDING block"); - padding->length = 71; - if(!replace_in_our_metadata_(padding, our_current_position--, /*copy=*/false)) - return die_("copying object"); - if(!FLAC__metadata_iterator_delete_block(iterator, /*replace_with_padding=*/true)) - return die_c_("FLAC__metadata_iterator_delete_block(iterator, true)", FLAC__metadata_chain_status(chain)); - - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - - printf("S[V]PP\tnext\n"); - if(!FLAC__metadata_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[P]P\tdelete middle block, don't replace with padding\n"); - delete_from_our_metadata_(our_current_position--); - if(!FLAC__metadata_iterator_delete_block(iterator, /*replace_with_padding=*/false)) - return die_c_("FLAC__metadata_iterator_delete_block(iterator, false)", FLAC__metadata_chain_status(chain)); - - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - - printf("S[V]P\tnext\n"); - if(!FLAC__metadata_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[P]\tdelete last block, replace with padding\n"); - if(0 == (padding = FLAC__metadata_object_new(FLAC__METADATA_TYPE_PADDING))) - return die_("creating PADDING block"); - padding->length = 219; - if(!replace_in_our_metadata_(padding, our_current_position--, /*copy=*/false)) - return die_("copying object"); - if(!FLAC__metadata_iterator_delete_block(iterator, /*replace_with_padding=*/true)) - return die_c_("FLAC__metadata_iterator_delete_block(iterator, true)", FLAC__metadata_chain_status(chain)); - - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - - printf("S[V]P\tnext\n"); - if(!FLAC__metadata_iterator_next(iterator)) - return die_("iterator ended early\n"); - our_current_position++; - - printf("SV[P]\tdelete last block, don't replace with padding\n"); - delete_from_our_metadata_(our_current_position--); - if(!FLAC__metadata_iterator_delete_block(iterator, /*replace_with_padding=*/false)) - return die_c_("FLAC__metadata_iterator_delete_block(iterator, false)", FLAC__metadata_chain_status(chain)); - - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - - printf("S[V]\tprev\n"); - if(!FLAC__metadata_iterator_prev(iterator)) - return die_("iterator ended early\n"); - our_current_position--; - - printf("[S]V\tdelete STREAMINFO block, should fail\n"); - if(FLAC__metadata_iterator_delete_block(iterator, /*replace_with_padding=*/false)) - return die_("FLAC__metadata_iterator_delete_block() on STREAMINFO should have failed but didn't"); - - if(!compare_chain_(chain, our_current_position, FLAC__metadata_iterator_get_block(iterator))) - return false; - - printf("delete iterator\n"); - FLAC__metadata_iterator_delete(iterator); - our_current_position = 0; - - printf("SV\tmerge padding\n"); - FLAC__metadata_chain_merge_padding(chain); - - if(!write_chain_(chain, /*use_padding=*/false, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during FLAC__metadata_chain_write(chain, false, false)", FLAC__metadata_chain_status(chain)); - if(!compare_chain_(chain, 0, 0)) - return false; - if(!test_file_(is_ogg, decoder_metadata_callback_compare_)) - return false; - - printf("SV\tsort padding\n"); - FLAC__metadata_chain_sort_padding(chain); - - if(!write_chain_(chain, /*use_padding=*/false, /*preserve_file_stats=*/false, filename_based, flacfilename(is_ogg))) - return die_c_("during FLAC__metadata_chain_write(chain, false, false)", FLAC__metadata_chain_status(chain)); - if(!compare_chain_(chain, 0, 0)) - return false; - if(!test_file_(is_ogg, decoder_metadata_callback_compare_)) - return false; - -end: - printf("delete chain\n"); - - FLAC__metadata_chain_delete(chain); - - if(!remove_file_(flacfilename(is_ogg))) - return false; - - return true; -} - -static FLAC__bool test_level_2_misc_(FLAC__bool is_ogg) -{ - FLAC__Metadata_Iterator *iterator; - FLAC__Metadata_Chain *chain; - FLAC__IOCallbacks callbacks; - - memset(&callbacks, 0, sizeof(callbacks)); - callbacks.read = (FLAC__IOCallback_Read)fread; -#ifdef FLAC__VALGRIND_TESTING - callbacks.write = chain_write_cb_; -#else - callbacks.write = (FLAC__IOCallback_Write)fwrite; -#endif - callbacks.seek = chain_seek_cb_; - callbacks.tell = chain_tell_cb_; - callbacks.eof = chain_eof_cb_; - - printf("\n\n++++++ testing level 2 interface (mismatched read/write protections)\n"); - - printf("generate file\n"); - - if(!generate_file_(/*include_extras=*/false, is_ogg)) - return false; - - printf("create chain\n"); - - if(0 == (chain = FLAC__metadata_chain_new())) - return die_("allocating chain"); - - printf("read chain (filename-based)\n"); - - if(!FLAC__metadata_chain_read(chain, flacfilename(is_ogg))) - return die_c_("reading chain", FLAC__metadata_chain_status(chain)); - - printf("write chain with wrong method FLAC__metadata_chain_write_with_callbacks()\n"); - { - if(FLAC__metadata_chain_write_with_callbacks(chain, /*use_padding=*/false, 0, callbacks)) - return die_c_("mismatched write should have failed", FLAC__metadata_chain_status(chain)); - if(FLAC__metadata_chain_status(chain) != FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH) - return die_c_("expected FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH", FLAC__metadata_chain_status(chain)); - printf(" OK: FLAC__metadata_chain_write_with_callbacks() returned false,FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH like it should\n"); - } - - printf("read chain (filename-based)\n"); - - if(!FLAC__metadata_chain_read(chain, flacfilename(is_ogg))) - return die_c_("reading chain", FLAC__metadata_chain_status(chain)); - - printf("write chain with wrong method FLAC__metadata_chain_write_with_callbacks_and_tempfile()\n"); - { - if(FLAC__metadata_chain_write_with_callbacks_and_tempfile(chain, /*use_padding=*/false, 0, callbacks, 0, callbacks)) - return die_c_("mismatched write should have failed", FLAC__metadata_chain_status(chain)); - if(FLAC__metadata_chain_status(chain) != FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH) - return die_c_("expected FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH", FLAC__metadata_chain_status(chain)); - printf(" OK: FLAC__metadata_chain_write_with_callbacks_and_tempfile() returned false,FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH like it should\n"); - } - - printf("read chain (callback-based)\n"); - { - FILE *file = fopen(flacfilename(is_ogg), "rb"); - if(0 == file) - return die_("opening file"); - if(!FLAC__metadata_chain_read_with_callbacks(chain, (FLAC__IOHandle)file, callbacks)) { - fclose(file); - return die_c_("reading chain", FLAC__metadata_chain_status(chain)); - } - fclose(file); - } - - printf("write chain with wrong method FLAC__metadata_chain_write()\n"); - { - if(FLAC__metadata_chain_write(chain, /*use_padding=*/false, /*preserve_file_stats=*/false)) - return die_c_("mismatched write should have failed", FLAC__metadata_chain_status(chain)); - if(FLAC__metadata_chain_status(chain) != FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH) - return die_c_("expected FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH", FLAC__metadata_chain_status(chain)); - printf(" OK: FLAC__metadata_chain_write() returned false,FLAC__METADATA_CHAIN_STATUS_READ_WRITE_MISMATCH like it should\n"); - } - - printf("read chain (callback-based)\n"); - { - FILE *file = fopen(flacfilename(is_ogg), "rb"); - if(0 == file) - return die_("opening file"); - if(!FLAC__metadata_chain_read_with_callbacks(chain, (FLAC__IOHandle)file, callbacks)) { - fclose(file); - return die_c_("reading chain", FLAC__metadata_chain_status(chain)); - } - fclose(file); - } - - printf("testing FLAC__metadata_chain_check_if_tempfile_needed()... "); - - if(!FLAC__metadata_chain_check_if_tempfile_needed(chain, /*use_padding=*/false)) - printf("OK: FLAC__metadata_chain_check_if_tempfile_needed() returned false like it should\n"); - else - return die_("FLAC__metadata_chain_check_if_tempfile_needed() returned true but shouldn't have"); - - printf("write chain with wrong method FLAC__metadata_chain_write_with_callbacks_and_tempfile()\n"); - { - if(FLAC__metadata_chain_write_with_callbacks_and_tempfile(chain, /*use_padding=*/false, 0, callbacks, 0, callbacks)) - return die_c_("mismatched write should have failed", FLAC__metadata_chain_status(chain)); - if(FLAC__metadata_chain_status(chain) != FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL) - return die_c_("expected FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL", FLAC__metadata_chain_status(chain)); - printf(" OK: FLAC__metadata_chain_write_with_callbacks_and_tempfile() returned false,FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL like it should\n"); - } - - printf("read chain (callback-based)\n"); - { - FILE *file = fopen(flacfilename(is_ogg), "rb"); - if(0 == file) - return die_("opening file"); - if(!FLAC__metadata_chain_read_with_callbacks(chain, (FLAC__IOHandle)file, callbacks)) { - fclose(file); - return die_c_("reading chain", FLAC__metadata_chain_status(chain)); - } - fclose(file); - } - - printf("create iterator\n"); - if(0 == (iterator = FLAC__metadata_iterator_new())) - return die_("allocating memory for iterator"); - - FLAC__metadata_iterator_init(iterator, chain); - - printf("[S]VP\tnext\n"); - if(!FLAC__metadata_iterator_next(iterator)) - return die_("iterator ended early\n"); - - printf("S[V]P\tdelete VORBIS_COMMENT, write\n"); - if(!FLAC__metadata_iterator_delete_block(iterator, /*replace_with_padding=*/false)) - return die_c_("block delete failed\n", FLAC__metadata_chain_status(chain)); - - printf("testing FLAC__metadata_chain_check_if_tempfile_needed()... "); - - if(FLAC__metadata_chain_check_if_tempfile_needed(chain, /*use_padding=*/false)) - printf("OK: FLAC__metadata_chain_check_if_tempfile_needed() returned true like it should\n"); - else - return die_("FLAC__metadata_chain_check_if_tempfile_needed() returned false but shouldn't have"); - - printf("write chain with wrong method FLAC__metadata_chain_write_with_callbacks()\n"); - { - if(FLAC__metadata_chain_write_with_callbacks(chain, /*use_padding=*/false, 0, callbacks)) - return die_c_("mismatched write should have failed", FLAC__metadata_chain_status(chain)); - if(FLAC__metadata_chain_status(chain) != FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL) - return die_c_("expected FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL", FLAC__metadata_chain_status(chain)); - printf(" OK: FLAC__metadata_chain_write_with_callbacks() returned false,FLAC__METADATA_CHAIN_STATUS_WRONG_WRITE_CALL like it should\n"); - } - - printf("delete iterator\n"); - - FLAC__metadata_iterator_delete(iterator); - - printf("delete chain\n"); - - FLAC__metadata_chain_delete(chain); - - if(!remove_file_(flacfilename(is_ogg))) - return false; - - return true; -} - -FLAC__bool test_metadata_file_manipulation(void) -{ - printf("\n+++ libFLAC unit test: metadata manipulation\n\n"); - - our_metadata_.num_blocks = 0; - - if(!test_level_0_()) - return false; - - if(!test_level_1_()) - return false; - - if(!test_level_2_(/*filename_based=*/true, /*is_ogg=*/false)) /* filename-based */ - return false; - if(!test_level_2_(/*filename_based=*/false, /*is_ogg=*/false)) /* callback-based */ - return false; - if(!test_level_2_misc_(/*is_ogg=*/false)) - return false; - - if(FLAC_API_SUPPORTS_OGG_FLAC) { - if(!test_level_2_(/*filename_based=*/true, /*is_ogg=*/true)) /* filename-based */ - return false; - if(!test_level_2_(/*filename_based=*/false, /*is_ogg=*/true)) /* callback-based */ - return false; -#if 0 - /* when ogg flac write is supported, will have to add this: */ - if(!test_level_2_misc_(/*is_ogg=*/true)) - return false; -#endif - } - - return true; -} diff --git a/3rdparty/libflac/src/test_libFLAC/metadata_object.c b/3rdparty/libflac/src/test_libFLAC/metadata_object.c deleted file mode 100644 index 617248fb14f..00000000000 --- a/3rdparty/libflac/src/test_libFLAC/metadata_object.c +++ /dev/null @@ -1,2299 +0,0 @@ -/* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "FLAC/assert.h" -#include "FLAC/metadata.h" -#include "test_libs_common/metadata_utils.h" -#include "metadata.h" -#include <stdio.h> -#include <stdlib.h> /* for malloc() */ -#include <string.h> /* for memcmp() */ - -static FLAC__byte *make_dummydata_(FLAC__byte *dummydata, unsigned len) -{ - FLAC__byte *ret; - - if(0 == (ret = (FLAC__byte*)malloc(len))) { - printf("FAILED, malloc error\n"); - exit(1); - } - else - memcpy(ret, dummydata, len); - - return ret; -} - -static FLAC__bool compare_track_(const FLAC__StreamMetadata_CueSheet_Track *from, const FLAC__StreamMetadata_CueSheet_Track *to) -{ - unsigned i; - - if(from->offset != to->offset) { -#ifdef _MSC_VER - printf("FAILED, track offset mismatch, expected %I64u, got %I64u\n", to->offset, from->offset); -#else - printf("FAILED, track offset mismatch, expected %llu, got %llu\n", (unsigned long long)to->offset, (unsigned long long)from->offset); -#endif - return false; - } - if(from->number != to->number) { - printf("FAILED, track number mismatch, expected %u, got %u\n", (unsigned)to->number, (unsigned)from->number); - return false; - } - if(0 != strcmp(from->isrc, to->isrc)) { - printf("FAILED, track number mismatch, expected %s, got %s\n", to->isrc, from->isrc); - return false; - } - if(from->type != to->type) { - printf("FAILED, track type mismatch, expected %u, got %u\n", (unsigned)to->type, (unsigned)from->type); - return false; - } - if(from->pre_emphasis != to->pre_emphasis) { - printf("FAILED, track pre_emphasis mismatch, expected %u, got %u\n", (unsigned)to->pre_emphasis, (unsigned)from->pre_emphasis); - return false; - } - if(from->num_indices != to->num_indices) { - printf("FAILED, track num_indices mismatch, expected %u, got %u\n", (unsigned)to->num_indices, (unsigned)from->num_indices); - return false; - } - if(0 == to->indices || 0 == from->indices) { - if(to->indices != from->indices) { - printf("FAILED, track indices mismatch\n"); - return false; - } - } - else { - for(i = 0; i < to->num_indices; i++) { - if(from->indices[i].offset != to->indices[i].offset) { -#ifdef _MSC_VER - printf("FAILED, track indices[%u].offset mismatch, expected %I64u, got %I64u\n", i, to->indices[i].offset, from->indices[i].offset); -#else - printf("FAILED, track indices[%u].offset mismatch, expected %llu, got %llu\n", i, (unsigned long long)to->indices[i].offset, (unsigned long long)from->indices[i].offset); -#endif - return false; - } - if(from->indices[i].number != to->indices[i].number) { - printf("FAILED, track indices[%u].number mismatch, expected %u, got %u\n", i, (unsigned)to->indices[i].number, (unsigned)from->indices[i].number); - return false; - } - } - } - - return true; -} - -static FLAC__bool compare_seekpoint_array_(const FLAC__StreamMetadata_SeekPoint *from, const FLAC__StreamMetadata_SeekPoint *to, unsigned n) -{ - unsigned i; - - FLAC__ASSERT(0 != from); - FLAC__ASSERT(0 != to); - - for(i = 0; i < n; i++) { - if(from[i].sample_number != to[i].sample_number) { -#ifdef _MSC_VER - printf("FAILED, point[%u].sample_number mismatch, expected %I64u, got %I64u\n", i, to[i].sample_number, from[i].sample_number); -#else - printf("FAILED, point[%u].sample_number mismatch, expected %llu, got %llu\n", i, (unsigned long long)to[i].sample_number, (unsigned long long)from[i].sample_number); -#endif - return false; - } - if(from[i].stream_offset != to[i].stream_offset) { -#ifdef _MSC_VER - printf("FAILED, point[%u].stream_offset mismatch, expected %I64u, got %I64u\n", i, to[i].stream_offset, from[i].stream_offset); -#else - printf("FAILED, point[%u].stream_offset mismatch, expected %llu, got %llu\n", i, (unsigned long long)to[i].stream_offset, (unsigned long long)from[i].stream_offset); -#endif - return false; - } - if(from[i].frame_samples != to[i].frame_samples) { - printf("FAILED, point[%u].frame_samples mismatch, expected %u, got %u\n", i, to[i].frame_samples, from[i].frame_samples); - return false; - } - } - - return true; -} - -static FLAC__bool check_seektable_(const FLAC__StreamMetadata *block, unsigned num_points, const FLAC__StreamMetadata_SeekPoint *array) -{ - const unsigned expected_length = num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH; - - if(block->length != expected_length) { - printf("FAILED, bad length, expected %u, got %u\n", expected_length, block->length); - return false; - } - if(block->data.seek_table.num_points != num_points) { - printf("FAILED, expected %u point, got %u\n", num_points, block->data.seek_table.num_points); - return false; - } - if(0 == array) { - if(0 != block->data.seek_table.points) { - printf("FAILED, 'points' pointer is not null\n"); - return false; - } - } - else { - if(!compare_seekpoint_array_(block->data.seek_table.points, array, num_points)) - return false; - } - printf("OK\n"); - - return true; -} - -static void entry_new_(FLAC__StreamMetadata_VorbisComment_Entry *entry, const char *field) -{ - entry->length = strlen(field); - entry->entry = (FLAC__byte*)malloc(entry->length+1); - FLAC__ASSERT(0 != entry->entry); - memcpy(entry->entry, field, entry->length); - entry->entry[entry->length] = '\0'; -} - -static void entry_clone_(FLAC__StreamMetadata_VorbisComment_Entry *entry) -{ - FLAC__byte *x = (FLAC__byte*)malloc(entry->length+1); - FLAC__ASSERT(0 != x); - memcpy(x, entry->entry, entry->length); - x[entry->length] = '\0'; - entry->entry = x; -} - -static void vc_calc_len_(FLAC__StreamMetadata *block) -{ - const FLAC__StreamMetadata_VorbisComment *vc = &block->data.vorbis_comment; - unsigned i; - - block->length = FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN / 8; - block->length += vc->vendor_string.length; - block->length += FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN / 8; - for(i = 0; i < vc->num_comments; i++) { - block->length += FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN / 8; - block->length += vc->comments[i].length; - } -} - -static void vc_resize_(FLAC__StreamMetadata *block, unsigned num) -{ - FLAC__StreamMetadata_VorbisComment *vc = &block->data.vorbis_comment; - - if(vc->num_comments != 0) { - FLAC__ASSERT(0 != vc->comments); - if(num < vc->num_comments) { - unsigned i; - for(i = num; i < vc->num_comments; i++) { - if(0 != vc->comments[i].entry) - free(vc->comments[i].entry); - } - } - } - if(num == 0) { - if(0 != vc->comments) { - free(vc->comments); - vc->comments = 0; - } - } - else { - vc->comments = (FLAC__StreamMetadata_VorbisComment_Entry*)realloc(vc->comments, sizeof(FLAC__StreamMetadata_VorbisComment_Entry)*num); - FLAC__ASSERT(0 != vc->comments); - if(num > vc->num_comments) - memset(vc->comments+vc->num_comments, 0, sizeof(FLAC__StreamMetadata_VorbisComment_Entry)*(num-vc->num_comments)); - } - - vc->num_comments = num; - vc_calc_len_(block); -} - -static int vc_find_from_(FLAC__StreamMetadata *block, const char *name, unsigned start) -{ - const unsigned n = strlen(name); - unsigned i; - for(i = start; i < block->data.vorbis_comment.num_comments; i++) { - const FLAC__StreamMetadata_VorbisComment_Entry *entry = &block->data.vorbis_comment.comments[i]; - if(entry->length > n && 0 == strncmp((const char *)entry->entry, name, n) && entry->entry[n] == '=') - return (int)i; - } - return -1; -} - -static void vc_set_vs_new_(FLAC__StreamMetadata_VorbisComment_Entry *entry, FLAC__StreamMetadata *block, const char *field) -{ - if(0 != block->data.vorbis_comment.vendor_string.entry) - free(block->data.vorbis_comment.vendor_string.entry); - entry_new_(entry, field); - block->data.vorbis_comment.vendor_string = *entry; - vc_calc_len_(block); -} - -static void vc_set_new_(FLAC__StreamMetadata_VorbisComment_Entry *entry, FLAC__StreamMetadata *block, unsigned pos, const char *field) -{ - if(0 != block->data.vorbis_comment.comments[pos].entry) - free(block->data.vorbis_comment.comments[pos].entry); - entry_new_(entry, field); - block->data.vorbis_comment.comments[pos] = *entry; - vc_calc_len_(block); -} - -static void vc_insert_new_(FLAC__StreamMetadata_VorbisComment_Entry *entry, FLAC__StreamMetadata *block, unsigned pos, const char *field) -{ - vc_resize_(block, block->data.vorbis_comment.num_comments+1); - memmove(&block->data.vorbis_comment.comments[pos+1], &block->data.vorbis_comment.comments[pos], sizeof(FLAC__StreamMetadata_VorbisComment_Entry)*(block->data.vorbis_comment.num_comments-1-pos)); - memset(&block->data.vorbis_comment.comments[pos], 0, sizeof(FLAC__StreamMetadata_VorbisComment_Entry)); - vc_set_new_(entry, block, pos, field); - vc_calc_len_(block); -} - -static void vc_delete_(FLAC__StreamMetadata *block, unsigned pos) -{ - if(0 != block->data.vorbis_comment.comments[pos].entry) - free(block->data.vorbis_comment.comments[pos].entry); - memmove(&block->data.vorbis_comment.comments[pos], &block->data.vorbis_comment.comments[pos+1], sizeof(FLAC__StreamMetadata_VorbisComment_Entry)*(block->data.vorbis_comment.num_comments-pos-1)); - block->data.vorbis_comment.comments[block->data.vorbis_comment.num_comments-1].entry = 0; - block->data.vorbis_comment.comments[block->data.vorbis_comment.num_comments-1].length = 0; - vc_resize_(block, block->data.vorbis_comment.num_comments-1); - vc_calc_len_(block); -} - -static void vc_replace_new_(FLAC__StreamMetadata_VorbisComment_Entry *entry, FLAC__StreamMetadata *block, const char *field, FLAC__bool all) -{ - int index; - char field_name[256]; - const char *eq = strchr(field, '='); - FLAC__ASSERT(eq>field && (unsigned)(eq-field) < sizeof(field_name)); - memcpy(field_name, field, eq-field); - field_name[eq-field]='\0'; - - index = vc_find_from_(block, field_name, 0); - if(index < 0) - vc_insert_new_(entry, block, block->data.vorbis_comment.num_comments, field); - else { - vc_set_new_(entry, block, (unsigned)index, field); - if(all) { - for(index = index+1; index >= 0 && (unsigned)index < block->data.vorbis_comment.num_comments; ) - if((index = vc_find_from_(block, field_name, (unsigned)index)) >= 0) - vc_delete_(block, (unsigned)index); - } - } - - vc_calc_len_(block); -} - -static void track_new_(FLAC__StreamMetadata_CueSheet_Track *track, FLAC__uint64 offset, FLAC__byte number, const char *isrc, FLAC__bool data, FLAC__bool pre_em) -{ - track->offset = offset; - track->number = number; - memcpy(track->isrc, isrc, sizeof(track->isrc)); - track->type = data; - track->pre_emphasis = pre_em; - track->num_indices = 0; - track->indices = 0; -} - -static void track_clone_(FLAC__StreamMetadata_CueSheet_Track *track) -{ - if(track->num_indices > 0) { - size_t bytes = sizeof(FLAC__StreamMetadata_CueSheet_Index) * track->num_indices; - FLAC__StreamMetadata_CueSheet_Index *x = (FLAC__StreamMetadata_CueSheet_Index*)malloc(bytes); - FLAC__ASSERT(0 != x); - memcpy(x, track->indices, bytes); - track->indices = x; - } -} - -static void cs_calc_len_(FLAC__StreamMetadata *block) -{ - const FLAC__StreamMetadata_CueSheet *cs = &block->data.cue_sheet; - unsigned i; - - block->length = ( - FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN + - FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN + - FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN + - FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN + - FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN - ) / 8; - block->length += cs->num_tracks * ( - FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN - ) / 8; - for(i = 0; i < cs->num_tracks; i++) { - block->length += cs->tracks[i].num_indices * ( - FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN + - FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN + - FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN - ) / 8; - } -} - -static void tr_resize_(FLAC__StreamMetadata *block, unsigned track_num, unsigned num) -{ - FLAC__StreamMetadata_CueSheet_Track *tr; - - FLAC__ASSERT(track_num < block->data.cue_sheet.num_tracks); - - tr = &block->data.cue_sheet.tracks[track_num]; - - if(tr->num_indices != 0) { - FLAC__ASSERT(0 != tr->indices); - } - if(num == 0) { - if(0 != tr->indices) { - free(tr->indices); - tr->indices = 0; - } - } - else { - tr->indices = (FLAC__StreamMetadata_CueSheet_Index*)realloc(tr->indices, sizeof(FLAC__StreamMetadata_CueSheet_Index)*num); - FLAC__ASSERT(0 != tr->indices); - if(num > tr->num_indices) - memset(tr->indices+tr->num_indices, 0, sizeof(FLAC__StreamMetadata_CueSheet_Index)*(num-tr->num_indices)); - } - - tr->num_indices = num; - cs_calc_len_(block); -} - -static void tr_set_new_(FLAC__StreamMetadata *block, unsigned track_num, unsigned pos, FLAC__StreamMetadata_CueSheet_Index index) -{ - FLAC__StreamMetadata_CueSheet_Track *tr; - - FLAC__ASSERT(track_num < block->data.cue_sheet.num_tracks); - - tr = &block->data.cue_sheet.tracks[track_num]; - - FLAC__ASSERT(pos < tr->num_indices); - - tr->indices[pos] = index; - - cs_calc_len_(block); -} - -static void tr_insert_new_(FLAC__StreamMetadata *block, unsigned track_num, unsigned pos, FLAC__StreamMetadata_CueSheet_Index index) -{ - FLAC__StreamMetadata_CueSheet_Track *tr; - - FLAC__ASSERT(track_num < block->data.cue_sheet.num_tracks); - - tr = &block->data.cue_sheet.tracks[track_num]; - - FLAC__ASSERT(pos <= tr->num_indices); - - tr_resize_(block, track_num, tr->num_indices+1); - memmove(&tr->indices[pos+1], &tr->indices[pos], sizeof(FLAC__StreamMetadata_CueSheet_Index)*(tr->num_indices-1-pos)); - tr_set_new_(block, track_num, pos, index); - cs_calc_len_(block); -} - -static void tr_delete_(FLAC__StreamMetadata *block, unsigned track_num, unsigned pos) -{ - FLAC__StreamMetadata_CueSheet_Track *tr; - - FLAC__ASSERT(track_num < block->data.cue_sheet.num_tracks); - - tr = &block->data.cue_sheet.tracks[track_num]; - - FLAC__ASSERT(pos <= tr->num_indices); - - memmove(&tr->indices[pos], &tr->indices[pos+1], sizeof(FLAC__StreamMetadata_CueSheet_Index)*(tr->num_indices-pos-1)); - tr_resize_(block, track_num, tr->num_indices-1); - cs_calc_len_(block); -} - -static void cs_resize_(FLAC__StreamMetadata *block, unsigned num) -{ - FLAC__StreamMetadata_CueSheet *cs = &block->data.cue_sheet; - - if(cs->num_tracks != 0) { - FLAC__ASSERT(0 != cs->tracks); - if(num < cs->num_tracks) { - unsigned i; - for(i = num; i < cs->num_tracks; i++) { - if(0 != cs->tracks[i].indices) - free(cs->tracks[i].indices); - } - } - } - if(num == 0) { - if(0 != cs->tracks) { - free(cs->tracks); - cs->tracks = 0; - } - } - else { - cs->tracks = (FLAC__StreamMetadata_CueSheet_Track*)realloc(cs->tracks, sizeof(FLAC__StreamMetadata_CueSheet_Track)*num); - FLAC__ASSERT(0 != cs->tracks); - if(num > cs->num_tracks) - memset(cs->tracks+cs->num_tracks, 0, sizeof(FLAC__StreamMetadata_CueSheet_Track)*(num-cs->num_tracks)); - } - - cs->num_tracks = num; - cs_calc_len_(block); -} - -static void cs_set_new_(FLAC__StreamMetadata_CueSheet_Track *track, FLAC__StreamMetadata *block, unsigned pos, FLAC__uint64 offset, FLAC__byte number, const char *isrc, FLAC__bool data, FLAC__bool pre_em) -{ - track_new_(track, offset, number, isrc, data, pre_em); - block->data.cue_sheet.tracks[pos] = *track; - cs_calc_len_(block); -} - -static void cs_insert_new_(FLAC__StreamMetadata_CueSheet_Track *track, FLAC__StreamMetadata *block, unsigned pos, FLAC__uint64 offset, FLAC__byte number, const char *isrc, FLAC__bool data, FLAC__bool pre_em) -{ - cs_resize_(block, block->data.cue_sheet.num_tracks+1); - memmove(&block->data.cue_sheet.tracks[pos+1], &block->data.cue_sheet.tracks[pos], sizeof(FLAC__StreamMetadata_CueSheet_Track)*(block->data.cue_sheet.num_tracks-1-pos)); - cs_set_new_(track, block, pos, offset, number, isrc, data, pre_em); - cs_calc_len_(block); -} - -static void cs_delete_(FLAC__StreamMetadata *block, unsigned pos) -{ - if(0 != block->data.cue_sheet.tracks[pos].indices) - free(block->data.cue_sheet.tracks[pos].indices); - memmove(&block->data.cue_sheet.tracks[pos], &block->data.cue_sheet.tracks[pos+1], sizeof(FLAC__StreamMetadata_CueSheet_Track)*(block->data.cue_sheet.num_tracks-pos-1)); - block->data.cue_sheet.tracks[block->data.cue_sheet.num_tracks-1].indices = 0; - block->data.cue_sheet.tracks[block->data.cue_sheet.num_tracks-1].num_indices = 0; - cs_resize_(block, block->data.cue_sheet.num_tracks-1); - cs_calc_len_(block); -} - -static void pi_set_mime_type(FLAC__StreamMetadata *block, const char *s) -{ - if(block->data.picture.mime_type) { - block->length -= strlen(block->data.picture.mime_type); - free(block->data.picture.mime_type); - } - block->data.picture.mime_type = strdup(s); - FLAC__ASSERT(block->data.picture.mime_type); - block->length += strlen(block->data.picture.mime_type); -} - -static void pi_set_description(FLAC__StreamMetadata *block, const FLAC__byte *s) -{ - if(block->data.picture.description) { - block->length -= strlen((const char *)block->data.picture.description); - free(block->data.picture.description); - } - block->data.picture.description = (FLAC__byte*)strdup((const char *)s); - FLAC__ASSERT(block->data.picture.description); - block->length += strlen((const char *)block->data.picture.description); -} - -static void pi_set_data(FLAC__StreamMetadata *block, const FLAC__byte *data, FLAC__uint32 len) -{ - if(block->data.picture.data) { - block->length -= block->data.picture.data_length; - free(block->data.picture.data); - } - block->data.picture.data = (FLAC__byte*)strdup((const char *)data); - FLAC__ASSERT(block->data.picture.data); - block->data.picture.data_length = len; - block->length += len; -} - -FLAC__bool test_metadata_object(void) -{ - FLAC__StreamMetadata *block, *blockcopy, *vorbiscomment, *cuesheet, *picture; - FLAC__StreamMetadata_SeekPoint seekpoint_array[14]; - FLAC__StreamMetadata_VorbisComment_Entry entry; - FLAC__StreamMetadata_CueSheet_Index index; - FLAC__StreamMetadata_CueSheet_Track track; - unsigned i, expected_length, seekpoints; - int j; - static FLAC__byte dummydata[4] = { 'a', 'b', 'c', 'd' }; - - printf("\n+++ libFLAC unit test: metadata objects\n\n"); - - - printf("testing STREAMINFO\n"); - - printf("testing FLAC__metadata_object_new()... "); - block = FLAC__metadata_object_new(FLAC__METADATA_TYPE_STREAMINFO); - if(0 == block) { - printf("FAILED, returned NULL\n"); - return false; - } - expected_length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH; - if(block->length != expected_length) { - printf("FAILED, bad length, expected %u, got %u\n", expected_length, block->length); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_clone()... "); - blockcopy = FLAC__metadata_object_clone(block); - if(0 == blockcopy) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!mutils__compare_block(block, blockcopy)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(blockcopy); - FLAC__metadata_object_delete(block); - printf("OK\n"); - - - printf("testing PADDING\n"); - - printf("testing FLAC__metadata_object_new()... "); - block = FLAC__metadata_object_new(FLAC__METADATA_TYPE_PADDING); - if(0 == block) { - printf("FAILED, returned NULL\n"); - return false; - } - expected_length = 0; - if(block->length != expected_length) { - printf("FAILED, bad length, expected %u, got %u\n", expected_length, block->length); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_clone()... "); - blockcopy = FLAC__metadata_object_clone(block); - if(0 == blockcopy) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!mutils__compare_block(block, blockcopy)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(blockcopy); - FLAC__metadata_object_delete(block); - printf("OK\n"); - - - printf("testing APPLICATION\n"); - - printf("testing FLAC__metadata_object_new()... "); - block = FLAC__metadata_object_new(FLAC__METADATA_TYPE_APPLICATION); - if(0 == block) { - printf("FAILED, returned NULL\n"); - return false; - } - expected_length = FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8; - if(block->length != expected_length) { - printf("FAILED, bad length, expected %u, got %u\n", expected_length, block->length); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_clone()... "); - blockcopy = FLAC__metadata_object_clone(block); - if(0 == blockcopy) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!mutils__compare_block(block, blockcopy)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(blockcopy); - printf("OK\n"); - - printf("testing FLAC__metadata_object_application_set_data(copy)... "); - if(!FLAC__metadata_object_application_set_data(block, dummydata, sizeof(dummydata), true/*copy*/)) { - printf("FAILED, returned false\n"); - return false; - } - expected_length = (FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8) + sizeof(dummydata); - if(block->length != expected_length) { - printf("FAILED, bad length, expected %u, got %u\n", expected_length, block->length); - return false; - } - if(0 != memcmp(block->data.application.data, dummydata, sizeof(dummydata))) { - printf("FAILED, data mismatch\n"); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_clone()... "); - blockcopy = FLAC__metadata_object_clone(block); - if(0 == blockcopy) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!mutils__compare_block(block, blockcopy)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(blockcopy); - printf("OK\n"); - - printf("testing FLAC__metadata_object_application_set_data(own)... "); - if(!FLAC__metadata_object_application_set_data(block, make_dummydata_(dummydata, sizeof(dummydata)), sizeof(dummydata), false/*own*/)) { - printf("FAILED, returned false\n"); - return false; - } - expected_length = (FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8) + sizeof(dummydata); - if(block->length != expected_length) { - printf("FAILED, bad length, expected %u, got %u\n", expected_length, block->length); - return false; - } - if(0 != memcmp(block->data.application.data, dummydata, sizeof(dummydata))) { - printf("FAILED, data mismatch\n"); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_clone()... "); - blockcopy = FLAC__metadata_object_clone(block); - if(0 == blockcopy) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!mutils__compare_block(block, blockcopy)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(blockcopy); - FLAC__metadata_object_delete(block); - printf("OK\n"); - - - printf("testing SEEKTABLE\n"); - - for(i = 0; i < sizeof(seekpoint_array) / sizeof(FLAC__StreamMetadata_SeekPoint); i++) { - seekpoint_array[i].sample_number = FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER; - seekpoint_array[i].stream_offset = 0; - seekpoint_array[i].frame_samples = 0; - } - - seekpoints = 0; - printf("testing FLAC__metadata_object_new()... "); - block = FLAC__metadata_object_new(FLAC__METADATA_TYPE_SEEKTABLE); - if(0 == block) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!check_seektable_(block, seekpoints, 0)) - return false; - - printf("testing FLAC__metadata_object_clone()... "); - blockcopy = FLAC__metadata_object_clone(block); - if(0 == blockcopy) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!mutils__compare_block(block, blockcopy)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(blockcopy); - printf("OK\n"); - - seekpoints = 2; - printf("testing FLAC__metadata_object_seektable_resize_points(grow to %u)...", seekpoints); - if(!FLAC__metadata_object_seektable_resize_points(block, seekpoints)) { - printf("FAILED, returned false\n"); - return false; - } - if(!check_seektable_(block, seekpoints, seekpoint_array)) - return false; - - seekpoints = 1; - printf("testing FLAC__metadata_object_seektable_resize_points(shrink to %u)...", seekpoints); - if(!FLAC__metadata_object_seektable_resize_points(block, seekpoints)) { - printf("FAILED, returned false\n"); - return false; - } - if(!check_seektable_(block, seekpoints, seekpoint_array)) - return false; - - printf("testing FLAC__metadata_object_seektable_is_legal()..."); - if(!FLAC__metadata_object_seektable_is_legal(block)) { - printf("FAILED, returned false\n"); - return false; - } - printf("OK\n"); - - seekpoints = 0; - printf("testing FLAC__metadata_object_seektable_resize_points(shrink to %u)...", seekpoints); - if(!FLAC__metadata_object_seektable_resize_points(block, seekpoints)) { - printf("FAILED, returned false\n"); - return false; - } - if(!check_seektable_(block, seekpoints, 0)) - return false; - - seekpoints++; - printf("testing FLAC__metadata_object_seektable_insert_point() on empty array..."); - if(!FLAC__metadata_object_seektable_insert_point(block, 0, seekpoint_array[0])) { - printf("FAILED, returned false\n"); - return false; - } - if(!check_seektable_(block, seekpoints, seekpoint_array)) - return false; - - seekpoint_array[0].sample_number = 1; - seekpoints++; - printf("testing FLAC__metadata_object_seektable_insert_point() on beginning of non-empty array..."); - if(!FLAC__metadata_object_seektable_insert_point(block, 0, seekpoint_array[0])) { - printf("FAILED, returned false\n"); - return false; - } - if(!check_seektable_(block, seekpoints, seekpoint_array)) - return false; - - seekpoint_array[1].sample_number = 2; - seekpoints++; - printf("testing FLAC__metadata_object_seektable_insert_point() on middle of non-empty array..."); - if(!FLAC__metadata_object_seektable_insert_point(block, 1, seekpoint_array[1])) { - printf("FAILED, returned false\n"); - return false; - } - if(!check_seektable_(block, seekpoints, seekpoint_array)) - return false; - - seekpoint_array[3].sample_number = 3; - seekpoints++; - printf("testing FLAC__metadata_object_seektable_insert_point() on end of non-empty array..."); - if(!FLAC__metadata_object_seektable_insert_point(block, 3, seekpoint_array[3])) { - printf("FAILED, returned false\n"); - return false; - } - if(!check_seektable_(block, seekpoints, seekpoint_array)) - return false; - - printf("testing FLAC__metadata_object_clone()... "); - blockcopy = FLAC__metadata_object_clone(block); - if(0 == blockcopy) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!mutils__compare_block(block, blockcopy)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(blockcopy); - printf("OK\n"); - - seekpoint_array[2].sample_number = seekpoint_array[3].sample_number; - seekpoints--; - printf("testing FLAC__metadata_object_seektable_delete_point() on middle of array..."); - if(!FLAC__metadata_object_seektable_delete_point(block, 2)) { - printf("FAILED, returned false\n"); - return false; - } - if(!check_seektable_(block, seekpoints, seekpoint_array)) - return false; - - seekpoints--; - printf("testing FLAC__metadata_object_seektable_delete_point() on end of array..."); - if(!FLAC__metadata_object_seektable_delete_point(block, 2)) { - printf("FAILED, returned false\n"); - return false; - } - if(!check_seektable_(block, seekpoints, seekpoint_array)) - return false; - - seekpoints--; - printf("testing FLAC__metadata_object_seektable_delete_point() on beginning of array..."); - if(!FLAC__metadata_object_seektable_delete_point(block, 0)) { - printf("FAILED, returned false\n"); - return false; - } - if(!check_seektable_(block, seekpoints, seekpoint_array+1)) - return false; - - printf("testing FLAC__metadata_object_seektable_set_point()..."); - FLAC__metadata_object_seektable_set_point(block, 0, seekpoint_array[0]); - if(!check_seektable_(block, seekpoints, seekpoint_array)) - return false; - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(block); - printf("OK\n"); - - /* seektable template functions */ - - for(i = 0; i < sizeof(seekpoint_array) / sizeof(FLAC__StreamMetadata_SeekPoint); i++) { - seekpoint_array[i].sample_number = FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER; - seekpoint_array[i].stream_offset = 0; - seekpoint_array[i].frame_samples = 0; - } - - seekpoints = 0; - printf("testing FLAC__metadata_object_new()... "); - block = FLAC__metadata_object_new(FLAC__METADATA_TYPE_SEEKTABLE); - if(0 == block) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!check_seektable_(block, seekpoints, 0)) - return false; - - seekpoints += 2; - printf("testing FLAC__metadata_object_seekpoint_template_append_placeholders()... "); - if(!FLAC__metadata_object_seektable_template_append_placeholders(block, 2)) { - printf("FAILED, returned false\n"); - return false; - } - if(!check_seektable_(block, seekpoints, seekpoint_array)) - return false; - - seekpoint_array[seekpoints++].sample_number = 7; - printf("testing FLAC__metadata_object_seekpoint_template_append_point()... "); - if(!FLAC__metadata_object_seektable_template_append_point(block, 7)) { - printf("FAILED, returned false\n"); - return false; - } - if(!check_seektable_(block, seekpoints, seekpoint_array)) - return false; - - { - FLAC__uint64 nums[2] = { 3, 7 }; - seekpoint_array[seekpoints++].sample_number = nums[0]; - seekpoint_array[seekpoints++].sample_number = nums[1]; - printf("testing FLAC__metadata_object_seekpoint_template_append_points()... "); - if(!FLAC__metadata_object_seektable_template_append_points(block, nums, sizeof(nums)/sizeof(FLAC__uint64))) { - printf("FAILED, returned false\n"); - return false; - } - if(!check_seektable_(block, seekpoints, seekpoint_array)) - return false; - } - - seekpoint_array[seekpoints++].sample_number = 0; - seekpoint_array[seekpoints++].sample_number = 10; - seekpoint_array[seekpoints++].sample_number = 20; - printf("testing FLAC__metadata_object_seekpoint_template_append_spaced_points()... "); - if(!FLAC__metadata_object_seektable_template_append_spaced_points(block, 3, 30)) { - printf("FAILED, returned false\n"); - return false; - } - if(!check_seektable_(block, seekpoints, seekpoint_array)) - return false; - - seekpoints--; - seekpoint_array[0].sample_number = 0; - seekpoint_array[1].sample_number = 3; - seekpoint_array[2].sample_number = 7; - seekpoint_array[3].sample_number = 10; - seekpoint_array[4].sample_number = 20; - seekpoint_array[5].sample_number = FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER; - seekpoint_array[6].sample_number = FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER; - printf("testing FLAC__metadata_object_seekpoint_template_sort(compact=true)... "); - if(!FLAC__metadata_object_seektable_template_sort(block, /*compact=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!FLAC__metadata_object_seektable_is_legal(block)) { - printf("FAILED, seek table is illegal\n"); - return false; - } - if(!check_seektable_(block, seekpoints, seekpoint_array)) - return false; - - printf("testing FLAC__metadata_object_seekpoint_template_sort(compact=false)... "); - if(!FLAC__metadata_object_seektable_template_sort(block, /*compact=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!FLAC__metadata_object_seektable_is_legal(block)) { - printf("FAILED, seek table is illegal\n"); - return false; - } - if(!check_seektable_(block, seekpoints, seekpoint_array)) - return false; - - seekpoint_array[seekpoints++].sample_number = 0; - seekpoint_array[seekpoints++].sample_number = 10; - seekpoint_array[seekpoints++].sample_number = 20; - printf("testing FLAC__metadata_object_seekpoint_template_append_spaced_points_by_samples()... "); - if(!FLAC__metadata_object_seektable_template_append_spaced_points_by_samples(block, 10, 30)) { - printf("FAILED, returned false\n"); - return false; - } - if(!check_seektable_(block, seekpoints, seekpoint_array)) - return false; - - seekpoint_array[seekpoints++].sample_number = 0; - seekpoint_array[seekpoints++].sample_number = 11; - seekpoint_array[seekpoints++].sample_number = 22; - printf("testing FLAC__metadata_object_seekpoint_template_append_spaced_points_by_samples()... "); - if(!FLAC__metadata_object_seektable_template_append_spaced_points_by_samples(block, 11, 30)) { - printf("FAILED, returned false\n"); - return false; - } - if(!check_seektable_(block, seekpoints, seekpoint_array)) - return false; - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(block); - printf("OK\n"); - - - printf("testing VORBIS_COMMENT\n"); - - { - FLAC__StreamMetadata_VorbisComment_Entry entry_; - char *field_name, *field_value; - - printf("testing FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair()... "); - if(!FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair(&entry_, "name", "value")) { - printf("FAILED, returned false\n"); - return false; - } - if(strcmp((const char *)entry_.entry, "name=value")) { - printf("FAILED, field mismatch\n"); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_entry_to_name_value_pair()... "); - if(!FLAC__metadata_object_vorbiscomment_entry_to_name_value_pair(entry_, &field_name, &field_value)) { - printf("FAILED, returned false\n"); - return false; - } - if(strcmp(field_name, "name")) { - printf("FAILED, field name mismatch\n"); - return false; - } - if(strcmp(field_value, "value")) { - printf("FAILED, field value mismatch\n"); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_entry_matches()... "); - if(!FLAC__metadata_object_vorbiscomment_entry_matches(entry_, field_name, strlen(field_name))) { - printf("FAILED, expected true, returned false\n"); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_entry_matches()... "); - if(FLAC__metadata_object_vorbiscomment_entry_matches(entry_, "blah", strlen("blah"))) { - printf("FAILED, expected false, returned true\n"); - return false; - } - printf("OK\n"); - - free(entry_.entry); - free(field_name); - free(field_value); - } - - printf("testing FLAC__metadata_object_new()... "); - block = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT); - if(0 == block) { - printf("FAILED, returned NULL\n"); - return false; - } - expected_length = (FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN/8 + strlen(FLAC__VENDOR_STRING) + FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN/8); - if(block->length != expected_length) { - printf("FAILED, bad length, expected %u, got %u\n", expected_length, block->length); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_clone()... "); - vorbiscomment = FLAC__metadata_object_clone(block); - if(0 == vorbiscomment) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - vc_resize_(vorbiscomment, 2); - printf("testing FLAC__metadata_object_vorbiscomment_resize_comments(grow to %u)...", vorbiscomment->data.vorbis_comment.num_comments); - if(!FLAC__metadata_object_vorbiscomment_resize_comments(block, vorbiscomment->data.vorbis_comment.num_comments)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - vc_resize_(vorbiscomment, 1); - printf("testing FLAC__metadata_object_vorbiscomment_resize_comments(shrink to %u)...", vorbiscomment->data.vorbis_comment.num_comments); - if(!FLAC__metadata_object_vorbiscomment_resize_comments(block, vorbiscomment->data.vorbis_comment.num_comments)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - vc_resize_(vorbiscomment, 0); - printf("testing FLAC__metadata_object_vorbiscomment_resize_comments(shrink to %u)...", vorbiscomment->data.vorbis_comment.num_comments); - if(!FLAC__metadata_object_vorbiscomment_resize_comments(block, vorbiscomment->data.vorbis_comment.num_comments)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_append_comment(copy) on empty array..."); - vc_insert_new_(&entry, vorbiscomment, 0, "name1=field1"); - if(!FLAC__metadata_object_vorbiscomment_append_comment(block, entry, /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_append_comment(copy) on non-empty array..."); - vc_insert_new_(&entry, vorbiscomment, 1, "name2=field2"); - if(!FLAC__metadata_object_vorbiscomment_append_comment(block, entry, /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - vc_resize_(vorbiscomment, 0); - printf("testing FLAC__metadata_object_vorbiscomment_resize_comments(shrink to %u)...", vorbiscomment->data.vorbis_comment.num_comments); - if(!FLAC__metadata_object_vorbiscomment_resize_comments(block, vorbiscomment->data.vorbis_comment.num_comments)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_insert_comment(copy) on empty array..."); - vc_insert_new_(&entry, vorbiscomment, 0, "name1=field1"); - if(!FLAC__metadata_object_vorbiscomment_insert_comment(block, 0, entry, /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_insert_comment(copy) on beginning of non-empty array..."); - vc_insert_new_(&entry, vorbiscomment, 0, "name2=field2"); - if(!FLAC__metadata_object_vorbiscomment_insert_comment(block, 0, entry, /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_insert_comment(copy) on middle of non-empty array..."); - vc_insert_new_(&entry, vorbiscomment, 1, "name3=field3"); - if(!FLAC__metadata_object_vorbiscomment_insert_comment(block, 1, entry, /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_insert_comment(copy) on end of non-empty array..."); - vc_insert_new_(&entry, vorbiscomment, 3, "name4=field4"); - if(!FLAC__metadata_object_vorbiscomment_insert_comment(block, 3, entry, /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_insert_comment(copy) on end of non-empty array..."); - vc_insert_new_(&entry, vorbiscomment, 4, "name3=field3dup1"); - if(!FLAC__metadata_object_vorbiscomment_insert_comment(block, 4, entry, /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_insert_comment(copy) on end of non-empty array..."); - vc_insert_new_(&entry, vorbiscomment, 5, "name3=field3dup1"); - if(!FLAC__metadata_object_vorbiscomment_insert_comment(block, 5, entry, /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_find_entry_from()..."); - if((j = FLAC__metadata_object_vorbiscomment_find_entry_from(block, 0, "name3")) != 1) { - printf("FAILED, expected 1, got %d\n", j); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_find_entry_from()..."); - if((j = FLAC__metadata_object_vorbiscomment_find_entry_from(block, j+1, "name3")) != 4) { - printf("FAILED, expected 4, got %d\n", j); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_find_entry_from()..."); - if((j = FLAC__metadata_object_vorbiscomment_find_entry_from(block, j+1, "name3")) != 5) { - printf("FAILED, expected 5, got %d\n", j); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_find_entry_from()..."); - if((j = FLAC__metadata_object_vorbiscomment_find_entry_from(block, 0, "name2")) != 0) { - printf("FAILED, expected 0, got %d\n", j); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_find_entry_from()..."); - if((j = FLAC__metadata_object_vorbiscomment_find_entry_from(block, j+1, "name2")) != -1) { - printf("FAILED, expected -1, got %d\n", j); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_find_entry_from()..."); - if((j = FLAC__metadata_object_vorbiscomment_find_entry_from(block, 0, "blah")) != -1) { - printf("FAILED, expected -1, got %d\n", j); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_replace_comment(first, copy)..."); - vc_replace_new_(&entry, vorbiscomment, "name3=field3new1", /*all=*/false); - if(!FLAC__metadata_object_vorbiscomment_replace_comment(block, entry, /*all=*/false, /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - if(block->data.vorbis_comment.num_comments != 6) { - printf("FAILED, expected 6 comments, got %u\n", block->data.vorbis_comment.num_comments); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_replace_comment(all, copy)..."); - vc_replace_new_(&entry, vorbiscomment, "name3=field3new2", /*all=*/true); - if(!FLAC__metadata_object_vorbiscomment_replace_comment(block, entry, /*all=*/true, /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - if(block->data.vorbis_comment.num_comments != 4) { - printf("FAILED, expected 4 comments, got %u\n", block->data.vorbis_comment.num_comments); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_clone()... "); - blockcopy = FLAC__metadata_object_clone(block); - if(0 == blockcopy) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!mutils__compare_block(block, blockcopy)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(blockcopy); - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_delete_comment() on middle of array..."); - vc_delete_(vorbiscomment, 2); - if(!FLAC__metadata_object_vorbiscomment_delete_comment(block, 2)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_delete_comment() on end of array..."); - vc_delete_(vorbiscomment, 2); - if(!FLAC__metadata_object_vorbiscomment_delete_comment(block, 2)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_delete_comment() on beginning of array..."); - vc_delete_(vorbiscomment, 0); - if(!FLAC__metadata_object_vorbiscomment_delete_comment(block, 0)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_append_comment(copy) on non-empty array..."); - vc_insert_new_(&entry, vorbiscomment, 1, "rem0=val0"); - if(!FLAC__metadata_object_vorbiscomment_append_comment(block, entry, /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_append_comment(copy) on non-empty array..."); - vc_insert_new_(&entry, vorbiscomment, 2, "rem0=val1"); - if(!FLAC__metadata_object_vorbiscomment_append_comment(block, entry, /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_append_comment(copy) on non-empty array..."); - vc_insert_new_(&entry, vorbiscomment, 3, "rem0=val2"); - if(!FLAC__metadata_object_vorbiscomment_append_comment(block, entry, /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_remove_entry_matching(\"blah\")..."); - if((j = FLAC__metadata_object_vorbiscomment_remove_entry_matching(block, "blah")) != 0) { - printf("FAILED, expected 0, got %d\n", j); - return false; - } - if(block->data.vorbis_comment.num_comments != 4) { - printf("FAILED, expected 4 comments, got %u\n", block->data.vorbis_comment.num_comments); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_remove_entry_matching(\"rem0\")..."); - vc_delete_(vorbiscomment, 1); - if((j = FLAC__metadata_object_vorbiscomment_remove_entry_matching(block, "rem0")) != 1) { - printf("FAILED, expected 1, got %d\n", j); - return false; - } - if(block->data.vorbis_comment.num_comments != 3) { - printf("FAILED, expected 3 comments, got %u\n", block->data.vorbis_comment.num_comments); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_remove_entries_matching(\"blah\")..."); - if((j = FLAC__metadata_object_vorbiscomment_remove_entries_matching(block, "blah")) != 0) { - printf("FAILED, expected 0, got %d\n", j); - return false; - } - if(block->data.vorbis_comment.num_comments != 3) { - printf("FAILED, expected 3 comments, got %u\n", block->data.vorbis_comment.num_comments); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_remove_entries_matching(\"rem0\")..."); - vc_delete_(vorbiscomment, 1); - vc_delete_(vorbiscomment, 1); - if((j = FLAC__metadata_object_vorbiscomment_remove_entries_matching(block, "rem0")) != 2) { - printf("FAILED, expected 2, got %d\n", j); - return false; - } - if(block->data.vorbis_comment.num_comments != 1) { - printf("FAILED, expected 1 comments, got %u\n", block->data.vorbis_comment.num_comments); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_set_comment(copy)..."); - vc_set_new_(&entry, vorbiscomment, 0, "name5=field5"); - FLAC__metadata_object_vorbiscomment_set_comment(block, 0, entry, /*copy=*/true); - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_set_vendor_string(copy)..."); - vc_set_vs_new_(&entry, vorbiscomment, "name6=field6"); - FLAC__metadata_object_vorbiscomment_set_vendor_string(block, entry, /*copy=*/true); - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(vorbiscomment); - FLAC__metadata_object_delete(block); - printf("OK\n"); - - - printf("testing FLAC__metadata_object_new()... "); - block = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT); - if(0 == block) { - printf("FAILED, returned NULL\n"); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_clone()... "); - vorbiscomment = FLAC__metadata_object_clone(block); - if(0 == vorbiscomment) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_append_comment(own) on empty array..."); - vc_insert_new_(&entry, vorbiscomment, 0, "name1=field1"); - entry_clone_(&entry); - if(!FLAC__metadata_object_vorbiscomment_append_comment(block, entry, /*copy=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_append_comment(own) on non-empty array..."); - vc_insert_new_(&entry, vorbiscomment, 1, "name2=field2"); - entry_clone_(&entry); - if(!FLAC__metadata_object_vorbiscomment_append_comment(block, entry, /*copy=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(vorbiscomment); - FLAC__metadata_object_delete(block); - printf("OK\n"); - - printf("testing FLAC__metadata_object_new()... "); - block = FLAC__metadata_object_new(FLAC__METADATA_TYPE_VORBIS_COMMENT); - if(0 == block) { - printf("FAILED, returned NULL\n"); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_clone()... "); - vorbiscomment = FLAC__metadata_object_clone(block); - if(0 == vorbiscomment) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_insert_comment(own) on empty array..."); - vc_insert_new_(&entry, vorbiscomment, 0, "name1=field1"); - entry_clone_(&entry); - if(!FLAC__metadata_object_vorbiscomment_insert_comment(block, 0, entry, /*copy=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_insert_comment(own) on beginning of non-empty array..."); - vc_insert_new_(&entry, vorbiscomment, 0, "name2=field2"); - entry_clone_(&entry); - if(!FLAC__metadata_object_vorbiscomment_insert_comment(block, 0, entry, /*copy=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_insert_comment(own) on middle of non-empty array..."); - vc_insert_new_(&entry, vorbiscomment, 1, "name3=field3"); - entry_clone_(&entry); - if(!FLAC__metadata_object_vorbiscomment_insert_comment(block, 1, entry, /*copy=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_insert_comment(own) on end of non-empty array..."); - vc_insert_new_(&entry, vorbiscomment, 3, "name4=field4"); - entry_clone_(&entry); - if(!FLAC__metadata_object_vorbiscomment_insert_comment(block, 3, entry, /*copy=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_insert_comment(own) on end of non-empty array..."); - vc_insert_new_(&entry, vorbiscomment, 4, "name3=field3dup1"); - entry_clone_(&entry); - if(!FLAC__metadata_object_vorbiscomment_insert_comment(block, 4, entry, /*copy=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_insert_comment(own) on end of non-empty array..."); - vc_insert_new_(&entry, vorbiscomment, 5, "name3=field3dup1"); - entry_clone_(&entry); - if(!FLAC__metadata_object_vorbiscomment_insert_comment(block, 5, entry, /*copy=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_replace_comment(first, own)..."); - vc_replace_new_(&entry, vorbiscomment, "name3=field3new1", /*all=*/false); - entry_clone_(&entry); - if(!FLAC__metadata_object_vorbiscomment_replace_comment(block, entry, /*all=*/false, /*copy=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - if(block->data.vorbis_comment.num_comments != 6) { - printf("FAILED, expected 6 comments, got %u\n", block->data.vorbis_comment.num_comments); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_replace_comment(all, own)..."); - vc_replace_new_(&entry, vorbiscomment, "name3=field3new2", /*all=*/true); - entry_clone_(&entry); - if(!FLAC__metadata_object_vorbiscomment_replace_comment(block, entry, /*all=*/true, /*copy=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - if(block->data.vorbis_comment.num_comments != 4) { - printf("FAILED, expected 4 comments, got %u\n", block->data.vorbis_comment.num_comments); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_delete_comment() on middle of array..."); - vc_delete_(vorbiscomment, 2); - if(!FLAC__metadata_object_vorbiscomment_delete_comment(block, 2)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_delete_comment() on end of array..."); - vc_delete_(vorbiscomment, 2); - if(!FLAC__metadata_object_vorbiscomment_delete_comment(block, 2)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_delete_comment() on beginning of array..."); - vc_delete_(vorbiscomment, 0); - if(!FLAC__metadata_object_vorbiscomment_delete_comment(block, 0)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_set_comment(own)..."); - vc_set_new_(&entry, vorbiscomment, 0, "name5=field5"); - entry_clone_(&entry); - FLAC__metadata_object_vorbiscomment_set_comment(block, 0, entry, /*copy=*/false); - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_vorbiscomment_set_vendor_string(own)..."); - vc_set_vs_new_(&entry, vorbiscomment, "name6=field6"); - entry_clone_(&entry); - FLAC__metadata_object_vorbiscomment_set_vendor_string(block, entry, /*copy=*/false); - if(!mutils__compare_block(vorbiscomment, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(vorbiscomment); - FLAC__metadata_object_delete(block); - printf("OK\n"); - - - printf("testing CUESHEET\n"); - - { - FLAC__StreamMetadata_CueSheet_Track *track_, *trackcopy_; - - printf("testing FLAC__metadata_object_cuesheet_track_new()... "); - track_ = FLAC__metadata_object_cuesheet_track_new(); - if(0 == track_) { - printf("FAILED, returned NULL\n"); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_track_clone()... "); - trackcopy_ = FLAC__metadata_object_cuesheet_track_clone(track_); - if(0 == trackcopy_) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!compare_track_(trackcopy_, track_)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_track_delete()... "); - FLAC__metadata_object_cuesheet_track_delete(trackcopy_); - FLAC__metadata_object_cuesheet_track_delete(track_); - printf("OK\n"); - } - - - printf("testing FLAC__metadata_object_new()... "); - block = FLAC__metadata_object_new(FLAC__METADATA_TYPE_CUESHEET); - if(0 == block) { - printf("FAILED, returned NULL\n"); - return false; - } - expected_length = ( - FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN + - FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN + - FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN + - FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN + - FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN - ) / 8; - if(block->length != expected_length) { - printf("FAILED, bad length, expected %u, got %u\n", expected_length, block->length); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_clone()... "); - cuesheet = FLAC__metadata_object_clone(block); - if(0 == cuesheet) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - cs_resize_(cuesheet, 2); - printf("testing FLAC__metadata_object_cuesheet_resize_tracks(grow to %u)...", cuesheet->data.cue_sheet.num_tracks); - if(!FLAC__metadata_object_cuesheet_resize_tracks(block, cuesheet->data.cue_sheet.num_tracks)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - cs_resize_(cuesheet, 1); - printf("testing FLAC__metadata_object_cuesheet_resize_tracks(shrink to %u)...", cuesheet->data.cue_sheet.num_tracks); - if(!FLAC__metadata_object_cuesheet_resize_tracks(block, cuesheet->data.cue_sheet.num_tracks)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - cs_resize_(cuesheet, 0); - printf("testing FLAC__metadata_object_cuesheet_resize_tracks(shrink to %u)...", cuesheet->data.cue_sheet.num_tracks); - if(!FLAC__metadata_object_cuesheet_resize_tracks(block, cuesheet->data.cue_sheet.num_tracks)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_insert_track(copy) on empty array..."); - cs_insert_new_(&track, cuesheet, 0, 0, 1, "ABCDE1234567", false, false); - if(!FLAC__metadata_object_cuesheet_insert_track(block, 0, &track, /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_insert_track(copy) on beginning of non-empty array..."); - cs_insert_new_(&track, cuesheet, 0, 10, 2, "BBCDE1234567", false, false); - if(!FLAC__metadata_object_cuesheet_insert_track(block, 0, &track, /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_insert_track(copy) on middle of non-empty array..."); - cs_insert_new_(&track, cuesheet, 1, 20, 3, "CBCDE1234567", false, false); - if(!FLAC__metadata_object_cuesheet_insert_track(block, 1, &track, /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_insert_track(copy) on end of non-empty array..."); - cs_insert_new_(&track, cuesheet, 3, 30, 4, "DBCDE1234567", false, false); - if(!FLAC__metadata_object_cuesheet_insert_track(block, 3, &track, /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_insert_blank_track() on end of non-empty array..."); - cs_insert_new_(&track, cuesheet, 4, 0, 0, "\0\0\0\0\0\0\0\0\0\0\0\0", false, false); - if(!FLAC__metadata_object_cuesheet_insert_blank_track(block, 4)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_clone()... "); - blockcopy = FLAC__metadata_object_clone(block); - if(0 == blockcopy) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!mutils__compare_block(block, blockcopy)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(blockcopy); - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_delete_track() on end of array..."); - cs_delete_(cuesheet, 4); - if(!FLAC__metadata_object_cuesheet_delete_track(block, 4)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_delete_track() on middle of array..."); - cs_delete_(cuesheet, 2); - if(!FLAC__metadata_object_cuesheet_delete_track(block, 2)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_delete_track() on end of array..."); - cs_delete_(cuesheet, 2); - if(!FLAC__metadata_object_cuesheet_delete_track(block, 2)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_delete_track() on beginning of array..."); - cs_delete_(cuesheet, 0); - if(!FLAC__metadata_object_cuesheet_delete_track(block, 0)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_set_track(copy)..."); - cs_set_new_(&track, cuesheet, 0, 40, 5, "EBCDE1234567", false, false); - FLAC__metadata_object_cuesheet_set_track(block, 0, &track, /*copy=*/true); - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - tr_resize_(cuesheet, 0, 2); - printf("testing FLAC__metadata_object_cuesheet_track_resize_indices(grow to %u)...", cuesheet->data.cue_sheet.tracks[0].num_indices); - if(!FLAC__metadata_object_cuesheet_track_resize_indices(block, 0, cuesheet->data.cue_sheet.tracks[0].num_indices)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - tr_resize_(cuesheet, 0, 1); - printf("testing FLAC__metadata_object_cuesheet_track_resize_indices(shrink to %u)...", cuesheet->data.cue_sheet.tracks[0].num_indices); - if(!FLAC__metadata_object_cuesheet_track_resize_indices(block, 0, cuesheet->data.cue_sheet.tracks[0].num_indices)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - tr_resize_(cuesheet, 0, 0); - printf("testing FLAC__metadata_object_cuesheet_track_resize_indices(shrink to %u)...", cuesheet->data.cue_sheet.tracks[0].num_indices); - if(!FLAC__metadata_object_cuesheet_track_resize_indices(block, 0, cuesheet->data.cue_sheet.tracks[0].num_indices)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - index.offset = 0; - index.number = 1; - printf("testing FLAC__metadata_object_cuesheet_track_insert_index() on empty array..."); - tr_insert_new_(cuesheet, 0, 0, index); - if(!FLAC__metadata_object_cuesheet_track_insert_index(block, 0, 0, index)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - index.offset = 10; - index.number = 2; - printf("testing FLAC__metadata_object_cuesheet_track_insert_index() on beginning of non-empty array..."); - tr_insert_new_(cuesheet, 0, 0, index); - if(!FLAC__metadata_object_cuesheet_track_insert_index(block, 0, 0, index)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - index.offset = 20; - index.number = 3; - printf("testing FLAC__metadata_object_cuesheet_track_insert_index() on middle of non-empty array..."); - tr_insert_new_(cuesheet, 0, 1, index); - if(!FLAC__metadata_object_cuesheet_track_insert_index(block, 0, 1, index)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - index.offset = 30; - index.number = 4; - printf("testing FLAC__metadata_object_cuesheet_track_insert_index() on end of non-empty array..."); - tr_insert_new_(cuesheet, 0, 3, index); - if(!FLAC__metadata_object_cuesheet_track_insert_index(block, 0, 3, index)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - index.offset = 0; - index.number = 0; - printf("testing FLAC__metadata_object_cuesheet_track_insert_blank_index() on end of non-empty array..."); - tr_insert_new_(cuesheet, 0, 4, index); - if(!FLAC__metadata_object_cuesheet_track_insert_blank_index(block, 0, 4)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_clone()... "); - blockcopy = FLAC__metadata_object_clone(block); - if(0 == blockcopy) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!mutils__compare_block(block, blockcopy)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(blockcopy); - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_track_delete_index() on end of array..."); - tr_delete_(cuesheet, 0, 4); - if(!FLAC__metadata_object_cuesheet_track_delete_index(block, 0, 4)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_track_delete_index() on middle of array..."); - tr_delete_(cuesheet, 0, 2); - if(!FLAC__metadata_object_cuesheet_track_delete_index(block, 0, 2)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_track_delete_index() on end of array..."); - tr_delete_(cuesheet, 0, 2); - if(!FLAC__metadata_object_cuesheet_track_delete_index(block, 0, 2)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_track_delete_index() on beginning of array..."); - tr_delete_(cuesheet, 0, 0); - if(!FLAC__metadata_object_cuesheet_track_delete_index(block, 0, 0)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(cuesheet); - FLAC__metadata_object_delete(block); - printf("OK\n"); - - - printf("testing FLAC__metadata_object_new()... "); - block = FLAC__metadata_object_new(FLAC__METADATA_TYPE_CUESHEET); - if(0 == block) { - printf("FAILED, returned NULL\n"); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_clone()... "); - cuesheet = FLAC__metadata_object_clone(block); - if(0 == cuesheet) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_insert_track(own) on empty array..."); - cs_insert_new_(&track, cuesheet, 0, 60, 7, "GBCDE1234567", false, false); - track_clone_(&track); - if(!FLAC__metadata_object_cuesheet_insert_track(block, 0, &track, /*copy=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_insert_track(own) on beginning of non-empty array..."); - cs_insert_new_(&track, cuesheet, 0, 70, 8, "HBCDE1234567", false, false); - track_clone_(&track); - if(!FLAC__metadata_object_cuesheet_insert_track(block, 0, &track, /*copy=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_insert_track(own) on middle of non-empty array..."); - cs_insert_new_(&track, cuesheet, 1, 80, 9, "IBCDE1234567", false, false); - track_clone_(&track); - if(!FLAC__metadata_object_cuesheet_insert_track(block, 1, &track, /*copy=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_insert_track(own) on end of non-empty array..."); - cs_insert_new_(&track, cuesheet, 3, 90, 10, "JBCDE1234567", false, false); - track_clone_(&track); - if(!FLAC__metadata_object_cuesheet_insert_track(block, 3, &track, /*copy=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_delete_track() on middle of array..."); - cs_delete_(cuesheet, 2); - if(!FLAC__metadata_object_cuesheet_delete_track(block, 2)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_delete_track() on end of array..."); - cs_delete_(cuesheet, 2); - if(!FLAC__metadata_object_cuesheet_delete_track(block, 2)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_delete_track() on beginning of array..."); - cs_delete_(cuesheet, 0); - if(!FLAC__metadata_object_cuesheet_delete_track(block, 0)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_set_track(own)..."); - cs_set_new_(&track, cuesheet, 0, 100, 11, "KBCDE1234567", false, false); - track_clone_(&track); - FLAC__metadata_object_cuesheet_set_track(block, 0, &track, /*copy=*/false); - if(!mutils__compare_block(cuesheet, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_cuesheet_is_legal()..."); - { - const char *violation; - if(FLAC__metadata_object_cuesheet_is_legal(block, /*check_cd_da_subset=*/true, &violation)) { - printf("FAILED, returned true when expecting false\n"); - return false; - } - printf("returned false as expected, violation=\"%s\" OK\n", violation); - } - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(cuesheet); - FLAC__metadata_object_delete(block); - printf("OK\n"); - - - printf("testing PICTURE\n"); - - printf("testing FLAC__metadata_object_new()... "); - block = FLAC__metadata_object_new(FLAC__METADATA_TYPE_PICTURE); - if(0 == block) { - printf("FAILED, returned NULL\n"); - return false; - } - expected_length = ( - FLAC__STREAM_METADATA_PICTURE_TYPE_LEN + - FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN + - FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN + - FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN + - FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN + - FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN + - FLAC__STREAM_METADATA_PICTURE_COLORS_LEN + - FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN - ) / 8; - if(block->length != expected_length) { - printf("FAILED, bad length, expected %u, got %u\n", expected_length, block->length); - return false; - } - printf("OK\n"); - - printf("testing FLAC__metadata_object_clone()... "); - picture = FLAC__metadata_object_clone(block); - if(0 == picture) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!mutils__compare_block(picture, block)) - return false; - printf("OK\n"); - - pi_set_mime_type(picture, "image/png\t"); - printf("testing FLAC__metadata_object_picture_set_mime_type(copy)..."); - if(!FLAC__metadata_object_picture_set_mime_type(block, "image/png\t", /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(picture, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_picture_is_legal()..."); - { - const char *violation; - if(FLAC__metadata_object_picture_is_legal(block, &violation)) { - printf("FAILED, returned true when expecting false\n"); - return false; - } - printf("returned false as expected, violation=\"%s\" OK\n", violation); - } - - pi_set_mime_type(picture, "image/png"); - printf("testing FLAC__metadata_object_picture_set_mime_type(copy)..."); - if(!FLAC__metadata_object_picture_set_mime_type(block, "image/png", /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(picture, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_picture_is_legal()..."); - { - const char *violation; - if(!FLAC__metadata_object_picture_is_legal(block, &violation)) { - printf("FAILED, returned false, violation=\"%s\"\n", violation); - return false; - } - printf("OK\n"); - } - - pi_set_description(picture, (const FLAC__byte *)"DESCRIPTION\xff"); - printf("testing FLAC__metadata_object_picture_set_description(copy)..."); - if(!FLAC__metadata_object_picture_set_description(block, (FLAC__byte *)"DESCRIPTION\xff", /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(picture, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_picture_is_legal()..."); - { - const char *violation; - if(FLAC__metadata_object_picture_is_legal(block, &violation)) { - printf("FAILED, returned true when expecting false\n"); - return false; - } - printf("returned false as expected, violation=\"%s\" OK\n", violation); - } - - pi_set_description(picture, (const FLAC__byte *)"DESCRIPTION"); - printf("testing FLAC__metadata_object_picture_set_description(copy)..."); - if(!FLAC__metadata_object_picture_set_description(block, (FLAC__byte *)"DESCRIPTION", /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(picture, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_picture_is_legal()..."); - { - const char *violation; - if(!FLAC__metadata_object_picture_is_legal(block, &violation)) { - printf("FAILED, returned false, violation=\"%s\"\n", violation); - return false; - } - printf("OK\n"); - } - - - pi_set_data(picture, (const FLAC__byte*)"PNGDATA", strlen("PNGDATA")); - printf("testing FLAC__metadata_object_picture_set_data(copy)..."); - if(!FLAC__metadata_object_picture_set_data(block, (FLAC__byte*)"PNGDATA", strlen("PNGDATA"), /*copy=*/true)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(picture, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_clone()... "); - blockcopy = FLAC__metadata_object_clone(block); - if(0 == blockcopy) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!mutils__compare_block(block, blockcopy)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(blockcopy); - printf("OK\n"); - - pi_set_mime_type(picture, "image/png\t"); - printf("testing FLAC__metadata_object_picture_set_mime_type(own)..."); - if(!FLAC__metadata_object_picture_set_mime_type(block, strdup("image/png\t"), /*copy=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(picture, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_picture_is_legal()..."); - { - const char *violation; - if(FLAC__metadata_object_picture_is_legal(block, &violation)) { - printf("FAILED, returned true when expecting false\n"); - return false; - } - printf("returned false as expected, violation=\"%s\" OK\n", violation); - } - - pi_set_mime_type(picture, "image/png"); - printf("testing FLAC__metadata_object_picture_set_mime_type(own)..."); - if(!FLAC__metadata_object_picture_set_mime_type(block, strdup("image/png"), /*copy=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(picture, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_picture_is_legal()..."); - { - const char *violation; - if(!FLAC__metadata_object_picture_is_legal(block, &violation)) { - printf("FAILED, returned false, violation=\"%s\"\n", violation); - return false; - } - printf("OK\n"); - } - - pi_set_description(picture, (const FLAC__byte *)"DESCRIPTION\xff"); - printf("testing FLAC__metadata_object_picture_set_description(own)..."); - if(!FLAC__metadata_object_picture_set_description(block, (FLAC__byte *)strdup("DESCRIPTION\xff"), /*copy=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(picture, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_picture_is_legal()..."); - { - const char *violation; - if(FLAC__metadata_object_picture_is_legal(block, &violation)) { - printf("FAILED, returned true when expecting false\n"); - return false; - } - printf("returned false as expected, violation=\"%s\" OK\n", violation); - } - - pi_set_description(picture, (const FLAC__byte *)"DESCRIPTION"); - printf("testing FLAC__metadata_object_picture_set_description(own)..."); - if(!FLAC__metadata_object_picture_set_description(block, (FLAC__byte *)strdup("DESCRIPTION"), /*copy=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(picture, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_picture_is_legal()..."); - { - const char *violation; - if(!FLAC__metadata_object_picture_is_legal(block, &violation)) { - printf("FAILED, returned false, violation=\"%s\"\n", violation); - return false; - } - printf("OK\n"); - } - - pi_set_data(picture, (const FLAC__byte*)"PNGDATA", strlen("PNGDATA")); - printf("testing FLAC__metadata_object_picture_set_data(own)..."); - if(!FLAC__metadata_object_picture_set_data(block, (FLAC__byte*)strdup("PNGDATA"), strlen("PNGDATA"), /*copy=*/false)) { - printf("FAILED, returned false\n"); - return false; - } - if(!mutils__compare_block(picture, block)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_clone()... "); - blockcopy = FLAC__metadata_object_clone(block); - if(0 == blockcopy) { - printf("FAILED, returned NULL\n"); - return false; - } - if(!mutils__compare_block(block, blockcopy)) - return false; - printf("OK\n"); - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(blockcopy); - printf("OK\n"); - - printf("testing FLAC__metadata_object_delete()... "); - FLAC__metadata_object_delete(picture); - FLAC__metadata_object_delete(block); - printf("OK\n"); - - - return true; -} diff --git a/3rdparty/libflac/src/test_libFLAC/test_libFLAC.dsp b/3rdparty/libflac/src/test_libFLAC/test_libFLAC.dsp deleted file mode 100644 index bc351e3779a..00000000000 --- a/3rdparty/libflac/src/test_libFLAC/test_libFLAC.dsp +++ /dev/null @@ -1,148 +0,0 @@ -# Microsoft Developer Studio Project File - Name="test_libFLAC" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=test_libFLAC - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "test_libFLAC.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "test_libFLAC.mak" CFG="test_libFLAC - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "test_libFLAC - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "test_libFLAC - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "test_libFLAC - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\obj\release\bin" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\libFLAC\include" /I "..\..\include" /D "NDEBUG" /D "FLAC__NO_DLL" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\..\obj\release\lib\grabbag_static.lib ..\..\obj\release\lib\replaygain_analysis_static.lib ..\..\obj\release\lib\test_libs_common_static.lib ..\..\obj\release\lib\libFLAC_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "test_libFLAC - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\obj\debug\bin" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\libFLAC\include" /I "..\..\include" /D "_DEBUG" /D "DEBUG" /D "FLAC__NO_DLL" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\..\obj\debug\lib\grabbag_static.lib ..\..\obj\debug\lib\replaygain_analysis_static.lib ..\..\obj\debug\lib\test_libs_common_static.lib ..\..\obj\debug\lib\libFLAC_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "test_libFLAC - Win32 Release" -# Name "test_libFLAC - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\bitwriter.c -# End Source File -# Begin Source File - -SOURCE=.\decoders.c -# End Source File -# Begin Source File - -SOURCE=.\encoders.c -# End Source File -# Begin Source File - -SOURCE=.\format.c -# End Source File -# Begin Source File - -SOURCE=.\main.c -# End Source File -# Begin Source File - -SOURCE=.\metadata.c -# End Source File -# Begin Source File - -SOURCE=.\metadata_manip.c -# End Source File -# Begin Source File - -SOURCE=.\metadata_object.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\bitwriter.h -# End Source File -# Begin Source File - -SOURCE=.\decoders.h -# End Source File -# Begin Source File - -SOURCE=.\encoders.h -# End Source File -# Begin Source File - -SOURCE=.\format.h -# End Source File -# Begin Source File - -SOURCE=.\metadata.h -# End Source File -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/test_libFLAC/test_libFLAC.vcproj b/3rdparty/libflac/src/test_libFLAC/test_libFLAC.vcproj deleted file mode 100644 index 47988e74eee..00000000000 --- a/3rdparty/libflac/src/test_libFLAC/test_libFLAC.vcproj +++ /dev/null @@ -1,252 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="test_libFLAC" - ProjectGUID="{4cefbc8c-c215-11db-8314-0800200c9a66}" - RootNamespace="test_libFLAC" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\obj\debug\bin" - IntermediateDirectory="Debug" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".;..\libFLAC\include;..\..\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;FLAC__NO_DLL;DEBUG" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="..\..\obj\release\lib\ogg_static.lib" - LinkIncremental="2" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\obj\release\bin" - IntermediateDirectory="Release" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".;..\libFLAC\include;..\..\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__NO_DLL" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="..\..\obj\release\lib\ogg_static.lib" - LinkIncremental="1" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" - LinkTimeCodeGeneration="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - <File - RelativePath=".\bitwriter.h" - > - </File> - <File - RelativePath=".\decoders.h" - > - </File> - <File - RelativePath=".\encoders.h" - > - </File> - <File - RelativePath=".\format.h" - > - </File> - <File - RelativePath=".\metadata.h" - > - </File> - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\bitwriter.c" - > - </File> - <File - RelativePath=".\decoders.c" - > - </File> - <File - RelativePath=".\encoders.c" - > - </File> - <File - RelativePath=".\format.c" - > - </File> - <File - RelativePath=".\main.c" - > - </File> - <File - RelativePath=".\metadata.c" - > - </File> - <File - RelativePath=".\metadata_manip.c" - > - </File> - <File - RelativePath=".\metadata_object.c" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/test_libs_common/Makefile.am b/3rdparty/libflac/src/test_libs_common/Makefile.am deleted file mode 100644 index f363f8b6ebb..00000000000 --- a/3rdparty/libflac/src/test_libs_common/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -# test_libs_common - Common code to library unit tests -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -INCLUDES = -I$(top_srcdir)/include - -noinst_LTLIBRARIES = libtest_libs_common.la - -libtest_libs_common_la_SOURCES = \ - file_utils_flac.c \ - metadata_utils.c - -EXTRA_DIST = \ - Makefile.lite \ - README \ - test_libs_common_static.dsp \ - test_libs_common_static.vcproj diff --git a/3rdparty/libflac/src/test_libs_common/Makefile.in b/3rdparty/libflac/src/test_libs_common/Makefile.in deleted file mode 100644 index 424c04e49cc..00000000000 --- a/3rdparty/libflac/src/test_libs_common/Makefile.in +++ /dev/null @@ -1,514 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# test_libs_common - Common code to library unit tests -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -INCLUDES = -I$(top_srcdir)/include - -noinst_LTLIBRARIES = libtest_libs_common.la - -libtest_libs_common_la_SOURCES = \ - file_utils_flac.c \ - metadata_utils.c - - -EXTRA_DIST = \ - Makefile.lite \ - README \ - test_libs_common_static.dsp \ - test_libs_common_static.vcproj - -subdir = src/test_libs_common -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) - -libtest_libs_common_la_LDFLAGS = -libtest_libs_common_la_LIBADD = -am_libtest_libs_common_la_OBJECTS = file_utils_flac.lo metadata_utils.lo -libtest_libs_common_la_OBJECTS = $(am_libtest_libs_common_la_OBJECTS) - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/file_utils_flac.Plo \ -@AMDEP_TRUE@ ./$(DEPDIR)/metadata_utils.Plo -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(libtest_libs_common_la_SOURCES) -DIST_COMMON = README $(srcdir)/Makefile.in Makefile.am -SOURCES = $(libtest_libs_common_la_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/test_libs_common/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" = "$$p" && dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libtest_libs_common.la: $(libtest_libs_common_la_OBJECTS) $(libtest_libs_common_la_DEPENDENCIES) - $(LINK) $(libtest_libs_common_la_LDFLAGS) $(libtest_libs_common_la_OBJECTS) $(libtest_libs_common_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_utils_flac.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metadata_utils.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/test_libs_common/Makefile.lite b/3rdparty/libflac/src/test_libs_common/Makefile.lite deleted file mode 100644 index fe7c92f8051..00000000000 --- a/3rdparty/libflac/src/test_libs_common/Makefile.lite +++ /dev/null @@ -1,35 +0,0 @@ -# test_libs_common - Common code to library unit tests -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# -# GNU makefile -# - -topdir = ../.. -libdir = $(topdir)/obj/$(BUILD)/lib - -LIB_NAME = libtest_libs_common - -INCLUDES = -I$(topdir)/include - -SRCS_C = \ - file_utils_flac.c \ - metadata_utils.c - -include $(topdir)/build/lib.mk - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/3rdparty/libflac/src/test_libs_common/README b/3rdparty/libflac/src/test_libs_common/README deleted file mode 100644 index 6a704c20442..00000000000 --- a/3rdparty/libflac/src/test_libs_common/README +++ /dev/null @@ -1,2 +0,0 @@ -This directory contains a convenience library of routines that are -common to the library unit testers. diff --git a/3rdparty/libflac/src/test_libs_common/file_utils_flac.c b/3rdparty/libflac/src/test_libs_common/file_utils_flac.c deleted file mode 100644 index a52fee09f26..00000000000 --- a/3rdparty/libflac/src/test_libs_common/file_utils_flac.c +++ /dev/null @@ -1,153 +0,0 @@ -/* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "FLAC/assert.h" -#include "FLAC/stream_encoder.h" -#include "test_libs_common/file_utils_flac.h" -#include <stdio.h> -#include <stdlib.h> -#include <sys/stat.h> /* for stat() */ - -#ifdef min -#undef min -#endif -#define min(a,b) ((a)<(b)?(a):(b)) - -const long file_utils__ogg_serial_number = 12345; - -#ifdef FLAC__VALGRIND_TESTING -static size_t local__fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) -{ - size_t ret = fwrite(ptr, size, nmemb, stream); - if(!ferror(stream)) - fflush(stream); - return ret; -} -#else -#define local__fwrite fwrite -#endif - -typedef struct { - FILE *file; -} encoder_client_struct; - -static FLAC__StreamEncoderWriteStatus encoder_write_callback_(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data) -{ - encoder_client_struct *ecd = (encoder_client_struct*)client_data; - - (void)encoder, (void)samples, (void)current_frame; - - if(local__fwrite(buffer, 1, bytes, ecd->file) != bytes) - return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR; - else - return FLAC__STREAM_ENCODER_WRITE_STATUS_OK; -} - -static void encoder_metadata_callback_(const FLAC__StreamEncoder *encoder, const FLAC__StreamMetadata *metadata, void *client_data) -{ - (void)encoder, (void)metadata, (void)client_data; -} - -FLAC__bool file_utils__generate_flacfile(FLAC__bool is_ogg, const char *output_filename, off_t *output_filesize, unsigned length, const FLAC__StreamMetadata *streaminfo, FLAC__StreamMetadata **metadata, unsigned num_metadata) -{ - FLAC__int32 samples[1024]; - FLAC__StreamEncoder *encoder; - FLAC__StreamEncoderInitStatus init_status; - encoder_client_struct encoder_client_data; - unsigned i, n; - - FLAC__ASSERT(0 != output_filename); - FLAC__ASSERT(0 != streaminfo); - FLAC__ASSERT(streaminfo->type == FLAC__METADATA_TYPE_STREAMINFO); - FLAC__ASSERT((streaminfo->is_last && num_metadata == 0) || (!streaminfo->is_last && num_metadata > 0)); - - if(0 == (encoder_client_data.file = fopen(output_filename, "wb"))) - return false; - - encoder = FLAC__stream_encoder_new(); - if(0 == encoder) { - fclose(encoder_client_data.file); - return false; - } - - FLAC__stream_encoder_set_ogg_serial_number(encoder, file_utils__ogg_serial_number); - FLAC__stream_encoder_set_verify(encoder, true); - FLAC__stream_encoder_set_streamable_subset(encoder, true); - FLAC__stream_encoder_set_do_mid_side_stereo(encoder, false); - FLAC__stream_encoder_set_loose_mid_side_stereo(encoder, false); - FLAC__stream_encoder_set_channels(encoder, streaminfo->data.stream_info.channels); - FLAC__stream_encoder_set_bits_per_sample(encoder, streaminfo->data.stream_info.bits_per_sample); - FLAC__stream_encoder_set_sample_rate(encoder, streaminfo->data.stream_info.sample_rate); - FLAC__stream_encoder_set_blocksize(encoder, streaminfo->data.stream_info.min_blocksize); - FLAC__stream_encoder_set_max_lpc_order(encoder, 0); - FLAC__stream_encoder_set_qlp_coeff_precision(encoder, 0); - FLAC__stream_encoder_set_do_qlp_coeff_prec_search(encoder, false); - FLAC__stream_encoder_set_do_escape_coding(encoder, false); - FLAC__stream_encoder_set_do_exhaustive_model_search(encoder, false); - FLAC__stream_encoder_set_min_residual_partition_order(encoder, 0); - FLAC__stream_encoder_set_max_residual_partition_order(encoder, 0); - FLAC__stream_encoder_set_rice_parameter_search_dist(encoder, 0); - FLAC__stream_encoder_set_total_samples_estimate(encoder, streaminfo->data.stream_info.total_samples); - FLAC__stream_encoder_set_metadata(encoder, metadata, num_metadata); - - if(is_ogg) - init_status = FLAC__stream_encoder_init_ogg_stream(encoder, /*read_callback=*/0, encoder_write_callback_, /*seek_callback=*/0, /*tell_callback=*/0, encoder_metadata_callback_, &encoder_client_data); - else - init_status = FLAC__stream_encoder_init_stream(encoder, encoder_write_callback_, /*seek_callback=*/0, /*tell_callback=*/0, encoder_metadata_callback_, &encoder_client_data); - - if(init_status != FLAC__STREAM_ENCODER_INIT_STATUS_OK) { - fclose(encoder_client_data.file); - return false; - } - - /* init the dummy sample buffer */ - for(i = 0; i < sizeof(samples) / sizeof(FLAC__int32); i++) - samples[i] = i & 7; - - while(length > 0) { - n = min(length, sizeof(samples) / sizeof(FLAC__int32)); - - if(!FLAC__stream_encoder_process_interleaved(encoder, samples, n)) { - fclose(encoder_client_data.file); - return false; - } - - length -= n; - } - - (void)FLAC__stream_encoder_finish(encoder); - - fclose(encoder_client_data.file); - - FLAC__stream_encoder_delete(encoder); - - if(0 != output_filesize) { - struct stat filestats; - - if(stat(output_filename, &filestats) != 0) - return false; - else - *output_filesize = filestats.st_size; - } - - return true; -} diff --git a/3rdparty/libflac/src/test_libs_common/metadata_utils.c b/3rdparty/libflac/src/test_libs_common/metadata_utils.c deleted file mode 100644 index fe192e7c017..00000000000 --- a/3rdparty/libflac/src/test_libs_common/metadata_utils.c +++ /dev/null @@ -1,657 +0,0 @@ -/* test_libFLAC - Unit tester for libFLAC - * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -/* - * These are not tests, just utility functions used by the metadata tests - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include "FLAC/metadata.h" -#include "test_libs_common/metadata_utils.h" -#include <stdio.h> -#include <stdlib.h> /* for malloc() */ -#include <string.h> /* for memcmp() */ - -FLAC__bool mutils__compare_block_data_streaminfo(const FLAC__StreamMetadata_StreamInfo *block, const FLAC__StreamMetadata_StreamInfo *blockcopy) -{ - if(blockcopy->min_blocksize != block->min_blocksize) { - printf("FAILED, min_blocksize mismatch, expected %u, got %u\n", block->min_blocksize, blockcopy->min_blocksize); - return false; - } - if(blockcopy->max_blocksize != block->max_blocksize) { - printf("FAILED, max_blocksize mismatch, expected %u, got %u\n", block->max_blocksize, blockcopy->max_blocksize); - return false; - } - if(blockcopy->min_framesize != block->min_framesize) { - printf("FAILED, min_framesize mismatch, expected %u, got %u\n", block->min_framesize, blockcopy->min_framesize); - return false; - } - if(blockcopy->max_framesize != block->max_framesize) { - printf("FAILED, max_framesize mismatch, expected %u, got %u\n", block->max_framesize, blockcopy->max_framesize); - return false; - } - if(blockcopy->sample_rate != block->sample_rate) { - printf("FAILED, sample_rate mismatch, expected %u, got %u\n", block->sample_rate, blockcopy->sample_rate); - return false; - } - if(blockcopy->channels != block->channels) { - printf("FAILED, channels mismatch, expected %u, got %u\n", block->channels, blockcopy->channels); - return false; - } - if(blockcopy->bits_per_sample != block->bits_per_sample) { - printf("FAILED, bits_per_sample mismatch, expected %u, got %u\n", block->bits_per_sample, blockcopy->bits_per_sample); - return false; - } - if(blockcopy->total_samples != block->total_samples) { -#ifdef _MSC_VER - printf("FAILED, total_samples mismatch, expected %I64u, got %I64u\n", block->total_samples, blockcopy->total_samples); -#else - printf("FAILED, total_samples mismatch, expected %llu, got %llu\n", (unsigned long long)block->total_samples, (unsigned long long)blockcopy->total_samples); -#endif - return false; - } - if(0 != memcmp(blockcopy->md5sum, block->md5sum, sizeof(block->md5sum))) { - printf("FAILED, md5sum mismatch, expected %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X, got %02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X\n", - (unsigned)block->md5sum[0], - (unsigned)block->md5sum[1], - (unsigned)block->md5sum[2], - (unsigned)block->md5sum[3], - (unsigned)block->md5sum[4], - (unsigned)block->md5sum[5], - (unsigned)block->md5sum[6], - (unsigned)block->md5sum[7], - (unsigned)block->md5sum[8], - (unsigned)block->md5sum[9], - (unsigned)block->md5sum[10], - (unsigned)block->md5sum[11], - (unsigned)block->md5sum[12], - (unsigned)block->md5sum[13], - (unsigned)block->md5sum[14], - (unsigned)block->md5sum[15], - (unsigned)blockcopy->md5sum[0], - (unsigned)blockcopy->md5sum[1], - (unsigned)blockcopy->md5sum[2], - (unsigned)blockcopy->md5sum[3], - (unsigned)blockcopy->md5sum[4], - (unsigned)blockcopy->md5sum[5], - (unsigned)blockcopy->md5sum[6], - (unsigned)blockcopy->md5sum[7], - (unsigned)blockcopy->md5sum[8], - (unsigned)blockcopy->md5sum[9], - (unsigned)blockcopy->md5sum[10], - (unsigned)blockcopy->md5sum[11], - (unsigned)blockcopy->md5sum[12], - (unsigned)blockcopy->md5sum[13], - (unsigned)blockcopy->md5sum[14], - (unsigned)blockcopy->md5sum[15] - ); - return false; - } - return true; -} - -FLAC__bool mutils__compare_block_data_padding(const FLAC__StreamMetadata_Padding *block, const FLAC__StreamMetadata_Padding *blockcopy, unsigned block_length) -{ - /* we don't compare the padding guts */ - (void)block, (void)blockcopy, (void)block_length; - return true; -} - -FLAC__bool mutils__compare_block_data_application(const FLAC__StreamMetadata_Application *block, const FLAC__StreamMetadata_Application *blockcopy, unsigned block_length) -{ - if(block_length < sizeof(block->id)) { - printf("FAILED, bad block length = %u\n", block_length); - return false; - } - if(0 != memcmp(blockcopy->id, block->id, sizeof(block->id))) { - printf("FAILED, id mismatch, expected %02X%02X%02X%02X, got %02X%02X%02X%02X\n", - (unsigned)block->id[0], - (unsigned)block->id[1], - (unsigned)block->id[2], - (unsigned)block->id[3], - (unsigned)blockcopy->id[0], - (unsigned)blockcopy->id[1], - (unsigned)blockcopy->id[2], - (unsigned)blockcopy->id[3] - ); - return false; - } - if(0 == block->data || 0 == blockcopy->data) { - if(block->data != blockcopy->data) { - printf("FAILED, data mismatch (%s's data pointer is null)\n", 0==block->data?"original":"copy"); - return false; - } - else if(block_length - sizeof(block->id) > 0) { - printf("FAILED, data pointer is null but block length is not 0\n"); - return false; - } - } - else { - if(block_length - sizeof(block->id) == 0) { - printf("FAILED, data pointer is not null but block length is 0\n"); - return false; - } - else if(0 != memcmp(blockcopy->data, block->data, block_length - sizeof(block->id))) { - printf("FAILED, data mismatch\n"); - return false; - } - } - return true; -} - -FLAC__bool mutils__compare_block_data_seektable(const FLAC__StreamMetadata_SeekTable *block, const FLAC__StreamMetadata_SeekTable *blockcopy) -{ - unsigned i; - if(blockcopy->num_points != block->num_points) { - printf("FAILED, num_points mismatch, expected %u, got %u\n", block->num_points, blockcopy->num_points); - return false; - } - for(i = 0; i < block->num_points; i++) { - if(blockcopy->points[i].sample_number != block->points[i].sample_number) { -#ifdef _MSC_VER - printf("FAILED, points[%u].sample_number mismatch, expected %I64u, got %I64u\n", i, block->points[i].sample_number, blockcopy->points[i].sample_number); -#else - printf("FAILED, points[%u].sample_number mismatch, expected %llu, got %llu\n", i, (unsigned long long)block->points[i].sample_number, (unsigned long long)blockcopy->points[i].sample_number); -#endif - return false; - } - if(blockcopy->points[i].stream_offset != block->points[i].stream_offset) { -#ifdef _MSC_VER - printf("FAILED, points[%u].stream_offset mismatch, expected %I64u, got %I64u\n", i, block->points[i].stream_offset, blockcopy->points[i].stream_offset); -#else - printf("FAILED, points[%u].stream_offset mismatch, expected %llu, got %llu\n", i, (unsigned long long)block->points[i].stream_offset, (unsigned long long)blockcopy->points[i].stream_offset); -#endif - return false; - } - if(blockcopy->points[i].frame_samples != block->points[i].frame_samples) { - printf("FAILED, points[%u].frame_samples mismatch, expected %u, got %u\n", i, block->points[i].frame_samples, blockcopy->points[i].frame_samples); - return false; - } - } - return true; -} - -FLAC__bool mutils__compare_block_data_vorbiscomment(const FLAC__StreamMetadata_VorbisComment *block, const FLAC__StreamMetadata_VorbisComment *blockcopy) -{ - unsigned i; - if(blockcopy->vendor_string.length != block->vendor_string.length) { - printf("FAILED, vendor_string.length mismatch, expected %u, got %u\n", block->vendor_string.length, blockcopy->vendor_string.length); - return false; - } - if(0 == block->vendor_string.entry || 0 == blockcopy->vendor_string.entry) { - if(block->vendor_string.entry != blockcopy->vendor_string.entry) { - printf("FAILED, vendor_string.entry mismatch\n"); - return false; - } - } - else if(0 != memcmp(blockcopy->vendor_string.entry, block->vendor_string.entry, block->vendor_string.length)) { - printf("FAILED, vendor_string.entry mismatch\n"); - return false; - } - if(blockcopy->num_comments != block->num_comments) { - printf("FAILED, num_comments mismatch, expected %u, got %u\n", block->num_comments, blockcopy->num_comments); - return false; - } - for(i = 0; i < block->num_comments; i++) { - if(blockcopy->comments[i].length != block->comments[i].length) { - printf("FAILED, comments[%u].length mismatch, expected %u, got %u\n", i, block->comments[i].length, blockcopy->comments[i].length); - return false; - } - if(0 == block->comments[i].entry || 0 == blockcopy->comments[i].entry) { - if(block->comments[i].entry != blockcopy->comments[i].entry) { - printf("FAILED, comments[%u].entry mismatch\n", i); - return false; - } - } - else { - if(0 != memcmp(blockcopy->comments[i].entry, block->comments[i].entry, block->comments[i].length)) { - printf("FAILED, comments[%u].entry mismatch\n", i); - return false; - } - } - } - return true; -} - -FLAC__bool mutils__compare_block_data_cuesheet(const FLAC__StreamMetadata_CueSheet *block, const FLAC__StreamMetadata_CueSheet *blockcopy) -{ - unsigned i, j; - - if(0 != strcmp(blockcopy->media_catalog_number, block->media_catalog_number)) { - printf("FAILED, media_catalog_number mismatch, expected %s, got %s\n", block->media_catalog_number, blockcopy->media_catalog_number); - return false; - } - if(blockcopy->lead_in != block->lead_in) { -#ifdef _MSC_VER - printf("FAILED, lead_in mismatch, expected %I64u, got %I64u\n", block->lead_in, blockcopy->lead_in); -#else - printf("FAILED, lead_in mismatch, expected %llu, got %llu\n", (unsigned long long)block->lead_in, (unsigned long long)blockcopy->lead_in); -#endif - return false; - } - if(blockcopy->is_cd != block->is_cd) { - printf("FAILED, is_cd mismatch, expected %u, got %u\n", (unsigned)block->is_cd, (unsigned)blockcopy->is_cd); - return false; - } - if(blockcopy->num_tracks != block->num_tracks) { - printf("FAILED, num_tracks mismatch, expected %u, got %u\n", block->num_tracks, blockcopy->num_tracks); - return false; - } - for(i = 0; i < block->num_tracks; i++) { - if(blockcopy->tracks[i].offset != block->tracks[i].offset) { -#ifdef _MSC_VER - printf("FAILED, tracks[%u].offset mismatch, expected %I64u, got %I64u\n", i, block->tracks[i].offset, blockcopy->tracks[i].offset); -#else - printf("FAILED, tracks[%u].offset mismatch, expected %llu, got %llu\n", i, (unsigned long long)block->tracks[i].offset, (unsigned long long)blockcopy->tracks[i].offset); -#endif - return false; - } - if(blockcopy->tracks[i].number != block->tracks[i].number) { - printf("FAILED, tracks[%u].number mismatch, expected %u, got %u\n", i, (unsigned)block->tracks[i].number, (unsigned)blockcopy->tracks[i].number); - return false; - } - if(blockcopy->tracks[i].num_indices != block->tracks[i].num_indices) { - printf("FAILED, tracks[%u].num_indices mismatch, expected %u, got %u\n", i, (unsigned)block->tracks[i].num_indices, (unsigned)blockcopy->tracks[i].num_indices); - return false; - } - /* num_indices == 0 means lead-out track so only the track offset and number are valid */ - if(block->tracks[i].num_indices > 0) { - if(0 != strcmp(blockcopy->tracks[i].isrc, block->tracks[i].isrc)) { - printf("FAILED, tracks[%u].isrc mismatch, expected %s, got %s\n", i, block->tracks[i].isrc, blockcopy->tracks[i].isrc); - return false; - } - if(blockcopy->tracks[i].type != block->tracks[i].type) { - printf("FAILED, tracks[%u].type mismatch, expected %u, got %u\n", i, (unsigned)block->tracks[i].type, (unsigned)blockcopy->tracks[i].type); - return false; - } - if(blockcopy->tracks[i].pre_emphasis != block->tracks[i].pre_emphasis) { - printf("FAILED, tracks[%u].pre_emphasis mismatch, expected %u, got %u\n", i, (unsigned)block->tracks[i].pre_emphasis, (unsigned)blockcopy->tracks[i].pre_emphasis); - return false; - } - if(0 == block->tracks[i].indices || 0 == blockcopy->tracks[i].indices) { - if(block->tracks[i].indices != blockcopy->tracks[i].indices) { - printf("FAILED, tracks[%u].indices mismatch\n", i); - return false; - } - } - else { - for(j = 0; j < block->tracks[i].num_indices; j++) { - if(blockcopy->tracks[i].indices[j].offset != block->tracks[i].indices[j].offset) { -#ifdef _MSC_VER - printf("FAILED, tracks[%u].indices[%u].offset mismatch, expected %I64u, got %I64u\n", i, j, block->tracks[i].indices[j].offset, blockcopy->tracks[i].indices[j].offset); -#else - printf("FAILED, tracks[%u].indices[%u].offset mismatch, expected %llu, got %llu\n", i, j, (unsigned long long)block->tracks[i].indices[j].offset, (unsigned long long)blockcopy->tracks[i].indices[j].offset); -#endif - return false; - } - if(blockcopy->tracks[i].indices[j].number != block->tracks[i].indices[j].number) { - printf("FAILED, tracks[%u].indices[%u].number mismatch, expected %u, got %u\n", i, j, (unsigned)block->tracks[i].indices[j].number, (unsigned)blockcopy->tracks[i].indices[j].number); - return false; - } - } - } - } - } - return true; -} - -FLAC__bool mutils__compare_block_data_picture(const FLAC__StreamMetadata_Picture *block, const FLAC__StreamMetadata_Picture *blockcopy) -{ - size_t len, lencopy; - if(blockcopy->type != block->type) { - printf("FAILED, type mismatch, expected %u, got %u\n", (unsigned)block->type, (unsigned)blockcopy->type); - return false; - } - len = strlen(block->mime_type); - lencopy = strlen(blockcopy->mime_type); - if(lencopy != len) { - printf("FAILED, mime_type length mismatch, expected %u, got %u\n", (unsigned)len, (unsigned)lencopy); - return false; - } - if(strcmp(blockcopy->mime_type, block->mime_type)) { - printf("FAILED, mime_type mismatch, expected %s, got %s\n", block->mime_type, blockcopy->mime_type); - return false; - } - len = strlen((const char *)block->description); - lencopy = strlen((const char *)blockcopy->description); - if(lencopy != len) { - printf("FAILED, description length mismatch, expected %u, got %u\n", (unsigned)len, (unsigned)lencopy); - return false; - } - if(strcmp((const char *)blockcopy->description, (const char *)block->description)) { - printf("FAILED, description mismatch, expected %s, got %s\n", block->description, blockcopy->description); - return false; - } - if(blockcopy->width != block->width) { - printf("FAILED, width mismatch, expected %u, got %u\n", block->width, blockcopy->width); - return false; - } - if(blockcopy->height != block->height) { - printf("FAILED, height mismatch, expected %u, got %u\n", block->height, blockcopy->height); - return false; - } - if(blockcopy->depth != block->depth) { - printf("FAILED, depth mismatch, expected %u, got %u\n", block->depth, blockcopy->depth); - return false; - } - if(blockcopy->colors != block->colors) { - printf("FAILED, colors mismatch, expected %u, got %u\n", block->colors, blockcopy->colors); - return false; - } - if(blockcopy->data_length != block->data_length) { - printf("FAILED, data_length mismatch, expected %u, got %u\n", block->data_length, blockcopy->data_length); - return false; - } - if(memcmp(blockcopy->data, block->data, block->data_length)) { - printf("FAILED, data mismatch\n"); - return false; - } - return true; -} - -FLAC__bool mutils__compare_block_data_unknown(const FLAC__StreamMetadata_Unknown *block, const FLAC__StreamMetadata_Unknown *blockcopy, unsigned block_length) -{ - if(0 == block->data || 0 == blockcopy->data) { - if(block->data != blockcopy->data) { - printf("FAILED, data mismatch (%s's data pointer is null)\n", 0==block->data?"original":"copy"); - return false; - } - else if(block_length > 0) { - printf("FAILED, data pointer is null but block length is not 0\n"); - return false; - } - } - else { - if(block_length == 0) { - printf("FAILED, data pointer is not null but block length is 0\n"); - return false; - } - else if(0 != memcmp(blockcopy->data, block->data, block_length)) { - printf("FAILED, data mismatch\n"); - return false; - } - } - return true; -} - -FLAC__bool mutils__compare_block(const FLAC__StreamMetadata *block, const FLAC__StreamMetadata *blockcopy) -{ - if(blockcopy->type != block->type) { - printf("FAILED, type mismatch, expected %s, got %s\n", FLAC__MetadataTypeString[block->type], FLAC__MetadataTypeString[blockcopy->type]); - return false; - } - if(blockcopy->is_last != block->is_last) { - printf("FAILED, is_last mismatch, expected %u, got %u\n", (unsigned)block->is_last, (unsigned)blockcopy->is_last); - return false; - } - if(blockcopy->length != block->length) { - printf("FAILED, length mismatch, expected %u, got %u\n", block->length, blockcopy->length); - return false; - } - switch(block->type) { - case FLAC__METADATA_TYPE_STREAMINFO: - return mutils__compare_block_data_streaminfo(&block->data.stream_info, &blockcopy->data.stream_info); - case FLAC__METADATA_TYPE_PADDING: - return mutils__compare_block_data_padding(&block->data.padding, &blockcopy->data.padding, block->length); - case FLAC__METADATA_TYPE_APPLICATION: - return mutils__compare_block_data_application(&block->data.application, &blockcopy->data.application, block->length); - case FLAC__METADATA_TYPE_SEEKTABLE: - return mutils__compare_block_data_seektable(&block->data.seek_table, &blockcopy->data.seek_table); - case FLAC__METADATA_TYPE_VORBIS_COMMENT: - return mutils__compare_block_data_vorbiscomment(&block->data.vorbis_comment, &blockcopy->data.vorbis_comment); - case FLAC__METADATA_TYPE_CUESHEET: - return mutils__compare_block_data_cuesheet(&block->data.cue_sheet, &blockcopy->data.cue_sheet); - case FLAC__METADATA_TYPE_PICTURE: - return mutils__compare_block_data_picture(&block->data.picture, &blockcopy->data.picture); - default: - return mutils__compare_block_data_unknown(&block->data.unknown, &blockcopy->data.unknown, block->length); - } -} - -static void *malloc_or_die_(size_t size) -{ - void *x = malloc(size); - if(0 == x) { - fprintf(stderr, "ERROR: out of memory allocating %u bytes\n", (unsigned)size); - exit(1); - } - return x; -} - -static void *calloc_or_die_(size_t n, size_t size) -{ - void *x = calloc(n, size); - if(0 == x) { - fprintf(stderr, "ERROR: out of memory allocating %u bytes\n", (unsigned)n * (unsigned)size); - exit(1); - } - return x; -} - -static char *strdup_or_die_(const char *s) -{ - char *x = strdup(s); - if(0 == x) { - fprintf(stderr, "ERROR: out of memory copying string \"%s\"\n", s); - exit(1); - } - return x; -} - -void mutils__init_metadata_blocks( - FLAC__StreamMetadata *streaminfo, - FLAC__StreamMetadata *padding, - FLAC__StreamMetadata *seektable, - FLAC__StreamMetadata *application1, - FLAC__StreamMetadata *application2, - FLAC__StreamMetadata *vorbiscomment, - FLAC__StreamMetadata *cuesheet, - FLAC__StreamMetadata *picture, - FLAC__StreamMetadata *unknown -) -{ - /* - most of the actual numbers and data in the blocks don't matter, - we just want to make sure the decoder parses them correctly - - remember, the metadata interface gets tested after the decoders, - so we do all the metadata manipulation here without it. - */ - - /* min/max_framesize and md5sum don't get written at first, so we have to leave them 0 */ - streaminfo->is_last = false; - streaminfo->type = FLAC__METADATA_TYPE_STREAMINFO; - streaminfo->length = FLAC__STREAM_METADATA_STREAMINFO_LENGTH; - streaminfo->data.stream_info.min_blocksize = 576; - streaminfo->data.stream_info.max_blocksize = 576; - streaminfo->data.stream_info.min_framesize = 0; - streaminfo->data.stream_info.max_framesize = 0; - streaminfo->data.stream_info.sample_rate = 44100; - streaminfo->data.stream_info.channels = 1; - streaminfo->data.stream_info.bits_per_sample = 8; - streaminfo->data.stream_info.total_samples = 0; - memset(streaminfo->data.stream_info.md5sum, 0, 16); - - padding->is_last = false; - padding->type = FLAC__METADATA_TYPE_PADDING; - padding->length = 1234; - - seektable->is_last = false; - seektable->type = FLAC__METADATA_TYPE_SEEKTABLE; - seektable->data.seek_table.num_points = 2; - seektable->length = seektable->data.seek_table.num_points * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH; - seektable->data.seek_table.points = (FLAC__StreamMetadata_SeekPoint*)malloc_or_die_(seektable->data.seek_table.num_points * sizeof(FLAC__StreamMetadata_SeekPoint)); - seektable->data.seek_table.points[0].sample_number = 0; - seektable->data.seek_table.points[0].stream_offset = 0; - seektable->data.seek_table.points[0].frame_samples = streaminfo->data.stream_info.min_blocksize; - seektable->data.seek_table.points[1].sample_number = FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER; - seektable->data.seek_table.points[1].stream_offset = 1000; - seektable->data.seek_table.points[1].frame_samples = streaminfo->data.stream_info.min_blocksize; - - application1->is_last = false; - application1->type = FLAC__METADATA_TYPE_APPLICATION; - application1->length = 8; - memcpy(application1->data.application.id, "\xfe\xdc\xba\x98", 4); - application1->data.application.data = (FLAC__byte*)malloc_or_die_(4); - memcpy(application1->data.application.data, "\xf0\xe1\xd2\xc3", 4); - - application2->is_last = false; - application2->type = FLAC__METADATA_TYPE_APPLICATION; - application2->length = 4; - memcpy(application2->data.application.id, "\x76\x54\x32\x10", 4); - application2->data.application.data = 0; - - { - const unsigned vendor_string_length = (unsigned)strlen(FLAC__VENDOR_STRING); - vorbiscomment->is_last = false; - vorbiscomment->type = FLAC__METADATA_TYPE_VORBIS_COMMENT; - vorbiscomment->length = (4 + vendor_string_length) + 4 + (4 + 5) + (4 + 0); - vorbiscomment->data.vorbis_comment.vendor_string.length = vendor_string_length; - vorbiscomment->data.vorbis_comment.vendor_string.entry = (FLAC__byte*)malloc_or_die_(vendor_string_length+1); - memcpy(vorbiscomment->data.vorbis_comment.vendor_string.entry, FLAC__VENDOR_STRING, vendor_string_length+1); - vorbiscomment->data.vorbis_comment.num_comments = 2; - vorbiscomment->data.vorbis_comment.comments = (FLAC__StreamMetadata_VorbisComment_Entry*)malloc_or_die_(vorbiscomment->data.vorbis_comment.num_comments * sizeof(FLAC__StreamMetadata_VorbisComment_Entry)); - vorbiscomment->data.vorbis_comment.comments[0].length = 5; - vorbiscomment->data.vorbis_comment.comments[0].entry = (FLAC__byte*)malloc_or_die_(5+1); - memcpy(vorbiscomment->data.vorbis_comment.comments[0].entry, "ab=cd", 5+1); - vorbiscomment->data.vorbis_comment.comments[1].length = 0; - vorbiscomment->data.vorbis_comment.comments[1].entry = 0; - } - - cuesheet->is_last = false; - cuesheet->type = FLAC__METADATA_TYPE_CUESHEET; - cuesheet->length = - /* cuesheet guts */ - ( - FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN + - FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN + - FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN + - FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN + - FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN - ) / 8 + - /* 2 tracks */ - 3 * ( - FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN + - FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN - ) / 8 + - /* 3 index points */ - 3 * ( - FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN + - FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN + - FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN - ) / 8 - ; - memset(cuesheet->data.cue_sheet.media_catalog_number, 0, sizeof(cuesheet->data.cue_sheet.media_catalog_number)); - cuesheet->data.cue_sheet.media_catalog_number[0] = 'j'; - cuesheet->data.cue_sheet.media_catalog_number[1] = 'C'; - cuesheet->data.cue_sheet.lead_in = 2 * 44100; - cuesheet->data.cue_sheet.is_cd = true; - cuesheet->data.cue_sheet.num_tracks = 3; - cuesheet->data.cue_sheet.tracks = (FLAC__StreamMetadata_CueSheet_Track*)calloc_or_die_(cuesheet->data.cue_sheet.num_tracks, sizeof(FLAC__StreamMetadata_CueSheet_Track)); - cuesheet->data.cue_sheet.tracks[0].offset = 0; - cuesheet->data.cue_sheet.tracks[0].number = 1; - memcpy(cuesheet->data.cue_sheet.tracks[0].isrc, "ACBDE1234567", sizeof(cuesheet->data.cue_sheet.tracks[0].isrc)); - cuesheet->data.cue_sheet.tracks[0].type = 0; - cuesheet->data.cue_sheet.tracks[0].pre_emphasis = 1; - cuesheet->data.cue_sheet.tracks[0].num_indices = 2; - cuesheet->data.cue_sheet.tracks[0].indices = (FLAC__StreamMetadata_CueSheet_Index*)malloc_or_die_(cuesheet->data.cue_sheet.tracks[0].num_indices * sizeof(FLAC__StreamMetadata_CueSheet_Index)); - cuesheet->data.cue_sheet.tracks[0].indices[0].offset = 0; - cuesheet->data.cue_sheet.tracks[0].indices[0].number = 0; - cuesheet->data.cue_sheet.tracks[0].indices[1].offset = 123 * 588; - cuesheet->data.cue_sheet.tracks[0].indices[1].number = 1; - cuesheet->data.cue_sheet.tracks[1].offset = 1234 * 588; - cuesheet->data.cue_sheet.tracks[1].number = 2; - memcpy(cuesheet->data.cue_sheet.tracks[1].isrc, "ACBDE7654321", sizeof(cuesheet->data.cue_sheet.tracks[1].isrc)); - cuesheet->data.cue_sheet.tracks[1].type = 1; - cuesheet->data.cue_sheet.tracks[1].pre_emphasis = 0; - cuesheet->data.cue_sheet.tracks[1].num_indices = 1; - cuesheet->data.cue_sheet.tracks[1].indices = (FLAC__StreamMetadata_CueSheet_Index*)malloc_or_die_(cuesheet->data.cue_sheet.tracks[1].num_indices * sizeof(FLAC__StreamMetadata_CueSheet_Index)); - cuesheet->data.cue_sheet.tracks[1].indices[0].offset = 0; - cuesheet->data.cue_sheet.tracks[1].indices[0].number = 1; - cuesheet->data.cue_sheet.tracks[2].offset = 12345 * 588; - cuesheet->data.cue_sheet.tracks[2].number = 170; - cuesheet->data.cue_sheet.tracks[2].num_indices = 0; - - picture->is_last = false; - picture->type = FLAC__METADATA_TYPE_PICTURE; - picture->length = - ( - FLAC__STREAM_METADATA_PICTURE_TYPE_LEN + - FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN + /* will add the length for the string later */ - FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN + /* will add the length for the string later */ - FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN + - FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN + - FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN + - FLAC__STREAM_METADATA_PICTURE_COLORS_LEN + - FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN /* will add the length for the data later */ - ) / 8 - ; - picture->data.picture.type = FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER; - picture->data.picture.mime_type = strdup_or_die_("image/jpeg"); - picture->length += strlen(picture->data.picture.mime_type); - picture->data.picture.description = (FLAC__byte*)strdup_or_die_("desc"); - picture->length += strlen((const char *)picture->data.picture.description); - picture->data.picture.width = 300; - picture->data.picture.height = 300; - picture->data.picture.depth = 24; - picture->data.picture.colors = 0; - picture->data.picture.data = (FLAC__byte*)strdup_or_die_("SOMEJPEGDATA"); - picture->data.picture.data_length = strlen((const char *)picture->data.picture.data); - picture->length += picture->data.picture.data_length; - - unknown->is_last = true; - unknown->type = 126; - unknown->length = 8; - unknown->data.unknown.data = (FLAC__byte*)malloc_or_die_(unknown->length); - memcpy(unknown->data.unknown.data, "\xfe\xdc\xba\x98\xf0\xe1\xd2\xc3", unknown->length); -} - -void mutils__free_metadata_blocks( - FLAC__StreamMetadata *streaminfo, - FLAC__StreamMetadata *padding, - FLAC__StreamMetadata *seektable, - FLAC__StreamMetadata *application1, - FLAC__StreamMetadata *application2, - FLAC__StreamMetadata *vorbiscomment, - FLAC__StreamMetadata *cuesheet, - FLAC__StreamMetadata *picture, - FLAC__StreamMetadata *unknown -) -{ - (void)streaminfo, (void)padding, (void)application2; - free(seektable->data.seek_table.points); - free(application1->data.application.data); - free(vorbiscomment->data.vorbis_comment.vendor_string.entry); - free(vorbiscomment->data.vorbis_comment.comments[0].entry); - free(vorbiscomment->data.vorbis_comment.comments); - free(cuesheet->data.cue_sheet.tracks[0].indices); - free(cuesheet->data.cue_sheet.tracks[1].indices); - free(cuesheet->data.cue_sheet.tracks); - free(picture->data.picture.mime_type); - free(picture->data.picture.description); - free(picture->data.picture.data); - free(unknown->data.unknown.data); -} diff --git a/3rdparty/libflac/src/test_libs_common/test_libs_common_static.dsp b/3rdparty/libflac/src/test_libs_common/test_libs_common_static.dsp deleted file mode 100644 index 3989317c70d..00000000000 --- a/3rdparty/libflac/src/test_libs_common/test_libs_common_static.dsp +++ /dev/null @@ -1,108 +0,0 @@ -# Microsoft Developer Studio Project File - Name="test_libs_common_static" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=test_libs_common_static - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "test_libs_common_static.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "test_libs_common_static.mak" CFG="test_libs_common_static - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "test_libs_common_static - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "test_libs_common_static - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "test_libs_common" -# PROP Scc_LocalPath "..\.." -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "test_libs_common_static - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\obj\release\lib" -# PROP Intermediate_Dir "Release_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /Op /I ".\include" /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /nodefaultlib - -!ELSEIF "$(CFG)" == "test_libs_common_static - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\obj\debug\lib" -# PROP Intermediate_Dir "Debug_static" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".\include" /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /nodefaultlib - -!ENDIF - -# Begin Target - -# Name "test_libs_common_static - Win32 Release" -# Name "test_libs_common_static - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "c" -# Begin Source File - -SOURCE=.\file_utils_flac.c -# End Source File -# Begin Source File - -SOURCE=.\metadata_utils.c -# End Source File -# End Group -# Begin Group "Public Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\include\test_libs_common\file_utils_flac.h -# End Source File -# Begin Source File - -SOURCE=..\..\include\test_libs_common\metadata_utils.h -# End Source File -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/test_libs_common/test_libs_common_static.vcproj b/3rdparty/libflac/src/test_libs_common/test_libs_common_static.vcproj deleted file mode 100644 index b1c9074ea9a..00000000000 --- a/3rdparty/libflac/src/test_libs_common/test_libs_common_static.vcproj +++ /dev/null @@ -1,177 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="test_libs_common_static" - ProjectGUID="{4cefbc8e-c215-11db-8314-0800200c9a66}" - RootNamespace="test_libs_common_static" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\obj\debug\lib" - IntermediateDirectory="Debug_static" - ConfigurationType="4" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".\include;..\..\include" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;FLAC__NO_DLL;DEBUG" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\..\obj\debug\lib\$(ProjectName).lib" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\obj\release\lib" - IntermediateDirectory="Release_static" - ConfigurationType="4" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".\include;..\..\include" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__NO_DLL" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLibrarianTool" - OutputFile="..\..\..\obj\release\lib\$(ProjectName).lib" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\file_utils_flac.c" - > - </File> - <File - RelativePath=".\metadata_utils.c" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/test_seeking/Makefile.am b/3rdparty/libflac/src/test_seeking/Makefile.am deleted file mode 100644 index 120e233fb1e..00000000000 --- a/3rdparty/libflac/src/test_seeking/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -# test_seeking - Seeking tester for libFLAC -# Copyright (C) 2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -EXTRA_DIST = \ - Makefile.lite \ - test_seeking.dsp \ - test_seeking.vcproj - -AM_CFLAGS = @OGG_CFLAGS@ - -INCLUDES = - -noinst_PROGRAMS = test_seeking -test_seeking_LDADD = \ - $(top_builddir)/src/libFLAC/libFLAC.la \ - @OGG_LIBS@ \ - @MINGW_WINSOCK_LIBS@ \ - -lm -test_seeking_SOURCES = \ - main.c diff --git a/3rdparty/libflac/src/test_seeking/Makefile.in b/3rdparty/libflac/src/test_seeking/Makefile.in deleted file mode 100644 index 552d9728849..00000000000 --- a/3rdparty/libflac/src/test_seeking/Makefile.in +++ /dev/null @@ -1,517 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# test_seeking - Seeking tester for libFLAC -# Copyright (C) 2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -EXTRA_DIST = \ - Makefile.lite \ - test_seeking.dsp \ - test_seeking.vcproj - - -AM_CFLAGS = @OGG_CFLAGS@ - -INCLUDES = - -noinst_PROGRAMS = test_seeking -test_seeking_LDADD = \ - $(top_builddir)/src/libFLAC/libFLAC.la \ - @OGG_LIBS@ \ - @MINGW_WINSOCK_LIBS@ \ - -lm - -test_seeking_SOURCES = \ - main.c - -subdir = src/test_seeking -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -noinst_PROGRAMS = test_seeking$(EXEEXT) -PROGRAMS = $(noinst_PROGRAMS) - -am_test_seeking_OBJECTS = main.$(OBJEXT) -test_seeking_OBJECTS = $(am_test_seeking_OBJECTS) -test_seeking_DEPENDENCIES = $(top_builddir)/src/libFLAC/libFLAC.la -test_seeking_LDFLAGS = - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/main.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(test_seeking_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(test_seeking_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/test_seeking/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -test_seeking$(EXEEXT): $(test_seeking_OBJECTS) $(test_seeking_DEPENDENCIES) - @rm -f test_seeking$(EXEEXT) - $(LINK) $(test_seeking_LDFLAGS) $(test_seeking_OBJECTS) $(test_seeking_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/test_seeking/Makefile.lite b/3rdparty/libflac/src/test_seeking/Makefile.lite deleted file mode 100644 index 0df91a0cb73..00000000000 --- a/3rdparty/libflac/src/test_seeking/Makefile.lite +++ /dev/null @@ -1,40 +0,0 @@ -# test_seeking - Seeking tester for libFLAC -# Copyright (C) 2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# -# GNU makefile -# - -topdir = ../.. -libdir = $(topdir)/obj/$(BUILD)/lib - -PROGRAM_NAME = test_seeking - -INCLUDES = -I../libFLAC/include -I$(topdir)/include - -ifeq ($(DARWIN_BUILD),yes) -EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm -else -LIBS = -lFLAC -L$(OGG_LIB_DIR) -logg -lm -endif - -SRCS_C = \ - main.c - -include $(topdir)/build/exe.mk - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/3rdparty/libflac/src/test_seeking/main.c b/3rdparty/libflac/src/test_seeking/main.c deleted file mode 100644 index 11b549a4883..00000000000 --- a/3rdparty/libflac/src/test_seeking/main.c +++ /dev/null @@ -1,501 +0,0 @@ -/* test_seeking - Seeking tester for libFLAC - * Copyright (C) 2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <signal.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#if defined _MSC_VER || defined __MINGW32__ -#include <time.h> -#else -#include <sys/time.h> -#endif -#include <sys/stat.h> /* for stat() */ -#include "FLAC/assert.h" -#include "FLAC/metadata.h" -#include "FLAC/stream_decoder.h" - -typedef struct { - FLAC__int32 **pcm; - FLAC__bool got_data; - FLAC__uint64 total_samples; - unsigned channels; - unsigned bits_per_sample; - FLAC__bool quiet; - FLAC__bool ignore_errors; - FLAC__bool error_occurred; -} DecoderClientData; - -static FLAC__bool stop_signal_ = false; - -static void our_sigint_handler_(int signal) -{ - (void)signal; - printf("(caught SIGINT) "); - fflush(stdout); - stop_signal_ = true; -} - -static FLAC__bool die_(const char *msg) -{ - printf("ERROR: %s\n", msg); - return false; -} - -static FLAC__bool die_s_(const char *msg, const FLAC__StreamDecoder *decoder) -{ - FLAC__StreamDecoderState state = FLAC__stream_decoder_get_state(decoder); - - if(msg) - printf("FAILED, %s", msg); - else - printf("FAILED"); - - printf(", state = %u (%s)\n", (unsigned)state, FLAC__StreamDecoderStateString[state]); - - return false; -} - -static unsigned local_rand_(void) -{ -#if !defined _MSC_VER && !defined __MINGW32__ -#define RNDFUNC random -#else -#define RNDFUNC rand -#endif - /* every RAND_MAX I've ever seen is 2^15-1 or 2^31-1, so a little hackery here: */ - if (RAND_MAX > 32767) - return RNDFUNC(); - else /* usually MSVC, some solaris */ - return (RNDFUNC()<<15) | RNDFUNC(); -#undef RNDFUNC -} - -static off_t get_filesize_(const char *srcpath) -{ - struct stat srcstat; - - if(0 == stat(srcpath, &srcstat)) - return srcstat.st_size; - else - return -1; -} - -static FLAC__bool read_pcm_(FLAC__int32 *pcm[], const char *rawfilename, const char *flacfilename) -{ - FILE *f; - unsigned channels = 0, bps = 0, samples, i, j; - - off_t rawfilesize = get_filesize_(rawfilename); - if (rawfilesize < 0) { - fprintf(stderr, "ERROR: can't determine filesize for %s\n", rawfilename); - return false; - } - /* get sample format from flac file; would just use FLAC__metadata_get_streaminfo() except it doesn't work for Ogg FLAC yet */ - { -#if 0 - FLAC__StreamMetadata streaminfo; - if(!FLAC__metadata_get_streaminfo(flacfilename, &streaminfo)) { - printf("ERROR: getting STREAMINFO from %s\n", flacfilename); - return false; - } - channels = streaminfo.data.stream_info.channels; - bps = streaminfo.data.stream_info.bits_per_sample; -#else - FLAC__bool ok = true; - FLAC__Metadata_Chain *chain = FLAC__metadata_chain_new(); - FLAC__Metadata_Iterator *it = 0; - ok = ok && chain && (FLAC__metadata_chain_read(chain, flacfilename) || FLAC__metadata_chain_read_ogg(chain, flacfilename)); - ok = ok && (it = FLAC__metadata_iterator_new()); - if(ok) FLAC__metadata_iterator_init(it, chain); - ok = ok && (FLAC__metadata_iterator_get_block(it)->type == FLAC__METADATA_TYPE_STREAMINFO); - ok = ok && (channels = FLAC__metadata_iterator_get_block(it)->data.stream_info.channels); - ok = ok && (bps = FLAC__metadata_iterator_get_block(it)->data.stream_info.bits_per_sample); - if(it) FLAC__metadata_iterator_delete(it); - if(chain) FLAC__metadata_chain_delete(chain); - if(!ok) { - printf("ERROR: getting STREAMINFO from %s\n", flacfilename); - return false; - } -#endif - } - if(channels > 2) { - printf("ERROR: PCM verification requires 1 or 2 channels, got %u\n", channels); - return false; - } - if(bps != 8 && bps != 16) { - printf("ERROR: PCM verification requires 8 or 16 bps, got %u\n", bps); - return false; - } - samples = rawfilesize / channels / (bps>>3); - if (samples > 10000000) { - fprintf(stderr, "ERROR: %s is too big\n", rawfilename); - return false; - } - for(i = 0; i < channels; i++) { - if(0 == (pcm[i] = (FLAC__int32*)malloc(sizeof(FLAC__int32)*samples))) { - printf("ERROR: allocating space for PCM samples\n"); - return false; - } - } - if(0 == (f = fopen(rawfilename, "rb"))) { - printf("ERROR: opening %s for reading\n", rawfilename); - return false; - } - /* assumes signed big-endian data */ - if(bps == 8) { - signed char c; - for(i = 0; i < samples; i++) { - for(j = 0; j < channels; j++) { - fread(&c, 1, 1, f); - pcm[j][i] = c; - } - } - } - else { /* bps == 16 */ - unsigned char c[2]; - for(i = 0; i < samples; i++) { - for(j = 0; j < channels; j++) { - fread(&c, 1, 2, f); - pcm[j][i] = ((int)((signed char)c[0])) << 8 | (int)c[1]; - } - } - } - fclose(f); - return true; -} - -static FLAC__StreamDecoderWriteStatus write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data) -{ - DecoderClientData *dcd = (DecoderClientData*)client_data; - - (void)decoder, (void)buffer; - - if(0 == dcd) { - printf("ERROR: client_data in write callback is NULL\n"); - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - } - - if(dcd->error_occurred) - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - - FLAC__ASSERT(frame->header.number_type == FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER); /* decoder guarantees this */ - if (!dcd->quiet) -#ifdef _MSC_VER - printf("frame@%I64u(%u)... ", frame->header.number.sample_number, frame->header.blocksize); -#else - printf("frame@%llu(%u)... ", (unsigned long long)frame->header.number.sample_number, frame->header.blocksize); -#endif - fflush(stdout); - - /* check against PCM data if we have it */ - if (dcd->pcm) { - unsigned c, i, j; - for (c = 0; c < frame->header.channels; c++) - for (i = (unsigned)frame->header.number.sample_number, j = 0; j < frame->header.blocksize; i++, j++) - if (buffer[c][j] != dcd->pcm[c][i]) { - printf("ERROR: sample mismatch at sample#%u(%u), channel=%u, expected %d, got %d\n", i, j, c, buffer[c][j], dcd->pcm[c][i]); - return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; - } - } - - return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; -} - -static void metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) -{ - DecoderClientData *dcd = (DecoderClientData*)client_data; - - (void)decoder; - - if(0 == dcd) { - printf("ERROR: client_data in metadata callback is NULL\n"); - return; - } - - if(dcd->error_occurred) - return; - - if (!dcd->got_data && metadata->type == FLAC__METADATA_TYPE_STREAMINFO) { - dcd->got_data = true; - dcd->total_samples = metadata->data.stream_info.total_samples; - dcd->channels = metadata->data.stream_info.channels; - dcd->bits_per_sample = metadata->data.stream_info.bits_per_sample; - } -} - -static void error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) -{ - DecoderClientData *dcd = (DecoderClientData*)client_data; - - (void)decoder; - - if(0 == dcd) { - printf("ERROR: client_data in error callback is NULL\n"); - return; - } - - if(!dcd->ignore_errors) { - printf("ERROR: got error callback: err = %u (%s)\n", (unsigned)status, FLAC__StreamDecoderErrorStatusString[status]); - dcd->error_occurred = true; - } -} - -/* read mode: - * 0 - no read after seek - * 1 - read 2 frames - * 2 - read until end - */ -static FLAC__bool seek_barrage(FLAC__bool is_ogg, const char *filename, off_t filesize, unsigned count, FLAC__int64 total_samples, unsigned read_mode, FLAC__int32 **pcm) -{ - FLAC__StreamDecoder *decoder; - DecoderClientData decoder_client_data; - unsigned i; - long int n; - - decoder_client_data.pcm = pcm; - decoder_client_data.got_data = false; - decoder_client_data.total_samples = 0; - decoder_client_data.quiet = false; - decoder_client_data.ignore_errors = false; - decoder_client_data.error_occurred = false; - - printf("\n+++ seek test: FLAC__StreamDecoder (%s FLAC, read_mode=%u)\n\n", is_ogg? "Ogg":"native", read_mode); - - decoder = FLAC__stream_decoder_new(); - if(0 == decoder) - return die_("FLAC__stream_decoder_new() FAILED, returned NULL\n"); - - if(is_ogg) { - if(FLAC__stream_decoder_init_ogg_file(decoder, filename, write_callback_, metadata_callback_, error_callback_, &decoder_client_data) != FLAC__STREAM_DECODER_INIT_STATUS_OK) - return die_s_("FLAC__stream_decoder_init_file() FAILED", decoder); - } - else { - if(FLAC__stream_decoder_init_file(decoder, filename, write_callback_, metadata_callback_, error_callback_, &decoder_client_data) != FLAC__STREAM_DECODER_INIT_STATUS_OK) - return die_s_("FLAC__stream_decoder_init_file() FAILED", decoder); - } - - if(!FLAC__stream_decoder_process_until_end_of_metadata(decoder)) - return die_s_("FLAC__stream_decoder_process_until_end_of_metadata() FAILED", decoder); - - if(!is_ogg) { /* not necessary to do this for Ogg because of its seeking method */ - /* process until end of stream to make sure we can still seek in that state */ - decoder_client_data.quiet = true; - if(!FLAC__stream_decoder_process_until_end_of_stream(decoder)) - return die_s_("FLAC__stream_decoder_process_until_end_of_stream() FAILED", decoder); - decoder_client_data.quiet = false; - - printf("stream decoder state is %s\n", FLAC__stream_decoder_get_resolved_state_string(decoder)); - if(FLAC__stream_decoder_get_state(decoder) != FLAC__STREAM_DECODER_END_OF_STREAM) - return die_s_("expected FLAC__STREAM_DECODER_END_OF_STREAM", decoder); - } - -#ifdef _MSC_VER - printf("file's total_samples is %I64u\n", decoder_client_data.total_samples); -#else - printf("file's total_samples is %llu\n", (unsigned long long)decoder_client_data.total_samples); -#endif - n = (long int)decoder_client_data.total_samples; - - if(n == 0 && total_samples >= 0) - n = (long int)total_samples; - - /* if we don't have a total samples count, just guess based on the file size */ - /* @@@ for is_ogg we should get it from last page's granulepos */ - if(n == 0) { - /* 8 would imply no compression, 9 guarantees that we will get some samples off the end of the stream to test that case */ - n = 9 * filesize / (decoder_client_data.channels * decoder_client_data.bits_per_sample); - } - - printf("Begin seek barrage, count=%u\n", count); - - for (i = 0; !stop_signal_ && (count == 0 || i < count); i++) { - FLAC__uint64 pos; - - /* for the first 10, seek to the first 10 samples */ - if (n >= 10 && i < 10) { - pos = i; - } - /* for the second 10, seek to the last 10 samples */ - else if (n >= 10 && i < 20) { - pos = n - 1 - (i-10); - } - /* for the third 10, seek past the end and make sure we fail properly as expected */ - else if (i < 30) { - pos = n + (i-20); - } - else { - pos = (FLAC__uint64)(local_rand_() % n); - } - -#ifdef _MSC_VER - printf("#%u:seek(%I64u)... ", i, pos); -#else - printf("#%u:seek(%llu)... ", i, (unsigned long long)pos); -#endif - fflush(stdout); - if(!FLAC__stream_decoder_seek_absolute(decoder, pos)) { - if(pos >= (FLAC__uint64)n) - printf("seek past end failed as expected... "); - else if(decoder_client_data.total_samples == 0 && total_samples <= 0) - printf("seek failed, assuming it was past EOF... "); - else - return die_s_("FLAC__stream_decoder_seek_absolute() FAILED", decoder); - if(!FLAC__stream_decoder_flush(decoder)) - return die_s_("FLAC__stream_decoder_flush() FAILED", decoder); - } - else if(read_mode == 1) { - printf("decode_frame... "); - fflush(stdout); - if(!FLAC__stream_decoder_process_single(decoder)) - return die_s_("FLAC__stream_decoder_process_single() FAILED", decoder); - - printf("decode_frame... "); - fflush(stdout); - if(!FLAC__stream_decoder_process_single(decoder)) - return die_s_("FLAC__stream_decoder_process_single() FAILED", decoder); - } - else if(read_mode == 2) { - printf("decode_all... "); - fflush(stdout); - decoder_client_data.quiet = true; - if(!FLAC__stream_decoder_process_until_end_of_stream(decoder)) - return die_s_("FLAC__stream_decoder_process_until_end_of_stream() FAILED", decoder); - decoder_client_data.quiet = false; - } - - printf("OK\n"); - fflush(stdout); - } - stop_signal_ = false; - - if(FLAC__stream_decoder_get_state(decoder) != FLAC__STREAM_DECODER_UNINITIALIZED) { - if(!FLAC__stream_decoder_finish(decoder)) - return die_s_("FLAC__stream_decoder_finish() FAILED", decoder); - } - - FLAC__stream_decoder_delete(decoder); - printf("\nPASSED!\n"); - - return true; -} - -#ifdef _MSC_VER -/* There's no strtoull() in MSVC6 so we just write a specialized one */ -static FLAC__uint64 local__strtoull(const char *src) -{ - FLAC__uint64 ret = 0; - int c; - FLAC__ASSERT(0 != src); - while(0 != (c = *src++)) { - c -= '0'; - if(c >= 0 && c <= 9) - ret = (ret * 10) + c; - else - break; - } - return ret; -} -#endif - -int main(int argc, char *argv[]) -{ - const char *flacfilename, *rawfilename = 0; - unsigned count = 0, read_mode; - FLAC__int64 samples = -1; - off_t flacfilesize; - FLAC__int32 *pcm[2] = { 0, 0 }; - FLAC__bool ok = true; - - static const char * const usage = "usage: test_seeking file.flac [#seeks] [#samples-in-file.flac] [file.raw]\n"; - - if (argc < 2 || argc > 5) { - fprintf(stderr, usage); - return 1; - } - - flacfilename = argv[1]; - - if (argc > 2) - count = strtoul(argv[2], 0, 10); - if (argc > 3) -#ifdef _MSC_VER - samples = local__strtoull(argv[3]); -#else - samples = strtoull(argv[3], 0, 10); -#endif - if (argc > 4) - rawfilename = argv[4]; - - if (count < 30) - fprintf(stderr, "WARNING: random seeks don't kick in until after 30 preprogrammed ones\n"); - -#if !defined _MSC_VER && !defined __MINGW32__ - { - struct timeval tv; - - if (gettimeofday(&tv, 0) < 0) { - fprintf(stderr, "WARNING: couldn't seed RNG with time\n"); - tv.tv_usec = 4321; - } - srandom(tv.tv_usec); - } -#else - srand((unsigned)time(0)); -#endif - - flacfilesize = get_filesize_(flacfilename); - if (flacfilesize < 0) { - fprintf(stderr, "ERROR: can't determine filesize for %s\n", flacfilename); - return 1; - } - - if (rawfilename && !read_pcm_(pcm, rawfilename, flacfilename)) { - free(pcm[0]); - free(pcm[1]); - return 1; - } - - (void) signal(SIGINT, our_sigint_handler_); - - for (read_mode = 0; ok && read_mode <= 2; read_mode++) { - /* no need to do "decode all" read_mode if PCM checking is available */ - if (rawfilename && read_mode > 1) - continue; - if (strlen(flacfilename) > 4 && (0 == strcmp(flacfilename+strlen(flacfilename)-4, ".oga") || 0 == strcmp(flacfilename+strlen(flacfilename)-4, ".ogg"))) { -#if FLAC__HAS_OGG - ok = seek_barrage(/*is_ogg=*/true, flacfilename, flacfilesize, count, samples, read_mode, rawfilename? pcm : 0); -#else - fprintf(stderr, "ERROR: Ogg FLAC not supported\n"); - ok = false; -#endif - } - else { - ok = seek_barrage(/*is_ogg=*/false, flacfilename, flacfilesize, count, samples, read_mode, rawfilename? pcm : 0); - } - } - - free(pcm[0]); - free(pcm[1]); - - return ok? 0 : 2; -} diff --git a/3rdparty/libflac/src/test_seeking/test_seeking.dsp b/3rdparty/libflac/src/test_seeking/test_seeking.dsp deleted file mode 100644 index 1bdb853ec3c..00000000000 --- a/3rdparty/libflac/src/test_seeking/test_seeking.dsp +++ /dev/null @@ -1,100 +0,0 @@ -# Microsoft Developer Studio Project File - Name="test_seeking" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=test_seeking - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "test_seeking.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "test_seeking.mak" CFG="test_seeking - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "test_seeking - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "test_seeking - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "test_seeking - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\obj\release\bin" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /D "NDEBUG" /D "FLAC__NO_DLL" /D "FLAC__HAS_OGG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 ..\..\obj\release\lib\libFLAC_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "test_seeking - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\obj\debug\bin" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "_DEBUG" /D "DEBUG" /D "FLAC__NO_DLL" /D "FLAC__HAS_OGG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 ..\..\obj\debug\lib\libFLAC_static.lib ..\..\obj\release\lib\ogg_static.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "test_seeking - Win32 Release" -# Name "test_seeking - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\main.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/test_seeking/test_seeking.vcproj b/3rdparty/libflac/src/test_seeking/test_seeking.vcproj deleted file mode 100644 index b4cf8eca0d4..00000000000 --- a/3rdparty/libflac/src/test_seeking/test_seeking.vcproj +++ /dev/null @@ -1,204 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="test_seeking" - ProjectGUID="{4cefbc90-c215-11db-8314-0800200c9a66}" - RootNamespace="test_seeking" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\obj\debug\bin" - IntermediateDirectory="Debug" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".;..\..\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;FLAC__HAS_OGG;FLAC__NO_DLL;DEBUG" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="..\..\obj\release\lib\ogg_static.lib" - LinkIncremental="2" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\obj\release\bin" - IntermediateDirectory="Release" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".;..\..\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__HAS_OGG;FLAC__NO_DLL" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - AdditionalDependencies="..\..\obj\release\lib\ogg_static.lib" - LinkIncremental="1" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" - LinkTimeCodeGeneration="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\main.c" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> diff --git a/3rdparty/libflac/src/test_streams/Makefile.am b/3rdparty/libflac/src/test_streams/Makefile.am deleted file mode 100644 index 2d562ce62c8..00000000000 --- a/3rdparty/libflac/src/test_streams/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -# test_streams - Simple test pattern generator -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -EXTRA_DIST = \ - Makefile.lite \ - test_streams.dsp \ - test_streams.vcproj - -noinst_PROGRAMS = test_streams -test_streams_SOURCES = \ - main.c -test_streams_LDADD = -lm diff --git a/3rdparty/libflac/src/test_streams/Makefile.in b/3rdparty/libflac/src/test_streams/Makefile.in deleted file mode 100644 index 0621f85c8d8..00000000000 --- a/3rdparty/libflac/src/test_streams/Makefile.in +++ /dev/null @@ -1,508 +0,0 @@ -# Makefile.in generated by automake 1.7.9 from Makefile.am. -# @configure_input@ - -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 -# Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# test_streams - Simple test pattern generator -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = ../.. - -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_triplet = @host@ -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCAS = @CCAS@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG_FALSE = @DEBUG_FALSE@ -DEBUG_TRUE = @DEBUG_TRUE@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DOCBOOK_TO_MAN = @DOCBOOK_TO_MAN@ -DOXYGEN = @DOXYGEN@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -FLAC__TEST_LEVEL = @FLAC__TEST_LEVEL@ -FLAC__TEST_WITH_VALGRIND = @FLAC__TEST_WITH_VALGRIND@ -FLaC__CPU_IA32_FALSE = @FLaC__CPU_IA32_FALSE@ -FLaC__CPU_IA32_TRUE = @FLaC__CPU_IA32_TRUE@ -FLaC__CPU_PPC_FALSE = @FLaC__CPU_PPC_FALSE@ -FLaC__CPU_PPC_TRUE = @FLaC__CPU_PPC_TRUE@ -FLaC__CPU_SPARC_FALSE = @FLaC__CPU_SPARC_FALSE@ -FLaC__CPU_SPARC_TRUE = @FLaC__CPU_SPARC_TRUE@ -FLaC__HAS_AS_FALSE = @FLaC__HAS_AS_FALSE@ -FLaC__HAS_AS_TRUE = @FLaC__HAS_AS_TRUE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_AS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_DOCBOOK_TO_MAN_FALSE = @FLaC__HAS_DOCBOOK_TO_MAN_FALSE@ -FLaC__HAS_DOCBOOK_TO_MAN_TRUE = @FLaC__HAS_DOCBOOK_TO_MAN_TRUE@ -FLaC__HAS_DOXYGEN_FALSE = @FLaC__HAS_DOXYGEN_FALSE@ -FLaC__HAS_DOXYGEN_TRUE = @FLaC__HAS_DOXYGEN_TRUE@ -FLaC__HAS_GAS_FALSE = @FLaC__HAS_GAS_FALSE@ -FLaC__HAS_GAS_TRUE = @FLaC__HAS_GAS_TRUE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_FALSE@ -FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE = @FLaC__HAS_GAS__TEMPORARILY_DISABLED_TRUE@ -FLaC__HAS_NASM_FALSE = @FLaC__HAS_NASM_FALSE@ -FLaC__HAS_NASM_TRUE = @FLaC__HAS_NASM_TRUE@ -FLaC__HAS_OGG_FALSE = @FLaC__HAS_OGG_FALSE@ -FLaC__HAS_OGG_TRUE = @FLaC__HAS_OGG_TRUE@ -FLaC__HAS_XMMS_FALSE = @FLaC__HAS_XMMS_FALSE@ -FLaC__HAS_XMMS_TRUE = @FLaC__HAS_XMMS_TRUE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_FALSE@ -FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE = @FLaC__INSTALL_XMMS_PLUGIN_LOCALLY_TRUE@ -FLaC__NO_ASM_FALSE = @FLaC__NO_ASM_FALSE@ -FLaC__NO_ASM_TRUE = @FLaC__NO_ASM_TRUE@ -FLaC__SSE_OS_FALSE = @FLaC__SSE_OS_FALSE@ -FLaC__SSE_OS_TRUE = @FLaC__SSE_OS_TRUE@ -FLaC__SYS_DARWIN_FALSE = @FLaC__SYS_DARWIN_FALSE@ -FLaC__SYS_DARWIN_TRUE = @FLaC__SYS_DARWIN_TRUE@ -FLaC__SYS_LINUX_FALSE = @FLaC__SYS_LINUX_FALSE@ -FLaC__SYS_LINUX_TRUE = @FLaC__SYS_LINUX_TRUE@ -FLaC__USE_3DNOW_FALSE = @FLaC__USE_3DNOW_FALSE@ -FLaC__USE_3DNOW_TRUE = @FLaC__USE_3DNOW_TRUE@ -FLaC__USE_ALTIVEC_FALSE = @FLaC__USE_ALTIVEC_FALSE@ -FLaC__USE_ALTIVEC_TRUE = @FLaC__USE_ALTIVEC_TRUE@ -FLaC__WITH_CPPLIBS_FALSE = @FLaC__WITH_CPPLIBS_FALSE@ -FLaC__WITH_CPPLIBS_TRUE = @FLaC__WITH_CPPLIBS_TRUE@ -GAS = @GAS@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBICONV = @LIBICONV@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -LTLIBICONV = @LTLIBICONV@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ -MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ -MAKEINFO = @MAKEINFO@ -MINGW_WINSOCK_LIBS = @MINGW_WINSOCK_LIBS@ -NASM = @NASM@ -OBJEXT = @OBJEXT@ -OBJ_FORMAT = @OBJ_FORMAT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMMS_CFLAGS = @XMMS_CFLAGS@ -XMMS_CONFIG = @XMMS_CONFIG@ -XMMS_DATA_DIR = @XMMS_DATA_DIR@ -XMMS_EFFECT_PLUGIN_DIR = @XMMS_EFFECT_PLUGIN_DIR@ -XMMS_GENERAL_PLUGIN_DIR = @XMMS_GENERAL_PLUGIN_DIR@ -XMMS_INPUT_PLUGIN_DIR = @XMMS_INPUT_PLUGIN_DIR@ -XMMS_LIBS = @XMMS_LIBS@ -XMMS_OUTPUT_PLUGIN_DIR = @XMMS_OUTPUT_PLUGIN_DIR@ -XMMS_PLUGIN_DIR = @XMMS_PLUGIN_DIR@ -XMMS_VERSION = @XMMS_VERSION@ -XMMS_VISUALIZATION_PLUGIN_DIR = @XMMS_VISUALIZATION_PLUGIN_DIR@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ - -EXTRA_DIST = \ - Makefile.lite \ - test_streams.dsp \ - test_streams.vcproj - - -noinst_PROGRAMS = test_streams -test_streams_SOURCES = \ - main.c - -test_streams_LDADD = -lm -subdir = src/test_streams -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -noinst_PROGRAMS = test_streams$(EXEEXT) -PROGRAMS = $(noinst_PROGRAMS) - -am_test_streams_OBJECTS = main.$(OBJEXT) -test_streams_OBJECTS = $(am_test_streams_OBJECTS) -test_streams_DEPENDENCIES = -test_streams_LDFLAGS = - -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/main.Po -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ - $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(test_streams_SOURCES) -DIST_COMMON = $(srcdir)/Makefile.in Makefile.am -SOURCES = $(test_streams_SOURCES) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/test_streams/Makefile -Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ - f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f $$p $$f"; \ - rm -f $$p $$f ; \ - done -test_streams$(EXEEXT): $(test_streams_OBJECTS) $(test_streams_DEPENDENCIES) - @rm -f test_streams$(EXEEXT) - $(LINK) $(test_streams_LDFLAGS) $(test_streams_OBJECTS) $(test_streams_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< - -.c.obj: -@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` - -.c.lo: -@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ -@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \ -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ -@am__fastdepCC_TRUE@ fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool -uninstall-info-am: - -ETAGS = etags -ETAGSFLAGS = - -CTAGS = ctags -CTAGSFLAGS = - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique - -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) - -top_distdir = ../.. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) - -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-libtool distclean-tags - -dvi: dvi-am - -dvi-am: - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/3rdparty/libflac/src/test_streams/Makefile.lite b/3rdparty/libflac/src/test_streams/Makefile.lite deleted file mode 100644 index af9dab675d4..00000000000 --- a/3rdparty/libflac/src/test_streams/Makefile.lite +++ /dev/null @@ -1,36 +0,0 @@ -# test_streams - Simple test pattern generator -# Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -# -# 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 the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# -# GNU makefile -# - -topdir = ../.. -libdir = $(topdir)/obj/$(BUILD)/lib - -PROGRAM_NAME = test_streams - -INCLUDES = -I./include -I$(topdir)/include - -LIBS = -lm - -SRCS_C = \ - main.c - -include $(topdir)/build/exe.mk - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/3rdparty/libflac/src/test_streams/main.c b/3rdparty/libflac/src/test_streams/main.c deleted file mode 100644 index c335776dc7b..00000000000 --- a/3rdparty/libflac/src/test_streams/main.c +++ /dev/null @@ -1,927 +0,0 @@ -/* test_streams - Simple test pattern generator - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson - * - * 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 the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#if HAVE_CONFIG_H -# include <config.h> -#endif - -#include <math.h> -#include <stdio.h> -#include <stdlib.h> -#if defined _MSC_VER || defined __MINGW32__ -#include <time.h> -#else -#include <sys/time.h> -#endif -#include "FLAC/assert.h" -#include "FLAC/ordinals.h" - -#ifndef M_PI -/* math.h in VC++ doesn't seem to have this (how Microsoft is that?) */ -#define M_PI 3.14159265358979323846 -#endif - -#if !defined _MSC_VER && !defined __MINGW32__ -#define GET_RANDOM_BYTE (((unsigned)random()) & 0xff) -#else -#define GET_RANDOM_BYTE (((unsigned)rand()) & 0xff) -#endif - -static FLAC__bool is_big_endian_host; - - -static FLAC__bool write_little_endian(FILE *f, FLAC__int32 x, size_t bytes) -{ - while(bytes) { - if(fputc(x, f) == EOF) - return false; - x >>= 8; - bytes--; - } - return true; -} - -static FLAC__bool write_little_endian_uint16(FILE *f, FLAC__uint16 x) -{ - return - fputc(x, f) != EOF && - fputc(x >> 8, f) != EOF - ; -} - -static FLAC__bool write_little_endian_int16(FILE *f, FLAC__int16 x) -{ - return write_little_endian_uint16(f, (FLAC__uint16)x); -} - -static FLAC__bool write_little_endian_uint24(FILE *f, FLAC__uint32 x) -{ - return - fputc(x, f) != EOF && - fputc(x >> 8, f) != EOF && - fputc(x >> 16, f) != EOF - ; -} - -static FLAC__bool write_little_endian_int24(FILE *f, FLAC__int32 x) -{ - return write_little_endian_uint24(f, (FLAC__uint32)x); -} - -static FLAC__bool write_little_endian_uint32(FILE *f, FLAC__uint32 x) -{ - return - fputc(x, f) != EOF && - fputc(x >> 8, f) != EOF && - fputc(x >> 16, f) != EOF && - fputc(x >> 24, f) != EOF - ; -} - -#if 0 -/* @@@ not used (yet) */ -static FLAC__bool write_little_endian_int32(FILE *f, FLAC__int32 x) -{ - return write_little_endian_uint32(f, (FLAC__uint32)x); -} -#endif - -static FLAC__bool write_big_endian(FILE *f, FLAC__int32 x, size_t bytes) -{ - if(bytes < 4) - x <<= 8*(4-bytes); - while(bytes) { - if(fputc(x>>24, f) == EOF) - return false; - x <<= 8; - bytes--; - } - return true; -} - -static FLAC__bool write_big_endian_uint16(FILE *f, FLAC__uint16 x) -{ - return - fputc(x >> 8, f) != EOF && - fputc(x, f) != EOF - ; -} - -#if 0 -/* @@@ not used (yet) */ -static FLAC__bool write_big_endian_int16(FILE *f, FLAC__int16 x) -{ - return write_big_endian_uint16(f, (FLAC__uint16)x); -} -#endif - -#if 0 -/* @@@ not used (yet) */ -static FLAC__bool write_big_endian_uint24(FILE *f, FLAC__uint32 x) -{ - return - fputc(x >> 16, f) != EOF && - fputc(x >> 8, f) != EOF && - fputc(x, f) != EOF - ; -} -#endif - -#if 0 -/* @@@ not used (yet) */ -static FLAC__bool write_big_endian_int24(FILE *f, FLAC__int32 x) -{ - return write_big_endian_uint24(f, (FLAC__uint32)x); -} -#endif - -static FLAC__bool write_big_endian_uint32(FILE *f, FLAC__uint32 x) -{ - return - fputc(x >> 24, f) != EOF && - fputc(x >> 16, f) != EOF && - fputc(x >> 8, f) != EOF && - fputc(x, f) != EOF - ; -} - -#if 0 -/* @@@ not used (yet) */ -static FLAC__bool write_big_endian_int32(FILE *f, FLAC__int32 x) -{ - return write_big_endian_uint32(f, (FLAC__uint32)x); -} -#endif - -static FLAC__bool write_sane_extended(FILE *f, unsigned val) - /* Write to 'f' a SANE extended representation of 'val'. Return false if - * the write succeeds; return true otherwise. - * - * SANE extended is an 80-bit IEEE-754 representation with sign bit, 15 bits - * of exponent, and 64 bits of significand (mantissa). Unlike most IEEE-754 - * representations, it does not imply a 1 above the MSB of the significand. - * - * Preconditions: - * val!=0U - */ -{ - unsigned int shift, exponent; - - FLAC__ASSERT(val!=0U); /* handling 0 would require a special case */ - - for(shift= 0U; (val>>(31-shift))==0U; ++shift) - ; - val<<= shift; - exponent= 63U-(shift+32U); /* add 32 for unused second word */ - - if(!write_big_endian_uint16(f, (FLAC__uint16)(exponent+0x3FFF))) - return false; - if(!write_big_endian_uint32(f, val)) - return false; - if(!write_big_endian_uint32(f, 0)) /* unused second word */ - return false; - - return true; -} - -/* a mono one-sample 16bps stream */ -static FLAC__bool generate_01(void) -{ - FILE *f; - FLAC__int16 x = -32768; - - if(0 == (f = fopen("test01.raw", "wb"))) - return false; - - if(!write_little_endian_int16(f, x)) - goto foo; - - fclose(f); - return true; -foo: - fclose(f); - return false; -} - -/* a stereo one-sample 16bps stream */ -static FLAC__bool generate_02(void) -{ - FILE *f; - FLAC__int16 xl = -32768, xr = 32767; - - if(0 == (f = fopen("test02.raw", "wb"))) - return false; - - if(!write_little_endian_int16(f, xl)) - goto foo; - if(!write_little_endian_int16(f, xr)) - goto foo; - - fclose(f); - return true; -foo: - fclose(f); - return false; -} - -/* a mono five-sample 16bps stream */ -static FLAC__bool generate_03(void) -{ - FILE *f; - FLAC__int16 x[] = { -25, 0, 25, 50, 100 }; - unsigned i; - - if(0 == (f = fopen("test03.raw", "wb"))) - return false; - - for(i = 0; i < 5; i++) - if(!write_little_endian_int16(f, x[i])) - goto foo; - - fclose(f); - return true; -foo: - fclose(f); - return false; -} - -/* a stereo five-sample 16bps stream */ -static FLAC__bool generate_04(void) -{ - FILE *f; - FLAC__int16 x[] = { -25, 500, 0, 400, 25, 300, 50, 200, 100, 100 }; - unsigned i; - - if(0 == (f = fopen("test04.raw", "wb"))) - return false; - - for(i = 0; i < 10; i++) - if(!write_little_endian_int16(f, x[i])) - goto foo; - - fclose(f); - return true; -foo: - fclose(f); - return false; -} - -/* a mono full-scale deflection 8bps stream */ -static FLAC__bool generate_fsd8(const char *fn, const int pattern[], unsigned reps) -{ - FILE *f; - unsigned rep, p; - - FLAC__ASSERT(pattern != 0); - - if(0 == (f = fopen(fn, "wb"))) - return false; - - for(rep = 0; rep < reps; rep++) { - for(p = 0; pattern[p]; p++) { - signed char x = pattern[p] > 0? 127 : -128; - if(fwrite(&x, sizeof(x), 1, f) < 1) - goto foo; - } - } - - fclose(f); - return true; -foo: - fclose(f); - return false; -} - -/* a mono full-scale deflection 16bps stream */ -static FLAC__bool generate_fsd16(const char *fn, const int pattern[], unsigned reps) -{ - FILE *f; - unsigned rep, p; - - FLAC__ASSERT(pattern != 0); - - if(0 == (f = fopen(fn, "wb"))) - return false; - - for(rep = 0; rep < reps; rep++) { - for(p = 0; pattern[p]; p++) { - FLAC__int16 x = pattern[p] > 0? 32767 : -32768; - if(!write_little_endian_int16(f, x)) - goto foo; - } - } - - fclose(f); - return true; -foo: - fclose(f); - return false; -} - -/* a stereo wasted-bits-per-sample 16bps stream */ -static FLAC__bool generate_wbps16(const char *fn, unsigned samples) -{ - FILE *f; - unsigned sample; - - if(0 == (f = fopen(fn, "wb"))) - return false; - - for(sample = 0; sample < samples; sample++) { - FLAC__int16 l = (sample % 2000) << 2; - FLAC__int16 r = (sample % 1000) << 3; - if(!write_little_endian_int16(f, l)) - goto foo; - if(!write_little_endian_int16(f, r)) - goto foo; - } - - fclose(f); - return true; -foo: - fclose(f); - return false; -} - -/* a mono full-scale deflection 24bps stream */ -static FLAC__bool generate_fsd24(const char *fn, const int pattern[], unsigned reps) -{ - FILE *f; - unsigned rep, p; - - FLAC__ASSERT(pattern != 0); - - if(0 == (f = fopen(fn, "wb"))) - return false; - - for(rep = 0; rep < reps; rep++) { - for(p = 0; pattern[p]; p++) { - FLAC__int32 x = pattern[p] > 0? 8388607 : -8388608; - if(!write_little_endian_int24(f, x)) - goto foo; - } - } - - fclose(f); - return true; -foo: - fclose(f); - return false; -} - -/* a mono sine-wave 8bps stream */ -static FLAC__bool generate_sine8_1(const char *fn, const double sample_rate, const unsigned samples, const double f1, const double a1, const double f2, const double a2) -{ - const FLAC__int8 full_scale = 127; - const double delta1 = 2.0 * M_PI / ( sample_rate / f1); - const double delta2 = 2.0 * M_PI / ( sample_rate / f2); - FILE *f; - double theta1, theta2; - unsigned i; - - if(0 == (f = fopen(fn, "wb"))) - return false; - - for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) { - double val = (a1*sin(theta1) + a2*sin(theta2))*(double)full_scale; - FLAC__int8 v = (FLAC__int8)(val + 0.5); - if(fwrite(&v, sizeof(v), 1, f) < 1) - goto foo; - } - - fclose(f); - return true; -foo: - fclose(f); - return false; -} - -/* a stereo sine-wave 8bps stream */ -static FLAC__bool generate_sine8_2(const char *fn, const double sample_rate, const unsigned samples, const double f1, const double a1, const double f2, const double a2, double fmult) -{ - const FLAC__int8 full_scale = 127; - const double delta1 = 2.0 * M_PI / ( sample_rate / f1); - const double delta2 = 2.0 * M_PI / ( sample_rate / f2); - FILE *f; - double theta1, theta2; - unsigned i; - - if(0 == (f = fopen(fn, "wb"))) - return false; - - for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) { - double val = (a1*sin(theta1) + a2*sin(theta2))*(double)full_scale; - FLAC__int8 v = (FLAC__int8)(val + 0.5); - if(fwrite(&v, sizeof(v), 1, f) < 1) - goto foo; - val = -(a1*sin(theta1*fmult) + a2*sin(theta2*fmult))*(double)full_scale; - v = (FLAC__int8)(val + 0.5); - if(fwrite(&v, sizeof(v), 1, f) < 1) - goto foo; - } - - fclose(f); - return true; -foo: - fclose(f); - return false; -} - -/* a mono sine-wave 16bps stream */ -static FLAC__bool generate_sine16_1(const char *fn, const double sample_rate, const unsigned samples, const double f1, const double a1, const double f2, const double a2) -{ - const FLAC__int16 full_scale = 32767; - const double delta1 = 2.0 * M_PI / ( sample_rate / f1); - const double delta2 = 2.0 * M_PI / ( sample_rate / f2); - FILE *f; - double theta1, theta2; - unsigned i; - - if(0 == (f = fopen(fn, "wb"))) - return false; - - for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) { - double val = (a1*sin(theta1) + a2*sin(theta2))*(double)full_scale; - FLAC__int16 v = (FLAC__int16)(val + 0.5); - if(!write_little_endian_int16(f, v)) - goto foo; - } - - fclose(f); - return true; -foo: - fclose(f); - return false; -} - -/* a stereo sine-wave 16bps stream */ -static FLAC__bool generate_sine16_2(const char *fn, const double sample_rate, const unsigned samples, const double f1, const double a1, const double f2, const double a2, double fmult) -{ - const FLAC__int16 full_scale = 32767; - const double delta1 = 2.0 * M_PI / ( sample_rate / f1); - const double delta2 = 2.0 * M_PI / ( sample_rate / f2); - FILE *f; - double theta1, theta2; - unsigned i; - - if(0 == (f = fopen(fn, "wb"))) - return false; - - for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) { - double val = (a1*sin(theta1) + a2*sin(theta2))*(double)full_scale; - FLAC__int16 v = (FLAC__int16)(val + 0.5); - if(!write_little_endian_int16(f, v)) - goto foo; - val = -(a1*sin(theta1*fmult) + a2*sin(theta2*fmult))*(double)full_scale; - v = (FLAC__int16)(val + 0.5); - if(!write_little_endian_int16(f, v)) - goto foo; - } - - fclose(f); - return true; -foo: - fclose(f); - return false; -} - -/* a mono sine-wave 24bps stream */ -static FLAC__bool generate_sine24_1(const char *fn, const double sample_rate, const unsigned samples, const double f1, const double a1, const double f2, const double a2) -{ - const FLAC__int32 full_scale = 0x7fffff; - const double delta1 = 2.0 * M_PI / ( sample_rate / f1); - const double delta2 = 2.0 * M_PI / ( sample_rate / f2); - FILE *f; - double theta1, theta2; - unsigned i; - - if(0 == (f = fopen(fn, "wb"))) - return false; - - for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) { - double val = (a1*sin(theta1) + a2*sin(theta2))*(double)full_scale; - FLAC__int32 v = (FLAC__int32)(val + 0.5); - if(!write_little_endian_int24(f, v)) - goto foo; - } - - fclose(f); - return true; -foo: - fclose(f); - return false; -} - -/* a stereo sine-wave 24bps stream */ -static FLAC__bool generate_sine24_2(const char *fn, const double sample_rate, const unsigned samples, const double f1, const double a1, const double f2, const double a2, double fmult) -{ - const FLAC__int32 full_scale = 0x7fffff; - const double delta1 = 2.0 * M_PI / ( sample_rate / f1); - const double delta2 = 2.0 * M_PI / ( sample_rate / f2); - FILE *f; - double theta1, theta2; - unsigned i; - - if(0 == (f = fopen(fn, "wb"))) - return false; - - for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) { - double val = (a1*sin(theta1) + a2*sin(theta2))*(double)full_scale; - FLAC__int32 v = (FLAC__int32)(val + 0.5); - if(!write_little_endian_int24(f, v)) - goto foo; - val = -(a1*sin(theta1*fmult) + a2*sin(theta2*fmult))*(double)full_scale; - v = (FLAC__int32)(val + 0.5); - if(!write_little_endian_int24(f, v)) - goto foo; - } - - fclose(f); - return true; -foo: - fclose(f); - return false; -} - -static FLAC__bool generate_noise(const char *fn, unsigned bytes) -{ - FILE *f; - unsigned b; - - if(0 == (f = fopen(fn, "wb"))) - return false; - - for(b = 0; b < bytes; b++) { -#if !defined _MSC_VER && !defined __MINGW32__ - FLAC__byte x = (FLAC__byte)(((unsigned)random()) & 0xff); -#else - FLAC__byte x = (FLAC__byte)(((unsigned)rand()) & 0xff); -#endif - if(fwrite(&x, sizeof(x), 1, f) < 1) - goto foo; - } - - fclose(f); - return true; -foo: - fclose(f); - return false; -} - -static FLAC__bool generate_raw(const char *filename, unsigned channels, unsigned bytes_per_sample, unsigned samples) -{ - const FLAC__int32 full_scale = (1 << (bytes_per_sample*8-1)) - 1; - const double f1 = 441.0, a1 = 0.61, f2 = 661.5, a2 = 0.37; - const double delta1 = 2.0 * M_PI / ( 44100.0 / f1); - const double delta2 = 2.0 * M_PI / ( 44100.0 / f2); - double theta1, theta2; - FILE *f; - unsigned i, j; - - if(0 == (f = fopen(filename, "wb"))) - return false; - - for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) { - for(j = 0; j < channels; j++) { - double val = (a1*sin(theta1) + a2*sin(theta2))*(double)full_scale; - FLAC__int32 v = (FLAC__int32)(val + 0.5) + ((GET_RANDOM_BYTE>>4)-8); - if(!write_little_endian(f, v, bytes_per_sample)) - goto foo; - } - } - - fclose(f); - return true; -foo: - fclose(f); - return false; -} - -static FLAC__bool generate_aiff(const char *filename, unsigned sample_rate, unsigned channels, unsigned bps, unsigned samples) -{ - const unsigned bytes_per_sample = (bps+7)/8; - const unsigned true_size = channels * bytes_per_sample * samples; - const unsigned padded_size = (true_size + 1) & (~1u); - const unsigned shift = (bps%8)? 8 - (bps%8) : 0; - const FLAC__int32 full_scale = (1 << (bps-1)) - 1; - const double f1 = 441.0, a1 = 0.61, f2 = 661.5, a2 = 0.37; - const double delta1 = 2.0 * M_PI / ( sample_rate / f1); - const double delta2 = 2.0 * M_PI / ( sample_rate / f2); - double theta1, theta2; - FILE *f; - unsigned i, j; - - if(0 == (f = fopen(filename, "wb"))) - return false; - if(fwrite("FORM", 1, 4, f) < 4) - goto foo; - if(!write_big_endian_uint32(f, padded_size + 46)) - goto foo; - if(fwrite("AIFFCOMM\000\000\000\022", 1, 12, f) < 12) - goto foo; - if(!write_big_endian_uint16(f, (FLAC__uint16)channels)) - goto foo; - if(!write_big_endian_uint32(f, samples)) - goto foo; - if(!write_big_endian_uint16(f, (FLAC__uint16)bps)) - goto foo; - if(!write_sane_extended(f, sample_rate)) - goto foo; - if(fwrite("SSND", 1, 4, f) < 4) - goto foo; - if(!write_big_endian_uint32(f, true_size + 8)) - goto foo; - if(fwrite("\000\000\000\000\000\000\000\000", 1, 8, f) < 8) - goto foo; - - for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) { - for(j = 0; j < channels; j++) { - double val = (a1*sin(theta1) + a2*sin(theta2))*(double)full_scale; - FLAC__int32 v = ((FLAC__int32)(val + 0.5) + ((GET_RANDOM_BYTE>>4)-8)) << shift; - if(!write_big_endian(f, v, bytes_per_sample)) - goto foo; - } - } - for(i = true_size; i < padded_size; i++) - if(fputc(0, f) == EOF) - goto foo; - - fclose(f); - return true; -foo: - fclose(f); - return false; -} - -static FLAC__bool generate_wav(const char *filename, unsigned sample_rate, unsigned channels, unsigned bps, unsigned samples, FLAC__bool strict) -{ - const FLAC__bool waveformatextensible = strict && (channels > 2 || (bps%8)); - /* ^^^^^^^ - * (bps%8) allows 24 bps which is technically supposed to be WAVEFORMATEXTENSIBLE but we - * write 24bps as WAVEFORMATEX since it's unambiguous and matches how flac writes it - */ - const unsigned bytes_per_sample = (bps+7)/8; - const unsigned true_size = channels * bytes_per_sample * samples; - const unsigned padded_size = (true_size + 1) & (~1u); - const unsigned shift = (bps%8)? 8 - (bps%8) : 0; - const FLAC__int32 full_scale = (1 << (bps-1)) - 1; - const double f1 = 441.0, a1 = 0.61, f2 = 661.5, a2 = 0.37; - const double delta1 = 2.0 * M_PI / ( sample_rate / f1); - const double delta2 = 2.0 * M_PI / ( sample_rate / f2); - double theta1, theta2; - FILE *f; - unsigned i, j; - - if(0 == (f = fopen(filename, "wb"))) - return false; - if(fwrite("RIFF", 1, 4, f) < 4) - goto foo; - if(!write_little_endian_uint32(f, padded_size + (waveformatextensible?60:36))) - goto foo; - if(fwrite("WAVEfmt ", 1, 8, f) < 8) - goto foo; - if(!write_little_endian_uint32(f, waveformatextensible?40:16)) - goto foo; - if(!write_little_endian_uint16(f, (FLAC__uint16)(waveformatextensible?65534:1))) - goto foo; - if(!write_little_endian_uint16(f, (FLAC__uint16)channels)) - goto foo; - if(!write_little_endian_uint32(f, sample_rate)) - goto foo; - if(!write_little_endian_uint32(f, sample_rate * channels * bytes_per_sample)) - goto foo; - if(!write_little_endian_uint16(f, (FLAC__uint16)(channels * bytes_per_sample))) /* block align */ - goto foo; - if(!write_little_endian_uint16(f, (FLAC__uint16)(bps+shift))) - goto foo; - if(waveformatextensible) { - if(!write_little_endian_uint16(f, (FLAC__uint16)22)) /* cbSize */ - goto foo; - if(!write_little_endian_uint16(f, (FLAC__uint16)bps)) /* validBitsPerSample */ - goto foo; - if(!write_little_endian_uint32(f, 0)) /* channelMask */ - goto foo; - /* GUID = {0x00000001, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}} */ - if(fwrite("\x01\x00\x00\x00\x00\x00\x10\x00\x80\x00\x00\xaa\x00\x38\x9b\x71", 1, 16, f) != 16) - goto foo; - } - if(fwrite("data", 1, 4, f) < 4) - goto foo; - if(!write_little_endian_uint32(f, true_size)) - goto foo; - - for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) { - for(j = 0; j < channels; j++) { - double val = (a1*sin(theta1) + a2*sin(theta2))*(double)full_scale; - FLAC__int32 v = ((FLAC__int32)(val + 0.5) + ((GET_RANDOM_BYTE>>4)-8)) << shift; - if(!write_little_endian(f, v, bytes_per_sample)) - goto foo; - } - } - for(i = true_size; i < padded_size; i++) - if(fputc(0, f) == EOF) - goto foo; - - fclose(f); - return true; -foo: - fclose(f); - return false; -} - -static FLAC__bool generate_wackywavs(void) -{ - FILE *f; - FLAC__byte wav[] = { - 'R', 'I', 'F', 'F', 76, 0, 0, 0, - 'W', 'A', 'V', 'E', 'f', 'a', 'c', 't', - 4, 0, 0, 0 , 'b', 'l', 'a', 'h', - 'p', 'a', 'd', ' ', 4, 0, 0, 0, - 'B', 'L', 'A', 'H', 'f', 'm', 't', ' ', - 16, 0, 0, 0, 1, 0, 1, 0, - 0x44,0xAC, 0, 0, 0, 0, 0, 0, - 2, 0, 16, 0, 'd', 'a', 't', 'a', - 16, 0, 0, 0, 0, 0, 1, 0, - 4, 0, 9, 0, 16, 0, 25, 0, - 36, 0, 49, 0, 'p', 'a', 'd', ' ', - 4, 0, 0, 0, 'b', 'l', 'a', 'h' - }; - - if(0 == (f = fopen("wacky1.wav", "wb"))) - return false; - if(fwrite(wav, 1, 84, f) < 84) - goto foo; - fclose(f); - - wav[4] += 12; - if(0 == (f = fopen("wacky2.wav", "wb"))) - return false; - if(fwrite(wav, 1, 96, f) < 96) - goto foo; - fclose(f); - - return true; -foo: - fclose(f); - return false; -} - -int main(int argc, char *argv[]) -{ - FLAC__uint32 test = 1; - unsigned channels; - - int pattern01[] = { 1, -1, 0 }; - int pattern02[] = { 1, 1, -1, 0 }; - int pattern03[] = { 1, -1, -1, 0 }; - int pattern04[] = { 1, -1, 1, -1, 0 }; - int pattern05[] = { 1, -1, -1, 1, 0 }; - int pattern06[] = { 1, -1, 1, 1, -1, 0 }; - int pattern07[] = { 1, -1, -1, 1, -1, 0 }; - - (void)argc; - (void)argv; - is_big_endian_host = (*((FLAC__byte*)(&test)))? false : true; - -#if !defined _MSC_VER && !defined __MINGW32__ - { - struct timeval tv; - - if(gettimeofday(&tv, 0) < 0) { - fprintf(stderr, "WARNING: couldn't seed RNG with time\n"); - tv.tv_usec = 4321; - } - srandom(tv.tv_usec); - } -#else - srand((unsigned)time(0)); -#endif - - if(!generate_01()) return 1; - if(!generate_02()) return 1; - if(!generate_03()) return 1; - if(!generate_04()) return 1; - - if(!generate_fsd8("fsd8-01.raw", pattern01, 100)) return 1; - if(!generate_fsd8("fsd8-02.raw", pattern02, 100)) return 1; - if(!generate_fsd8("fsd8-03.raw", pattern03, 100)) return 1; - if(!generate_fsd8("fsd8-04.raw", pattern04, 100)) return 1; - if(!generate_fsd8("fsd8-05.raw", pattern05, 100)) return 1; - if(!generate_fsd8("fsd8-06.raw", pattern06, 100)) return 1; - if(!generate_fsd8("fsd8-07.raw", pattern07, 100)) return 1; - - if(!generate_fsd16("fsd16-01.raw", pattern01, 100)) return 1; - if(!generate_fsd16("fsd16-02.raw", pattern02, 100)) return 1; - if(!generate_fsd16("fsd16-03.raw", pattern03, 100)) return 1; - if(!generate_fsd16("fsd16-04.raw", pattern04, 100)) return 1; - if(!generate_fsd16("fsd16-05.raw", pattern05, 100)) return 1; - if(!generate_fsd16("fsd16-06.raw", pattern06, 100)) return 1; - if(!generate_fsd16("fsd16-07.raw", pattern07, 100)) return 1; - - if(!generate_fsd24("fsd24-01.raw", pattern01, 100)) return 1; - if(!generate_fsd24("fsd24-02.raw", pattern02, 100)) return 1; - if(!generate_fsd24("fsd24-03.raw", pattern03, 100)) return 1; - if(!generate_fsd24("fsd24-04.raw", pattern04, 100)) return 1; - if(!generate_fsd24("fsd24-05.raw", pattern05, 100)) return 1; - if(!generate_fsd24("fsd24-06.raw", pattern06, 100)) return 1; - if(!generate_fsd24("fsd24-07.raw", pattern07, 100)) return 1; - - if(!generate_wbps16("wbps16-01.raw", 1000)) return 1; - - if(!generate_sine8_1("sine8-00.raw", 48000.0, 200000, 441.0, 0.50, 441.0, 0.49)) return 1; - if(!generate_sine8_1("sine8-01.raw", 96000.0, 200000, 441.0, 0.61, 661.5, 0.37)) return 1; - if(!generate_sine8_1("sine8-02.raw", 44100.0, 200000, 441.0, 0.50, 882.0, 0.49)) return 1; - if(!generate_sine8_1("sine8-03.raw", 44100.0, 200000, 441.0, 0.50, 4410.0, 0.49)) return 1; - if(!generate_sine8_1("sine8-04.raw", 44100.0, 200000, 8820.0, 0.70, 4410.0, 0.29)) return 1; - - if(!generate_sine8_2("sine8-10.raw", 48000.0, 200000, 441.0, 0.50, 441.0, 0.49, 1.0)) return 1; - if(!generate_sine8_2("sine8-11.raw", 48000.0, 200000, 441.0, 0.61, 661.5, 0.37, 1.0)) return 1; - if(!generate_sine8_2("sine8-12.raw", 96000.0, 200000, 441.0, 0.50, 882.0, 0.49, 1.0)) return 1; - if(!generate_sine8_2("sine8-13.raw", 44100.0, 200000, 441.0, 0.50, 4410.0, 0.49, 1.0)) return 1; - if(!generate_sine8_2("sine8-14.raw", 44100.0, 200000, 8820.0, 0.70, 4410.0, 0.29, 1.0)) return 1; - if(!generate_sine8_2("sine8-15.raw", 44100.0, 200000, 441.0, 0.50, 441.0, 0.49, 0.5)) return 1; - if(!generate_sine8_2("sine8-16.raw", 44100.0, 200000, 441.0, 0.61, 661.5, 0.37, 2.0)) return 1; - if(!generate_sine8_2("sine8-17.raw", 44100.0, 200000, 441.0, 0.50, 882.0, 0.49, 0.7)) return 1; - if(!generate_sine8_2("sine8-18.raw", 44100.0, 200000, 441.0, 0.50, 4410.0, 0.49, 1.3)) return 1; - if(!generate_sine8_2("sine8-19.raw", 44100.0, 200000, 8820.0, 0.70, 4410.0, 0.29, 0.1)) return 1; - - if(!generate_sine16_1("sine16-00.raw", 48000.0, 200000, 441.0, 0.50, 441.0, 0.49)) return 1; - if(!generate_sine16_1("sine16-01.raw", 96000.0, 200000, 441.0, 0.61, 661.5, 0.37)) return 1; - if(!generate_sine16_1("sine16-02.raw", 44100.0, 200000, 441.0, 0.50, 882.0, 0.49)) return 1; - if(!generate_sine16_1("sine16-03.raw", 44100.0, 200000, 441.0, 0.50, 4410.0, 0.49)) return 1; - if(!generate_sine16_1("sine16-04.raw", 44100.0, 200000, 8820.0, 0.70, 4410.0, 0.29)) return 1; - - if(!generate_sine16_2("sine16-10.raw", 48000.0, 200000, 441.0, 0.50, 441.0, 0.49, 1.0)) return 1; - if(!generate_sine16_2("sine16-11.raw", 48000.0, 200000, 441.0, 0.61, 661.5, 0.37, 1.0)) return 1; - if(!generate_sine16_2("sine16-12.raw", 96000.0, 200000, 441.0, 0.50, 882.0, 0.49, 1.0)) return 1; - if(!generate_sine16_2("sine16-13.raw", 44100.0, 200000, 441.0, 0.50, 4410.0, 0.49, 1.0)) return 1; - if(!generate_sine16_2("sine16-14.raw", 44100.0, 200000, 8820.0, 0.70, 4410.0, 0.29, 1.0)) return 1; - if(!generate_sine16_2("sine16-15.raw", 44100.0, 200000, 441.0, 0.50, 441.0, 0.49, 0.5)) return 1; - if(!generate_sine16_2("sine16-16.raw", 44100.0, 200000, 441.0, 0.61, 661.5, 0.37, 2.0)) return 1; - if(!generate_sine16_2("sine16-17.raw", 44100.0, 200000, 441.0, 0.50, 882.0, 0.49, 0.7)) return 1; - if(!generate_sine16_2("sine16-18.raw", 44100.0, 200000, 441.0, 0.50, 4410.0, 0.49, 1.3)) return 1; - if(!generate_sine16_2("sine16-19.raw", 44100.0, 200000, 8820.0, 0.70, 4410.0, 0.29, 0.1)) return 1; - - if(!generate_sine24_1("sine24-00.raw", 48000.0, 200000, 441.0, 0.50, 441.0, 0.49)) return 1; - if(!generate_sine24_1("sine24-01.raw", 96000.0, 200000, 441.0, 0.61, 661.5, 0.37)) return 1; - if(!generate_sine24_1("sine24-02.raw", 44100.0, 200000, 441.0, 0.50, 882.0, 0.49)) return 1; - if(!generate_sine24_1("sine24-03.raw", 44100.0, 200000, 441.0, 0.50, 4410.0, 0.49)) return 1; - if(!generate_sine24_1("sine24-04.raw", 44100.0, 200000, 8820.0, 0.70, 4410.0, 0.29)) return 1; - - if(!generate_sine24_2("sine24-10.raw", 48000.0, 200000, 441.0, 0.50, 441.0, 0.49, 1.0)) return 1; - if(!generate_sine24_2("sine24-11.raw", 48000.0, 200000, 441.0, 0.61, 661.5, 0.37, 1.0)) return 1; - if(!generate_sine24_2("sine24-12.raw", 96000.0, 200000, 441.0, 0.50, 882.0, 0.49, 1.0)) return 1; - if(!generate_sine24_2("sine24-13.raw", 44100.0, 200000, 441.0, 0.50, 4410.0, 0.49, 1.0)) return 1; - if(!generate_sine24_2("sine24-14.raw", 44100.0, 200000, 8820.0, 0.70, 4410.0, 0.29, 1.0)) return 1; - if(!generate_sine24_2("sine24-15.raw", 44100.0, 200000, 441.0, 0.50, 441.0, 0.49, 0.5)) return 1; - if(!generate_sine24_2("sine24-16.raw", 44100.0, 200000, 441.0, 0.61, 661.5, 0.37, 2.0)) return 1; - if(!generate_sine24_2("sine24-17.raw", 44100.0, 200000, 441.0, 0.50, 882.0, 0.49, 0.7)) return 1; - if(!generate_sine24_2("sine24-18.raw", 44100.0, 200000, 441.0, 0.50, 4410.0, 0.49, 1.3)) return 1; - if(!generate_sine24_2("sine24-19.raw", 44100.0, 200000, 8820.0, 0.70, 4410.0, 0.29, 0.1)) return 1; - - /* WATCHOUT: the size of noise.raw is hardcoded into test/test_flac.sh */ - if(!generate_noise("noise.raw", 65536 * 8 * 3)) return 1; - if(!generate_noise("noise8m32.raw", 32)) return 1; - if(!generate_wackywavs()) return 1; - for(channels = 1; channels <= 8; channels++) { - unsigned bits_per_sample; - for(bits_per_sample = 4; bits_per_sample <= 24; bits_per_sample++) { - static const unsigned nsamples[] = { 1, 111, 4777 } ; - unsigned samples; - for(samples = 0; samples < sizeof(nsamples)/sizeof(nsamples[0]); samples++) { - char fn[64]; - - sprintf(fn, "rt-%u-%u-%u.aiff", channels, bits_per_sample, nsamples[samples]); - if(!generate_aiff(fn, 44100, channels, bits_per_sample, nsamples[samples])) - return 1; - - sprintf(fn, "rt-%u-%u-%u.wav", channels, bits_per_sample, nsamples[samples]); - if(!generate_wav(fn, 44100, channels, bits_per_sample, nsamples[samples], /*strict=*/true)) - return 1; - - if(bits_per_sample % 8 == 0) { - sprintf(fn, "rt-%u-%u-%u.raw", channels, bits_per_sample, nsamples[samples]); - if(!generate_raw(fn, channels, bits_per_sample/8, nsamples[samples])) - return 1; - } - } - } - } - - return 0; -} diff --git a/3rdparty/libflac/src/test_streams/test_streams.dsp b/3rdparty/libflac/src/test_streams/test_streams.dsp deleted file mode 100644 index 985cde94266..00000000000 --- a/3rdparty/libflac/src/test_streams/test_streams.dsp +++ /dev/null @@ -1,96 +0,0 @@ -# Microsoft Developer Studio Project File - Name="test_streams" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=test_streams - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "test_streams.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "test_streams.mak" CFG="test_streams - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "test_streams - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "test_streams - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "test_streams - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "..\..\obj\release\bin" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\include" /D "NDEBUG" /D "FLAC__NO_DLL" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "test_streams - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "..\..\obj\debug\bin" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "_DEBUG" /D "DEBUG" /D "FLAC__NO_DLL" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "test_streams - Win32 Release" -# Name "test_streams - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "c" -# Begin Source File - -SOURCE=.\main.c -# End Source File -# End Group -# End Target -# End Project diff --git a/3rdparty/libflac/src/test_streams/test_streams.vcproj b/3rdparty/libflac/src/test_streams/test_streams.vcproj deleted file mode 100644 index fec5facae7d..00000000000 --- a/3rdparty/libflac/src/test_streams/test_streams.vcproj +++ /dev/null @@ -1,202 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="8.00" - Name="test_streams" - ProjectGUID="{4cefbc91-c215-11db-8314-0800200c9a66}" - RootNamespace="test_streams" - Keyword="Win32Proj" - > - <Platforms> - <Platform - Name="Win32" - /> - </Platforms> - <ToolFiles> - </ToolFiles> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="..\..\obj\debug\bin" - IntermediateDirectory="Debug" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=".;..\..\include" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;FLAC__NO_DLL;DEBUG" - MinimalRebuild="true" - BasicRuntimeChecks="3" - RuntimeLibrary="1" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="4" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="2" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - <Configuration - Name="Release|Win32" - OutputDirectory="..\..\obj\release\bin" - IntermediateDirectory="Release" - ConfigurationType="1" - > - <Tool - Name="VCPreBuildEventTool" - /> - <Tool - Name="VCCustomBuildTool" - /> - <Tool - Name="VCXMLDataGeneratorTool" - /> - <Tool - Name="VCWebServiceProxyGeneratorTool" - /> - <Tool - Name="VCMIDLTool" - /> - <Tool - Name="VCCLCompilerTool" - EnableIntrinsicFunctions="true" - FavorSizeOrSpeed="1" - OmitFramePointers="true" - WholeProgramOptimization="true" - AdditionalIncludeDirectories=".;..\..\include" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;FLAC__NO_DLL" - RuntimeLibrary="0" - BufferSecurityCheck="false" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="3" - CompileAs="0" - DisableSpecificWarnings="4267;4996" - /> - <Tool - Name="VCManagedResourceCompilerTool" - /> - <Tool - Name="VCResourceCompilerTool" - /> - <Tool - Name="VCPreLinkEventTool" - /> - <Tool - Name="VCLinkerTool" - LinkIncremental="1" - IgnoreDefaultLibraryNames="uuid.lib" - GenerateDebugInformation="true" - SubSystem="1" - OptimizeReferences="2" - EnableCOMDATFolding="2" - LinkTimeCodeGeneration="1" - TargetMachine="1" - /> - <Tool - Name="VCALinkTool" - /> - <Tool - Name="VCManifestTool" - /> - <Tool - Name="VCXDCMakeTool" - /> - <Tool - Name="VCBscMakeTool" - /> - <Tool - Name="VCFxCopTool" - /> - <Tool - Name="VCAppVerifierTool" - /> - <Tool - Name="VCWebDeploymentTool" - /> - <Tool - Name="VCPostBuildEventTool" - /> - </Configuration> - </Configurations> - <References> - </References> - <Files> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" - > - </Filter> - <Filter - Name="Source Files" - Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" - UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" - > - <File - RelativePath=".\main.c" - > - </File> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> |