Fixed bug 2491 - Force LOCAL_ARM_MODE for android builds
authorSam Lantinga <slouken@libsdl.org>
Sun, 22 Oct 2017 12:08:11 -0700
changeset 830c292b484a95e
parent 829 ab82b7aff1fd
child 831 d87b8620f8ed
Fixed bug 2491 - Force LOCAL_ARM_MODE for android builds

Sylvain

Here's a patch for building SDL_mixer and its dependencies.
There is an Android.mk file for each library.

It easier to customize the compilation of each library if necessary. Cleaner to extend and to maintain I think.
Android.mk
external/Android.mk
external/flac-1.3.2.patch
external/flac-1.3.2/Android.mk
external/libmodplug-0.8.9.0.patch
external/libmodplug-0.8.9.0/Android.mk
external/libogg-1.3.2.patch
external/libogg-1.3.2/Android.mk
external/libvorbisidec-1.2.1.patch
external/libvorbisidec-1.2.1/Android.mk
external/mpg123-1.25.6.patch
music.c
timidity/Android.mk
     1.1 --- a/Android.mk	Sun Oct 22 10:48:52 2017 -0700
     1.2 +++ b/Android.mk	Sun Oct 22 12:08:11 2017 -0700
     1.3 @@ -1,136 +1,102 @@
     1.4 +# Save the local path
     1.5  MY_LOCAL_PATH := $(call my-dir)
     1.6  
     1.7 -include $(call all-subdir-makefiles)
     1.8  
     1.9 +# Enable this if you want to support loading FLAC music with libFLAC
    1.10 +SUPPORT_FLAC ?= true
    1.11 +FLAC_LIBRARY_PATH := external/flac-1.3.2
    1.12 +
    1.13 +# Enable this if you want to support loading OGG Vorbis music via Tremor
    1.14 +SUPPORT_OGG ?= true
    1.15 +OGG_LIBRARY_PATH := external/libogg-1.3.2
    1.16 +VORBIS_LIBRARY_PATH := external/libvorbisidec-1.2.1
    1.17 +
    1.18 +# Enable this if you want to support loading MP3 music via MPG123
    1.19 +SUPPORT_MP3_MPG123 ?= true
    1.20 +MPG123_LIBRARY_PATH := external/mpg123-1.25.6
    1.21 +
    1.22 +# Enable this if you want to support loading MOD music via modplug
    1.23 +SUPPORT_MOD_MODPLUG ?= true
    1.24 +MODPLUG_LIBRARY_PATH := external/libmodplug-0.8.9.0
    1.25 +
    1.26 +# Enable this if you want to support TiMidity
    1.27 +SUPPORT_TIMIDITY ?= true
    1.28 +TIMIDITY_LIBRARY_PATH := timidity
    1.29 +
    1.30 +
    1.31 +# Build the library
    1.32 +ifeq ($(SUPPORT_FLAC),true)
    1.33 +    include $(MY_LOCAL_PATH)/$(FLAC_LIBRARY_PATH)/Android.mk
    1.34 +endif
    1.35 +
    1.36 +# Build the library
    1.37 +ifeq ($(SUPPORT_OGG),true)
    1.38 +    include $(MY_LOCAL_PATH)/$(OGG_LIBRARY_PATH)/Android.mk
    1.39 +    include $(MY_LOCAL_PATH)/$(VORBIS_LIBRARY_PATH)/Android.mk
    1.40 +endif
    1.41 +
    1.42 +# Build the library
    1.43 +ifeq ($(SUPPORT_MP3_MPG123),true)
    1.44 +    include $(MY_LOCAL_PATH)/$(MPG123_LIBRARY_PATH)/Android.mk
    1.45 +endif
    1.46 +
    1.47 +# Build the library
    1.48 +ifeq ($(SUPPORT_MOD_MODPLUG),true)
    1.49 +    include $(MY_LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/Android.mk
    1.50 +endif
    1.51 +
    1.52 +# Build the library
    1.53 +ifeq ($(SUPPORT_TIMIDITY),true)
    1.54 +    include $(MY_LOCAL_PATH)/$(TIMIDITY_LIBRARY_PATH)/Android.mk
    1.55 +endif
    1.56 +
    1.57 +
    1.58 +# Restore local path
    1.59  LOCAL_PATH := $(MY_LOCAL_PATH)
    1.60  
    1.61  include $(CLEAR_VARS)
    1.62  
    1.63  LOCAL_MODULE := SDL2_mixer
    1.64  
    1.65 -# Enable this if you want to support loading FLAC music via libFLAC
    1.66 -# The library path should be a relative path to this directory.
    1.67 -SUPPORT_FLAC ?= true
    1.68 -FLAC_LIBRARY_PATH := external/flac-1.3.2
    1.69 -
    1.70 -# Enable this if you want to support loading MOD music via modplug
    1.71 -# The library path should be a relative path to this directory.
    1.72 -SUPPORT_MOD_MODPLUG ?= true
    1.73 -MODPLUG_LIBRARY_PATH := external/libmodplug-0.8.9.0
    1.74 -
    1.75 -# Enable this if you want to support loading MP3 music via mpg123
    1.76 -# The library path should be a relative path to this directory.
    1.77 -SUPPORT_MP3_MPG123 ?= true
    1.78 -MPG123_LIBRARY_PATH := external/mpg123-1.25.6
    1.79 -
    1.80 -# Enable this if you want to support loading OGG Vorbis music via Tremor
    1.81 -# The library path should be a relative path to this directory.
    1.82 -SUPPORT_OGG ?= true
    1.83 -OGG_LIBRARY_PATH := external/libogg-1.3.2
    1.84 -VORBIS_LIBRARY_PATH := external/libvorbisidec-1.2.1
    1.85 -
    1.86 -# Enable this if you want to support TiMidity
    1.87 -SUPPORT_TIMIDITY ?= true
    1.88 -
    1.89 -LOCAL_C_INCLUDES := $(LOCAL_PATH) 
    1.90 -LOCAL_CFLAGS := -DMUSIC_WAV
    1.91 -
    1.92  LOCAL_SRC_FILES := $(notdir $(filter-out %/playmus.c %/playwave.c, $(wildcard $(LOCAL_PATH)/*.c))) \
    1.93  
    1.94 -
    1.95  LOCAL_LDLIBS :=
    1.96  LOCAL_STATIC_LIBRARIES :=
    1.97  LOCAL_SHARED_LIBRARIES := SDL2
    1.98  
    1.99 -ifeq ($(SUPPORT_TIMIDITY),true)
   1.100 -	LOCAL_C_INCLUDES += $(LOCAL_PATH)/timidity
   1.101 -	LOCAL_CFLAGS += -DMUSIC_MID -DMUSIC_MID_TIMIDITY
   1.102 -	LOCAL_SRC_FILES += $(subst $(LOCAL_PATH)/,,$(wildcard $(LOCAL_PATH)/timidity/*.c))
   1.103 -endif
   1.104 -
   1.105  ifeq ($(SUPPORT_FLAC),true)
   1.106  	LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(FLAC_LIBRARY_PATH)/include
   1.107  	LOCAL_CFLAGS += -DMUSIC_FLAC
   1.108 -    LOCAL_SHARED_LIBRARIES += libFLAC
   1.109 +    LOCAL_STATIC_LIBRARIES += libFLAC
   1.110  endif
   1.111  
   1.112 -ifeq ($(SUPPORT_MOD_MODPLUG),true)
   1.113 -    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src/libmodplug
   1.114 -    LOCAL_CFLAGS += -DMUSIC_MOD_MODPLUG -DMODPLUG_HEADER="<modplug.h>" -DHAVE_SETENV -DHAVE_SINF
   1.115 -    LOCAL_SRC_FILES += \
   1.116 -        $(MODPLUG_LIBRARY_PATH)/src/fastmix.cpp \
   1.117 -        $(MODPLUG_LIBRARY_PATH)/src/load_669.cpp \
   1.118 -        $(MODPLUG_LIBRARY_PATH)/src/load_abc.cpp \
   1.119 -        $(MODPLUG_LIBRARY_PATH)/src/load_amf.cpp \
   1.120 -        $(MODPLUG_LIBRARY_PATH)/src/load_ams.cpp \
   1.121 -        $(MODPLUG_LIBRARY_PATH)/src/load_dbm.cpp \
   1.122 -        $(MODPLUG_LIBRARY_PATH)/src/load_dmf.cpp \
   1.123 -        $(MODPLUG_LIBRARY_PATH)/src/load_dsm.cpp \
   1.124 -        $(MODPLUG_LIBRARY_PATH)/src/load_far.cpp \
   1.125 -        $(MODPLUG_LIBRARY_PATH)/src/load_it.cpp \
   1.126 -        $(MODPLUG_LIBRARY_PATH)/src/load_j2b.cpp \
   1.127 -        $(MODPLUG_LIBRARY_PATH)/src/load_mdl.cpp \
   1.128 -        $(MODPLUG_LIBRARY_PATH)/src/load_med.cpp \
   1.129 -        $(MODPLUG_LIBRARY_PATH)/src/load_mid.cpp \
   1.130 -        $(MODPLUG_LIBRARY_PATH)/src/load_mod.cpp \
   1.131 -        $(MODPLUG_LIBRARY_PATH)/src/load_mt2.cpp \
   1.132 -        $(MODPLUG_LIBRARY_PATH)/src/load_mtm.cpp \
   1.133 -        $(MODPLUG_LIBRARY_PATH)/src/load_okt.cpp \
   1.134 -        $(MODPLUG_LIBRARY_PATH)/src/load_pat.cpp \
   1.135 -        $(MODPLUG_LIBRARY_PATH)/src/load_psm.cpp \
   1.136 -        $(MODPLUG_LIBRARY_PATH)/src/load_ptm.cpp \
   1.137 -        $(MODPLUG_LIBRARY_PATH)/src/load_s3m.cpp \
   1.138 -        $(MODPLUG_LIBRARY_PATH)/src/load_stm.cpp \
   1.139 -        $(MODPLUG_LIBRARY_PATH)/src/load_ult.cpp \
   1.140 -        $(MODPLUG_LIBRARY_PATH)/src/load_umx.cpp \
   1.141 -        $(MODPLUG_LIBRARY_PATH)/src/load_wav.cpp \
   1.142 -        $(MODPLUG_LIBRARY_PATH)/src/load_xm.cpp \
   1.143 -        $(MODPLUG_LIBRARY_PATH)/src/mmcmp.cpp \
   1.144 -        $(MODPLUG_LIBRARY_PATH)/src/modplug.cpp \
   1.145 -        $(MODPLUG_LIBRARY_PATH)/src/snd_dsp.cpp \
   1.146 -        $(MODPLUG_LIBRARY_PATH)/src/snd_flt.cpp \
   1.147 -        $(MODPLUG_LIBRARY_PATH)/src/snd_fx.cpp \
   1.148 -        $(MODPLUG_LIBRARY_PATH)/src/sndfile.cpp \
   1.149 -        $(MODPLUG_LIBRARY_PATH)/src/sndmix.cpp
   1.150 +ifeq ($(SUPPORT_OGG),true)
   1.151 +    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(OGG_LIBRARY_PATH)/include
   1.152 +    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(VORBIS_LIBRARY_PATH)
   1.153 +    LOCAL_CFLAGS += -DMUSIC_OGG -DOGG_USE_TREMOR -DOGG_HEADER="<ivorbisfile.h>"
   1.154 +	LOCAL_STATIC_LIBRARIES += ogg vorbisidec
   1.155  endif
   1.156  
   1.157 +# This needs to be a shared library to comply with the LGPL license
   1.158  ifeq ($(SUPPORT_MP3_MPG123),true)
   1.159      LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MPG123_LIBRARY_PATH)
   1.160      LOCAL_CFLAGS += -DMUSIC_MP3_MPG123
   1.161      LOCAL_SHARED_LIBRARIES += mpg123
   1.162  endif
   1.163  
   1.164 -ifeq ($(SUPPORT_OGG),true)
   1.165 -    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(OGG_LIBRARY_PATH)/android \
   1.166 -                        $(LOCAL_PATH)/$(OGG_LIBRARY_PATH)/include \
   1.167 -                        $(LOCAL_PATH)/$(VORBIS_LIBRARY_PATH)
   1.168 -    LOCAL_CFLAGS += -DMUSIC_OGG -DOGG_USE_TREMOR -DOGG_HEADER="<ivorbisfile.h>"
   1.169 -    ifeq ($(TARGET_ARCH_ABI),armeabi)
   1.170 -	LOCAL_CFLAGS += -D_ARM_ASSEM_
   1.171 -    endif
   1.172 -    ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
   1.173 -	LOCAL_CFLAGS += -D_ARM_ASSEM_
   1.174 -    endif
   1.175 -    LOCAL_SRC_FILES += \
   1.176 -        $(VORBIS_LIBRARY_PATH)/mdct.c \
   1.177 -        $(VORBIS_LIBRARY_PATH)/block.c \
   1.178 -        $(VORBIS_LIBRARY_PATH)/window.c \
   1.179 -        $(VORBIS_LIBRARY_PATH)/synthesis.c \
   1.180 -        $(VORBIS_LIBRARY_PATH)/info.c \
   1.181 -        $(VORBIS_LIBRARY_PATH)/floor1.c \
   1.182 -        $(VORBIS_LIBRARY_PATH)/floor0.c \
   1.183 -        $(VORBIS_LIBRARY_PATH)/vorbisfile.c \
   1.184 -        $(VORBIS_LIBRARY_PATH)/res012.c \
   1.185 -        $(VORBIS_LIBRARY_PATH)/mapping0.c \
   1.186 -        $(VORBIS_LIBRARY_PATH)/registry.c \
   1.187 -        $(VORBIS_LIBRARY_PATH)/codebook.c \
   1.188 -        $(VORBIS_LIBRARY_PATH)/sharedbook.c \
   1.189 -        $(OGG_LIBRARY_PATH)/src/framing.c \
   1.190 -        $(OGG_LIBRARY_PATH)/src/bitwise.c
   1.191 +ifeq ($(SUPPORT_MOD_MODPLUG),true)
   1.192 +    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src
   1.193 +    LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(MODPLUG_LIBRARY_PATH)/src/libmodplug
   1.194 +    LOCAL_CFLAGS += -DMUSIC_MOD_MODPLUG -DMODPLUG_HEADER="<modplug.h>"
   1.195 +	LOCAL_STATIC_LIBRARIES += modplug
   1.196 +endif
   1.197 +
   1.198 +ifeq ($(SUPPORT_TIMIDITY),true)
   1.199 +	LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(TIMIDITY_LIBRARY_PATH)
   1.200 +	LOCAL_CFLAGS += -DMUSIC_MID_TIMIDITY
   1.201 +	LOCAL_STATIC_LIBRARIES += timidity
   1.202  endif
   1.203  
   1.204  LOCAL_EXPORT_C_INCLUDES += $(LOCAL_C_INCLUDES)
   1.205  
   1.206 -LOCAL_ARM_MODE := arm
   1.207 -
   1.208  include $(BUILD_SHARED_LIBRARY)
     2.1 --- a/external/Android.mk	Sun Oct 22 10:48:52 2017 -0700
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,1 +0,0 @@
     2.4 -include $(call all-subdir-makefiles)
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/external/flac-1.3.2.patch	Sun Oct 22 12:08:11 2017 -0700
     3.3 @@ -0,0 +1,310 @@
     3.4 +diff -ruN flac-1.3.2.orig/android/config.h flac-1.3.2/android/config.h
     3.5 +--- flac-1.3.2.orig/android/config.h	1969-12-31 16:00:00.000000000 -0800
     3.6 ++++ flac-1.3.2/android/config.h	2017-10-12 21:18:02.127360706 -0700
     3.7 +@@ -0,0 +1,240 @@
     3.8 ++/* config.h.  Generated from config.h.in by configure.  */
     3.9 ++/* config.h.in.  Generated from configure.ac by autoheader.  */
    3.10 ++
    3.11 ++/* Define if building universal (internal helper macro) */
    3.12 ++/* #undef AC_APPLE_UNIVERSAL_BUILD */
    3.13 ++
    3.14 ++/* Target processor is big endian. */
    3.15 ++#define CPU_IS_BIG_ENDIAN 0
    3.16 ++
    3.17 ++/* Target processor is little endian. */
    3.18 ++#define CPU_IS_LITTLE_ENDIAN 1
    3.19 ++
    3.20 ++/* Set FLAC__BYTES_PER_WORD to 8 (4 is the default) */
    3.21 ++#define ENABLE_64_BIT_WORDS 0
    3.22 ++
    3.23 ++/* define to align allocated memory on 32-byte boundaries */
    3.24 ++#define FLAC__ALIGN_MALLOC_DATA 1
    3.25 ++
    3.26 ++/* define if building for ia32/i386 */
    3.27 ++/* #undef FLAC__CPU_IA32 */
    3.28 ++
    3.29 ++/* define if building for PowerPC */
    3.30 ++/* #undef FLAC__CPU_PPC */
    3.31 ++
    3.32 ++/* define if building for PowerPC with SPE ABI */
    3.33 ++/* #undef FLAC__CPU_PPC_SPE */
    3.34 ++
    3.35 ++/* define if building for SPARC */
    3.36 ++/* #undef FLAC__CPU_SPARC */
    3.37 ++
    3.38 ++/* define if building for x86_64 */
    3.39 ++/* #undef FLAC__CPU_X86_64 */
    3.40 ++
    3.41 ++/* define if you have docbook-to-man or docbook2man */
    3.42 ++/* #undef FLAC__HAS_DOCBOOK_TO_MAN */
    3.43 ++
    3.44 ++/* define if you are compiling for x86 and have the NASM assembler */
    3.45 ++/* #undef FLAC__HAS_NASM */
    3.46 ++
    3.47 ++/* define if you have the ogg library */
    3.48 ++#define FLAC__HAS_OGG 1
    3.49 ++
    3.50 ++/* Set to 1 if <x86intrin.h> is available. */
    3.51 ++#define FLAC__HAS_X86INTRIN 0
    3.52 ++
    3.53 ++/* define to disable use of assembly code */
    3.54 ++/* #undef FLAC__NO_ASM */
    3.55 ++
    3.56 ++/* define if building for Darwin / MacOS X */
    3.57 ++/* #undef FLAC__SYS_DARWIN */
    3.58 ++
    3.59 ++/* define if building for Linux */
    3.60 ++/* #undef FLAC__SYS_LINUX */
    3.61 ++
    3.62 ++/* define to enable use of Altivec instructions */
    3.63 ++#define FLAC__USE_ALTIVEC 1
    3.64 ++
    3.65 ++/* define to enable use of AVX instructions */
    3.66 ++#define FLAC__USE_AVX 1
    3.67 ++
    3.68 ++/* Compiler has the __builtin_bswap16 intrinsic */
    3.69 ++#define HAVE_BSWAP16 1
    3.70 ++
    3.71 ++/* Compiler has the __builtin_bswap32 intrinsic */
    3.72 ++#define HAVE_BSWAP32 1
    3.73 ++
    3.74 ++/* Define to 1 if you have the <byteswap.h> header file. */
    3.75 ++#define HAVE_BYTESWAP_H 1
    3.76 ++
    3.77 ++/* define if you have clock_gettime */
    3.78 ++/* #undef HAVE_CLOCK_GETTIME */
    3.79 ++
    3.80 ++/* Define to 1 if you have the <cpuid.h> header file. */
    3.81 ++/* #undef HAVE_CPUID_H */
    3.82 ++
    3.83 ++/* Define to 1 if C++ supports variable-length arrays. */
    3.84 ++#define HAVE_CXX_VARARRAYS 1
    3.85 ++
    3.86 ++/* Define to 1 if C supports variable-length arrays. */
    3.87 ++#define HAVE_C_VARARRAYS 1
    3.88 ++
    3.89 ++/* Define to 1 if you have the <dlfcn.h> header file. */
    3.90 ++#define HAVE_DLFCN_H 1
    3.91 ++
    3.92 ++/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
    3.93 ++#define HAVE_FSEEKO 1
    3.94 ++
    3.95 ++/* Define to 1 if you have the `getopt_long' function. */
    3.96 ++#define HAVE_GETOPT_LONG 1
    3.97 ++
    3.98 ++/* Define if you have the iconv() function and it works. */
    3.99 ++/* #undef HAVE_ICONV */
   3.100 ++
   3.101 ++/* Define to 1 if you have the <inttypes.h> header file. */
   3.102 ++#define HAVE_INTTYPES_H 1
   3.103 ++
   3.104 ++/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
   3.105 ++/* #undef HAVE_LANGINFO_CODESET */
   3.106 ++
   3.107 ++/* lround support */
   3.108 ++#define HAVE_LROUND 1
   3.109 ++
   3.110 ++/* Define to 1 if you have the <memory.h> header file. */
   3.111 ++#define HAVE_MEMORY_H 1
   3.112 ++
   3.113 ++/* Define to 1 if the system has the type `socklen_t'. */
   3.114 ++/* #undef HAVE_SOCKLEN_T */
   3.115 ++
   3.116 ++/* Define to 1 if you have the <stdint.h> header file. */
   3.117 ++#define HAVE_STDINT_H 1
   3.118 ++
   3.119 ++/* Define to 1 if you have the <stdlib.h> header file. */
   3.120 ++#define HAVE_STDLIB_H 1
   3.121 ++
   3.122 ++/* Define to 1 if you have the <strings.h> header file. */
   3.123 ++#define HAVE_STRINGS_H 1
   3.124 ++
   3.125 ++/* Define to 1 if you have the <string.h> header file. */
   3.126 ++#define HAVE_STRING_H 1
   3.127 ++
   3.128 ++/* Define to 1 if you have the <sys/ioctl.h> header file. */
   3.129 ++#define HAVE_SYS_IOCTL_H 1
   3.130 ++
   3.131 ++/* Define to 1 if you have the <sys/param.h> header file. */
   3.132 ++#define HAVE_SYS_PARAM_H 1
   3.133 ++
   3.134 ++/* Define to 1 if you have the <sys/stat.h> header file. */
   3.135 ++#define HAVE_SYS_STAT_H 1
   3.136 ++
   3.137 ++/* Define to 1 if you have the <sys/types.h> header file. */
   3.138 ++#define HAVE_SYS_TYPES_H 1
   3.139 ++
   3.140 ++/* Define to 1 if you have the <termios.h> header file. */
   3.141 ++#define HAVE_TERMIOS_H 1
   3.142 ++
   3.143 ++/* Define to 1 if typeof works with your compiler. */
   3.144 ++#define HAVE_TYPEOF 1
   3.145 ++
   3.146 ++/* Define to 1 if you have the <unistd.h> header file. */
   3.147 ++#define HAVE_UNISTD_H 1
   3.148 ++
   3.149 ++/* Define to 1 if you have the <x86intrin.h> header file. */
   3.150 ++/* #undef HAVE_X86INTRIN_H */
   3.151 ++
   3.152 ++/* Define as const if the declaration of iconv() needs const. */
   3.153 ++/* #undef ICONV_CONST */
   3.154 ++
   3.155 ++/* Define to the sub-directory where libtool stores uninstalled libraries. */
   3.156 ++#define LT_OBJDIR ".libs/"
   3.157 ++
   3.158 ++/* Name of package */
   3.159 ++#define PACKAGE "flac"
   3.160 ++
   3.161 ++/* Define to the address where bug reports for this package should be sent. */
   3.162 ++#define PACKAGE_BUGREPORT "flac-dev@xiph.org"
   3.163 ++
   3.164 ++/* Define to the full name of this package. */
   3.165 ++#define PACKAGE_NAME "flac"
   3.166 ++
   3.167 ++/* Define to the full name and version of this package. */
   3.168 ++#define PACKAGE_STRING "flac 1.3.2"
   3.169 ++
   3.170 ++/* Define to the one symbol short name of this package. */
   3.171 ++#define PACKAGE_TARNAME "flac"
   3.172 ++
   3.173 ++/* Define to the home page for this package. */
   3.174 ++#define PACKAGE_URL "https://www.xiph.org/flac/"
   3.175 ++
   3.176 ++/* Define to the version of this package. */
   3.177 ++#define PACKAGE_VERSION "1.3.2"
   3.178 ++
   3.179 ++/* The size of `off_t', as computed by sizeof. */
   3.180 ++#define SIZEOF_OFF_T 4
   3.181 ++
   3.182 ++/* The size of `void*', as computed by sizeof. */
   3.183 ++#define SIZEOF_VOIDP 4
   3.184 ++
   3.185 ++/* Define to 1 if you have the ANSI C header files. */
   3.186 ++#define STDC_HEADERS 1
   3.187 ++
   3.188 ++/* Enable extensions on AIX 3, Interix.  */
   3.189 ++#ifndef _ALL_SOURCE
   3.190 ++# define _ALL_SOURCE 1
   3.191 ++#endif
   3.192 ++/* Enable GNU extensions on systems that have them.  */
   3.193 ++#ifndef _GNU_SOURCE
   3.194 ++# define _GNU_SOURCE 1
   3.195 ++#endif
   3.196 ++/* Enable threading extensions on Solaris.  */
   3.197 ++#ifndef _POSIX_PTHREAD_SEMANTICS
   3.198 ++# define _POSIX_PTHREAD_SEMANTICS 1
   3.199 ++#endif
   3.200 ++/* Enable extensions on HP NonStop.  */
   3.201 ++#ifndef _TANDEM_SOURCE
   3.202 ++# define _TANDEM_SOURCE 1
   3.203 ++#endif
   3.204 ++/* Enable general extensions on Solaris.  */
   3.205 ++#ifndef __EXTENSIONS__
   3.206 ++# define __EXTENSIONS__ 1
   3.207 ++#endif
   3.208 ++
   3.209 ++
   3.210 ++/* Version number of package */
   3.211 ++#define VERSION "1.3.2"
   3.212 ++
   3.213 ++/* Target processor is big endian. */
   3.214 ++#define WORDS_BIGENDIAN 0
   3.215 ++
   3.216 ++/* Enable large inode numbers on Mac OS X 10.5.  */
   3.217 ++#ifndef _DARWIN_USE_64_BIT_INODE
   3.218 ++# define _DARWIN_USE_64_BIT_INODE 1
   3.219 ++#endif
   3.220 ++
   3.221 ++/* Number of bits in a file offset, on hosts where this is settable. */
   3.222 ++/* #undef _FILE_OFFSET_BITS */
   3.223 ++
   3.224 ++/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
   3.225 ++/* #undef _LARGEFILE_SOURCE */
   3.226 ++
   3.227 ++/* Define for large files, on AIX-style hosts. */
   3.228 ++/* #undef _LARGE_FILES */
   3.229 ++
   3.230 ++/* Define to 1 if on MINIX. */
   3.231 ++/* #undef _MINIX */
   3.232 ++
   3.233 ++/* Define to 2 if the system does not provide POSIX.1 features except with
   3.234 ++   this defined. */
   3.235 ++/* #undef _POSIX_1_SOURCE */
   3.236 ++
   3.237 ++/* Define to 1 if you need to in order for `stat' and other things to work. */
   3.238 ++/* #undef _POSIX_SOURCE */
   3.239 ++
   3.240 ++/* Define to `__inline__' or `__inline' if that's what the C compiler
   3.241 ++   calls it, or to nothing if 'inline' is not supported under any name.  */
   3.242 ++#ifndef __cplusplus
   3.243 ++/* #undef inline */
   3.244 ++#endif
   3.245 ++
   3.246 ++/* Define to __typeof__ if your compiler spells it that way. */
   3.247 ++/* #undef typeof */
   3.248 +diff -ruN flac-1.3.2.orig/Android.mk flac-1.3.2/Android.mk
   3.249 +--- flac-1.3.2.orig/Android.mk	1969-12-31 16:00:00.000000000 -0800
   3.250 ++++ flac-1.3.2/Android.mk	2017-10-22 11:54:16.336359001 -0700
   3.251 +@@ -0,0 +1,49 @@
   3.252 ++LOCAL_PATH := $(call my-dir)
   3.253 ++
   3.254 ++include $(CLEAR_VARS)
   3.255 ++
   3.256 ++LOCAL_MODULE := libFLAC
   3.257 ++
   3.258 ++FLAC_OGG_LIBRARY_PATH := ../libogg-1.3.2
   3.259 ++
   3.260 ++LOCAL_C_INCLUDES := $(LOCAL_PATH)/include \
   3.261 ++                    $(LOCAL_PATH)/src/libFLAC/include \
   3.262 ++                    $(LOCAL_PATH)/$(FLAC_OGG_LIBRARY_PATH)/include \
   3.263 ++                    $(LOCAL_PATH)/$(FLAC_OGG_LIBRARY_PATH)/android
   3.264 ++LOCAL_CFLAGS := -include $(LOCAL_PATH)/android/config.h
   3.265 ++
   3.266 ++LOCAL_SRC_FILES := \
   3.267 ++    src/libFLAC/bitmath.c \
   3.268 ++    src/libFLAC/bitreader.c \
   3.269 ++    src/libFLAC/bitwriter.c \
   3.270 ++    src/libFLAC/cpu.c \
   3.271 ++    src/libFLAC/crc.c \
   3.272 ++    src/libFLAC/fixed.c \
   3.273 ++    src/libFLAC/fixed_intrin_sse2.c \
   3.274 ++    src/libFLAC/fixed_intrin_ssse3.c \
   3.275 ++    src/libFLAC/float.c \
   3.276 ++    src/libFLAC/format.c \
   3.277 ++    src/libFLAC/lpc.c \
   3.278 ++    src/libFLAC/lpc_intrin_sse.c \
   3.279 ++    src/libFLAC/lpc_intrin_sse2.c \
   3.280 ++    src/libFLAC/lpc_intrin_sse41.c \
   3.281 ++    src/libFLAC/lpc_intrin_avx2.c \
   3.282 ++    src/libFLAC/md5.c \
   3.283 ++    src/libFLAC/memory.c \
   3.284 ++    src/libFLAC/metadata_iterators.c \
   3.285 ++    src/libFLAC/metadata_object.c \
   3.286 ++    src/libFLAC/stream_decoder.c \
   3.287 ++    src/libFLAC/stream_encoder.c \
   3.288 ++    src/libFLAC/stream_encoder_intrin_sse2.c \
   3.289 ++    src/libFLAC/stream_encoder_intrin_ssse3.c \
   3.290 ++    src/libFLAC/stream_encoder_intrin_avx2.c \
   3.291 ++    src/libFLAC/stream_encoder_framing.c \
   3.292 ++    src/libFLAC/window.c \
   3.293 ++	src/libFLAC/ogg_decoder_aspect.c \
   3.294 ++	src/libFLAC/ogg_encoder_aspect.c \
   3.295 ++	src/libFLAC/ogg_helper.c \
   3.296 ++	src/libFLAC/ogg_mapping.c
   3.297 ++
   3.298 ++LOCAL_EXPORT_C_INCLUDES += $(LOCAL_C_INCLUDES)
   3.299 ++
   3.300 ++include $(BUILD_STATIC_LIBRARY)
   3.301 +diff -ruN flac-1.3.2.orig/src/libFLAC/format.c flac-1.3.2/src/libFLAC/format.c
   3.302 +--- flac-1.3.2.orig/src/libFLAC/format.c	2016-12-31 17:46:35.228989070 -0800
   3.303 ++++ flac-1.3.2/src/libFLAC/format.c	2017-10-22 10:56:05.613169824 -0700
   3.304 +@@ -45,6 +45,9 @@
   3.305 + #include "private/macros.h"
   3.306 + 
   3.307 + /* PACKAGE_VERSION should come from configure */
   3.308 ++#ifndef PACKAGE_VERSION
   3.309 ++#define PACKAGE_VERSION	"UNKNOWN"
   3.310 ++#endif
   3.311 + FLAC_API const char *FLAC__VERSION_STRING = PACKAGE_VERSION;
   3.312 + 
   3.313 + FLAC_API const char *FLAC__VENDOR_STRING = "reference libFLAC " PACKAGE_VERSION " 20170101";
     4.1 --- a/external/flac-1.3.2/Android.mk	Sun Oct 22 10:48:52 2017 -0700
     4.2 +++ b/external/flac-1.3.2/Android.mk	Sun Oct 22 12:08:11 2017 -0700
     4.3 @@ -4,12 +4,12 @@
     4.4  
     4.5  LOCAL_MODULE := libFLAC
     4.6  
     4.7 -OGG_LIBRARY_PATH := ../libogg-1.3.2
     4.8 +FLAC_OGG_LIBRARY_PATH := ../libogg-1.3.2
     4.9  
    4.10  LOCAL_C_INCLUDES := $(LOCAL_PATH)/include \
    4.11                      $(LOCAL_PATH)/src/libFLAC/include \
    4.12 -                    $(LOCAL_PATH)/$(OGG_LIBRARY_PATH)/include \
    4.13 -                    $(LOCAL_PATH)/$(OGG_LIBRARY_PATH)/android
    4.14 +                    $(LOCAL_PATH)/$(FLAC_OGG_LIBRARY_PATH)/include \
    4.15 +                    $(LOCAL_PATH)/$(FLAC_OGG_LIBRARY_PATH)/android
    4.16  LOCAL_CFLAGS := -include $(LOCAL_PATH)/android/config.h
    4.17  
    4.18  LOCAL_SRC_FILES := \
    4.19 @@ -42,10 +42,8 @@
    4.20  	src/libFLAC/ogg_decoder_aspect.c \
    4.21  	src/libFLAC/ogg_encoder_aspect.c \
    4.22  	src/libFLAC/ogg_helper.c \
    4.23 -	src/libFLAC/ogg_mapping.c \
    4.24 -    $(OGG_LIBRARY_PATH)/src/framing.c \
    4.25 -    $(OGG_LIBRARY_PATH)/src/bitwise.c
    4.26 +	src/libFLAC/ogg_mapping.c
    4.27  
    4.28  LOCAL_EXPORT_C_INCLUDES += $(LOCAL_C_INCLUDES)
    4.29  
    4.30 -include $(BUILD_SHARED_LIBRARY)
    4.31 +include $(BUILD_STATIC_LIBRARY)
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/external/libmodplug-0.8.9.0.patch	Sun Oct 22 12:08:11 2017 -0700
     5.3 @@ -0,0 +1,51 @@
     5.4 +diff -ruN libmodplug-0.8.9.0.orig/Android.mk libmodplug-0.8.9.0/Android.mk
     5.5 +--- libmodplug-0.8.9.0.orig/Android.mk	1969-12-31 16:00:00.000000000 -0800
     5.6 ++++ libmodplug-0.8.9.0/Android.mk	2017-10-22 11:43:42.132552241 -0700
     5.7 +@@ -0,0 +1,47 @@
     5.8 ++LOCAL_PATH := $(call my-dir)
     5.9 ++
    5.10 ++include $(CLEAR_VARS)
    5.11 ++
    5.12 ++LOCAL_MODULE := modplug
    5.13 ++
    5.14 ++LOCAL_C_INCLUDES := $(LOCAL_PATH)/src $(LOCAL_PATH)/src/libmodplug 
    5.15 ++
    5.16 ++LOCAL_CFLAGS += -DHAVE_SETENV -DHAVE_SINF
    5.17 ++
    5.18 ++LOCAL_SRC_FILES += \
    5.19 ++    src/fastmix.cpp \
    5.20 ++    src/load_669.cpp \
    5.21 ++    src/load_abc.cpp \
    5.22 ++    src/load_amf.cpp \
    5.23 ++    src/load_ams.cpp \
    5.24 ++    src/load_dbm.cpp \
    5.25 ++    src/load_dmf.cpp \
    5.26 ++    src/load_dsm.cpp \
    5.27 ++    src/load_far.cpp \
    5.28 ++    src/load_it.cpp \
    5.29 ++    src/load_j2b.cpp \
    5.30 ++    src/load_mdl.cpp \
    5.31 ++    src/load_med.cpp \
    5.32 ++    src/load_mid.cpp \
    5.33 ++    src/load_mod.cpp \
    5.34 ++    src/load_mt2.cpp \
    5.35 ++    src/load_mtm.cpp \
    5.36 ++    src/load_okt.cpp \
    5.37 ++    src/load_pat.cpp \
    5.38 ++    src/load_psm.cpp \
    5.39 ++    src/load_ptm.cpp \
    5.40 ++    src/load_s3m.cpp \
    5.41 ++    src/load_stm.cpp \
    5.42 ++    src/load_ult.cpp \
    5.43 ++    src/load_umx.cpp \
    5.44 ++    src/load_wav.cpp \
    5.45 ++    src/load_xm.cpp \
    5.46 ++    src/mmcmp.cpp \
    5.47 ++    src/modplug.cpp \
    5.48 ++    src/snd_dsp.cpp \
    5.49 ++    src/snd_flt.cpp \
    5.50 ++    src/snd_fx.cpp \
    5.51 ++    src/sndfile.cpp \
    5.52 ++    src/sndmix.cpp
    5.53 ++
    5.54 ++include $(BUILD_STATIC_LIBRARY)
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/external/libmodplug-0.8.9.0/Android.mk	Sun Oct 22 12:08:11 2017 -0700
     6.3 @@ -0,0 +1,47 @@
     6.4 +LOCAL_PATH := $(call my-dir)
     6.5 +
     6.6 +include $(CLEAR_VARS)
     6.7 +
     6.8 +LOCAL_MODULE := modplug
     6.9 +
    6.10 +LOCAL_C_INCLUDES := $(LOCAL_PATH)/src $(LOCAL_PATH)/src/libmodplug 
    6.11 +
    6.12 +LOCAL_CFLAGS += -DHAVE_SETENV -DHAVE_SINF
    6.13 +
    6.14 +LOCAL_SRC_FILES += \
    6.15 +    src/fastmix.cpp \
    6.16 +    src/load_669.cpp \
    6.17 +    src/load_abc.cpp \
    6.18 +    src/load_amf.cpp \
    6.19 +    src/load_ams.cpp \
    6.20 +    src/load_dbm.cpp \
    6.21 +    src/load_dmf.cpp \
    6.22 +    src/load_dsm.cpp \
    6.23 +    src/load_far.cpp \
    6.24 +    src/load_it.cpp \
    6.25 +    src/load_j2b.cpp \
    6.26 +    src/load_mdl.cpp \
    6.27 +    src/load_med.cpp \
    6.28 +    src/load_mid.cpp \
    6.29 +    src/load_mod.cpp \
    6.30 +    src/load_mt2.cpp \
    6.31 +    src/load_mtm.cpp \
    6.32 +    src/load_okt.cpp \
    6.33 +    src/load_pat.cpp \
    6.34 +    src/load_psm.cpp \
    6.35 +    src/load_ptm.cpp \
    6.36 +    src/load_s3m.cpp \
    6.37 +    src/load_stm.cpp \
    6.38 +    src/load_ult.cpp \
    6.39 +    src/load_umx.cpp \
    6.40 +    src/load_wav.cpp \
    6.41 +    src/load_xm.cpp \
    6.42 +    src/mmcmp.cpp \
    6.43 +    src/modplug.cpp \
    6.44 +    src/snd_dsp.cpp \
    6.45 +    src/snd_flt.cpp \
    6.46 +    src/snd_fx.cpp \
    6.47 +    src/sndfile.cpp \
    6.48 +    src/sndmix.cpp
    6.49 +
    6.50 +include $(BUILD_STATIC_LIBRARY)
     7.1 --- a/external/libogg-1.3.2.patch	Sun Oct 22 10:48:52 2017 -0700
     7.2 +++ b/external/libogg-1.3.2.patch	Sun Oct 22 12:08:11 2017 -0700
     7.3 @@ -1,62 +1,121 @@
     7.4 -diff -ru libogg-1.3.2.orig/macosx/Ogg.xcodeproj/project.pbxproj libogg-1.3.2/macosx/Ogg.xcodeproj/project.pbxproj
     7.5 ---- libogg-1.3.2.orig/macosx/Ogg.xcodeproj/project.pbxproj	2017-10-12 15:31:59.000000000 -0700
     7.6 -+++ libogg-1.3.2/macosx/Ogg.xcodeproj/project.pbxproj	2017-10-12 16:22:51.000000000 -0700
     7.7 -@@ -168,9 +168,11 @@
     7.8 +diff -ruN libogg-1.3.2.orig/android/ogg/config_types.h libogg-1.3.2/android/ogg/config_types.h
     7.9 +--- libogg-1.3.2.orig/android/ogg/config_types.h	1969-12-31 16:00:00.000000000 -0800
    7.10 ++++ libogg-1.3.2/android/ogg/config_types.h	2017-10-12 20:31:47.848694044 -0700
    7.11 +@@ -0,0 +1,25 @@
    7.12 ++#ifndef __CONFIG_TYPES_H__
    7.13 ++#define __CONFIG_TYPES_H__
    7.14 ++
    7.15 ++/* these are filled in by configure */
    7.16 ++#define INCLUDE_INTTYPES_H 1
    7.17 ++#define INCLUDE_STDINT_H 1
    7.18 ++#define INCLUDE_SYS_TYPES_H 1
    7.19 ++
    7.20 ++#if INCLUDE_INTTYPES_H
    7.21 ++#  include <inttypes.h>
    7.22 ++#endif
    7.23 ++#if INCLUDE_STDINT_H
    7.24 ++#  include <stdint.h>
    7.25 ++#endif
    7.26 ++#if INCLUDE_SYS_TYPES_H
    7.27 ++#  include <sys/types.h>
    7.28 ++#endif
    7.29 ++
    7.30 ++typedef int16_t ogg_int16_t;
    7.31 ++typedef uint16_t ogg_uint16_t;
    7.32 ++typedef int32_t ogg_int32_t;
    7.33 ++typedef uint32_t ogg_uint32_t;
    7.34 ++typedef int64_t ogg_int64_t;
    7.35 ++
    7.36 ++#endif
    7.37 +diff -ruN libogg-1.3.2.orig/Android.mk libogg-1.3.2/Android.mk
    7.38 +--- libogg-1.3.2.orig/Android.mk	1969-12-31 16:00:00.000000000 -0800
    7.39 ++++ libogg-1.3.2/Android.mk	2017-10-22 11:48:30.793339994 -0700
    7.40 +@@ -0,0 +1,17 @@
    7.41 ++LOCAL_PATH := $(call my-dir)
    7.42 ++
    7.43 ++include $(CLEAR_VARS)
    7.44 ++
    7.45 ++LOCAL_MODULE := ogg
    7.46 ++
    7.47 ++LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/android
    7.48 ++
    7.49 ++LOCAL_CFLAGS :=
    7.50 ++
    7.51 ++LOCAL_SRC_FILES += \
    7.52 ++    src/framing.c \
    7.53 ++    src/bitwise.c
    7.54 ++
    7.55 ++LOCAL_EXPORT_C_INCLUDES += $(LOCAL_C_INCLUDES)
    7.56 ++
    7.57 ++include $(BUILD_STATIC_LIBRARY)
    7.58 +diff -ruN libogg-1.3.2.orig/macosx/Ogg.xcodeproj/project.pbxproj libogg-1.3.2/macosx/Ogg.xcodeproj/project.pbxproj
    7.59 +--- libogg-1.3.2.orig/macosx/Ogg.xcodeproj/project.pbxproj	2014-05-27 12:52:34.000000000 -0700
    7.60 ++++ libogg-1.3.2/macosx/Ogg.xcodeproj/project.pbxproj	2017-10-22 11:30:36.440344213 -0700
    7.61 +@@ -168,11 +168,19 @@
    7.62   /* Begin PBXProject section */
    7.63   		0867D690FE84028FC02AAC07 /* Project object */ = {
    7.64   			isa = PBXProject;
    7.65  +			attributes = {
    7.66  +			};
    7.67   			buildConfigurationList = 730F235809181A3A00AB638C /* Build configuration list for PBXProject "Ogg" */;
    7.68 - 			compatibilityVersion = "Xcode 2.4";
    7.69 --			developmentRegion = English;
    7.70 ++			compatibilityVersion = "Xcode 2.4";
    7.71  +			developmentRegion = en;
    7.72   			hasScannedForEncodings = 1;
    7.73 - 			knownRegions = (
    7.74 - 				en,
    7.75 -@@ -243,11 +245,10 @@
    7.76 ++			knownRegions = (
    7.77 ++				en,
    7.78 ++			);
    7.79 + 			mainGroup = 0867D691FE84028FC02AAC07 /* Ogg */;
    7.80 + 			productRefGroup = 034768DDFF38A45A11DB9C8B /* Products */;
    7.81 + 			projectDirPath = "";
    7.82 ++			projectRoot = "";
    7.83 + 			targets = (
    7.84 + 				8D07F2BC0486CC7A007CD1D0 /* Ogg */,
    7.85 + 				734FB2E40B18B33E00D561D7 /* libogg (static) */,
    7.86 +@@ -237,9 +245,10 @@
    7.87   		730F235509181A3A00AB638C /* Debug */ = {
    7.88   			isa = XCBuildConfiguration;
    7.89   			buildSettings = {
    7.90 --				ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
    7.91 --				ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
    7.92  +				ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
    7.93   				COPY_PHASE_STRIP = NO;
    7.94 - 				DYLIB_COMPATIBILITY_VERSION = 9.0.0;
    7.95 --				DYLIB_CURRENT_VERSION = 9.1.0;
    7.96 +-				DYLIB_COMPATIBILITY_VERSION = 1;
    7.97 +-				DYLIB_CURRENT_VERSION = 1;
    7.98 ++				DYLIB_COMPATIBILITY_VERSION = 9.0.0;
    7.99  +				DYLIB_CURRENT_VERSION = 9.2.0;
   7.100   				FRAMEWORK_VERSION = A;
   7.101   				GCC_DYNAMIC_NO_PIC = NO;
   7.102   				GCC_ENABLE_FIX_AND_CONTINUE = YES;
   7.103 -@@ -257,7 +258,7 @@
   7.104 +@@ -248,7 +257,10 @@
   7.105 + 				GCC_PREFIX_HEADER = Ogg_Prefix.pch;
   7.106   				INFOPLIST_FILE = Info.plist;
   7.107   				INSTALL_PATH = /Library/Frameworks;
   7.108 - 				LD_DYLIB_INSTALL_NAME = "@rpath/$(EXECUTABLE_PATH)";
   7.109 --				MACOSX_DEPLOYMENT_TARGET = 10.5;
   7.110 ++				LD_DYLIB_INSTALL_NAME = "@rpath/$(EXECUTABLE_PATH)";
   7.111  +				MACOSX_DEPLOYMENT_TARGET = 10.6;
   7.112   				PRODUCT_NAME = Ogg;
   7.113 - 				SDKROOT = macosx;
   7.114 ++				SDKROOT = macosx;
   7.115   				WRAPPER_EXTENSION = framework;
   7.116 -@@ -268,11 +269,10 @@
   7.117 + 				ZERO_LINK = YES;
   7.118 + 			};
   7.119 +@@ -257,9 +269,10 @@
   7.120   		730F235609181A3A00AB638C /* Release */ = {
   7.121   			isa = XCBuildConfiguration;
   7.122   			buildSettings = {
   7.123 --				ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
   7.124 --				ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
   7.125  +				ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
   7.126   				COPY_PHASE_STRIP = YES;
   7.127 - 				DYLIB_COMPATIBILITY_VERSION = 9.0.0;
   7.128 --				DYLIB_CURRENT_VERSION = 9.1.0;
   7.129 +-				DYLIB_COMPATIBILITY_VERSION = 1;
   7.130 +-				DYLIB_CURRENT_VERSION = 1;
   7.131 ++				DYLIB_COMPATIBILITY_VERSION = 9.0.0;
   7.132  +				DYLIB_CURRENT_VERSION = 9.2.0;
   7.133   				FRAMEWORK_VERSION = A;
   7.134   				GCC_ENABLE_FIX_AND_CONTINUE = NO;
   7.135   				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
   7.136 -@@ -281,7 +281,7 @@
   7.137 +@@ -267,7 +280,10 @@
   7.138 + 				GCC_PREFIX_HEADER = Ogg_Prefix.pch;
   7.139   				INFOPLIST_FILE = Info.plist;
   7.140   				INSTALL_PATH = /Library/Frameworks;
   7.141 - 				LD_DYLIB_INSTALL_NAME = "@rpath/$(EXECUTABLE_PATH)";
   7.142 --				MACOSX_DEPLOYMENT_TARGET = 10.5;
   7.143 ++				LD_DYLIB_INSTALL_NAME = "@rpath/$(EXECUTABLE_PATH)";
   7.144  +				MACOSX_DEPLOYMENT_TARGET = 10.6;
   7.145   				PRODUCT_NAME = Ogg;
   7.146 - 				SDKROOT = macosx;
   7.147 ++				SDKROOT = macosx;
   7.148   				WRAPPER_EXTENSION = framework;
   7.149 + 				ZERO_LINK = NO;
   7.150 + 			};
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/external/libogg-1.3.2/Android.mk	Sun Oct 22 12:08:11 2017 -0700
     8.3 @@ -0,0 +1,17 @@
     8.4 +LOCAL_PATH := $(call my-dir)
     8.5 +
     8.6 +include $(CLEAR_VARS)
     8.7 +
     8.8 +LOCAL_MODULE := ogg
     8.9 +
    8.10 +LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/android
    8.11 +
    8.12 +LOCAL_CFLAGS :=
    8.13 +
    8.14 +LOCAL_SRC_FILES += \
    8.15 +    src/framing.c \
    8.16 +    src/bitwise.c
    8.17 +
    8.18 +LOCAL_EXPORT_C_INCLUDES += $(LOCAL_C_INCLUDES)
    8.19 +
    8.20 +include $(BUILD_STATIC_LIBRARY)
     9.1 --- a/external/libvorbisidec-1.2.1.patch	Sun Oct 22 10:48:52 2017 -0700
     9.2 +++ b/external/libvorbisidec-1.2.1.patch	Sun Oct 22 12:08:11 2017 -0700
     9.3 @@ -1,6 +1,42 @@
     9.4 -diff -ruN libvorbisidec-1.2.1/misc.h libvorbisidec-1.2.1.new/misc.h
     9.5 ---- libvorbisidec-1.2.1/misc.h	2013-06-01 21:02:13.000000000 -0700
     9.6 -+++ libvorbisidec-1.2.1.new/misc.h	2013-06-01 21:02:00.000000000 -0700
     9.7 +diff -ruN libvorbisidec-1.2.1.orig/Android.mk libvorbisidec-1.2.1/Android.mk
     9.8 +--- libvorbisidec-1.2.1.orig/Android.mk	1969-12-31 16:00:00.000000000 -0800
     9.9 ++++ libvorbisidec-1.2.1/Android.mk	2017-10-22 11:49:09.948298409 -0700
    9.10 +@@ -0,0 +1,32 @@
    9.11 ++LOCAL_PATH := $(call my-dir)
    9.12 ++
    9.13 ++include $(CLEAR_VARS)
    9.14 ++
    9.15 ++LOCAL_MODULE := vorbisidec
    9.16 ++
    9.17 ++LOCAL_C_INCLUDES :=
    9.18 ++
    9.19 ++LOCAL_CFLAGS :=
    9.20 ++
    9.21 ++ifeq ($(TARGET_ARCH),arm)
    9.22 ++	LOCAL_CFLAGS += -D_ARM_ASSEM_
    9.23 ++endif
    9.24 ++
    9.25 ++LOCAL_SRC_FILES += \
    9.26 ++    mdct.c.arm \
    9.27 ++    block.c \
    9.28 ++    window.c.arm \
    9.29 ++    synthesis.c \
    9.30 ++    info.c \
    9.31 ++    floor1.c.arm \
    9.32 ++    floor0.c.arm \
    9.33 ++    vorbisfile.c.arm \
    9.34 ++    res012.c \
    9.35 ++    mapping0.c \
    9.36 ++    registry.c \
    9.37 ++    codebook.c \
    9.38 ++    sharedbook.c.arm \
    9.39 ++
    9.40 ++LOCAL_SHARED_LIBRARIES := ogg
    9.41 ++
    9.42 ++include $(BUILD_STATIC_LIBRARY)
    9.43 +diff -ruN libvorbisidec-1.2.1.orig/misc.h libvorbisidec-1.2.1/misc.h
    9.44 +--- libvorbisidec-1.2.1.orig/misc.h	2017-10-22 11:25:03.341817045 -0700
    9.45 ++++ libvorbisidec-1.2.1/misc.h	2017-10-12 20:05:06.719770194 -0700
    9.46  @@ -30,6 +30,7 @@
    9.47   
    9.48   #include "asm_arm.h"
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/external/libvorbisidec-1.2.1/Android.mk	Sun Oct 22 12:08:11 2017 -0700
    10.3 @@ -0,0 +1,32 @@
    10.4 +LOCAL_PATH := $(call my-dir)
    10.5 +
    10.6 +include $(CLEAR_VARS)
    10.7 +
    10.8 +LOCAL_MODULE := vorbisidec
    10.9 +
   10.10 +LOCAL_C_INCLUDES :=
   10.11 +
   10.12 +LOCAL_CFLAGS :=
   10.13 +
   10.14 +ifeq ($(TARGET_ARCH),arm)
   10.15 +	LOCAL_CFLAGS += -D_ARM_ASSEM_
   10.16 +endif
   10.17 +
   10.18 +LOCAL_SRC_FILES += \
   10.19 +    mdct.c.arm \
   10.20 +    block.c \
   10.21 +    window.c.arm \
   10.22 +    synthesis.c \
   10.23 +    info.c \
   10.24 +    floor1.c.arm \
   10.25 +    floor0.c.arm \
   10.26 +    vorbisfile.c.arm \
   10.27 +    res012.c \
   10.28 +    mapping0.c \
   10.29 +    registry.c \
   10.30 +    codebook.c \
   10.31 +    sharedbook.c.arm \
   10.32 +
   10.33 +LOCAL_SHARED_LIBRARIES := ogg
   10.34 +
   10.35 +include $(BUILD_STATIC_LIBRARY)
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/external/mpg123-1.25.6.patch	Sun Oct 22 12:08:11 2017 -0700
    11.3 @@ -0,0 +1,2041 @@
    11.4 +diff -ruN mpg123-1.25.6.orig/android/config.h mpg123-1.25.6/android/config.h
    11.5 +--- mpg123-1.25.6.orig/android/config.h	1969-12-31 16:00:00.000000000 -0800
    11.6 ++++ mpg123-1.25.6/android/config.h	2017-10-18 00:55:57.906177396 -0700
    11.7 +@@ -0,0 +1,478 @@
    11.8 ++/* src/config.h.  Generated from config.h.in by configure.  */
    11.9 ++/* src/config.h.in.  Generated from configure.ac by autoheader.  */
   11.10 ++
   11.11 ++/* Define if your architecture wants/needs/can use attribute_align_arg and
   11.12 ++   alignment checks. It is for 32bit x86... */
   11.13 ++/* #undef ABI_ALIGN_FUN */
   11.14 ++
   11.15 ++/* Define to use proper rounding. */
   11.16 ++/* #undef ACCURATE_ROUNDING */
   11.17 ++
   11.18 ++/* Define if building universal (internal helper macro) */
   11.19 ++/* #undef AC_APPLE_UNIVERSAL_BUILD */
   11.20 ++
   11.21 ++/* Define if .balign is present. */
   11.22 ++#define ASMALIGN_BALIGN 1
   11.23 ++
   11.24 ++/* Define if .align just takes byte count. */
   11.25 ++/* #undef ASMALIGN_BYTE */
   11.26 ++
   11.27 ++/* Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. */
   11.28 ++/* #undef ASMALIGN_EXP */
   11.29 ++
   11.30 ++/* Define if __attribute__((aligned(16))) shall be used */
   11.31 ++#define CCALIGN 1
   11.32 ++
   11.33 ++/* Define if debugging is enabled. */
   11.34 ++/* #undef DEBUG */
   11.35 ++
   11.36 ++/* The default audio output module(s) to use */
   11.37 ++#define DEFAULT_OUTPUT_MODULE "oss,esd,pulse"
   11.38 ++
   11.39 ++/* Define if building with dynamcally linked libmpg123 */
   11.40 ++#define DYNAMIC_BUILD 1
   11.41 ++
   11.42 ++/* Use EFBIG as substitude for EOVERFLOW, mingw.org may lack the latter */
   11.43 ++/* #undef EOVERFLOW */
   11.44 ++
   11.45 ++/* Define if FIFO support is enabled. */
   11.46 ++/* #undef FIFO */
   11.47 ++
   11.48 ++/* Define if frame index should be used. */
   11.49 ++#define FRAME_INDEX 1
   11.50 ++
   11.51 ++/* Define if gapless is enabled. */
   11.52 ++#define GAPLESS 1
   11.53 ++
   11.54 ++/* Define to 1 if you have the <alc.h> header file. */
   11.55 ++/* #undef HAVE_ALC_H */
   11.56 ++
   11.57 ++/* Define to 1 if you have the <Alib.h> header file. */
   11.58 ++/* #undef HAVE_ALIB_H */
   11.59 ++
   11.60 ++/* Define to 1 if you have the <AL/alc.h> header file. */
   11.61 ++/* #undef HAVE_AL_ALC_H */
   11.62 ++
   11.63 ++/* Define to 1 if you have the <AL/al.h> header file. */
   11.64 ++/* #undef HAVE_AL_AL_H */
   11.65 ++
   11.66 ++/* Define to 1 if you have the <al.h> header file. */
   11.67 ++/* #undef HAVE_AL_H */
   11.68 ++
   11.69 ++/* Define to 1 if you have the <arpa/inet.h> header file. */
   11.70 ++#define HAVE_ARPA_INET_H 1
   11.71 ++
   11.72 ++/* Define to 1 if you have the <asm/audioio.h> header file. */
   11.73 ++/* #undef HAVE_ASM_AUDIOIO_H */
   11.74 ++
   11.75 ++/* Define to 1 if you have the `atoll' function. */
   11.76 ++#define HAVE_ATOLL 1
   11.77 ++
   11.78 ++/* Define to 1 if you have the <audios.h> header file. */
   11.79 ++/* #undef HAVE_AUDIOS_H */
   11.80 ++
   11.81 ++/* Define to 1 if you have the <AudioToolbox/AudioToolbox.h> header file. */
   11.82 ++/* #undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H */
   11.83 ++
   11.84 ++/* Define to 1 if you have the <AudioUnit/AudioUnit.h> header file. */
   11.85 ++/* #undef HAVE_AUDIOUNIT_AUDIOUNIT_H */
   11.86 ++
   11.87 ++/* Define to 1 if you have the <CoreServices/CoreServices.h> header file. */
   11.88 ++/* #undef HAVE_CORESERVICES_CORESERVICES_H */
   11.89 ++
   11.90 ++/* Define to 1 if you have the <CUlib.h> header file. */
   11.91 ++/* #undef HAVE_CULIB_H */
   11.92 ++
   11.93 ++/* Define to 1 if you have the <dirent.h> header file. */
   11.94 ++#define HAVE_DIRENT_H 1
   11.95 ++
   11.96 ++/* Define to 1 if you have the `dlclose' function. */
   11.97 ++#define HAVE_DLCLOSE 1
   11.98 ++
   11.99 ++/* Define to 1 if you have the <dlfcn.h> header file. */
  11.100 ++#define HAVE_DLFCN_H 1
  11.101 ++
  11.102 ++/* Define to 1 if you have the `dlopen' function. */
  11.103 ++#define HAVE_DLOPEN 1
  11.104 ++
  11.105 ++/* Define to 1 if you have the `dlsym' function. */
  11.106 ++#define HAVE_DLSYM 1
  11.107 ++
  11.108 ++/* Define if getaddrinfo accepts the AI_ADDRCONFIG flag */
  11.109 ++/* #undef HAVE_GAI_ADDRCONFIG */
  11.110 ++
  11.111 ++/* Define to 1 if you have the `getaddrinfo' function. */
  11.112 ++#define HAVE_GETADDRINFO 1
  11.113 ++
  11.114 ++/* Define to 1 if you have the `getpagesize' function. */
  11.115 ++/* #undef HAVE_GETPAGESIZE */
  11.116 ++
  11.117 ++/* Define to 1 if you have the `getuid' function. */
  11.118 ++#define HAVE_GETUID 1
  11.119 ++
  11.120 ++/* Define to 1 if you have the <inttypes.h> header file. */
  11.121 ++#define HAVE_INTTYPES_H 1
  11.122 ++
  11.123 ++/* Define to 1 if you have the <langinfo.h> header file. */
  11.124 ++/* #undef HAVE_LANGINFO_H */
  11.125 ++
  11.126 ++/* Define to 1 if you have the `m' library (-lm). */
  11.127 ++#define HAVE_LIBM 1
  11.128 ++
  11.129 ++/* Define to 1 if you have the `mx' library (-lmx). */
  11.130 ++/* #undef HAVE_LIBMX */
  11.131 ++
  11.132 ++/* Define to 1 if you have the <limits.h> header file. */
  11.133 ++#define HAVE_LIMITS_H 1
  11.134 ++
  11.135 ++/* Define to 1 if you have the <linux/soundcard.h> header file. */
  11.136 ++#define HAVE_LINUX_SOUNDCARD_H 1
  11.137 ++
  11.138 ++/* Define to 1 if you have the <locale.h> header file. */
  11.139 ++#define HAVE_LOCALE_H 1
  11.140 ++
  11.141 ++/* Define to 1 if you have the <machine/soundcard.h> header file. */
  11.142 ++/* #undef HAVE_MACHINE_SOUNDCARD_H */
  11.143 ++
  11.144 ++/* Define to 1 if you have the <memory.h> header file. */
  11.145 ++#define HAVE_MEMORY_H 1
  11.146 ++
  11.147 ++/* Define to 1 if you have the `mkfifo' function. */
  11.148 ++/* #undef HAVE_MKFIFO */
  11.149 ++
  11.150 ++/* Define to 1 if you have a working `mmap' system call. */
  11.151 ++/* #undef HAVE_MMAP */
  11.152 ++
  11.153 ++/* Define to 1 if you have the <netdb.h> header file. */
  11.154 ++#define HAVE_NETDB_H 1
  11.155 ++
  11.156 ++/* Define to 1 if you have the <netinet/in.h> header file. */
  11.157 ++#define HAVE_NETINET_IN_H 1
  11.158 ++
  11.159 ++/* Define to 1 if you have the <netinet/tcp.h> header file. */
  11.160 ++/* #undef HAVE_NETINET_TCP_H */
  11.161 ++
  11.162 ++/* Define to 1 if you have the `nl_langinfo' function. */
  11.163 ++/* #undef HAVE_NL_LANGINFO */
  11.164 ++
  11.165 ++/* Define to 1 if you have the <OpenAL/alc.h> header file. */
  11.166 ++/* #undef HAVE_OPENAL_ALC_H */
  11.167 ++
  11.168 ++/* Define to 1 if you have the <OpenAL/al.h> header file. */
  11.169 ++/* #undef HAVE_OPENAL_AL_H */
  11.170 ++
  11.171 ++/* Define to 1 if you have the <os2me.h> header file. */
  11.172 ++/* #undef HAVE_OS2ME_H */
  11.173 ++
  11.174 ++/* Define to 1 if you have the <os2.h> header file. */
  11.175 ++/* #undef HAVE_OS2_H */
  11.176 ++
  11.177 ++/* Define to 1 if you have the `random' function. */
  11.178 ++/* #undef HAVE_RANDOM */
  11.179 ++
  11.180 ++/* Define to 1 if you have the <sched.h> header file. */
  11.181 ++#define HAVE_SCHED_H 1
  11.182 ++
  11.183 ++/* Define to 1 if you have the `sched_setscheduler' function. */
  11.184 ++#define HAVE_SCHED_SETSCHEDULER 1
  11.185 ++
  11.186 ++/* Define to 1 if you have the `setlocale' function. */
  11.187 ++#define HAVE_SETLOCALE 1
  11.188 ++
  11.189 ++/* Define to 1 if you have the `setpriority' function. */
  11.190 ++#define HAVE_SETPRIORITY 1
  11.191 ++
  11.192 ++/* Define to 1 if you have the `setuid' function. */
  11.193 ++#define HAVE_SETUID 1
  11.194 ++
  11.195 ++/* Define to 1 if you have the <signal.h> header file. */
  11.196 ++#define HAVE_SIGNAL_H 1
  11.197 ++
  11.198 ++/* Define to 1 if you have the <sndio.h> header file. */
  11.199 ++/* #undef HAVE_SNDIO_H */
  11.200 ++
  11.201 ++/* Define to 1 if you have the <stdint.h> header file. */
  11.202 ++#define HAVE_STDINT_H 1
  11.203 ++
  11.204 ++/* Define to 1 if you have the <stdio.h> header file. */
  11.205 ++#define HAVE_STDIO_H 1
  11.206 ++
  11.207 ++/* Define to 1 if you have the <stdlib.h> header file. */
  11.208 ++#define HAVE_STDLIB_H 1
  11.209 ++
  11.210 ++/* Define to 1 if you have the `strerror' function. */
  11.211 ++#define HAVE_STRERROR 1
  11.212 ++
  11.213 ++/* Define to 1 if you have the <strings.h> header file. */
  11.214 ++#define HAVE_STRINGS_H 1
  11.215 ++
  11.216 ++/* Define to 1 if you have the <string.h> header file. */
  11.217 ++#define HAVE_STRING_H 1
  11.218 ++
  11.219 ++/* Define to 1 if you have the <sun/audioio.h> header file. */
  11.220 ++/* #undef HAVE_SUN_AUDIOIO_H */
  11.221 ++
  11.222 ++/* Define to 1 if you have the <sys/audioio.h> header file. */
  11.223 ++/* #undef HAVE_SYS_AUDIOIO_H */
  11.224 ++
  11.225 ++/* Define to 1 if you have the <sys/audio.h> header file. */
  11.226 ++/* #undef HAVE_SYS_AUDIO_H */
  11.227 ++
  11.228 ++/* Define to 1 if you have the <sys/ioctl.h> header file. */
  11.229 ++#define HAVE_SYS_IOCTL_H 1
  11.230 ++
  11.231 ++/* Define to 1 if you have the <sys/param.h> header file. */
  11.232 ++#define HAVE_SYS_PARAM_H 1
  11.233 ++
  11.234 ++/* Define to 1 if you have the <sys/resource.h> header file. */
  11.235 ++#define HAVE_SYS_RESOURCE_H 1
  11.236 ++
  11.237 ++/* Define to 1 if you have the <sys/select.h> header file. */
  11.238 ++#define HAVE_SYS_SELECT_H 1
  11.239 ++
  11.240 ++/* Define to 1 if you have the <sys/signal.h> header file. */
  11.241 ++/* #undef HAVE_SYS_SIGNAL_H */
  11.242 ++
  11.243 ++/* Define to 1 if you have the <sys/socket.h> header file. */
  11.244 ++#define HAVE_SYS_SOCKET_H 1
  11.245 ++
  11.246 ++/* Define to 1 if you have the <sys/soundcard.h> header file. */
  11.247 ++/* #undef HAVE_SYS_SOUNDCARD_H */
  11.248 ++
  11.249 ++/* Define to 1 if you have the <sys/stat.h> header file. */
  11.250 ++#define HAVE_SYS_STAT_H 1
  11.251 ++
  11.252 ++/* Define to 1 if you have the <sys/time.h> header file. */
  11.253 ++#define HAVE_SYS_TIME_H 1
  11.254 ++
  11.255 ++/* Define to 1 if you have the <sys/types.h> header file. */
  11.256 ++#define HAVE_SYS_TYPES_H 1
  11.257 ++
  11.258 ++/* Define to 1 if you have the <sys/wait.h> header file. */
  11.259 ++#define HAVE_SYS_WAIT_H 1
  11.260 ++
  11.261 ++/* Define this if you have the POSIX termios library */
  11.262 ++#define HAVE_TERMIOS 1
  11.263 ++
  11.264 ++/* Define to 1 if you have the <unistd.h> header file. */
  11.265 ++#define HAVE_UNISTD_H 1
  11.266 ++
  11.267 ++/* Define to 1 if you have the <windows.h> header file. */
  11.268 ++/* #undef HAVE_WINDOWS_H */
  11.269 ++
  11.270 ++/* Define to 1 if you have the <ws2tcpip.h> header file. */
  11.271 ++/* #undef HAVE_WS2TCPIP_H */
  11.272 ++
  11.273 ++/* Define to indicate that float storage follows IEEE754. */
  11.274 ++#define IEEE_FLOAT 1
  11.275 ++
  11.276 ++/* size of the frame index seek table */
  11.277 ++#define INDEX_SIZE 1000
  11.278 ++
  11.279 ++/* Define if IPV6 support is enabled. */
  11.280 ++#define IPV6 1
  11.281 ++
  11.282 ++/* Define this to the size of native offset type in bits, used for LFS alias
  11.283 ++   functions. */
  11.284 ++#define LFS_ALIAS_BITS 32
  11.285 ++
  11.286 ++/* Define to the extension used for runtime loadable modules, say, ".so". */
  11.287 ++#define LT_MODULE_EXT ".so"
  11.288 ++
  11.289 ++/* Define to the sub-directory where libtool stores uninstalled libraries. */
  11.290 ++#define LT_OBJDIR ".libs/"
  11.291 ++
  11.292 ++/* Define to the shared library suffix, say, ".dylib". */
  11.293 ++/* #undef LT_SHARED_EXT */
  11.294 ++
  11.295 ++/* Define to the shared archive member specification, say "(shr.o)". */
  11.296 ++/* #undef LT_SHARED_LIB_MEMBER */
  11.297 ++
  11.298 ++/* Define if network support is enabled. */
  11.299 ++#define NETWORK 1
  11.300 ++
  11.301 ++/* Define to disable 16 bit integer output. */
  11.302 ++/* #undef NO_16BIT */
  11.303 ++
  11.304 ++/* Define to disable 32 bit and 24 bit integer output. */
  11.305 ++/* #undef NO_32BIT */
  11.306 ++
  11.307 ++/* Define to disable 8 bit integer output. */
  11.308 ++/* #undef NO_8BIT */
  11.309 ++
  11.310 ++/* Define to disable downsampled decoding. */
  11.311 ++/* #undef NO_DOWNSAMPLE */
  11.312 ++
  11.313 ++/* Define to disable equalizer. */
  11.314 ++/* #undef NO_EQUALIZER */
  11.315 ++
  11.316 ++/* Define to disable error messages in combination with a return value (the
  11.317 ++   return is left intact). */
  11.318 ++/* #undef NO_ERETURN */
  11.319 ++
  11.320 ++/* Define to disable error messages. */
  11.321 ++/* #undef NO_ERRORMSG */
  11.322 ++
  11.323 ++/* Define to disable feeder and buffered readers. */
  11.324 ++/* #undef NO_FEEDER */
  11.325 ++
  11.326 ++/* Define to disable ICY handling. */
  11.327 ++/* #undef NO_ICY */
  11.328 ++
  11.329 ++/* Define to disable ID3v2 parsing. */
  11.330 ++/* #undef NO_ID3V2 */
  11.331 ++
  11.332 ++/* Define to disable layer I. */
  11.333 ++/* #undef NO_LAYER1 */
  11.334 ++
  11.335 ++/* Define to disable layer II. */
  11.336 ++/* #undef NO_LAYER2 */
  11.337 ++
  11.338 ++/* Define to disable layer III. */
  11.339 ++/* #undef NO_LAYER3 */
  11.340 ++
  11.341 ++/* Define to disable ntom resampling. */
  11.342 ++/* #undef NO_NTOM */
  11.343 ++
  11.344 ++/* Define to disable real output. */
  11.345 ++/* #undef NO_REAL */
  11.346 ++
  11.347 ++/* Define to disable string functions. */
  11.348 ++/* #undef NO_STRING */
  11.349 ++
  11.350 ++/* Define for post-processed 32 bit formats. */
  11.351 ++/* #undef NO_SYNTH32 */
  11.352 ++
  11.353 ++/* Define to disable warning messages. */
  11.354 ++/* #undef NO_WARNING */
  11.355 ++
  11.356 ++/* Name of package */
  11.357 ++#define PACKAGE "mpg123"
  11.358 ++
  11.359 ++/* Define to the address where bug reports for this package should be sent. */
  11.360 ++#define PACKAGE_BUGREPORT "maintainer@mpg123.org"
  11.361 ++
  11.362 ++/* Define to the full name of this package. */
  11.363 ++#define PACKAGE_NAME "mpg123"
  11.364 ++
  11.365 ++/* Define to the full name and version of this package. */
  11.366 ++#define PACKAGE_STRING "mpg123 1.25.6"
  11.367 ++
  11.368 ++/* Define to the one symbol short name of this package. */
  11.369 ++#define PACKAGE_TARNAME "mpg123"
  11.370 ++
  11.371 ++/* Define to the home page for this package. */
  11.372 ++#define PACKAGE_URL ""
  11.373 ++
  11.374 ++/* Define to the version of this package. */
  11.375 ++#define PACKAGE_VERSION "1.25.6"
  11.376 ++
  11.377 ++/* Define if portaudio v18 API is wanted. */
  11.378 ++/* #undef PORTAUDIO18 */
  11.379 ++
  11.380 ++/* The size of `int32_t', as computed by sizeof. */
  11.381 ++#define SIZEOF_INT32_T 4
  11.382 ++
  11.383 ++/* The size of `long', as computed by sizeof. */
  11.384 ++#define SIZEOF_LONG 4
  11.385 ++
  11.386 ++/* The size of `off_t', as computed by sizeof. */
  11.387 ++#define SIZEOF_OFF_T 4
  11.388 ++
  11.389 ++/* The size of `size_t', as computed by sizeof. */
  11.390 ++#define SIZEOF_SIZE_T 4
  11.391 ++
  11.392 ++/* The size of `ssize_t', as computed by sizeof. */
  11.393 ++#define SIZEOF_SSIZE_T 4
  11.394 ++
  11.395 ++/* Define to 1 if you have the ANSI C header files. */
  11.396 ++#define STDC_HEADERS 1
  11.397 ++
  11.398 ++/* Define if modules are enabled */
  11.399 ++#define USE_MODULES 1
  11.400 ++
  11.401 ++/* Define for new Huffman decoding scheme. */
  11.402 ++#define USE_NEW_HUFFTABLE 1
  11.403 ++
  11.404 ++/* Define to use yasm for assemble AVX sources. */
  11.405 ++/* #undef USE_YASM_FOR_AVX */
  11.406 ++
  11.407 ++/* Version number of package */
  11.408 ++#define VERSION "1.25.6"
  11.409 ++
  11.410 ++/* Define to use Win32 named pipes */
  11.411 ++/* #undef WANT_WIN32_FIFO */
  11.412 ++
  11.413 ++/* Define to use Win32 sockets */
  11.414 ++/* #undef WANT_WIN32_SOCKETS */
  11.415 ++
  11.416 ++/* Define to use Unicode for Windows */
  11.417 ++/* #undef WANT_WIN32_UNICODE */
  11.418 ++
  11.419 ++/* WinXP and above for ipv6 */
  11.420 ++/* #undef WINVER */
  11.421 ++
  11.422 ++/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
  11.423 ++   significant byte first (like Motorola and SPARC, unlike Intel). */
  11.424 ++#if defined AC_APPLE_UNIVERSAL_BUILD
  11.425 ++# if defined __BIG_ENDIAN__
  11.426 ++#  define WORDS_BIGENDIAN 1
  11.427 ++# endif
  11.428 ++#else
  11.429 ++# ifndef WORDS_BIGENDIAN
  11.430 ++/* #  undef WORDS_BIGENDIAN */
  11.431 ++# endif
  11.432 ++#endif
  11.433 ++
  11.434 ++/* Enable large inode numbers on Mac OS X 10.5.  */
  11.435 ++#ifndef _DARWIN_USE_64_BIT_INODE
  11.436 ++# define _DARWIN_USE_64_BIT_INODE 1
  11.437 ++#endif
  11.438 ++
  11.439 ++/* Number of bits in a file offset, on hosts where this is settable. */
  11.440 ++/* #undef _FILE_OFFSET_BITS */
  11.441 ++
  11.442 ++/* Define for large files, on AIX-style hosts. */
  11.443 ++/* #undef _LARGE_FILES */
  11.444 ++
  11.445 ++/* WinXP and above for ipv6 */
  11.446 ++/* #undef _WIN32_WINNT */
  11.447 ++
  11.448 ++/* Define to empty if `const' does not conform to ANSI C. */
  11.449 ++/* #undef const */
  11.450 ++
  11.451 ++/* Define to `__inline__' or `__inline' if that's what the C compiler
  11.452 ++   calls it, or to nothing if 'inline' is not supported under any name.  */
  11.453 ++#ifndef __cplusplus
  11.454 ++/* #undef inline */
  11.455 ++#endif
  11.456 ++
  11.457 ++/* Define to `short' if <sys/types.h> does not define. */
  11.458 ++/* #undef int16_t */
  11.459 ++
  11.460 ++/* Define to `int' if <sys/types.h> does not define. */
  11.461 ++/* #undef int32_t */
  11.462 ++
  11.463 ++/* Define to `long long' if <sys/types.h> does not define. */
  11.464 ++/* #undef int64_t */
  11.465 ++
  11.466 ++/* Define to the native offset type (long or actually off_t). */
  11.467 ++#define lfs_alias_t off_t
  11.468 ++
  11.469 ++/* Define to `long int' if <sys/types.h> does not define. */
  11.470 ++/* #undef off_t */
  11.471 ++
  11.472 ++/* Define to `unsigned long' if <sys/types.h> does not define. */
  11.473 ++/* #undef size_t */
  11.474 ++
  11.475 ++/* Define to `long' if <sys/types.h> does not define. */
  11.476 ++/* #undef ssize_t */
  11.477 ++
  11.478 ++/* Define to `unsigned short' if <sys/types.h> does not define. */
  11.479 ++/* #undef uint16_t */
  11.480 ++
  11.481 ++/* Define to `unsigned int' if <sys/types.h> does not define. */
  11.482 ++/* #undef uint32_t */
  11.483 ++
  11.484 ++/* Define to `unsigned long' if <sys/types.h> does not define. */
  11.485 ++/* #undef uintptr_t */
  11.486 +diff -ruN mpg123-1.25.6.orig/android/mpg123.h mpg123-1.25.6/android/mpg123.h
  11.487 +--- mpg123-1.25.6.orig/android/mpg123.h	1969-12-31 16:00:00.000000000 -0800
  11.488 ++++ mpg123-1.25.6/android/mpg123.h	2017-10-18 00:57:07.438009786 -0700
  11.489 +@@ -0,0 +1,1441 @@
  11.490 ++/*
  11.491 ++	libmpg123: MPEG Audio Decoder library (version 1.25.6)
  11.492 ++
  11.493 ++	copyright 1995-2015 by the mpg123 project
  11.494 ++	free software under the terms of the LGPL 2.1
  11.495 ++	see COPYING and AUTHORS files in distribution or http://mpg123.org
  11.496 ++*/
  11.497 ++
  11.498 ++#ifndef MPG123_LIB_H
  11.499 ++#define MPG123_LIB_H
  11.500 ++
  11.501 ++#include <fmt123.h>
  11.502 ++
  11.503 ++/** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */
  11.504 ++
  11.505 ++/** A macro to check at compile time which set of API functions to expect.
  11.506 ++ * This should be incremented at least each time a new symbol is added
  11.507 ++ * to the header.
  11.508 ++ */
  11.509 ++#define MPG123_API_VERSION 44
  11.510 ++
  11.511 ++#ifndef MPG123_EXPORT
  11.512 ++/** Defines needed for MS Visual Studio(tm) DLL builds.
  11.513 ++ * Every public function must be prefixed with MPG123_EXPORT. When building 
  11.514 ++ * the DLL ensure to define BUILD_MPG123_DLL. This makes the function accessible
  11.515 ++ * for clients and includes it in the import library which is created together
  11.516 ++ * with the DLL. When consuming the DLL ensure to define LINK_MPG123_DLL which
  11.517 ++ * imports the functions from the DLL. 
  11.518 ++ */
  11.519 ++#ifdef BUILD_MPG123_DLL
  11.520 ++/* The dll exports. */
  11.521 ++#define MPG123_EXPORT __declspec(dllexport)
  11.522 ++#else
  11.523 ++#ifdef LINK_MPG123_DLL
  11.524 ++/* The exe imports. */
  11.525 ++#define MPG123_EXPORT __declspec(dllimport)
  11.526 ++#else
  11.527 ++/* Nothing on normal/UNIX builds */
  11.528 ++#define MPG123_EXPORT
  11.529 ++#endif
  11.530 ++#endif
  11.531 ++#endif
  11.532 ++
  11.533 ++/* This is for Visual Studio, so this header works as distributed in the binary downloads */
  11.534 ++#if defined(_MSC_VER) && !defined(MPG123_DEF_SSIZE_T)
  11.535 ++#define MPG123_DEF_SSIZE_T
  11.536 ++#include <stddef.h>
  11.537 ++typedef ptrdiff_t ssize_t;
  11.538 ++#endif
  11.539 ++
  11.540 ++#ifndef MPG123_NO_CONFIGURE /* Enable use of this file without configure. */
  11.541 ++#include <stdlib.h>
  11.542 ++#include <sys/types.h>
  11.543 ++
  11.544 ++/* Simplified large file handling.
  11.545 ++	I used to have a check here that prevents building for a library with conflicting large file setup
  11.546 ++	(application that uses 32 bit offsets with library that uses 64 bits).
  11.547 ++	While that was perfectly fine in an environment where there is one incarnation of the library,
  11.548 ++	it hurt GNU/Linux and Solaris systems with multilib where the distribution fails to provide the
  11.549 ++	correct header matching the 32 bit library (where large files need explicit support) or
  11.550 ++	the 64 bit library (where there is no distinction).
  11.551 ++
  11.552 ++	New approach: When the app defines _FILE_OFFSET_BITS, it wants non-default large file support,
  11.553 ++	and thus functions with added suffix (mpg123_open_64).
  11.554 ++	Any mismatch will be caught at link time because of the _FILE_OFFSET_BITS setting used when
  11.555 ++	building libmpg123. Plus, there's dual mode large file support in mpg123 since 1.12 now.
  11.556 ++	Link failure is not the expected outcome of any half-sane usage anymore.
  11.557 ++
  11.558 ++	More complication: What about client code defining _LARGEFILE64_SOURCE? It might want direct access to the _64 functions, along with the ones without suffix. Well, that's possible now via defining MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling or enforcing the suffix names.
  11.559 ++*/
  11.560 ++
  11.561 ++/*
  11.562 ++	Now, the renaming of large file aware functions.
  11.563 ++	By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME.
  11.564 ++*/
  11.565 ++#if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX))
  11.566 ++
  11.567 ++/* Need some trickery to concatenate the value(s) of the given macro(s). */
  11.568 ++#define MPG123_MACROCAT_REALLY(a, b) a ## b
  11.569 ++#define MPG123_MACROCAT(a, b) MPG123_MACROCAT_REALLY(a, b)
  11.570 ++#ifndef MPG123_LARGESUFFIX
  11.571 ++#define MPG123_LARGESUFFIX MPG123_MACROCAT(_, _FILE_OFFSET_BITS)
  11.572 ++#endif
  11.573 ++#define MPG123_LARGENAME(func) MPG123_MACROCAT(func, MPG123_LARGESUFFIX)
  11.574 ++
  11.575 ++#define mpg123_open         MPG123_LARGENAME(mpg123_open)
  11.576 ++#define mpg123_open_fd      MPG123_LARGENAME(mpg123_open_fd)
  11.577 ++#define mpg123_open_handle  MPG123_LARGENAME(mpg123_open_handle)
  11.578 ++#define mpg123_framebyframe_decode MPG123_LARGENAME(mpg123_framebyframe_decode)
  11.579 ++#define mpg123_decode_frame MPG123_LARGENAME(mpg123_decode_frame)
  11.580 ++#define mpg123_tell         MPG123_LARGENAME(mpg123_tell)
  11.581 ++#define mpg123_tellframe    MPG123_LARGENAME(mpg123_tellframe)
  11.582 ++#define mpg123_tell_stream  MPG123_LARGENAME(mpg123_tell_stream)
  11.583 ++#define mpg123_seek         MPG123_LARGENAME(mpg123_seek)
  11.584 ++#define mpg123_feedseek     MPG123_LARGENAME(mpg123_feedseek)
  11.585 ++#define mpg123_seek_frame   MPG123_LARGENAME(mpg123_seek_frame)
  11.586 ++#define mpg123_timeframe    MPG123_LARGENAME(mpg123_timeframe)
  11.587 ++#define mpg123_index        MPG123_LARGENAME(mpg123_index)
  11.588 ++#define mpg123_set_index    MPG123_LARGENAME(mpg123_set_index)
  11.589 ++#define mpg123_position     MPG123_LARGENAME(mpg123_position)
  11.590 ++#define mpg123_length       MPG123_LARGENAME(mpg123_length)
  11.591 ++#define mpg123_framelength  MPG123_LARGENAME(mpg123_framelength)
  11.592 ++#define mpg123_set_filesize MPG123_LARGENAME(mpg123_set_filesize)
  11.593 ++#define mpg123_replace_reader MPG123_LARGENAME(mpg123_replace_reader)
  11.594 ++#define mpg123_replace_reader_handle MPG123_LARGENAME(mpg123_replace_reader_handle)
  11.595 ++#define mpg123_framepos MPG123_LARGENAME(mpg123_framepos)
  11.596 ++
  11.597 ++#endif /* largefile hackery */
  11.598 ++
  11.599 ++#endif /* MPG123_NO_CONFIGURE */
  11.600 ++
  11.601 ++#ifdef __cplusplus
  11.602 ++extern "C" {
  11.603 ++#endif
  11.604 ++
  11.605 ++/** \defgroup mpg123_init mpg123 library and handle setup
  11.606 ++ *
  11.607 ++ * Functions to initialise and shutdown the mpg123 library and handles.
  11.608 ++ * The parameters of handles have workable defaults, you only have to tune them when you want to tune something;-)
  11.609 ++ * Tip: Use a RVA setting...
  11.610 ++ *
  11.611 ++ * @{
  11.612 ++ */
  11.613 ++
  11.614 ++/** Opaque structure for the libmpg123 decoder handle. */
  11.615 ++struct mpg123_handle_struct;
  11.616 ++
  11.617 ++/** Opaque structure for the libmpg123 decoder handle.
  11.618 ++ *  Most functions take a pointer to a mpg123_handle as first argument and operate on its data in an object-oriented manner.
  11.619 ++ */
  11.620 ++typedef struct mpg123_handle_struct mpg123_handle;
  11.621 ++
  11.622 ++/** Function to initialise the mpg123 library. 
  11.623 ++ *	This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library.
  11.624 ++ *
  11.625 ++ *	\return MPG123_OK if successful, otherwise an error number.
  11.626 ++ */
  11.627 ++MPG123_EXPORT int mpg123_init(void);
  11.628 ++
  11.629 ++/** Function to close down the mpg123 library. 
  11.630 ++ *	This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. */
  11.631 ++MPG123_EXPORT void mpg123_exit(void);
  11.632 ++
  11.633 ++/** Create a handle with optional choice of decoder (named by a string, see mpg123_decoders() or mpg123_supported_decoders()).
  11.634 ++ *  and optional retrieval of an error code to feed to mpg123_plain_strerror().
  11.635 ++ *  Optional means: Any of or both the parameters may be NULL.
  11.636 ++ *
  11.637 ++ *  \param decoder optional choice of decoder variant (NULL for default)
  11.638 ++ *  \param error optional address to store error codes
  11.639 ++ *  \return Non-NULL pointer to fresh handle when successful.
  11.640 ++ */
  11.641 ++MPG123_EXPORT mpg123_handle *mpg123_new(const char* decoder, int *error);
  11.642 ++
  11.643 ++/** Delete handle, mh is either a valid mpg123 handle or NULL.
  11.644 ++ *  \param mh handle
  11.645 ++ */
  11.646 ++MPG123_EXPORT void mpg123_delete(mpg123_handle *mh);
  11.647 ++
  11.648 ++/** Enumeration of the parameters types that it is possible to set/get. */
  11.649 ++enum mpg123_parms
  11.650 ++{
  11.651 ++	MPG123_VERBOSE = 0,        /**< set verbosity value for enabling messages to stderr, >= 0 makes sense (integer) */
  11.652 ++	MPG123_FLAGS,          /**< set all flags, p.ex val = MPG123_GAPLESS|MPG123_MONO_MIX (integer) */
  11.653 ++	MPG123_ADD_FLAGS,      /**< add some flags (integer) */
  11.654 ++	MPG123_FORCE_RATE,     /**< when value > 0, force output rate to that value (integer) */
  11.655 ++	MPG123_DOWN_SAMPLE,    /**< 0=native rate, 1=half rate, 2=quarter rate (integer) */
  11.656 ++	MPG123_RVA,            /**< one of the RVA choices above (integer) */
  11.657 ++	MPG123_DOWNSPEED,      /**< play a frame N times (integer) */
  11.658 ++	MPG123_UPSPEED,        /**< play every Nth frame (integer) */
  11.659 ++	MPG123_START_FRAME,    /**< start with this frame (skip frames before that, integer) */ 
  11.660 ++	MPG123_DECODE_FRAMES,  /**< decode only this number of frames (integer) */
  11.661 ++	MPG123_ICY_INTERVAL,   /**< stream contains ICY metadata with this interval (integer) */
  11.662 ++	MPG123_OUTSCALE,       /**< the scale for output samples (amplitude - integer or float according to mpg123 output format, normally integer) */
  11.663 ++	MPG123_TIMEOUT,        /**< timeout for reading from a stream (not supported on win32, integer) */
  11.664 ++	MPG123_REMOVE_FLAGS,   /**< remove some flags (inverse of MPG123_ADD_FLAGS, integer) */
  11.665 ++	MPG123_RESYNC_LIMIT,   /**< Try resync on frame parsing for that many bytes or until end of stream (<0 ... integer). This can enlarge the limit for skipping junk on beginning, too (but not reduce it).  */
  11.666 ++	MPG123_INDEX_SIZE      /**< Set the frame index size (if supported). Values <0 mean that the index is allowed to grow dynamically in these steps (in positive direction, of course) -- Use this when you really want a full index with every individual frame. */
  11.667 ++	,MPG123_PREFRAMES /**< Decode/ignore that many frames in advance for layer 3. This is needed to fill bit reservoir after seeking, for example (but also at least one frame in advance is needed to have all "normal" data for layer 3). Give a positive integer value, please.*/
  11.668 ++	,MPG123_FEEDPOOL  /**< For feeder mode, keep that many buffers in a pool to avoid frequent malloc/free. The pool is allocated on mpg123_open_feed(). If you change this parameter afterwards, you can trigger growth and shrinkage during decoding. The default value could change any time. If you care about this, then set it. (integer) */
  11.669 ++	,MPG123_FEEDBUFFER /**< Minimal size of one internal feeder buffer, again, the default value is subject to change. (integer) */
  11.670 ++};
  11.671 ++
  11.672 ++/** Flag bits for MPG123_FLAGS, use the usual binary or to combine. */
  11.673 ++enum mpg123_param_flags
  11.674 ++{
  11.675 ++	 MPG123_FORCE_MONO   = 0x7  /**<     0111 Force some mono mode: This is a test bitmask for seeing if any mono forcing is active. */
  11.676 ++	,MPG123_MONO_LEFT    = 0x1  /**<     0001 Force playback of left channel only.  */
  11.677 ++	,MPG123_MONO_RIGHT   = 0x2  /**<     0010 Force playback of right channel only. */
  11.678 ++	,MPG123_MONO_MIX     = 0x4  /**<     0100 Force playback of mixed mono.         */
  11.679 ++	,MPG123_FORCE_STEREO = 0x8  /**<     1000 Force stereo output.                  */
  11.680 ++	,MPG123_FORCE_8BIT   = 0x10 /**< 00010000 Force 8bit formats.                   */
  11.681 ++	,MPG123_QUIET        = 0x20 /**< 00100000 Suppress any printouts (overrules verbose).                    */
  11.682 ++	,MPG123_GAPLESS      = 0x40 /**< 01000000 Enable gapless decoding (default on if libmpg123 has support). */
  11.683 ++	,MPG123_NO_RESYNC    = 0x80 /**< 10000000 Disable resync stream after error.                             */
  11.684 ++	,MPG123_SEEKBUFFER   = 0x100 /**< 000100000000 Enable small buffer on non-seekable streams to allow some peek-ahead (for better MPEG sync). */
  11.685 ++	,MPG123_FUZZY        = 0x200 /**< 001000000000 Enable fuzzy seeks (guessing byte offsets or using approximate seek points from Xing TOC) */
  11.686 ++	,MPG123_FORCE_FLOAT  = 0x400 /**< 010000000000 Force floating point output (32 or 64 bits depends on mpg123 internal precision). */
  11.687 ++	,MPG123_PLAIN_ID3TEXT = 0x800 /**< 100000000000 Do not translate ID3 text data to UTF-8. ID3 strings will contain the raw text data, with the first byte containing the ID3 encoding code. */
  11.688 ++	,MPG123_IGNORE_STREAMLENGTH = 0x1000 /**< 1000000000000 Ignore any stream length information contained in the stream, which can be contained in a 'TLEN' frame of an ID3v2 tag or a Xing tag */
  11.689 ++	,MPG123_SKIP_ID3V2 = 0x2000 /**< 10 0000 0000 0000 Do not parse ID3v2 tags, just skip them. */
  11.690 ++	,MPG123_IGNORE_INFOFRAME = 0x4000 /**< 100 0000 0000 0000 Do not parse the LAME/Xing info frame, treat it as normal MPEG data. */
  11.691 ++	,MPG123_AUTO_RESAMPLE = 0x8000 /**< 1000 0000 0000 0000 Allow automatic internal resampling of any kind (default on if supported). Especially when going lowlevel with replacing output buffer, you might want to unset this flag. Setting MPG123_DOWNSAMPLE or MPG123_FORCE_RATE will override this. */
  11.692 ++	,MPG123_PICTURE = 0x10000 /**< 17th bit: Enable storage of pictures from tags (ID3v2 APIC). */
  11.693 ++	,MPG123_NO_PEEK_END    = 0x20000 /**< 18th bit: Do not seek to the end of
  11.694 ++	 *  the stream in order to probe
  11.695 ++	 *  the stream length and search for the id3v1 field. This also means
  11.696 ++	 *  the file size is unknown unless set using mpg123_set_filesize() and
  11.697 ++	 *  the stream is assumed as non-seekable unless overridden.
  11.698 ++	 */
  11.699 ++	,MPG123_FORCE_SEEKABLE = 0x40000 /**< 19th bit: Force the stream to be seekable. */
  11.700 ++};
  11.701 ++
  11.702 ++/** choices for MPG123_RVA */
  11.703 ++enum mpg123_param_rva
  11.704 ++{
  11.705 ++	 MPG123_RVA_OFF   = 0 /**< RVA disabled (default).   */
  11.706 ++	,MPG123_RVA_MIX   = 1 /**< Use mix/track/radio gain. */
  11.707 ++	,MPG123_RVA_ALBUM = 2 /**< Use album/audiophile gain */
  11.708 ++	,MPG123_RVA_MAX   = MPG123_RVA_ALBUM /**< The maximum RVA code, may increase in future. */
  11.709 ++};
  11.710 ++
  11.711 ++/** Set a specific parameter, for a specific mpg123_handle, using a parameter 
  11.712 ++ *  type key chosen from the mpg123_parms enumeration, to the specified value.
  11.713 ++ *  \param mh handle
  11.714 ++ *  \param type parameter choice
  11.715 ++ *  \param value integer value
  11.716 ++ *  \param fvalue floating point value
  11.717 ++ *  \return MPG123_OK on success
  11.718 ++ */
  11.719 ++MPG123_EXPORT int mpg123_param( mpg123_handle *mh
  11.720 ++,	enum mpg123_parms type, long value, double fvalue );
  11.721 ++
  11.722 ++/** Get a specific parameter, for a specific mpg123_handle. 
  11.723 ++ *  See the mpg123_parms enumeration for a list of available parameters.
  11.724 ++ *  \param mh handle
  11.725 ++ *  \param type parameter choice
  11.726 ++ *  \param value integer value return address
  11.727 ++ *  \param fvalue floating point value return address
  11.728 ++ *  \return MPG123_OK on success
  11.729 ++ */
  11.730 ++MPG123_EXPORT int mpg123_getparam( mpg123_handle *mh
  11.731 ++,	enum mpg123_parms type, long *value, double *fvalue );
  11.732 ++
  11.733 ++/** Feature set available for query with mpg123_feature. */
  11.734 ++enum mpg123_feature_set
  11.735 ++{
  11.736 ++	 MPG123_FEATURE_ABI_UTF8OPEN = 0     /**< mpg123 expects path names to be given in UTF-8 encoding instead of plain native. */
  11.737 ++	,MPG123_FEATURE_OUTPUT_8BIT          /**< 8bit output   */
  11.738 ++	,MPG123_FEATURE_OUTPUT_16BIT         /**< 16bit output  */
  11.739 ++	,MPG123_FEATURE_OUTPUT_32BIT         /**< 32bit output  */
  11.740 ++	,MPG123_FEATURE_INDEX                /**< support for building a frame index for accurate seeking */
  11.741 ++	,MPG123_FEATURE_PARSE_ID3V2          /**< id3v2 parsing */
  11.742 ++	,MPG123_FEATURE_DECODE_LAYER1        /**< mpeg layer-1 decoder enabled */
  11.743 ++	,MPG123_FEATURE_DECODE_LAYER2        /**< mpeg layer-2 decoder enabled */
  11.744 ++	,MPG123_FEATURE_DECODE_LAYER3        /**< mpeg layer-3 decoder enabled */
  11.745 ++	,MPG123_FEATURE_DECODE_ACCURATE      /**< accurate decoder rounding    */
  11.746 ++	,MPG123_FEATURE_DECODE_DOWNSAMPLE    /**< downsample (sample omit)     */
  11.747 ++	,MPG123_FEATURE_DECODE_NTOM          /**< flexible rate decoding       */
  11.748 ++	,MPG123_FEATURE_PARSE_ICY            /**< ICY support                  */
  11.749 ++	,MPG123_FEATURE_TIMEOUT_READ         /**< Reader with timeout (network). */
  11.750 ++	,MPG123_FEATURE_EQUALIZER            /**< tunable equalizer */
  11.751 ++};
  11.752 ++
  11.753 ++/** Query libmpg123 features.
  11.754 ++ *  \param key feature selection
  11.755 ++ *  \return 1 for success, 0 for unimplemented functions
  11.756 ++ */
  11.757 ++MPG123_EXPORT int mpg123_feature(const enum mpg123_feature_set key);
  11.758 ++
  11.759 ++/* @} */
  11.760 ++
  11.761 ++
  11.762 ++/** \defgroup mpg123_error mpg123 error handling
  11.763 ++ *
  11.764 ++ * Functions to get text version of the error numbers and an enumeration
  11.765 ++ * of the error codes returned by libmpg123.
  11.766 ++ *
  11.767 ++ * Most functions operating on a mpg123_handle simply return MPG123_OK (0)
  11.768 ++ * on success and MPG123_ERR (-1) on failure, setting the internal error
  11.769 ++ * variable of the handle to the specific error code. If there was not a valid
  11.770 ++ * (non-NULL) handle provided to a function operating on one, MPG123_BAD_HANDLE
  11.771 ++ * may be returned if this can not be confused with a valid positive return
  11.772 ++ * value.
  11.773 ++ * Meaning: A function expected to return positive integers on success will
  11.774 ++ * always indicate error or a special condition by returning a negative one.
  11.775 ++ *
  11.776 ++ * Decoding/seek functions may also return message codes MPG123_DONE,
  11.777 ++ * MPG123_NEW_FORMAT and MPG123_NEED_MORE (all negative, see below on how to
  11.778 ++ * react). Note that calls to those can be nested, so generally watch out
  11.779 ++ * for these codes after initial handle setup.
  11.780 ++ * Especially any function that needs information about the current stream
  11.781 ++ * to work will try to at least parse the beginning if that did not happen
  11.782 ++ * yet.
  11.783 ++ *
  11.784 ++ * On a function that is supposed to return MPG123_OK on success and
  11.785 ++ * MPG123_ERR on failure, make sure you check for != MPG123_OK, not
  11.786 ++ * == MPG123_ERR, as the error code could get more specific in future,
  11.787 ++ * or there is just a special message from a decoding routine as indicated
  11.788 ++ * above.
  11.789 ++ *
  11.790 ++ * @{
  11.791 ++ */
  11.792 ++
  11.793 ++/** Enumeration of the message and error codes and returned by libmpg123 functions. */
  11.794 ++enum mpg123_errors
  11.795 ++{
  11.796 ++	MPG123_DONE=-12,	/**< Message: Track ended. Stop decoding. */
  11.797 ++	MPG123_NEW_FORMAT=-11,	/**< Message: Output format will be different on next call. Note that some libmpg123 versions between 1.4.3 and 1.8.0 insist on you calling mpg123_getformat() after getting this message code. Newer verisons behave like advertised: You have the chance to call mpg123_getformat(), but you can also just continue decoding and get your data. */
  11.798 ++	MPG123_NEED_MORE=-10,	/**< Message: For feed reader: "Feed me more!" (call mpg123_feed() or mpg123_decode() with some new input data). */
  11.799 ++	MPG123_ERR=-1,			/**< Generic Error */
  11.800 ++	MPG123_OK=0, 			/**< Success */
  11.801 ++	MPG123_BAD_OUTFORMAT, 	/**< Unable to set up output format! */
  11.802 ++	MPG123_BAD_CHANNEL,		/**< Invalid channel number specified. */
  11.803 ++	MPG123_BAD_RATE,		/**< Invalid sample rate specified.  */
  11.804 ++	MPG123_ERR_16TO8TABLE,	/**< Unable to allocate memory for 16 to 8 converter table! */
  11.805 ++	MPG123_BAD_PARAM,		/**< Bad parameter id! */
  11.806 ++	MPG123_BAD_BUFFER,		/**< Bad buffer given -- invalid pointer or too small size. */
  11.807 ++	MPG123_OUT_OF_MEM,		/**< Out of memory -- some malloc() failed. */
  11.808 ++	MPG123_NOT_INITIALIZED,	/**< You didn't initialize the library! */
  11.809 ++	MPG123_BAD_DECODER,		/**< Invalid decoder choice. */
  11.810 ++	MPG123_BAD_HANDLE,		/**< Invalid mpg123 handle. */
  11.811 ++	MPG123_NO_BUFFERS,		/**< Unable to initialize frame buffers (out of memory?). */
  11.812 ++	MPG123_BAD_RVA,			/**< Invalid RVA mode. */
  11.813 ++	MPG123_NO_GAPLESS,		/**< This build doesn't support gapless decoding. */
  11.814 ++	MPG123_NO_SPACE,		/**< Not enough buffer space. */
  11.815 ++	MPG123_BAD_TYPES,		/**< Incompatible numeric data types. */
  11.816 ++	MPG123_BAD_BAND,		/**< Bad equalizer band. */
  11.817 ++	MPG123_ERR_NULL,		/**< Null pointer given where valid storage address needed. */
  11.818 ++	MPG123_ERR_READER,		/**< Error reading the stream. */
  11.819 ++	MPG123_NO_SEEK_FROM_END,/**< Cannot seek from end (end is not known). */
  11.820 ++	MPG123_BAD_WHENCE,		/**< Invalid 'whence' for seek function.*/
  11.821 ++	MPG123_NO_TIMEOUT,		/**< Build does not support stream timeouts. */
  11.822 ++	MPG123_BAD_FILE,		/**< File access error. */
  11.823 ++	MPG123_NO_SEEK,			/**< Seek not supported by stream. */
  11.824 ++	MPG123_NO_READER,		/**< No stream opened. */
  11.825 ++	MPG123_BAD_PARS,		/**< Bad parameter handle. */
  11.826 ++	MPG123_BAD_INDEX_PAR,	/**< Bad parameters to mpg123_index() and mpg123_set_index() */
  11.827 ++	MPG123_OUT_OF_SYNC,	/**< Lost track in bytestream and did not try to resync. */
  11.828 ++	MPG123_RESYNC_FAIL,	/**< Resync failed to find valid MPEG data. */
  11.829 ++	MPG123_NO_8BIT,	/**< No 8bit encoding possible. */
  11.830 ++	MPG123_BAD_ALIGN,	/**< Stack aligmnent error */
  11.831 ++	MPG123_NULL_BUFFER,	/**< NULL input buffer with non-zero size... */
  11.832 ++	MPG123_NO_RELSEEK,	/**< Relative seek not possible (screwed up file offset) */
  11.833 ++	MPG123_NULL_POINTER, /**< You gave a null pointer somewhere where you shouldn't have. */
  11.834 ++	MPG123_BAD_KEY,	/**< Bad key value given. */
  11.835 ++	MPG123_NO_INDEX,	/**< No frame index in this build. */
  11.836 ++	MPG123_INDEX_FAIL,	/**< Something with frame index went wrong. */
  11.837 ++	MPG123_BAD_DECODER_SETUP,	/**< Something prevents a proper decoder setup */
  11.838 ++	MPG123_MISSING_FEATURE  /**< This feature has not been built into libmpg123. */
  11.839 ++	,MPG123_BAD_VALUE /**< A bad value has been given, somewhere. */
  11.840 ++	,MPG123_LSEEK_FAILED /**< Low-level seek failed. */
  11.841 ++	,MPG123_BAD_CUSTOM_IO /**< Custom I/O not prepared. */
  11.842 ++	,MPG123_LFS_OVERFLOW /**< Offset value overflow during translation of large file API calls -- your client program cannot handle that large file. */
  11.843 ++	,MPG123_INT_OVERFLOW /**< Some integer overflow. */
  11.844 ++};
  11.845 ++
  11.846 ++/** Look up error strings given integer code.
  11.847 ++ *  \param errcode integer error code
  11.848 ++ *  \return string describing what that error error code means
  11.849 ++ */
  11.850 ++MPG123_EXPORT const char* mpg123_plain_strerror(int errcode);
  11.851 ++
  11.852 ++/** Give string describing what error has occured in the context of handle mh.
  11.853 ++ *  When a function operating on an mpg123 handle returns MPG123_ERR, you should check for the actual reason via
  11.854 ++ *  char *errmsg = mpg123_strerror(mh)
  11.855 ++ *  This function will catch mh == NULL and return the message for MPG123_BAD_HANDLE.
  11.856 ++ *  \param mh handle
  11.857 ++ *  \return error message
  11.858 ++ */
  11.859 ++MPG123_EXPORT const char* mpg123_strerror(mpg123_handle *mh);
  11.860 ++
  11.861 ++/** Return the plain errcode intead of a string.
  11.862 ++ *  \param mh handle
  11.863 ++ *  \return error code recorded in handle or MPG123_BAD_HANDLE
  11.864 ++ */
  11.865 ++MPG123_EXPORT int mpg123_errcode(mpg123_handle *mh);
  11.866 ++
  11.867 ++/*@}*/
  11.868 ++
  11.869 ++
  11.870 ++/** \defgroup mpg123_decoder mpg123 decoder selection
  11.871 ++ *
  11.872 ++ * Functions to list and select the available decoders.
  11.873 ++ * Perhaps the most prominent feature of mpg123: You have several (optimized) decoders to choose from (on x86 and PPC (MacOS) systems, that is).
  11.874 ++ *
  11.875 ++ * @{
  11.876 ++ */
  11.877 ++
  11.878 ++/** Get available decoder list.
  11.879 ++ *  \return NULL-terminated array of generally available decoder names (plain 8bit ASCII)
  11.880 ++ */
  11.881 ++MPG123_EXPORT const char **mpg123_decoders(void);
  11.882 ++
  11.883 ++/** Get supported decoder list.
  11.884 ++ *  \return NULL-terminated array of the decoders supported by the CPU (plain 8bit ASCII)
  11.885 ++ */
  11.886 ++MPG123_EXPORT const char **mpg123_supported_decoders(void);
  11.887 ++
  11.888 ++/** Set the active decoder.
  11.889 ++ *  \param mh handle
  11.890 ++ *  \param decoder_name name of decoder
  11.891 ++ *  \return MPG123_OK on success
  11.892 ++ */
  11.893 ++MPG123_EXPORT int mpg123_decoder(mpg123_handle *mh, const char* decoder_name);
  11.894 ++
  11.895 ++/** Get the currently active decoder name.
  11.896 ++ *  The active decoder engine can vary depening on output constraints,
  11.897 ++ *  mostly non-resampling, integer output is accelerated via 3DNow & Co. but for
  11.898 ++ *  other modes a fallback engine kicks in.
  11.899 ++ *  Note that this can return a decoder that is only active in the hidden and not
  11.900 ++ *  available as decoder choice from the outside.
  11.901 ++ *  \param mh handle
  11.902 ++ *  \return The decoder name or NULL on error.
  11.903 ++ */
  11.904 ++MPG123_EXPORT const char* mpg123_current_decoder(mpg123_handle *mh);
  11.905 ++
  11.906 ++/*@}*/
  11.907 ++
  11.908 ++
  11.909 ++/** \defgroup mpg123_output mpg123 output audio format 
  11.910 ++ *
  11.911 ++ * Functions to get and select the format of the decoded audio.
  11.912 ++ *
  11.913 ++ * Before you dive in, please be warned that you might get confused by this. This seems to happen a lot, therefore I am trying to explain in advance.
  11.914 ++ *
  11.915 ++ * The mpg123 library decides what output format to use when encountering the first frame in a stream, or actually any frame that is still valid but differs from the frames before in the prompted output format. At such a deciding point, an internal table of allowed encodings, sampling rates and channel setups is consulted. According to this table, an output format is chosen and the decoding engine set up accordingly (including optimized routines for different output formats). This might seem unusual but it just follows from the non-existence of "MPEG audio files" with defined overall properties. There are streams, streams are concatenations of (semi) independent frames. We store streams on disk and call them "MPEG audio files", but that does not change their nature as the decoder is concerned (the LAME/Xing header for gapless decoding makes things interesting again).
  11.916 ++ *
  11.917 ++ * To get to the point: What you do with mpg123_format() and friends is to fill the internal table of allowed formats before it is used. That includes removing support for some formats or adding your forced sample rate (see MPG123_FORCE_RATE) that will be used with the crude internal resampler. Also keep in mind that the sample encoding is just a question of choice -- the MPEG frames do only indicate their native sampling rate and channel count. If you want to decode to integer or float samples, 8 or 16 bit ... that is your decision. In a "clean" world, libmpg123 would always decode to 32 bit float and let you handle any sample conversion. But there are optimized routines that work faster by directly decoding to the desired encoding / accuracy. We prefer efficiency over conceptual tidyness.
  11.918 ++ *
  11.919 ++ * People often start out thinking that mpg123_format() should change the actual decoding format on the fly. That is wrong. It only has effect on the next natural change of output format, when libmpg123 will consult its format table again. To make life easier, you might want to call mpg123_format_none() before any thing else and then just allow one desired encoding and a limited set of sample rates / channel choices that you actually intend to deal with. You can force libmpg123 to decode everything to 44100 KHz, stereo, 16 bit integer ... it will duplicate mono channels and even do resampling if needed (unless that feature is disabled in the build, same with some encodings). But I have to stress that the resampling of libmpg123 is very crude and doesn't even contain any kind of "proper" interpolation.
  11.920 ++ *
  11.921 ++ * In any case, watch out for MPG123_NEW_FORMAT as return message from decoding routines and call mpg123_getformat() to get the currently active output format.
  11.922 ++ *
  11.923 ++ * @{
  11.924 ++ */
  11.925 ++
  11.926 ++/** They can be combined into one number (3) to indicate mono and stereo... */
  11.927 ++enum mpg123_channelcount
  11.928 ++{
  11.929 ++	 MPG123_MONO   = 1 /**< mono */
  11.930 ++	,MPG123_STEREO = 2 /**< stereo */
  11.931 ++};
  11.932 ++
  11.933 ++/** An array of supported standard sample rates
  11.934 ++ *  These are possible native sample rates of MPEG audio files.
  11.935 ++ *  You can still force mpg123 to resample to a different one, but by default you will only get audio in one of these samplings.
  11.936 ++ *  \param list Store a pointer to the sample rates array there.
  11.937 ++ *  \param number Store the number of sample rates there. */
  11.938 ++MPG123_EXPORT void mpg123_rates(const long **list, size_t *number);
  11.939 ++
  11.940 ++/** An array of supported audio encodings.
  11.941 ++ *  An audio encoding is one of the fully qualified members of mpg123_enc_enum (MPG123_ENC_SIGNED_16, not MPG123_SIGNED).
  11.942 ++ *  \param list Store a pointer to the encodings array there.
  11.943 ++ *  \param number Store the number of encodings there. */
  11.944 ++MPG123_EXPORT void mpg123_encodings(const int **list, size_t *number);
  11.945 ++
  11.946 ++/** Return the size (in bytes) of one mono sample of the named encoding.
  11.947 ++ * \param encoding The encoding value to analyze.
  11.948 ++ * \return positive size of encoding in bytes, 0 on invalid encoding. */
  11.949 ++MPG123_EXPORT int mpg123_encsize(int encoding);
  11.950 ++
  11.951 ++/** Configure a mpg123 handle to accept no output format at all, 
  11.952 ++ *  use before specifying supported formats with mpg123_format
  11.953 ++ *  \param mh handle
  11.954 ++ *  \return MPG123_OK on success
  11.955 ++ */
  11.956 ++MPG123_EXPORT int mpg123_format_none(mpg123_handle *mh);
  11.957 ++
  11.958 ++/** Configure mpg123 handle to accept all formats 
  11.959 ++ *  (also any custom rate you may set) -- this is default.
  11.960 ++ *  \param mh handle
  11.961 ++ *  \return MPG123_OK on success
  11.962 ++ */
  11.963 ++MPG123_EXPORT int mpg123_format_all(mpg123_handle *mh);
  11.964 ++
  11.965 ++/** Set the audio format support of a mpg123_handle in detail:
  11.966 ++ *  \param mh handle
  11.967 ++ *  \param rate The sample rate value (in Hertz).
  11.968 ++ *  \param channels A combination of MPG123_STEREO and MPG123_MONO.
  11.969 ++ *  \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16 | MPG123_ENC_ULAW_8 (or 0 for no support). Please note that some encodings may not be supported in the library build and thus will be ignored here.
  11.970 ++ *  \return MPG123_OK on success, MPG123_ERR if there was an error. */
  11.971 ++MPG123_EXPORT int mpg123_format( mpg123_handle *mh
  11.972 ++,	long rate, int channels, int encodings );
  11.973 ++
  11.974 ++/** Check to see if a specific format at a specific rate is supported 
  11.975 ++ *  by mpg123_handle.
  11.976 ++ *  \param mh handle
  11.977 ++ *  \param rate sampling rate
  11.978 ++ *  \param encoding encoding
  11.979 ++ *  \return 0 for no support (that includes invalid parameters), MPG123_STEREO, 
  11.980 ++ *          MPG123_MONO or MPG123_STEREO|MPG123_MONO. */
  11.981 ++MPG123_EXPORT int mpg123_format_support( mpg123_handle *mh
  11.982 ++,	long rate, int encoding );
  11.983 ++
  11.984 ++/** Get the current output format written to the addresses given.
  11.985 ++ *  If the stream is freshly loaded, this will try to parse enough
  11.986 ++ *  of it to give you the format to come. This clears the flag that
  11.987 ++ *  would otherwise make the first decoding call return
  11.988 ++ *  MPG123_NEW_FORMAT.
  11.989 ++ *  \param mh handle
  11.990 ++ *  \param rate sampling rate return address
  11.991 ++ *  \param channels channel count return address
  11.992 ++ *  \param encoding encoding return address
  11.993 ++ *  \return MPG123_OK on success
  11.994 ++ */
  11.995 ++MPG123_EXPORT int mpg123_getformat( mpg123_handle *mh
  11.996 ++,	long *rate, int *channels, int *encoding );
  11.997 ++
  11.998 ++/** Get the current output format written to the addresses given.
  11.999 ++ *  This differs from plain mpg123_getformat() in that you can choose
 11.1000 ++ *  _not_ to clear the flag that would trigger the next decoding call
 11.1001 ++ *  to return MPG123_NEW_FORMAT in case of a new format arriving.
 11.1002 ++ *  \param mh handle
 11.1003 ++ *  \param rate sampling rate return address
 11.1004 ++ *  \param channels channel count return address
 11.1005 ++ *  \param encoding encoding return address
 11.1006 ++ *  \param clear_flag if true, clear internal format flag
 11.1007 ++ *  \return MPG123_OK on success
 11.1008 ++ */
 11.1009 ++MPG123_EXPORT int mpg123_getformat2( mpg123_handle *mh
 11.1010 ++,	long *rate, int *channels, int *encoding, int clear_flag );
 11.1011 ++
 11.1012 ++/*@}*/
 11.1013 ++
 11.1014 ++
 11.1015 ++/** \defgroup mpg123_input mpg123 file input and decoding
 11.1016 ++ *
 11.1017 ++ * Functions for input bitstream and decoding operations.
 11.1018 ++ * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!).
 11.1019 ++ * @{
 11.1020 ++ */
 11.1021 ++
 11.1022 ++/* reading samples / triggering decoding, possible return values: */
 11.1023 ++/** Enumeration of the error codes returned by libmpg123 functions. */
 11.1024 ++
 11.1025 ++/** Open and prepare to decode the specified file by filesystem path.
 11.1026 ++ *  This does not open HTTP urls; libmpg123 contains no networking code.
 11.1027 ++ *  If you want to decode internet streams, use mpg123_open_fd() or mpg123_open_feed().
 11.1028 ++ *  \param mh handle
 11.1029 ++ *  \param path filesystem path
 11.1030 ++ *  \return MPG123_OK on success
 11.1031 ++ */
 11.1032 ++MPG123_EXPORT int mpg123_open(mpg123_handle *mh, const char *path);
 11.1033 ++
 11.1034 ++/** Use an already opened file descriptor as the bitstream input
 11.1035 ++ *  mpg123_close() will _not_ close the file descriptor.
 11.1036 ++ *  \param mh handle
 11.1037 ++ *  \param fd file descriptor
 11.1038 ++ *  \return MPG123_OK on success
 11.1039 ++ */
 11.1040 ++MPG123_EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd);
 11.1041 ++
 11.1042 ++/** Use an opaque handle as bitstream input. This works only with the
 11.1043 ++ *  replaced I/O from mpg123_replace_reader_handle()!
 11.1044 ++ *  mpg123_close() will call the cleanup callback for your handle (if you gave one).
 11.1045 ++ *  \param mh handle
 11.1046 ++ *  \param iohandle your handle
 11.1047 ++ *  \return MPG123_OK on success
 11.1048 ++ */
 11.1049 ++MPG123_EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle);
 11.1050 ++
 11.1051 ++/** Open a new bitstream and prepare for direct feeding
 11.1052 ++ *  This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream.
 11.1053 ++ *  \param mh handle
 11.1054 ++ *  \return MPG123_OK on success
 11.1055 ++ */
 11.1056 ++MPG123_EXPORT int mpg123_open_feed(mpg123_handle *mh);
 11.1057 ++
 11.1058 ++/** Closes the source, if libmpg123 opened it.
 11.1059 ++ *  \param mh handle
 11.1060 ++ *  \return MPG123_OK on success
 11.1061 ++ */
 11.1062 ++MPG123_EXPORT int mpg123_close(mpg123_handle *mh);
 11.1063 ++
 11.1064 ++/** Read from stream and decode up to outmemsize bytes.
 11.1065 ++ *  \param mh handle
 11.1066 ++ *  \param outmemory address of output buffer to write to
 11.1067 ++ *  \param outmemsize maximum number of bytes to write
 11.1068 ++ *  \param done address to store the number of actually decoded bytes to
 11.1069 ++ *  \return MPG123_OK or error/message code
 11.1070 ++ */
 11.1071 ++MPG123_EXPORT int mpg123_read(mpg123_handle *mh
 11.1072 ++,	unsigned char *outmemory, size_t outmemsize, size_t *done );
 11.1073 ++
 11.1074 ++/** Feed data for a stream that has been opened with mpg123_open_feed().
 11.1075 ++ *  It's give and take: You provide the bytestream, mpg123 gives you the decoded samples.
 11.1076 ++ *  \param mh handle
 11.1077 ++ *  \param in input buffer
 11.1078 ++ *  \param size number of input bytes
 11.1079 ++ *  \return MPG123_OK or error/message code.
 11.1080 ++ */
 11.1081 ++MPG123_EXPORT int mpg123_feed( mpg123_handle *mh
 11.1082 ++,	const unsigned char *in, size_t size );
 11.1083 ++
 11.1084 ++/** Decode MPEG Audio from inmemory to outmemory. 
 11.1085 ++ *  This is very close to a drop-in replacement for old mpglib.
 11.1086 ++ *  When you give zero-sized output buffer the input will be parsed until 
 11.1087 ++ *  decoded data is available. This enables you to get MPG123_NEW_FORMAT (and query it) 
 11.1088 ++ *  without taking decoded data.
 11.1089 ++ *  Think of this function being the union of mpg123_read() and mpg123_feed() (which it actually is, sort of;-).
 11.1090 ++ *  You can actually always decide if you want those specialized functions in separate steps or one call this one here.
 11.1091 ++ *  \param mh handle
 11.1092 ++ *  \param inmemory input buffer
 11.1093 ++ *  \param inmemsize number of input bytes
 11.1094 ++ *  \param outmemory output buffer
 11.1095 ++ *  \param outmemsize maximum number of output bytes
 11.1096 ++ *  \param done address to store the number of actually decoded bytes to
 11.1097 ++ *  \return error/message code (watch out especially for MPG123_NEED_MORE)
 11.1098 ++ */
 11.1099 ++MPG123_EXPORT int mpg123_decode( mpg123_handle *mh
 11.1100 ++,	const unsigned char *inmemory, size_t inmemsize
 11.1101 ++,	unsigned char *outmemory, size_t outmemsize, size_t *done );
 11.1102 ++
 11.1103 ++/** Decode next MPEG frame to internal buffer
 11.1104 ++ *  or read a frame and return after setting a new format.
 11.1105 ++ *  \param mh handle
 11.1106 ++ *  \param num current frame offset gets stored there
 11.1107 ++ *  \param audio This pointer is set to the internal buffer to read the decoded audio from.
 11.1108 ++ *  \param bytes number of output bytes ready in the buffer
 11.1109 ++ *  \return MPG123_OK or error/message code
 11.1110 ++ */
 11.1111 ++MPG123_EXPORT int mpg123_decode_frame( mpg123_handle *mh
 11.1112 ++,	off_t *num, unsigned char **audio, size_t *bytes );
 11.1113 ++
 11.1114 ++/** Decode current MPEG frame to internal buffer.
 11.1115 ++ * Warning: This is experimental API that might change in future releases!
 11.1116 ++ * Please watch mpg123 development closely when using it.
 11.1117 ++ *  \param mh handle
 11.1118 ++ *  \param num last frame offset gets stored there
 11.1119 ++ *  \param audio this pointer is set to the internal buffer to read the decoded audio from.
 11.1120 ++ *  \param bytes number of output bytes ready in the buffer
 11.1121 ++ *  \return MPG123_OK or error/message code
 11.1122 ++ */
 11.1123 ++MPG123_EXPORT int mpg123_framebyframe_decode( mpg123_handle *mh
 11.1124 ++,	off_t *num, unsigned char **audio, size_t *bytes );
 11.1125 ++
 11.1126 ++/** Find, read and parse the next mp3 frame
 11.1127 ++ * Warning: This is experimental API that might change in future releases!
 11.1128 ++ * Please watch mpg123 development closely when using it.
 11.1129 ++ *  \param mh handle
 11.1130 ++ *  \return MPG123_OK or error/message code
 11.1131 ++ */
 11.1132 ++MPG123_EXPORT int mpg123_framebyframe_next(mpg123_handle *mh);
 11.1133 ++
 11.1134 ++/** Get access to the raw input data for the last parsed frame.
 11.1135 ++ * This gives you a direct look (and write access) to the frame body data.
 11.1136 ++ * Together with the raw header, you can reconstruct the whole raw MPEG stream without junk and meta data, or play games by actually modifying the frame body data before decoding this frame (mpg123_framebyframe_decode()).
 11.1137 ++ * A more sane use would be to use this for CRC checking (see mpg123_info() and MPG123_CRC), the first two bytes of the body make up the CRC16 checksum, if present.
 11.1138 ++ * You can provide NULL for a parameter pointer when you are not interested in the value.
 11.1139 ++ *
 11.1140 ++ * \param mh handle
 11.1141 ++ * \param header the 4-byte MPEG header
 11.1142 ++ * \param bodydata pointer to the frame body stored in the handle (without the header)
 11.1143 ++ * \param bodybytes size of frame body in bytes (without the header)
 11.1144 ++ * \return MPG123_OK if there was a yet un-decoded frame to get the
 11.1145 ++ *    data from, MPG123_BAD_HANDLE or MPG123_ERR otherwise (without further
 11.1146 ++ *    explanation, the error state of the mpg123_handle is not modified by
 11.1147 ++ *    this function).
 11.1148 ++ */
 11.1149 ++MPG123_EXPORT int mpg123_framedata( mpg123_handle *mh
 11.1150 ++,	unsigned long *header, unsigned char **bodydata, size_t *bodybytes );
 11.1151 ++
 11.1152 ++/** Get the input position (byte offset in stream) of the last parsed frame.
 11.1153 ++ *  This can be used for external seek index building, for example.
 11.1154 ++ *  It just returns the internally stored offset, regardless of validity --
 11.1155 ++ *  you ensure that a valid frame has been parsed before!
 11.1156 ++ * \param mh handle
 11.1157 ++ * \return byte offset in stream
 11.1158 ++ */
 11.1159 ++MPG123_EXPORT off_t mpg123_framepos(mpg123_handle *mh);
 11.1160 ++
 11.1161 ++/*@}*/
 11.1162 ++
 11.1163 ++
 11.1164 ++/** \defgroup mpg123_seek mpg123 position and seeking
 11.1165 ++ *
 11.1166 ++ * Functions querying and manipulating position in the decoded audio bitstream.
 11.1167 ++ * The position is measured in decoded audio samples, or MPEG frame offset for the specific functions.
 11.1168 ++ * If gapless code is in effect, the positions are adjusted to compensate the skipped padding/delay - meaning, you should not care about that at all and just use the position defined for the samples you get out of the decoder;-)
 11.1169 ++ * The general usage is modelled after stdlib's ftell() and fseek().
 11.1170 ++ * Especially, the whence parameter for the seek functions has the same meaning as the one for fseek() and needs the same constants from stdlib.h: 
 11.1171 ++ * - SEEK_SET: set position to (or near to) specified offset
 11.1172 ++ * - SEEK_CUR: change position by offset from now
 11.1173 ++ * - SEEK_END: set position to offset from end
 11.1174 ++ *
 11.1175 ++ * Note that sample-accurate seek only works when gapless support has been enabled at compile time; seek is frame-accurate otherwise.
 11.1176 ++ * Also, really sample-accurate seeking (meaning that you get the identical sample value after seeking compared to plain decoding up to the position) is only guaranteed when you do not mess with the position code by using MPG123_UPSPEED, MPG123_DOWNSPEED or MPG123_START_FRAME. The first two mainly should cause trouble with NtoM resampling, but in any case with these options in effect, you have to keep in mind that the sample offset is not the same as counting the samples you get from decoding since mpg123 counts the skipped samples, too (or the samples played twice only once)!
 11.1177 ++ * Short: When you care about the sample position, don't mess with those parameters;-)
 11.1178 ++ * Also, seeking is not guaranteed to work for all streams (underlying stream may not support it).
 11.1179 ++ * And yet another caveat: If the stream is concatenated out of differing pieces (Frankenstein stream), seeking may suffer, too.
 11.1180 ++ *
 11.1181 ++ * @{
 11.1182 ++ */
 11.1183 ++
 11.1184 ++/** Returns the current position in samples.
 11.1185 ++ *  On the next successful read, you'd get that sample.
 11.1186 ++ *  \param mh handle
 11.1187 ++ *  \return sample offset or MPG123_ERR (null handle)
 11.1188 ++ */
 11.1189 ++MPG123_EXPORT off_t mpg123_tell(mpg123_handle *mh);
 11.1190 ++
 11.1191 ++/** Returns the frame number that the next read will give you data from.
 11.1192 ++ *  \param mh handle
 11.1193 ++ *  \return frame offset or MPG123_ERR (null handle)
 11.1194 ++ */
 11.1195 ++MPG123_EXPORT off_t mpg123_tellframe(mpg123_handle *mh);
 11.1196 ++
 11.1197 ++/** Returns the current byte offset in the input stream.
 11.1198 ++ *  \param mh handle
 11.1199 ++ *  \return byte offset or MPG123_ERR (null handle)
 11.1200 ++ */
 11.1201 ++MPG123_EXPORT off_t mpg123_tell_stream(mpg123_handle *mh);
 11.1202 ++
 11.1203 ++/** Seek to a desired sample offset.
 11.1204 ++ *  Usage is modelled afer the standard lseek().
 11.1205 ++ * \param mh handle
 11.1206 ++ * \param sampleoff offset in PCM samples
 11.1207 ++ * \param whence one of SEEK_SET, SEEK_CUR or SEEK_END
 11.1208 ++ * \return The resulting offset >= 0 or error/message code
 11.1209 ++ */
 11.1210 ++MPG123_EXPORT off_t mpg123_seek( mpg123_handle *mh
 11.1211 ++,	off_t sampleoff, int whence );
 11.1212 ++
 11.1213 ++/** Seek to a desired sample offset in data feeding mode. 
 11.1214 ++ *  This just prepares things to be right only if you ensure that the next chunk of input data will be from input_offset byte position.
 11.1215 ++ *  \param mh handle
 11.1216 ++ *  \param sampleoff offset in PCM samples
 11.1217 ++ *  \param whence one of SEEK_SET, SEEK_CUR or SEEK_END
 11.1218 ++ *  \param input_offset The position it expects to be at the 
 11.1219 ++ *                      next time data is fed to mpg123_decode().
 11.1220 ++ *  \return The resulting offset >= 0 or error/message code */
 11.1221 ++MPG123_EXPORT off_t mpg123_feedseek( mpg123_handle *mh
 11.1222 ++,	off_t sampleoff, int whence, off_t *input_offset );
 11.1223 ++
 11.1224 ++/** Seek to a desired MPEG frame offset.
 11.1225 ++ *  Usage is modelled afer the standard lseek().
 11.1226 ++ * \param mh handle
 11.1227 ++ * \param frameoff offset in MPEG frames
 11.1228 ++ * \param whence one of SEEK_SET, SEEK_CUR or SEEK_END
 11.1229 ++ * \return The resulting offset >= 0 or error/message code */
 11.1230 ++MPG123_EXPORT off_t mpg123_seek_frame( mpg123_handle *mh
 11.1231 ++,	off_t frameoff, int whence );
 11.1232 ++
 11.1233 ++/** Return a MPEG frame offset corresponding to an offset in seconds.
 11.1234 ++ *  This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only.
 11.1235 ++ *  \return frame offset >= 0 or error/message code */
 11.1236 ++MPG123_EXPORT off_t mpg123_timeframe(mpg123_handle *mh, double sec);
 11.1237 ++
 11.1238 ++/** Give access to the frame index table that is managed for seeking.
 11.1239 ++ *  You are asked not to modify the values... Use mpg123_set_index to set the
 11.1240 ++ *  seek index
 11.1241 ++ *  \param mh handle
 11.1242 ++ *  \param offsets pointer to the index array
 11.1243 ++ *  \param step one index byte offset advances this many MPEG frames
 11.1244 ++ *  \param fill number of recorded index offsets; size of the array
 11.1245 ++ *  \return MPG123_OK on success
 11.1246 ++ */
 11.1247 ++MPG123_EXPORT int mpg123_index( mpg123_handle *mh
 11.1248 ++,	off_t **offsets, off_t *step, size_t *fill );
 11.1249 ++
 11.1250 ++/** Set the frame index table
 11.1251 ++ *  Setting offsets to NULL and fill > 0 will allocate fill entries. Setting offsets
 11.1252 ++ *  to NULL and fill to 0 will clear the index and free the allocated memory used by the index.
 11.1253 ++ *  \param mh handle
 11.1254 ++ *  \param offsets pointer to the index array
 11.1255 ++ *  \param step    one index byte offset advances this many MPEG frames
 11.1256 ++ *  \param fill    number of recorded index offsets; size of the array
 11.1257 ++ *  \return MPG123_OK on success
 11.1258 ++ */
 11.1259 ++MPG123_EXPORT int mpg123_set_index( mpg123_handle *mh
 11.1260 ++,	off_t *offsets, off_t step, size_t fill );
 11.1261 ++
 11.1262 ++/** An old crutch to keep old mpg123 binaries happy.
 11.1263 ++ *  WARNING: This function is there only to avoid runtime linking errors with
 11.1264 ++ *  standalone mpg123 before version 1.23.0 (if you strangely update the
 11.1265 ++ *  library but not the end-user program) and actually is broken
 11.1266 ++ *  for various cases (p.ex. 24 bit output). Do never use. It might eventually
 11.1267 ++ *  be purged from the library.
 11.1268 ++ */
 11.1269 ++MPG123_EXPORT int mpg123_position( mpg123_handle *mh, off_t frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left);
 11.1270 ++
 11.1271 ++/*@}*/
 11.1272 ++
 11.1273 ++
 11.1274 ++/** \defgroup mpg123_voleq mpg123 volume and equalizer
 11.1275 ++ *
 11.1276 ++ * @{
 11.1277 ++ */
 11.1278 ++
 11.1279 ++/** another channel enumeration, for left/right choice */
 11.1280 ++enum mpg123_channels
 11.1281 ++{
 11.1282 ++	 MPG123_LEFT=0x1	/**< The Left Channel. */
 11.1283 ++	,MPG123_RIGHT=0x2	/**< The Right Channel. */
 11.1284 ++	,MPG123_LR=0x3	/**< Both left and right channel; same as MPG123_LEFT|MPG123_RIGHT */
 11.1285 ++};
 11.1286 ++
 11.1287 ++/** Set the 32 Band Audio Equalizer settings.
 11.1288 ++ *  \param mh handle
 11.1289 ++ *  \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for both.
 11.1290 ++ *  \param band The equaliser band to change (from 0 to 31)
 11.1291 ++ *  \param val The (linear) adjustment factor.
 11.1292 ++ *  \return MPG123_OK on success
 11.1293 ++ */
 11.1294 ++MPG123_EXPORT int mpg123_eq( mpg123_handle *mh
 11.1295 ++,	enum mpg123_channels channel, int band, double val );
 11.1296 ++
 11.1297 ++/** Get the 32 Band Audio Equalizer settings.
 11.1298 ++ *  \param mh handle
 11.1299 ++ *  \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for (arithmetic mean of) both.
 11.1300 ++ *  \param band The equaliser band to change (from 0 to 31)
 11.1301 ++ *  \return The (linear) adjustment factor (zero for pad parameters) */
 11.1302 ++MPG123_EXPORT double mpg123_geteq(mpg123_handle *mh
 11.1303 ++                                 , enum mpg123_channels channel, int band);
 11.1304 ++
 11.1305 ++/** Reset the 32 Band Audio Equalizer settings to flat
 11.1306 ++ *  \param mh handle
 11.1307 ++ *  \return MPG123_OK on success
 11.1308 ++ */
 11.1309 ++MPG123_EXPORT int mpg123_reset_eq(mpg123_handle *mh);
 11.1310 ++
 11.1311 ++/** Set the absolute output volume including the RVA setting, 
 11.1312 ++ *  vol<0 just applies (a possibly changed) RVA setting.
 11.1313 ++ *  \param mh handle
 11.1314 ++ *  \param vol volume value (linear factor)
 11.1315 ++ *  \return MPG123_OK on success
 11.1316 ++ */
 11.1317 ++MPG123_EXPORT int mpg123_volume(mpg123_handle *mh, double vol);
 11.1318 ++
 11.1319 ++/** Adjust output volume including the RVA setting by chosen amount
 11.1320 ++ *  \param mh handle
 11.1321 ++ *  \param change volume value (linear factor increment)
 11.1322 ++ *  \return MPG123_OK on success
 11.1323 ++ */
 11.1324 ++MPG123_EXPORT int mpg123_volume_change(mpg123_handle *mh, double change);
 11.1325 ++
 11.1326 ++/** Return current volume setting, the actual value due to RVA, and the RVA 
 11.1327 ++ *  adjustment itself. It's all as double float value to abstract the sample 
 11.1328 ++ *  format. The volume values are linear factors / amplitudes (not percent) 
 11.1329 ++ *  and the RVA value is in decibels.
 11.1330 ++ *  \param mh handle
 11.1331 ++ *  \param base return address for base volume (linear factor)
 11.1332 ++ *  \param really return address for actual volume (linear factor)
 11.1333 ++ *  \param rva_db return address for RVA value (decibels)
 11.1334 ++ *  \return MPG123_OK on success
 11.1335 ++ */
 11.1336 ++MPG123_EXPORT int mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db);
 11.1337 ++
 11.1338 ++/* TODO: Set some preamp in addition / to replace internal RVA handling? */
 11.1339 ++
 11.1340 ++/*@}*/
 11.1341 ++
 11.1342 ++
 11.1343 ++/** \defgroup mpg123_status mpg123 status and information
 11.1344 ++ *
 11.1345 ++ * @{
 11.1346 ++ */
 11.1347 ++
 11.1348 ++/** Enumeration of the mode types of Variable Bitrate */
 11.1349 ++enum mpg123_vbr {
 11.1350 ++	MPG123_CBR=0,	/**< Constant Bitrate Mode (default) */
 11.1351 ++	MPG123_VBR,		/**< Variable Bitrate Mode */
 11.1352 ++	MPG123_ABR		/**< Average Bitrate Mode */
 11.1353 ++};
 11.1354 ++
 11.1355 ++/** Enumeration of the MPEG Versions */
 11.1356 ++enum mpg123_version {
 11.1357 ++	MPG123_1_0=0,	/**< MPEG Version 1.0 */
 11.1358 ++	MPG123_2_0,		/**< MPEG Version 2.0 */
 11.1359 ++	MPG123_2_5		/**< MPEG Version 2.5 */
 11.1360 ++};
 11.1361 ++
 11.1362 ++
 11.1363 ++/** Enumeration of the MPEG Audio mode.
 11.1364 ++ *  Only the mono mode has 1 channel, the others have 2 channels. */
 11.1365 ++enum mpg123_mode {
 11.1366 ++	MPG123_M_STEREO=0,	/**< Standard Stereo. */
 11.1367 ++	MPG123_M_JOINT,		/**< Joint Stereo. */
 11.1368 ++	MPG123_M_DUAL,		/**< Dual Channel. */
 11.1369 ++	MPG123_M_MONO		/**< Single Channel. */
 11.1370 ++};
 11.1371 ++
 11.1372 ++
 11.1373 ++/** Enumeration of the MPEG Audio flag bits */
 11.1374 ++enum mpg123_flags {
 11.1375 ++	MPG123_CRC=0x1,			/**< The bitstream is error protected using 16-bit CRC. */
 11.1376 ++	MPG123_COPYRIGHT=0x2,	/**< The bitstream is copyrighted. */
 11.1377 ++	MPG123_PRIVATE=0x4,		/**< The private bit has been set. */
 11.1378 ++	MPG123_ORIGINAL=0x8	/**< The bitstream is an original, not a copy. */
 11.1379 ++};
 11.1380 ++
 11.1381 ++/** Data structure for storing information about a frame of MPEG Audio */
 11.1382 ++struct mpg123_frameinfo
 11.1383 ++{
 11.1384 ++	enum mpg123_version version;	/**< The MPEG version (1.0/2.0/2.5). */
 11.1385 ++	int layer;						/**< The MPEG Audio Layer (MP1/MP2/MP3). */
 11.1386 ++	long rate; 						/**< The sampling rate in Hz. */
 11.1387 ++	enum mpg123_mode mode;			/**< The audio mode (Mono, Stereo, Joint-stero, Dual Channel). */
 11.1388 ++	int mode_ext;					/**< The mode extension bit flag. */
 11.1389 ++	int framesize;					/**< The size of the frame (in bytes, including header). */
 11.1390 ++	enum mpg123_flags flags;		/**< MPEG Audio flag bits. Just now I realize that it should be declared as int, not enum. It's a bitwise combination of the enum values. */
 11.1391 ++	int emphasis;					/**< The emphasis type. */
 11.1392 ++	int bitrate;					/**< Bitrate of the frame (kbps). */
 11.1393 ++	int abr_rate;					/**< The target average bitrate. */
 11.1394 ++	enum mpg123_vbr vbr;			/**< The VBR mode. */
 11.1395 ++};
 11.1396 ++
 11.1397 ++/** Get frame information about the MPEG audio bitstream and store it in a mpg123_frameinfo structure.
 11.1398 ++ *  \param mh handle
 11.1399 ++ *  \param mi address of existing frameinfo structure to write to
 11.1400 ++ *  \return MPG123_OK on success
 11.1401 ++ */
 11.1402 ++MPG123_EXPORT int mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi);
 11.1403 ++
 11.1404 ++/** Get the safe output buffer size for all cases
 11.1405 ++ *  (when you want to replace the internal buffer)
 11.1406 ++ *  \return safe buffer size
 11.1407 ++ */
 11.1408 ++MPG123_EXPORT size_t mpg123_safe_buffer(void);
 11.1409 ++
 11.1410 ++/** Make a full parsing scan of each frame in the file. ID3 tags are found. An
 11.1411 ++ *  accurate length value is stored. Seek index will be filled. A seek back to
 11.1412 ++ *  current position is performed. At all, this function refuses work when
 11.1413 ++ *  stream is not seekable.
 11.1414 ++ *  \param mh handle
 11.1415 ++ *  \return MPG123_OK on success
 11.1416 ++ */
 11.1417 ++MPG123_EXPORT int mpg123_scan(mpg123_handle *mh);
 11.1418 ++
 11.1419 ++/** Return, if possible, the full (expected) length of current track in frames.
 11.1420 ++ * \param mh handle
 11.1421 ++ * \return length >= 0 or MPG123_ERR if there is no length guess possible.
 11.1422 ++ */
 11.1423 ++MPG123_EXPORT off_t mpg123_framelength(mpg123_handle *mh);
 11.1424 ++
 11.1425 ++/** Return, if possible, the full (expected) length of current track in samples.
 11.1426 ++ * \param mh handle
 11.1427 ++ * \return length >= 0 or MPG123_ERR if there is no length guess possible.
 11.1428 ++ */
 11.1429 ++MPG123_EXPORT off_t mpg123_length(mpg123_handle *mh);
 11.1430 ++
 11.1431 ++/** Override the value for file size in bytes.
 11.1432 ++ *  Useful for getting sensible track length values in feed mode or for HTTP streams.
 11.1433 ++ *  \param mh handle
 11.1434 ++ *  \param size file size in bytes
 11.1435 ++ *  \return MPG123_OK on success
 11.1436 ++ */
 11.1437 ++MPG123_EXPORT int mpg123_set_filesize(mpg123_handle *mh, off_t size);
 11.1438 ++
 11.1439 ++/** Get MPEG frame duration in seconds.
 11.1440 ++ *  \param mh handle
 11.1441 ++ *  \return frame duration in seconds, <0 on error
 11.1442 ++ */
 11.1443 ++MPG123_EXPORT double mpg123_tpf(mpg123_handle *mh);
 11.1444 ++
 11.1445 ++/** Get MPEG frame duration in samples.
 11.1446 ++ *  \param mh handle
 11.1447 ++ *  \return samples per frame for the most recently parsed frame; <0 on errors
 11.1448 ++ */
 11.1449 ++MPG123_EXPORT int mpg123_spf(mpg123_handle *mh);
 11.1450 ++
 11.1451 ++/** Get and reset the clip count.
 11.1452 ++ *  \param mh handle
 11.1453 ++ *  \return count of clipped samples
 11.1454 ++ */
 11.1455 ++MPG123_EXPORT long mpg123_clip(mpg123_handle *mh);
 11.1456 ++
 11.1457 ++
 11.1458 ++/** The key values for state information from mpg123_getstate(). */
 11.1459 ++enum mpg123_state
 11.1460 ++{
 11.1461 ++	 MPG123_ACCURATE = 1 /**< Query if positons are currently accurate (integer value, 0 if false, 1 if true). */
 11.1462 ++	,MPG123_BUFFERFILL   /**< Get fill of internal (feed) input buffer as integer byte count returned as long and as double. An error is returned on integer overflow while converting to (signed) long, but the returned floating point value shold still be fine. */
 11.1463 ++	,MPG123_FRANKENSTEIN /**< Stream consists of carelessly stitched together files. Seeking may yield unexpected results (also with MPG123_ACCURATE, it may be confused). */
 11.1464 ++	,MPG123_FRESH_DECODER /**< Decoder structure has been updated, possibly indicating changed stream (integer value, 0 if false, 1 if true). Flag is cleared after retrieval. */
 11.1465 ++};
 11.1466 ++
 11.1467 ++/** Get various current decoder/stream state information.
 11.1468 ++ *  \param mh handle
 11.1469 ++ *  \param key the key to identify the information to give.
 11.1470 ++ *  \param val the address to return (long) integer values to
 11.1471 ++ *  \param fval the address to return floating point values to
 11.1472 ++ *  \return MPG123_OK on success
 11.1473 ++ */
 11.1474 ++MPG123_EXPORT int mpg123_getstate( mpg123_handle *mh
 11.1475 ++,	enum mpg123_state key, long *val, double *fval );
 11.1476 ++
 11.1477 ++/*@}*/
 11.1478 ++
 11.1479 ++
 11.1480 ++/** \defgroup mpg123_metadata mpg123 metadata handling
 11.1481 ++ *
 11.1482 ++ * Functions to retrieve the metadata from MPEG Audio files and streams.
 11.1483 ++ * Also includes string handling functions.
 11.1484 ++ *
 11.1485 ++ * @{
 11.1486 ++ */
 11.1487 ++
 11.1488 ++/** Data structure for storing strings in a safer way than a standard C-String.
 11.1489 ++ *  Can also hold a number of null-terminated strings. */
 11.1490 ++typedef struct 
 11.1491 ++{
 11.1492 ++	char* p;     /**< pointer to the string data */
 11.1493 ++	size_t size; /**< raw number of bytes allocated */
 11.1494 ++	size_t fill; /**< number of used bytes (including closing zero byte) */
 11.1495 ++} mpg123_string;
 11.1496 ++
 11.1497 ++/** Create and allocate memory for a new mpg123_string
 11.1498 ++ *  \param sb string handle (address of existing structure on your side)
 11.1499 ++ */
 11.1500 ++MPG123_EXPORT void mpg123_init_string(mpg123_string* sb);
 11.1501 ++
 11.1502 ++/** Free-up mempory for an existing mpg123_string
 11.1503 ++ *  \param sb string handle
 11.1504 ++ */
 11.1505 ++MPG123_EXPORT void mpg123_free_string(mpg123_string* sb);
 11.1506 ++
 11.1507 ++/** Change the size of a mpg123_string
 11.1508 ++ *  \param sb string handle
 11.1509 ++ *  \param news new size in bytes
 11.1510 ++ *  \return 0 on error, 1 on success
 11.1511 ++ */
 11.1512 ++MPG123_EXPORT int mpg123_resize_string(mpg123_string* sb, size_t news);
 11.1513 ++
 11.1514 ++/** Increase size of a mpg123_string if necessary (it may stay larger).
 11.1515 ++ *  Note that the functions for adding and setting in current libmpg123
 11.1516 ++ *  use this instead of mpg123_resize_string().
 11.1517 ++ *  That way, you can preallocate memory and safely work afterwards with
 11.1518 ++ *  pieces.
 11.1519 ++ *  \param sb string handle
 11.1520 ++ *  \param news new minimum size
 11.1521 ++ *  \return 0 on error, 1 on success
 11.1522 ++ */
 11.1523 ++MPG123_EXPORT int mpg123_grow_string(mpg123_string* sb, size_t news);
 11.1524 ++
 11.1525 ++/** Copy the contents of one mpg123_string string to another.
 11.1526 ++ *  Yes the order of arguments is reversed compated to memcpy().
 11.1527 ++ *  \param from string handle
 11.1528 ++ *  \param to string handle
 11.1529 ++ *  \return 0 on error, 1 on success
 11.1530 ++ */
 11.1531 ++MPG123_EXPORT int mpg123_copy_string(mpg123_string* from, mpg123_string* to);
 11.1532 ++
 11.1533 ++/** Append a C-String to an mpg123_string
 11.1534 ++ *  \param sb string handle
 11.1535 ++ *  \param stuff to append
 11.1536 ++ *  \return 0 on error, 1 on success
 11.1537 ++ */
 11.1538 ++MPG123_EXPORT int mpg123_add_string(mpg123_string* sb, const char* stuff);
 11.1539 ++
 11.1540 ++/** Append a C-substring to an mpg123 string
 11.1541 ++ *  \param sb string handle
 11.1542 ++ *  \param stuff content to copy
 11.1543 ++ *  \param from offset to copy from
 11.1544 ++ *  \param count number of characters to copy (a null-byte is always appended)
 11.1545 ++ *  \return 0 on error, 1 on success
 11.1546 ++ */
 11.1547 ++MPG123_EXPORT int mpg123_add_substring( mpg123_string *sb
 11.1548 ++,	const char *stuff, size_t from, size_t count );
 11.1549 ++
 11.1550 ++/** Set the content of a mpg123_string to a C-string
 11.1551 ++ *  \param sb string handle
 11.1552 ++ *  \param stuff content to copy
 11.1553 ++ *  \return 0 on error, 1 on success
 11.1554 ++ */
 11.1555 ++MPG123_EXPORT int mpg123_set_string(mpg123_string* sb, const char* stuff);
 11.1556 ++
 11.1557 ++/** Set the content of a mpg123_string to a C-substring
 11.1558 ++ *  \param sb string handle
 11.1559 ++ *  \param stuff the future content
 11.1560 ++ *  \param from offset to copy from
 11.1561 ++ *  \param count number of characters to copy (a null-byte is always appended)
 11.1562 ++ *  \return 0 on error, 1 on success
 11.1563 ++ */
 11.1564 ++MPG123_EXPORT int mpg123_set_substring( mpg123_string *sb
 11.1565 ++,	const char *stuff, size_t from, size_t count );
 11.1566 ++
 11.1567 ++/** Count characters in a mpg123 string (non-null bytes or UTF-8 characters).
 11.1568 ++ *  Even with the fill property, the character count is not obvious as there could be multiple trailing null bytes.
 11.1569 ++ *  \param sb string handle
 11.1570 ++ *  \param utf8 a flag to tell if the string is in utf8 encoding
 11.1571 ++ *  \return character count
 11.1572 ++*/
 11.1573 ++MPG123_EXPORT size_t mpg123_strlen(mpg123_string *sb, int utf8);
 11.1574 ++
 11.1575 ++/** Remove trailing \\r and \\n, if present.
 11.1576 ++ *  \param sb string handle
 11.1577 ++ *  \return 0 on error, 1 on success
 11.1578 ++ */
 11.1579 ++MPG123_EXPORT int mpg123_chomp_string(mpg123_string *sb);
 11.1580 ++
 11.1581 ++/** The mpg123 text encodings. This contains encodings we encounter in ID3 tags or ICY meta info. */
 11.1582 ++enum mpg123_text_encoding
 11.1583 ++{
 11.1584 ++	 mpg123_text_unknown  = 0 /**< Unkown encoding... mpg123_id3_encoding can return that on invalid codes. */
 11.1585 ++	,mpg123_text_utf8     = 1 /**< UTF-8 */
 11.1586 ++	,mpg123_text_latin1   = 2 /**< ISO-8859-1. Note that sometimes latin1 in ID3 is abused for totally different encodings. */
 11.1587 ++	,mpg123_text_icy      = 3 /**< ICY metadata encoding, usually CP-1252 but we take it as UTF-8 if it qualifies as such. */
 11.1588 ++	,mpg123_text_cp1252   = 4 /**< Really CP-1252 without any guessing. */
 11.1589 ++	,mpg123_text_utf16    = 5 /**< Some UTF-16 encoding. The last of a set of leading BOMs (byte order mark) rules.
 11.1590 ++	                           *   When there is no BOM, big endian ordering is used. Note that UCS-2 qualifies as UTF-8 when
 11.1591 ++	                           *   you don't mess with the reserved code points. If you want to decode little endian data
 11.1592 ++	                           *   without BOM you need to prepend 0xff 0xfe yourself. */
 11.1593 ++	,mpg123_text_utf16bom = 6 /**< Just an alias for UTF-16, ID3v2 has this as distinct code. */
 11.1594 ++	,mpg123_text_utf16be  = 7 /**< Another alias for UTF16 from ID3v2. Note, that, because of the mess that is reality,
 11.1595 ++	                           *   BOMs are used if encountered. There really is not much distinction between the UTF16 types for mpg123
 11.1596 ++	                           *   One exception: Since this is seen in ID3v2 tags, leading null bytes are skipped for all other UTF16
 11.1597 ++	                           *   types (we expect a BOM before real data there), not so for utf16be!*/
 11.1598 ++	,mpg123_text_max      = 7 /**< Placeholder for the maximum encoding value. */
 11.1599 ++};
 11.1600 ++
 11.1601 ++/** The encoding byte values from ID3v2. */
 11.1602 ++enum mpg123_id3_enc
 11.1603 ++{
 11.1604 ++	 mpg123_id3_latin1   = 0 /**< Note: This sometimes can mean anything in practice... */
 11.1605 ++	,mpg123_id3_utf16bom = 1 /**< UTF16, UCS-2 ... it's all the same for practical purposes. */
 11.1606 ++	,mpg123_id3_utf16be  = 2 /**< Big-endian UTF-16, BOM see note for mpg123_text_utf16be. */
 11.1607 ++	,mpg123_id3_utf8     = 3 /**< Our lovely overly ASCII-compatible 8 byte encoding for the world. */
 11.1608 ++	,mpg123_id3_enc_max  = 3 /**< Placeholder to check valid range of encoding byte. */
 11.1609 ++};
 11.1610 ++
 11.1611 ++/** Convert ID3 encoding byte to mpg123 encoding index.
 11.1612 ++ *  \param id3_enc_byte the ID3 encoding code
 11.1613 ++ *  \return the mpg123 encoding index
 11.1614 ++ */
 11.1615 ++
 11.1616 ++MPG123_EXPORT enum mpg123_text_encoding mpg123_enc_from_id3(unsigned char id3_enc_byte);
 11.1617 ++
 11.1618 ++/** Store text data in string, after converting to UTF-8 from indicated encoding
 11.1619 ++ *  A prominent error can be that you provided an unknown encoding value, or this build of libmpg123 lacks support for certain encodings (ID3 or ICY stuff missing).
 11.1620 ++ *  Also, you might want to take a bit of care with preparing the data; for example, strip leading zeroes (I have seen that).
 11.1621 ++ *  \param sb  target string
 11.1622 ++ *  \param enc mpg123 text encoding value
 11.1623 ++ *  \param source source buffer with plain unsigned bytes (you might need to cast from signed char)
 11.1624 ++ *  \param source_size number of bytes in the source buffer
 11.1625 ++ *  \return 0 on error, 1 on success (on error, mpg123_free_string is called on sb)
 11.1626 ++ */
 11.1627 ++MPG123_EXPORT int mpg123_store_utf8(mpg123_string *sb, enum mpg123_text_encoding enc, const unsigned char *source, size_t source_size);
 11.1628 ++
 11.1629 ++/** Sub data structure for ID3v2, for storing various text fields (including comments).
 11.1630 ++ *  This is for ID3v2 COMM, TXXX and all the other text fields.
 11.1631 ++ *  Only COMM and TXXX have a description, only COMM and USLT have a language.
 11.1632 ++ *  You should consult the ID3v2 specification for the use of the various text fields ("frames" in ID3v2 documentation, I use "fields" here to separate from MPEG frames). */
 11.1633 ++typedef struct
 11.1634 ++{
 11.1635 ++	char lang[3]; /**< Three-letter language code (not terminated). */
 11.1636 ++	char id[4];   /**< The ID3v2 text field id, like TALB, TPE2, ... (4 characters, no string termination). */
 11.1637 ++	mpg123_string description; /**< Empty for the generic comment... */
 11.1638 ++	mpg123_string text;        /**< ... */
 11.1639 ++} mpg123_text;
 11.1640 ++
 11.1641 ++/** The picture type values from ID3v2. */
 11.1642 ++enum mpg123_id3_pic_type
 11.1643 ++{
 11.1644 ++	 mpg123_id3_pic_other          =  0 /**< see ID3v2 docs */
 11.1645 ++	,mpg123_id3_pic_icon           =  1 /**< see ID3v2 docs */
 11.1646 ++	,mpg123_id3_pic_other_icon     =  2 /**< see ID3v2 docs */
 11.1647 ++	,mpg123_id3_pic_front_cover    =  3 /**< see ID3v2 docs */
 11.1648 ++	,mpg123_id3_pic_back_cover     =  4 /**< see ID3v2 docs */
 11.1649 ++	,mpg123_id3_pic_leaflet        =  5 /**< see ID3v2 docs */
 11.1650 ++	,mpg123_id3_pic_media          =  6 /**< see ID3v2 docs */
 11.1651 ++	,mpg123_id3_pic_lead           =  7 /**< see ID3v2 docs */
 11.1652 ++	,mpg123_id3_pic_artist         =  8 /**< see ID3v2 docs */
 11.1653 ++	,mpg123_id3_pic_conductor      =  9 /**< see ID3v2 docs */
 11.1654 ++	,mpg123_id3_pic_orchestra      = 10 /**< see ID3v2 docs */
 11.1655 ++	,mpg123_id3_pic_composer       = 11 /**< see ID3v2 docs */
 11.1656 ++	,mpg123_id3_pic_lyricist       = 12 /**< see ID3v2 docs */
 11.1657 ++	,mpg123_id3_pic_location       = 13 /**< see ID3v2 docs */
 11.1658 ++	,mpg123_id3_pic_recording      = 14 /**< see ID3v2 docs */
 11.1659 ++	,mpg123_id3_pic_performance    = 15 /**< see ID3v2 docs */
 11.1660 ++	,mpg123_id3_pic_video          = 16 /**< see ID3v2 docs */
 11.1661 ++	,mpg123_id3_pic_fish           = 17 /**< see ID3v2 docs */
 11.1662 ++	,mpg123_id3_pic_illustration   = 18 /**< see ID3v2 docs */
 11.1663 ++	,mpg123_id3_pic_artist_logo    = 19 /**< see ID3v2 docs */
 11.1664 ++	,mpg123_id3_pic_publisher_logo = 20 /**< see ID3v2 docs */
 11.1665 ++};
 11.1666 ++
 11.1667 ++/** Sub data structure for ID3v2, for storing picture data including comment.
 11.1668 ++ *  This is for the ID3v2 APIC field. You should consult the ID3v2 specification
 11.1669 ++ *  for the use of the APIC field ("frames" in ID3v2 documentation, I use "fields"
 11.1670 ++ *  here to separate from MPEG frames). */
 11.1671 ++typedef struct
 11.1672 ++{
 11.1673 ++	char type;                 /**< mpg123_id3_pic_type value */
 11.1674 ++	mpg123_string description; /**< description string */
 11.1675 ++	mpg123_string mime_type;   /**< MIME type */
 11.1676 ++	size_t size;               /**< size in bytes */
 11.1677 ++	unsigned char* data;       /**< pointer to the image data */
 11.1678 ++} mpg123_picture;
 11.1679 ++
 11.1680 ++/** Data structure for storing IDV3v2 tags.
 11.1681 ++ *  This structure is not a direct binary mapping with the file contents.
 11.1682 ++ *  The ID3v2 text frames are allowed to contain multiple strings.
 11.1683 ++ *  So check for null bytes until you reach the mpg123_string fill.
 11.1684 ++ *  All text is encoded in UTF-8. */
 11.1685 ++typedef struct
 11.1686 ++{
 11.1687 ++	unsigned char version; /**< 3 or 4 for ID3v2.3 or ID3v2.4. */
 11.1688 ++	mpg123_string *title;   /**< Title string (pointer into text_list). */
 11.1689 ++	mpg123_string *artist;  /**< Artist string (pointer into text_list). */
 11.1690 ++	mpg123_string *album;   /**< Album string (pointer into text_list). */
 11.1691 ++	mpg123_string *year;    /**< The year as a string (pointer into text_list). */
 11.1692 ++	mpg123_string *genre;   /**< Genre String (pointer into text_list). The genre string(s) may very well need postprocessing, esp. for ID3v2.3. */
 11.1693 ++	mpg123_string *comment; /**< Pointer to last encountered comment text with empty description. */
 11.1694 ++	/* Encountered ID3v2 fields are appended to these lists.
 11.1695 ++	   There can be multiple occurences, the pointers above always point to the last encountered data. */
 11.1696 ++	mpg123_text    *comment_list; /**< Array of comments. */
 11.1697 ++	size_t          comments;     /**< Number of comments. */
 11.1698 ++	mpg123_text    *text;         /**< Array of ID3v2 text fields (including USLT) */
 11.1699 ++	size_t          texts;        /**< Numer of text fields. */
 11.1700 ++	mpg123_text    *extra;        /**< The array of extra (TXXX) fields. */
 11.1701 ++	size_t          extras;       /**< Number of extra text (TXXX) fields. */
 11.1702 ++	mpg123_picture  *picture;     /**< Array of ID3v2 pictures fields (APIC). */
 11.1703 ++	size_t           pictures;    /**< Number of picture (APIC) fields. */
 11.1704 ++} mpg123_id3v2;
 11.1705 ++
 11.1706 ++/** Data structure for ID3v1 tags (the last 128 bytes of a file).
 11.1707 ++ *  Don't take anything for granted (like string termination)!
 11.1708 ++ *  Also note the change ID3v1.1 did: comment[28] = 0; comment[29] = track_number
 11.1709 ++ *  It is your task to support ID3v1 only or ID3v1.1 ...*/
 11.1710 ++typedef struct
 11.1711 ++{
 11.1712 ++	char tag[3];         /**< Always the string "TAG", the classic intro. */
 11.1713 ++	char title[30];      /**< Title string.  */
 11.1714 ++	char artist[30];     /**< Artist string. */
 11.1715 ++	char album[30];      /**< Album string. */
 11.1716 ++	char year[4];        /**< Year string. */
 11.1717 ++	char comment[30];    /**< Comment string. */
 11.1718 ++	unsigned char genre; /**< Genre index. */
 11.1719 ++} mpg123_id3v1;
 11.1720 ++
 11.1721 ++#define MPG123_ID3     0x3 /**< 0011 There is some ID3 info. Also matches 0010 or NEW_ID3. */
 11.1722 ++#define MPG123_NEW_ID3 0x1 /**< 0001 There is ID3 info that changed since last call to mpg123_id3. */
 11.1723 ++#define MPG123_ICY     0xc /**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/
 11.1724 ++#define MPG123_NEW_ICY 0x4 /**< 0100 There is ICY info that changed since last call to mpg123_icy. */
 11.1725 ++
 11.1726 ++/** Query if there is (new) meta info, be it ID3 or ICY (or something new in future).
 11.1727 ++ *  \param mh handle
 11.1728 ++ *  \return combination of flags, 0 on error (same as "nothing new")
 11.1729 ++ */
 11.1730 ++MPG123_EXPORT int mpg123_meta_check(mpg123_handle *mh);
 11.1731 ++
 11.1732 ++/** Clean up meta data storage (ID3v2 and ICY), freeing memory.
 11.1733 ++ *  \param mh handle
 11.1734 ++ */
 11.1735 ++MPG123_EXPORT void mpg123_meta_free(mpg123_handle *mh);
 11.1736 ++
 11.1737 ++/** Point v1 and v2 to existing data structures wich may change on any next read/decode function call.
 11.1738 ++ *  v1 and/or v2 can be set to NULL when there is no corresponding data.
 11.1739 ++ *  \return MPG123_OK on success
 11.1740 ++ */
 11.1741 ++MPG123_EXPORT int mpg123_id3( mpg123_handle *mh
 11.1742 ++,	mpg123_id3v1 **v1, mpg123_id3v2 **v2 );
 11.1743 ++
 11.1744 ++/** Point icy_meta to existing data structure wich may change on any next read/decode function call.
 11.1745 ++ *  \param mh handle
 11.1746 ++ *  \param icy_meta return address for ICY meta string (set to NULL if nothing there)
 11.1747 ++ *  \return MPG123_OK on success
 11.1748 ++ */
 11.1749 ++MPG123_EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta);
 11.1750 ++
 11.1751 ++/** Decode from windows-1252 (the encoding ICY metainfo used) to UTF-8.
 11.1752 ++ *  Note that this is very similar to mpg123_store_utf8(&sb, mpg123_text_icy, icy_text, strlen(icy_text+1)) .
 11.1753 ++ *  \param icy_text The input data in ICY encoding
 11.1754 ++ *  \return pointer to newly allocated buffer with UTF-8 data (You free() it!) */
 11.1755 ++MPG123_EXPORT char* mpg123_icy2utf8(const char* icy_text);
 11.1756 ++
 11.1757 ++
 11.1758 ++/* @} */
 11.1759 ++
 11.1760 ++
 11.1761 ++/** \defgroup mpg123_advpar mpg123 advanced parameter API
 11.1762 ++ *
 11.1763 ++ *  Direct access to a parameter set without full handle around it.
 11.1764 ++ *	Possible uses:
 11.1765 ++ *    - Influence behaviour of library _during_ initialization of handle (MPG123_VERBOSE).
 11.1766 ++ *    - Use one set of parameters for multiple handles.
 11.1767 ++ *
 11.1768 ++ *	The functions for handling mpg123_pars (mpg123_par() and mpg123_fmt() 
 11.1769 ++ *  family) directly return a fully qualified mpg123 error code, the ones 
 11.1770 ++ *  operating on full handles normally MPG123_OK or MPG123_ERR, storing the 
 11.1771 ++ *  specific error code itseld inside the handle. 
 11.1772 ++ *
 11.1773 ++ * @{
 11.1774 ++ */
 11.1775 ++
 11.1776 ++/** Opaque structure for the libmpg123 decoder parameters. */
 11.1777 ++struct mpg123_pars_struct;
 11.1778 ++
 11.1779 ++/** Opaque structure for the libmpg123 decoder parameters. */
 11.1780 ++typedef struct mpg123_pars_struct   mpg123_pars;
 11.1781 ++
 11.1782 ++/** Create a handle with preset parameters.
 11.1783 ++ *  \param mp parameter handle
 11.1784 ++ *  \param decoder decoder choice
 11.1785 ++ *  \param error error code return address
 11.1786 ++ *  \return mpg123 handle
 11.1787 ++ */
 11.1788 ++MPG123_EXPORT mpg123_handle *mpg123_parnew( mpg123_pars *mp
 11.1789 ++,	const char* decoder, int *error );
 11.1790 ++
 11.1791 ++/** Allocate memory for and return a pointer to a new mpg123_pars
 11.1792 ++ *  \param error error code return address
 11.1793 ++ *  \return new parameter handle
 11.1794 ++ */
 11.1795 ++MPG123_EXPORT mpg123_pars *mpg123_new_pars(int *error);
 11.1796 ++
 11.1797 ++/** Delete and free up memory used by a mpg123_pars data structure
 11.1798 ++ *  \param mp parameter handle
 11.1799 ++ */
 11.1800 ++MPG123_EXPORT void mpg123_delete_pars(mpg123_pars* mp);
 11.1801 ++
 11.1802 ++/** Configure mpg123 parameters to accept no output format at all, 
 11.1803 ++ *  use before specifying supported formats with mpg123_format
 11.1804 ++ *  \param mp parameter handle
 11.1805 ++ *  \return MPG123_OK on success
 11.1806 ++ */
 11.1807 ++MPG123_EXPORT int mpg123_fmt_none(mpg123_pars *mp);
 11.1808 ++
 11.1809 ++/** Configure mpg123 parameters to accept all formats 
 11.1810 ++ *  (also any custom rate you may set) -- this is default. 
 11.1811 ++ *  \param mp parameter handle
 11.1812 ++ *  \return MPG123_OK on success
 11.1813 ++ */
 11.1814 ++MPG123_EXPORT int mpg123_fmt_all(mpg123_pars *mp);
 11.1815 ++
 11.1816 ++/** Set the audio format support of a mpg123_pars in detail:
 11.1817 ++ * \param mp parameter handle
 11.1818 ++ * \param rate The sample rate value (in Hertz).
 11.1819 ++ * \param channels A combination of MPG123_STEREO and MPG123_MONO.
 11.1820 ++ * \param encodings A combination of accepted encodings for rate and channels,
 11.1821 ++ *                  p.ex MPG123_ENC_SIGNED16|MPG123_ENC_ULAW_8 (or 0 for no
 11.1822 ++ *                  support).
 11.1823 ++ * \return MPG123_OK on success
 11.1824 ++*/
 11.1825 ++MPG123_EXPORT int mpg123_fmt(mpg123_pars *mp
 11.1826 ++,	long rate, int channels, int encodings);
 11.1827 ++
 11.1828 ++/** Check to see if a specific format at a specific rate is supported
 11.1829 ++ *  by mpg123_pars.
 11.1830 ++ *  \param mp parameter handle
 11.1831 ++ *  \param rate sampling rate
 11.1832 ++ *  \param encoding encoding
 11.1833 ++ *  \return 0 for no support (that includes invalid parameters), MPG123_STEREO, 
 11.1834 ++ *          MPG123_MONO or MPG123_STEREO|MPG123_MONO. */
 11.1835 ++MPG123_EXPORT int mpg123_fmt_support(mpg123_pars *mp, long rate, int encoding);
 11.1836 ++
 11.1837 ++/** Set a specific parameter, for a specific mpg123_pars, using a parameter 
 11.1838 ++ *  type key chosen from the mpg123_parms enumeration, to the specified value.
 11.1839 ++ *  \param mp parameter handle
 11.1840 ++ *  \param type parameter choice
 11.1841 ++ *  \param value integer value
 11.1842 ++ *  \param fvalue floating point value
 11.1843 ++ *  \return MPG123_OK on success
 11.1844 ++ */
 11.1845 ++MPG123_EXPORT int mpg123_par( mpg123_pars *mp
 11.1846 ++,	enum mpg123_parms type, long value, double fvalue );
 11.1847 ++
 11.1848 ++/** Get a specific parameter, for a specific mpg123_pars. 
 11.1849 ++ *  See the mpg123_parms enumeration for a list of available parameters.
 11.1850 ++ *  \param mp parameter handle
 11.1851 ++ *  \param type parameter choice
 11.1852 ++ *  \param value integer value return address
 11.1853 ++ *  \param fvalue floating point value return address
 11.1854 ++ *  \return MPG123_OK on success
 11.1855 ++ */
 11.1856 ++MPG123_EXPORT int mpg123_getpar( mpg123_pars *mp
 11.1857 ++,	enum mpg123_parms type, long *value, double *fvalue);
 11.1858 ++
 11.1859 ++/* @} */
 11.1860 ++
 11.1861 ++
 11.1862 ++/** \defgroup mpg123_lowio mpg123 low level I/O
 11.1863 ++  * You may want to do tricky stuff with I/O that does not work with mpg123's default file access or you want to make it decode into your own pocket...
 11.1864 ++  *
 11.1865 ++  * @{ */
 11.1866 ++
 11.1867 ++/** Replace default internal buffer with user-supplied buffer.
 11.1868 ++  * Instead of working on it's own private buffer, mpg123 will directly use the one you provide for storing decoded audio.
 11.1869 ++  * Note that the required buffer size could be bigger than expected from output
 11.1870 ++  * encoding if libmpg123 has to convert from primary decoder output (p.ex. 32 bit
 11.1871 ++  * storage for 24 bit output).
 11.1872 ++  * \param mh handle
 11.1873 ++  * \param data pointer to user buffer
 11.1874 ++  * \param size of buffer in bytes
 11.1875 ++  * \return MPG123_OK on success
 11.1876 ++  */
 11.1877 ++MPG123_EXPORT int mpg123_replace_buffer(mpg123_handle *mh
 11.1878 ++,	unsigned char *data, size_t size);
 11.1879 ++
 11.1880 ++/** The max size of one frame's decoded output with current settings.
 11.1881 ++ *  Use that to determine an appropriate minimum buffer size for decoding one frame.
 11.1882 ++ *  \param mh handle
 11.1883 ++ *  \return maximum decoded data size in bytes
 11.1884 ++ */
 11.1885 ++MPG123_EXPORT size_t mpg123_outblock(mpg123_handle *mh);
 11.1886 ++
 11.1887 ++/** Replace low-level stream access functions; read and lseek as known in POSIX.
 11.1888 ++ *  You can use this to make any fancy file opening/closing yourself, 
 11.1889 ++ *  using mpg123_open_fd() to set the file descriptor for your read/lseek
 11.1890 ++ *  (doesn't need to be a "real" file descriptor...).
 11.1891 ++ *  Setting a function to NULL means that the default internal read is 
 11.1892 ++ *  used (active from next mpg123_open call on).
 11.1893 ++ *  Note: As it would be troublesome to mess with this while having a file open,
 11.1894 ++ *  this implies mpg123_close().
 11.1895 ++ * \param mh handle
 11.1896 ++ * \param r_read callback for reading (behaviour like POSIX read)
 11.1897 ++ * \param r_lseek callback for seeking (like POSIX lseek)
 11.1898 ++ * \return MPG123_OK on success
 11.1899 ++ */
 11.1900 ++MPG123_EXPORT int mpg123_replace_reader( mpg123_handle *mh
 11.1901 ++,	ssize_t (*r_read) (int, void *, size_t)
 11.1902 ++,	off_t (*r_lseek)(int, off_t, int)
 11.1903 ++);
 11.1904 ++
 11.1905 ++/** Replace I/O functions with your own ones operating on some kind of
 11.1906 ++ *  handle instead of integer descriptors.
 11.1907 ++ *  The handle is a void pointer, so you can pass any data you want...
 11.1908 ++ *  mpg123_open_handle() is the call you make to use the I/O defined here.
 11.1909 ++ *  There is no fallback to internal read/seek here.
 11.1910 ++ *  Note: As it would be troublesome to mess with this while having a file open,
 11.1911 ++ *  this mpg123_close() is implied here.
 11.1912 ++ *  \param mh handle
 11.1913 ++ *  \param r_read callback for reading (behaviour like POSIX read)
 11.1914 ++ *  \param r_lseek callback for seeking (like POSIX lseek)
 11.1915 ++ *  \param cleanup A callback to clean up an I/O handle on mpg123_close,
 11.1916 ++ *         can be NULL for none (you take care of cleaning your handles).
 11.1917 ++ * \return MPG123_OK on success
 11.1918 ++ */
 11.1919 ++MPG123_EXPORT int mpg123_replace_reader_handle( mpg123_handle *mh
 11.1920 ++,	ssize_t (*r_read) (void *, void *, size_t)
 11.1921 ++,	off_t (*r_lseek)(void *, off_t, int)
 11.1922 ++,	void (*cleanup)(void*) );
 11.1923 ++
 11.1924 ++/* @} */
 11.1925 ++
 11.1926 ++#ifdef __cplusplus
 11.1927 ++}
 11.1928 ++#endif
 11.1929 ++
 11.1930 ++#endif
 11.1931 +diff -ruN mpg123-1.25.6.orig/Android.mk mpg123-1.25.6/Android.mk
 11.1932 +--- mpg123-1.25.6.orig/Android.mk	1969-12-31 16:00:00.000000000 -0800
 11.1933 ++++ mpg123-1.25.6/Android.mk	2017-10-18 01:34:30.879829213 -0700
 11.1934 +@@ -0,0 +1,110 @@
 11.1935 ++LOCAL_PATH := $(call my-dir)
 11.1936 ++
 11.1937 ++include $(CLEAR_VARS)
 11.1938 ++
 11.1939 ++LOCAL_MODULE := libmpg123
 11.1940 ++
 11.1941 ++LOCAL_C_INCLUDES := $(LOCAL_PATH)/android \
 11.1942 ++                    $(LOCAL_PATH)/src \
 11.1943 ++                    $(LOCAL_PATH)/src/compat \
 11.1944 ++                    $(LOCAL_PATH)/src/libmpg123 \
 11.1945 ++
 11.1946 ++DECODER_CFLAGS_NEON := -DOPT_NEON -DREAL_IS_FLOAT
 11.1947 ++
 11.1948 ++DECODER_SRC_NEON := \
 11.1949 ++    src/libmpg123/stringbuf.c \
 11.1950 ++	src/libmpg123/icy.c \
 11.1951 ++	src/libmpg123/icy2utf8.c \
 11.1952 ++	src/libmpg123/ntom.c \
 11.1953 ++	src/libmpg123/synth.c \
 11.1954 ++	src/libmpg123/synth_8bit.c \
 11.1955 ++	src/libmpg123/layer1.c \
 11.1956 ++	src/libmpg123/layer2.c \
 11.1957 ++	src/libmpg123/layer3.c \
 11.1958 ++	src/libmpg123/dct36_neon.S \
 11.1959 ++	src/libmpg123/dct64_neon_float.S \
 11.1960 ++	src/libmpg123/synth_neon_float.S \
 11.1961 ++	src/libmpg123/synth_neon_s32.S \
 11.1962 ++	src/libmpg123/synth_stereo_neon_float.S \
 11.1963 ++	src/libmpg123/synth_stereo_neon_s32.S \
 11.1964 ++	src/libmpg123/dct64_neon.S \
 11.1965 ++	src/libmpg123/synth_neon.S \
 11.1966 ++	src/libmpg123/synth_stereo_neon.S \
 11.1967 ++	src/libmpg123/synth_s32.c \
 11.1968 ++	src/libmpg123/synth_real.c \
 11.1969 ++	src/libmpg123/feature.c \
 11.1970 ++
 11.1971 ++DECODER_CFLAGS_X86 := -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_I386 -DOPT_I586 -DOPT_I586_DITHER -DOPT_MMX -DOPT_3DNOW -DOPT_3DNOW_VINTAGE -DOPT_3DNOWEXT -DOPT_3DNOWEXT_VINTAGE -DOPT_SSE -DOPT_SSE_VINTAGE -DREAL_IS_FLOAT
 11.1972 ++
 11.1973 ++DECODER_SRC_X86 := \
 11.1974 ++    src/libmpg123/stringbuf.c \
 11.1975 ++	src/libmpg123/icy.c \
 11.1976 ++	src/libmpg123/icy2utf8.c \
 11.1977 ++	src/libmpg123/ntom.c \
 11.1978 ++	src/libmpg123/synth.c \
 11.1979 ++	src/libmpg123/synth_8bit.c \
 11.1980 ++	src/libmpg123/layer1.c \
 11.1981 ++	src/libmpg123/layer2.c \
 11.1982 ++	src/libmpg123/layer3.c \
 11.1983 ++	src/libmpg123/synth_s32.c \
 11.1984 ++	src/libmpg123/synth_real.c \
 11.1985 ++	src/libmpg123/dct64_i386.c \
 11.1986 ++	src/libmpg123/synth_i586.S \
 11.1987 ++	src/libmpg123/synth_i586_dither.S \
 11.1988 ++	src/libmpg123/dct64_mmx.S \
 11.1989 ++	src/libmpg123/tabinit_mmx.S \
 11.1990 ++	src/libmpg123/synth_mmx.S \
 11.1991 ++	src/libmpg123/synth_3dnow.S \
 11.1992 ++	src/libmpg123/dct64_3dnow.S \
 11.1993 ++	src/libmpg123/equalizer_3dnow.S \
 11.1994 ++	src/libmpg123/dct36_3dnow.S \
 11.1995 ++	src/libmpg123/dct64_3dnowext.S \
 11.1996 ++	src/libmpg123/synth_3dnowext.S \
 11.1997 ++	src/libmpg123/dct36_3dnowext.S \
 11.1998 ++	src/libmpg123/dct64_sse_float.S \
 11.1999 ++	src/libmpg123/synth_sse_float.S \
 11.2000 ++	src/libmpg123/synth_stereo_sse_float.S \
 11.2001 ++	src/libmpg123/synth_sse_s32.S \
 11.2002 ++	src/libmpg123/synth_stereo_sse_s32.S \
 11.2003 ++	src/libmpg123/dct36_sse.S \
 11.2004 ++	src/libmpg123/dct64_sse.S \
 11.2005 ++	src/libmpg123/synth_sse.S \
 11.2006 ++	src/libmpg123/getcpuflags.S \
 11.2007 ++	src/libmpg123/dither.c \
 11.2008 ++	src/libmpg123/feature.c \
 11.2009 ++
 11.2010 ++ifeq ($(TARGET_ARCH_ABI),armeabi)
 11.2011 ++DECODER_CFLAGS := $(DECODER_CFLAGS_NEON)
 11.2012 ++DECODER_SRC := $(DECODER_SRC_NEON)
 11.2013 ++endif
 11.2014 ++ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
 11.2015 ++DECODER_CFLAGS := $(DECODER_CFLAGS_NEON)
 11.2016 ++DECODER_SRC := $(DECODER_SRC_NEON)
 11.2017 ++endif
 11.2018 ++ifeq ($(TARGET_ARCH_ABI),x86)
 11.2019 ++DECODER_CFLAGS := $(DECODER_CFLAGS_X86)
 11.2020 ++DECODER_SRC := $(DECODER_SRC_X86)
 11.2021 ++endif
 11.2022 ++
 11.2023 ++LOCAL_CFLAGS := $(DECODER_CFLAGS)
 11.2024 ++
 11.2025 ++LOCAL_SRC_FILES := \
 11.2026 ++    src/libmpg123/parse.c \
 11.2027 ++	src/libmpg123/frame.c \
 11.2028 ++    src/libmpg123/format.c \
 11.2029 ++	src/libmpg123/dct64.c \
 11.2030 ++    src/libmpg123/equalizer.c \
 11.2031 ++	src/libmpg123/id3.c \
 11.2032 ++    src/libmpg123/optimize.c \
 11.2033 ++	src/libmpg123/readers.c \
 11.2034 ++    src/libmpg123/tabinit.c \
 11.2035 ++	src/libmpg123/libmpg123.c \
 11.2036 ++    src/libmpg123/index.c \
 11.2037 ++    src/compat/compat_str.c \
 11.2038 ++    src/compat/compat.c \
 11.2039 ++    $(DECODER_SRC)
 11.2040 ++
 11.2041 ++
 11.2042 ++LOCAL_EXPORT_C_INCLUDES += $(LOCAL_C_INCLUDES)
 11.2043 ++
 11.2044 ++include $(BUILD_SHARED_LIBRARY)
    12.1 --- a/music.c	Sun Oct 22 10:48:52 2017 -0700
    12.2 +++ b/music.c	Sun Oct 22 12:08:11 2017 -0700
    12.3 @@ -78,6 +78,21 @@
    12.4  #ifdef MUSIC_WAV
    12.5      &Mix_MusicInterface_WAV,
    12.6  #endif
    12.7 +#ifdef MUSIC_FLAC
    12.8 +    &Mix_MusicInterface_FLAC,
    12.9 +#endif
   12.10 +#ifdef MUSIC_OGG
   12.11 +    &Mix_MusicInterface_OGG,
   12.12 +#endif
   12.13 +#ifdef MUSIC_MP3_MPG123
   12.14 +    &Mix_MusicInterface_MPG123,
   12.15 +#endif
   12.16 +#ifdef MUSIC_MP3_MAD
   12.17 +    &Mix_MusicInterface_MAD,
   12.18 +#endif
   12.19 +#ifdef MUSIC_MP3_SMPEG
   12.20 +    &Mix_MusicInterface_SMPEG,
   12.21 +#endif
   12.22  #ifdef MUSIC_MOD_MODPLUG
   12.23      &Mix_MusicInterface_MODPLUG,
   12.24  #endif
   12.25 @@ -93,21 +108,6 @@
   12.26  #ifdef MUSIC_MID_NATIVE
   12.27      &Mix_MusicInterface_NATIVEMIDI,
   12.28  #endif
   12.29 -#ifdef MUSIC_OGG
   12.30 -    &Mix_MusicInterface_OGG,
   12.31 -#endif
   12.32 -#ifdef MUSIC_MP3_MPG123
   12.33 -    &Mix_MusicInterface_MPG123,
   12.34 -#endif
   12.35 -#ifdef MUSIC_MP3_MAD
   12.36 -    &Mix_MusicInterface_MAD,
   12.37 -#endif
   12.38 -#ifdef MUSIC_MP3_SMPEG
   12.39 -    &Mix_MusicInterface_SMPEG,
   12.40 -#endif
   12.41 -#ifdef MUSIC_FLAC
   12.42 -    &Mix_MusicInterface_FLAC,
   12.43 -#endif
   12.44  };
   12.45  
   12.46  int get_num_music_interfaces(void)
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/timidity/Android.mk	Sun Oct 22 12:08:11 2017 -0700
    13.3 @@ -0,0 +1,24 @@
    13.4 +LOCAL_PATH := $(call my-dir)
    13.5 +
    13.6 +include $(CLEAR_VARS)
    13.7 +
    13.8 +LOCAL_MODULE := timidity
    13.9 +
   13.10 +LOCAL_C_INCLUDES :=
   13.11 +
   13.12 +LOCAL_CFLAGS :=
   13.13 +
   13.14 +LOCAL_SRC_FILES += \
   13.15 +    common.c \
   13.16 +    instrum.c \
   13.17 +    mix.c \
   13.18 +    output.c \
   13.19 +    playmidi.c \
   13.20 +    readmidi.c \
   13.21 +    resample.c \
   13.22 +    tables.c \
   13.23 +    timidity.c
   13.24 +
   13.25 +LOCAL_SHARED_LIBRARIES := SDL2
   13.26 +
   13.27 +include $(BUILD_STATIC_LIBRARY)