Update libFLAC to version 1.4.3

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
Christopher Snowhill 2023-10-03 22:58:49 -07:00
parent 2fc42ccb73
commit 8997ffa030
No known key found for this signature in database
12 changed files with 100 additions and 92 deletions

View file

@ -1,8 +1,8 @@
Build with CMake, using the following options: Build with CMake, using the following options:
``` ```
cmake build-x86 -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.12" -DBUILD_SHARED_LIBS=ON cmake -B build-x86 -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" -DBUILD_SHARED_LIBS=ON
cmake build-arm -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" -DBUILD_SHARED_LIBS=ON cmake -B build-arm -DCMAKE_OSX_ARCHITECTURES="arm64" -DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" -DBUILD_SHARED_LIBS=ON
``` ```
@ -10,9 +10,9 @@ And some minor tweaks with `install_name_tool -id` to make sure that the
resulting libFLAC.12.dylib referred to itself with @rpath and not full resulting libFLAC.12.dylib referred to itself with @rpath and not full
paths of the build directory, and imported libogg.0.dylib with an @rpath. paths of the build directory, and imported libogg.0.dylib with an @rpath.
Version 1.4.1 was used from the official source code download: Version 1.4.3 was used from the official source code download:
https://downloads.xiph.org/releases/flac/flac-1.4.1.tar.xz https://downloads.xiph.org/releases/flac/flac-1.4.3.tar.xz
x86_64 and arm64 were built separately, to allow for intrinsic functions x86_64 and arm64 were built separately, to allow for intrinsic functions
to be used for x86_64. to be used for x86_64.

View file

@ -1,6 +1,6 @@
/* libFLAC - Free Lossless Audio Codec library /* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2001-2009 Josh Coalson * Copyright (C) 2001-2009 Josh Coalson
* Copyright (C) 2011-2022 Xiph.Org Foundation * Copyright (C) 2011-2023 Xiph.Org Foundation
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -34,6 +34,10 @@
#define FLAC__ASSERT_H #define FLAC__ASSERT_H
/* we need this since some compilers (like MSVC) leave assert()s on release code (and we don't want to use their ASSERT) */ /* we need this since some compilers (like MSVC) leave assert()s on release code (and we don't want to use their ASSERT) */
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
#define FLAC__ASSERT(x) if(!(x)) __builtin_abort();
#define FLAC__ASSERT_DECLARATION(x) x
#else
#ifndef NDEBUG #ifndef NDEBUG
#include <assert.h> #include <assert.h>
#define FLAC__ASSERT(x) assert(x) #define FLAC__ASSERT(x) assert(x)
@ -42,5 +46,6 @@
#define FLAC__ASSERT(x) #define FLAC__ASSERT(x)
#define FLAC__ASSERT_DECLARATION(x) #define FLAC__ASSERT_DECLARATION(x)
#endif #endif
#endif
#endif #endif

View file

@ -1,6 +1,6 @@
/* libFLAC - Free Lossless Audio Codec library /* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2000-2009 Josh Coalson * Copyright (C) 2000-2009 Josh Coalson
* Copyright (C) 2011-2022 Xiph.Org Foundation * Copyright (C) 2011-2023 Xiph.Org Foundation
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -52,7 +52,7 @@
* level idea of the structure and how to find the information you * level idea of the structure and how to find the information you
* need. As a prerequisite you should have at least a basic * need. As a prerequisite you should have at least a basic
* knowledge of the FLAC format, documented * knowledge of the FLAC format, documented
* <A HREF="../format.html">here</A>. * <A HREF="https://xiph.org/flac/format.html">here</A>.
* *
* \section c_api FLAC C API * \section c_api FLAC C API
* *
@ -64,7 +64,7 @@
* *
* By writing a little code and linking against libFLAC, it is * By writing a little code and linking against libFLAC, it is
* relatively easy to add FLAC support to another program. The * relatively easy to add FLAC support to another program. The
* library is licensed under <A HREF="../license.html">Xiph's BSD license</A>. * library is licensed under <A HREF="https://xiph.org/flac/license.html">Xiph's BSD license</A>.
* Complete source code of libFLAC as well as the command-line * Complete source code of libFLAC as well as the command-line
* encoder and plugins is available and is a useful source of * encoder and plugins is available and is a useful source of
* examples. * examples.
@ -97,7 +97,7 @@
* example /usr/include/FLAC++/...). * example /usr/include/FLAC++/...).
* *
* libFLAC++ is also licensed under * libFLAC++ is also licensed under
* <A HREF="../license.html">Xiph's BSD license</A>. * <A HREF="https://xiph.org/flac/license.html">Xiph's BSD license</A>.
* *
* \section getting_started Getting Started * \section getting_started Getting Started
* *
@ -113,7 +113,7 @@
* functions through the links in top bar across this page. * functions through the links in top bar across this page.
* *
* If you prefer a more hands-on approach, you can jump right to some * If you prefer a more hands-on approach, you can jump right to some
* <A HREF="../documentation_example_code.html">example code</A>. * <A HREF="https://xiph.org/flac/documentation_example_code.html">example code</A>.
* *
* \section porting_guide Porting Guide * \section porting_guide Porting Guide
* *

View file

@ -1,6 +1,6 @@
/* libFLAC - Free Lossless Audio Codec library /* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2004-2009 Josh Coalson * Copyright (C) 2004-2009 Josh Coalson
* Copyright (C) 2011-2022 Xiph.Org Foundation * Copyright (C) 2011-2023 Xiph.Org Foundation
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -90,7 +90,9 @@ typedef void* FLAC__IOHandle;
/** Signature for the read callback. /** Signature for the read callback.
* The signature and semantics match POSIX fread() implementations * The signature and semantics match POSIX fread() implementations
* and can generally be used interchangeably. * and can generally be used interchangeably. Note that the global
* variable errno from errno.h is read by some libFLAC functions to
* detect read errors.
* *
* \param ptr The address of the read buffer. * \param ptr The address of the read buffer.
* \param size The size of the records to be read. * \param size The size of the records to be read.
@ -166,6 +168,9 @@ typedef int (*FLAC__IOCallback_Close) (FLAC__IOHandle handle);
* *
* If the seek requirement for an interface is optional, you can signify that * If the seek requirement for an interface is optional, you can signify that
* a data source is not seekable by setting the \a seek field to \c NULL. * a data source is not seekable by setting the \a seek field to \c NULL.
*
* See the detailed documentation for callbacks in the
* \link flac_callbacks callbacks \endlink module.
*/ */
typedef struct { typedef struct {
FLAC__IOCallback_Read read; /**< See FLAC__IOCallbacks */ FLAC__IOCallback_Read read; /**< See FLAC__IOCallbacks */

View file

@ -1,6 +1,6 @@
/* libFLAC - Free Lossless Audio Codec library /* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2000-2009 Josh Coalson * Copyright (C) 2000-2009 Josh Coalson
* Copyright (C) 2011-2022 Xiph.Org Foundation * Copyright (C) 2011-2023 Xiph.Org Foundation
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -95,9 +95,9 @@
/** These \#defines will mirror the libtool-based library version number, see /** These \#defines will mirror the libtool-based library version number, see
* http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning * http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning
*/ */
#define FLAC_API_VERSION_CURRENT 12 #define FLAC_API_VERSION_CURRENT 13
#define FLAC_API_VERSION_REVISION 0 /**< see above */ #define FLAC_API_VERSION_REVISION 0 /**< see above */
#define FLAC_API_VERSION_AGE 0 /**< see above */ #define FLAC_API_VERSION_AGE 1 /**< see above */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View file

@ -1,6 +1,6 @@
/* libFLAC - Free Lossless Audio Codec library /* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2000-2009 Josh Coalson * Copyright (C) 2000-2009 Josh Coalson
* Copyright (C) 2011-2022 Xiph.Org Foundation * Copyright (C) 2011-2023 Xiph.Org Foundation
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -60,7 +60,7 @@ extern "C" {
* structures used by the rest of the interfaces. * structures used by the rest of the interfaces.
* *
* First, you should be familiar with the * First, you should be familiar with the
* <A HREF="../format.html">FLAC format</A>. Many of the values here * <A HREF="https://xiph.org/flac/format.html">FLAC format</A>. Many of the values here
* follow directly from the specification. As a user of libFLAC, the * follow directly from the specification. As a user of libFLAC, the
* interesting parts really are the structures that describe the frame * interesting parts really are the structures that describe the frame
* header and metadata blocks. * header and metadata blocks.
@ -225,7 +225,7 @@ typedef struct {
*/ */
} FLAC__EntropyCodingMethod_PartitionedRiceContents; } FLAC__EntropyCodingMethod_PartitionedRiceContents;
/** Header for a Rice partitioned residual. (c.f. <A HREF="../format.html#partitioned_rice">format specification</A>) /** Header for a Rice partitioned residual. (c.f. <A HREF="https://xiph.org/flac/format.html#partitioned_rice">format specification</A>)
*/ */
typedef struct { typedef struct {
@ -247,7 +247,7 @@ extern FLAC_API const uint32_t FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCA
extern FLAC_API const uint32_t FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_ESCAPE_PARAMETER; extern FLAC_API const uint32_t FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_ESCAPE_PARAMETER;
/**< == (1<<FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN)-1 */ /**< == (1<<FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN)-1 */
/** Header for the entropy coding method. (c.f. <A HREF="../format.html#residual">format specification</A>) /** Header for the entropy coding method. (c.f. <A HREF="https://xiph.org/flac/format.html#residual">format specification</A>)
*/ */
typedef struct { typedef struct {
FLAC__EntropyCodingMethodType type; FLAC__EntropyCodingMethodType type;
@ -276,7 +276,7 @@ typedef enum {
extern FLAC_API const char * const FLAC__SubframeTypeString[]; extern FLAC_API const char * const FLAC__SubframeTypeString[];
/** CONSTANT subframe. (c.f. <A HREF="../format.html#subframe_constant">format specification</A>) /** CONSTANT subframe. (c.f. <A HREF="https://xiph.org/flac/format.html#subframe_constant">format specification</A>)
*/ */
typedef struct { typedef struct {
FLAC__int64 value; /**< The constant signal value. */ FLAC__int64 value; /**< The constant signal value. */
@ -289,7 +289,7 @@ typedef enum {
} FLAC__VerbatimSubframeDataType; } FLAC__VerbatimSubframeDataType;
/** VERBATIM subframe. (c.f. <A HREF="../format.html#subframe_verbatim">format specification</A>) /** VERBATIM subframe. (c.f. <A HREF="https://xiph.org/flac/format.html#subframe_verbatim">format specification</A>)
*/ */
typedef struct { typedef struct {
union { union {
@ -300,7 +300,7 @@ typedef struct {
} FLAC__Subframe_Verbatim; } FLAC__Subframe_Verbatim;
/** FIXED subframe. (c.f. <A HREF="../format.html#subframe_fixed">format specification</A>) /** FIXED subframe. (c.f. <A HREF="https://xiph.org/flac/format.html#subframe_fixed">format specification</A>)
*/ */
typedef struct { typedef struct {
FLAC__EntropyCodingMethod entropy_coding_method; FLAC__EntropyCodingMethod entropy_coding_method;
@ -317,7 +317,7 @@ typedef struct {
} FLAC__Subframe_Fixed; } FLAC__Subframe_Fixed;
/** LPC subframe. (c.f. <A HREF="../format.html#subframe_lpc">format specification</A>) /** LPC subframe. (c.f. <A HREF="https://xiph.org/flac/format.html#subframe_lpc">format specification</A>)
*/ */
typedef struct { typedef struct {
FLAC__EntropyCodingMethod entropy_coding_method; FLAC__EntropyCodingMethod entropy_coding_method;
@ -346,7 +346,7 @@ extern FLAC_API const uint32_t FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN; /**<
extern FLAC_API const uint32_t FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN; /**< == 5 (bits) */ extern FLAC_API const uint32_t FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN; /**< == 5 (bits) */
/** FLAC subframe structure. (c.f. <A HREF="../format.html#subframe">format specification</A>) /** FLAC subframe structure. (c.f. <A HREF="https://xiph.org/flac/format.html#subframe">format specification</A>)
*/ */
typedef struct { typedef struct {
FLAC__SubframeType type; FLAC__SubframeType type;
@ -413,7 +413,7 @@ typedef enum {
extern FLAC_API const char * const FLAC__FrameNumberTypeString[]; extern FLAC_API const char * const FLAC__FrameNumberTypeString[];
/** FLAC frame header structure. (c.f. <A HREF="../format.html#frame_header">format specification</A>) /** FLAC frame header structure. (c.f. <A HREF="https://xiph.org/flac/format.html#frame_header">format specification</A>)
*/ */
typedef struct { typedef struct {
uint32_t blocksize; uint32_t blocksize;
@ -462,7 +462,7 @@ extern FLAC_API const uint32_t FLAC__FRAME_HEADER_ZERO_PAD_LEN; /**< == 1 (bit)
extern FLAC_API const uint32_t FLAC__FRAME_HEADER_CRC_LEN; /**< == 8 (bits) */ extern FLAC_API const uint32_t FLAC__FRAME_HEADER_CRC_LEN; /**< == 8 (bits) */
/** FLAC frame footer structure. (c.f. <A HREF="../format.html#frame_footer">format specification</A>) /** FLAC frame footer structure. (c.f. <A HREF="https://xiph.org/flac/format.html#frame_footer">format specification</A>)
*/ */
typedef struct { typedef struct {
FLAC__uint16 crc; FLAC__uint16 crc;
@ -475,7 +475,7 @@ typedef struct {
extern FLAC_API const uint32_t FLAC__FRAME_FOOTER_CRC_LEN; /**< == 16 (bits) */ extern FLAC_API const uint32_t FLAC__FRAME_FOOTER_CRC_LEN; /**< == 16 (bits) */
/** FLAC frame structure. (c.f. <A HREF="../format.html#frame">format specification</A>) /** FLAC frame structure. (c.f. <A HREF="https://xiph.org/flac/format.html#frame">format specification</A>)
*/ */
typedef struct { typedef struct {
FLAC__FrameHeader header; FLAC__FrameHeader header;
@ -496,25 +496,25 @@ typedef struct {
typedef enum { typedef enum {
FLAC__METADATA_TYPE_STREAMINFO = 0, FLAC__METADATA_TYPE_STREAMINFO = 0,
/**< <A HREF="../format.html#metadata_block_streaminfo">STREAMINFO</A> block */ /**< <A HREF="https://xiph.org/flac/format.html#metadata_block_streaminfo">STREAMINFO</A> block */
FLAC__METADATA_TYPE_PADDING = 1, FLAC__METADATA_TYPE_PADDING = 1,
/**< <A HREF="../format.html#metadata_block_padding">PADDING</A> block */ /**< <A HREF="https://xiph.org/flac/format.html#metadata_block_padding">PADDING</A> block */
FLAC__METADATA_TYPE_APPLICATION = 2, FLAC__METADATA_TYPE_APPLICATION = 2,
/**< <A HREF="../format.html#metadata_block_application">APPLICATION</A> block */ /**< <A HREF="https://xiph.org/flac/format.html#metadata_block_application">APPLICATION</A> block */
FLAC__METADATA_TYPE_SEEKTABLE = 3, FLAC__METADATA_TYPE_SEEKTABLE = 3,
/**< <A HREF="../format.html#metadata_block_seektable">SEEKTABLE</A> block */ /**< <A HREF="https://xiph.org/flac/format.html#metadata_block_seektable">SEEKTABLE</A> block */
FLAC__METADATA_TYPE_VORBIS_COMMENT = 4, FLAC__METADATA_TYPE_VORBIS_COMMENT = 4,
/**< <A HREF="../format.html#metadata_block_vorbis_comment">VORBISCOMMENT</A> block (a.k.a. FLAC tags) */ /**< <A HREF="https://xiph.org/flac/format.html#metadata_block_vorbis_comment">VORBISCOMMENT</A> block (a.k.a. FLAC tags) */
FLAC__METADATA_TYPE_CUESHEET = 5, FLAC__METADATA_TYPE_CUESHEET = 5,
/**< <A HREF="../format.html#metadata_block_cuesheet">CUESHEET</A> block */ /**< <A HREF="https://xiph.org/flac/format.html#metadata_block_cuesheet">CUESHEET</A> block */
FLAC__METADATA_TYPE_PICTURE = 6, FLAC__METADATA_TYPE_PICTURE = 6,
/**< <A HREF="../format.html#metadata_block_picture">PICTURE</A> block */ /**< <A HREF="https://xiph.org/flac/format.html#metadata_block_picture">PICTURE</A> block */
FLAC__METADATA_TYPE_UNDEFINED = 7, FLAC__METADATA_TYPE_UNDEFINED = 7,
/**< marker to denote beginning of undefined type range; this number will increase as new metadata types are added */ /**< marker to denote beginning of undefined type range; this number will increase as new metadata types are added */
@ -531,7 +531,7 @@ typedef enum {
extern FLAC_API const char * const FLAC__MetadataTypeString[]; extern FLAC_API const char * const FLAC__MetadataTypeString[];
/** FLAC STREAMINFO structure. (c.f. <A HREF="../format.html#metadata_block_streaminfo">format specification</A>) /** FLAC STREAMINFO structure. (c.f. <A HREF="https://xiph.org/flac/format.html#metadata_block_streaminfo">format specification</A>)
*/ */
typedef struct { typedef struct {
uint32_t min_blocksize, max_blocksize; uint32_t min_blocksize, max_blocksize;
@ -556,7 +556,7 @@ extern FLAC_API const uint32_t FLAC__STREAM_METADATA_STREAMINFO_MD5SUM_LEN; /**<
/** The total stream length of the STREAMINFO block in bytes. */ /** The total stream length of the STREAMINFO block in bytes. */
#define FLAC__STREAM_METADATA_STREAMINFO_LENGTH (34u) #define FLAC__STREAM_METADATA_STREAMINFO_LENGTH (34u)
/** FLAC PADDING structure. (c.f. <A HREF="../format.html#metadata_block_padding">format specification</A>) /** FLAC PADDING structure. (c.f. <A HREF="https://xiph.org/flac/format.html#metadata_block_padding">format specification</A>)
*/ */
typedef struct { typedef struct {
int dummy; int dummy;
@ -567,7 +567,7 @@ typedef struct {
} FLAC__StreamMetadata_Padding; } FLAC__StreamMetadata_Padding;
/** FLAC APPLICATION structure. (c.f. <A HREF="../format.html#metadata_block_application">format specification</A>) /** FLAC APPLICATION structure. (c.f. <A HREF="https://xiph.org/flac/format.html#metadata_block_application">format specification</A>)
*/ */
typedef struct { typedef struct {
FLAC__byte id[4]; FLAC__byte id[4];
@ -576,7 +576,7 @@ typedef struct {
extern FLAC_API const uint32_t FLAC__STREAM_METADATA_APPLICATION_ID_LEN; /**< == 32 (bits) */ extern FLAC_API const uint32_t FLAC__STREAM_METADATA_APPLICATION_ID_LEN; /**< == 32 (bits) */
/** SeekPoint structure used in SEEKTABLE blocks. (c.f. <A HREF="../format.html#seekpoint">format specification</A>) /** SeekPoint structure used in SEEKTABLE blocks. (c.f. <A HREF="https://xiph.org/flac/format.html#seekpoint">format specification</A>)
*/ */
typedef struct { typedef struct {
FLAC__uint64 sample_number; FLAC__uint64 sample_number;
@ -604,7 +604,7 @@ extern FLAC_API const uint32_t FLAC__STREAM_METADATA_SEEKPOINT_FRAME_SAMPLES_LEN
extern FLAC_API const FLAC__uint64 FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER; extern FLAC_API const FLAC__uint64 FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER;
/** FLAC SEEKTABLE structure. (c.f. <A HREF="../format.html#metadata_block_seektable">format specification</A>) /** FLAC SEEKTABLE structure. (c.f. <A HREF="https://xiph.org/flac/format.html#metadata_block_seektable">format specification</A>)
* *
* \note From the format specification: * \note From the format specification:
* - The seek points must be sorted by ascending sample number. * - The seek points must be sorted by ascending sample number.
@ -622,7 +622,7 @@ typedef struct {
} FLAC__StreamMetadata_SeekTable; } FLAC__StreamMetadata_SeekTable;
/** Vorbis comment entry structure used in VORBIS_COMMENT blocks. (c.f. <A HREF="../format.html#metadata_block_vorbis_comment">format specification</A>) /** Vorbis comment entry structure used in VORBIS_COMMENT blocks. (c.f. <A HREF="https://xiph.org/flac/format.html#metadata_block_vorbis_comment">format specification</A>)
* *
* For convenience, the APIs maintain a trailing NUL character at the end of * For convenience, the APIs maintain a trailing NUL character at the end of
* \a entry which is not counted toward \a length, i.e. * \a entry which is not counted toward \a length, i.e.
@ -636,7 +636,7 @@ typedef struct {
extern FLAC_API const uint32_t FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN; /**< == 32 (bits) */ extern FLAC_API const uint32_t FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN; /**< == 32 (bits) */
/** FLAC VORBIS_COMMENT structure. (c.f. <A HREF="../format.html#metadata_block_vorbis_comment">format specification</A>) /** FLAC VORBIS_COMMENT structure. (c.f. <A HREF="https://xiph.org/flac/format.html#metadata_block_vorbis_comment">format specification</A>)
*/ */
typedef struct { typedef struct {
FLAC__StreamMetadata_VorbisComment_Entry vendor_string; FLAC__StreamMetadata_VorbisComment_Entry vendor_string;
@ -648,7 +648,7 @@ extern FLAC_API const uint32_t FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS
/** FLAC CUESHEET track index structure. (See the /** FLAC CUESHEET track index structure. (See the
* <A HREF="../format.html#cuesheet_track_index">format specification</A> for * <A HREF="https://xiph.org/flac/format.html#cuesheet_track_index">format specification</A> for
* the full description of each field.) * the full description of each field.)
*/ */
typedef struct { typedef struct {
@ -667,7 +667,7 @@ extern FLAC_API const uint32_t FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN
/** FLAC CUESHEET track structure. (See the /** FLAC CUESHEET track structure. (See the
* <A HREF="../format.html#cuesheet_track">format specification</A> for * <A HREF="https://xiph.org/flac/format.html#cuesheet_track">format specification</A> for
* the full description of each field.) * the full description of each field.)
*/ */
typedef struct { typedef struct {
@ -704,7 +704,7 @@ extern FLAC_API const uint32_t FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_
/** FLAC CUESHEET structure. (See the /** FLAC CUESHEET structure. (See the
* <A HREF="../format.html#metadata_block_cuesheet">format specification</A> * <A HREF="https://xiph.org/flac/format.html#metadata_block_cuesheet">format specification</A>
* for the full description of each field.) * for the full description of each field.)
*/ */
typedef struct { typedef struct {
@ -770,7 +770,7 @@ typedef enum {
extern FLAC_API const char * const FLAC__StreamMetadata_Picture_TypeString[]; extern FLAC_API const char * const FLAC__StreamMetadata_Picture_TypeString[];
/** FLAC PICTURE structure. (See the /** FLAC PICTURE structure. (See the
* <A HREF="../format.html#metadata_block_picture">format specification</A> * <A HREF="https://xiph.org/flac/format.html#metadata_block_picture">format specification</A>
* for the full description of each field.) * for the full description of each field.)
*/ */
typedef struct { typedef struct {
@ -836,7 +836,7 @@ typedef struct {
} FLAC__StreamMetadata_Unknown; } FLAC__StreamMetadata_Unknown;
/** FLAC metadata block structure. (c.f. <A HREF="../format.html#metadata_block">format specification</A>) /** FLAC metadata block structure. (c.f. <A HREF="https://xiph.org/flac/format.html#metadata_block">format specification</A>)
*/ */
typedef struct FLAC__StreamMetadata { typedef struct FLAC__StreamMetadata {
FLAC__MetadataType type; FLAC__MetadataType type;

View file

@ -1,6 +1,6 @@
/* libFLAC - Free Lossless Audio Codec library /* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2001-2009 Josh Coalson * Copyright (C) 2001-2009 Josh Coalson
* Copyright (C) 2011-2022 Xiph.Org Foundation * Copyright (C) 2011-2023 Xiph.Org Foundation
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -510,7 +510,7 @@ FLAC_API FLAC__MetadataType FLAC__metadata_simple_iterator_get_block_type(const
* \retval uint32_t * \retval uint32_t
* The length of the metadata block at the current iterator position. * The length of the metadata block at the current iterator position.
* The is same length as that in the * The is same length as that in the
* <a href="http://xiph.org/flac/format.html#metadata_block_header">metadata block header</a>, * <a href="http://xiph.org/flhttps://xiph.org/flac/format.html#metadata_block_header">metadata block header</a>,
* i.e. the length of the metadata body that follows the header. * i.e. the length of the metadata body that follows the header.
*/ */
FLAC_API uint32_t FLAC__metadata_simple_iterator_get_block_length(const FLAC__Metadata_SimpleIterator *iterator); FLAC_API uint32_t FLAC__metadata_simple_iterator_get_block_length(const FLAC__Metadata_SimpleIterator *iterator);
@ -2197,6 +2197,34 @@ FLAC_API FLAC__bool FLAC__metadata_object_picture_set_data(FLAC__StreamMetadata
*/ */
FLAC_API FLAC__bool FLAC__metadata_object_picture_is_legal(const FLAC__StreamMetadata *object, const char **violation); FLAC_API FLAC__bool FLAC__metadata_object_picture_is_legal(const FLAC__StreamMetadata *object, const char **violation);
/** Get the raw (binary) representation of a FLAC__StreamMetadata objeect.
* After use, free() the returned buffer. The length of the buffer is
* the length of the input metadata object plus 4 bytes for the header.
*
* \param object A pointer to metadata block to be converted.
* \assert
* \code object != NULL \endcode
* \retval FLAC__byte*
* \c NULL if there was an error, else a pointer to a buffer holding
* the requested data.
*/
FLAC_API FLAC__byte * FLAC__metadata_object_get_raw(const FLAC__StreamMetadata *object);
/** Turn a raw (binary) representation into a FLAC__StreamMetadata objeect.
* The returned object must be deleted with FLAC__metadata_object_delete()
* after use.
*
* \param buffer A pointer to a buffer containing a binary representation
* to be converted to a FLAC__StreamMetadata object
* \param length The length of the supplied buffer
* \retval FLAC__StreamMetadata*
* \c NULL if there was an error, else a pointer to a FLAC__StreamMetadata
* holding the requested data.
*/
FLAC_API FLAC__StreamMetadata * FLAC__metadata_object_set_raw(FLAC__byte *buffer, FLAC__uint32 length);
/* \} */ /* \} */
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -1,6 +1,6 @@
/* libFLAC - Free Lossless Audio Codec library /* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2000-2009 Josh Coalson * Copyright (C) 2000-2009 Josh Coalson
* Copyright (C) 2011-2022 Xiph.Org Foundation * Copyright (C) 2011-2023 Xiph.Org Foundation
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -33,26 +33,10 @@
#ifndef FLAC__ORDINALS_H #ifndef FLAC__ORDINALS_H
#define FLAC__ORDINALS_H #define FLAC__ORDINALS_H
#if defined(_MSC_VER) && _MSC_VER < 1600 /* This of course assumes C99 headers */
/* Microsoft Visual Studio earlier than the 2010 version did not provide
* the 1999 ISO C Standard header file <stdint.h>.
*/
typedef signed __int8 FLAC__int8;
typedef signed __int16 FLAC__int16;
typedef signed __int32 FLAC__int32;
typedef signed __int64 FLAC__int64;
typedef unsigned __int8 FLAC__uint8;
typedef unsigned __int16 FLAC__uint16;
typedef unsigned __int32 FLAC__uint32;
typedef unsigned __int64 FLAC__uint64;
#else
/* For MSVC 2010 and everything else which provides <stdint.h>. */
#include <stdint.h> #include <stdint.h>
#include <stdbool.h>
typedef int8_t FLAC__int8; typedef int8_t FLAC__int8;
typedef uint8_t FLAC__uint8; typedef uint8_t FLAC__uint8;
@ -64,22 +48,8 @@ typedef uint16_t FLAC__uint16;
typedef uint32_t FLAC__uint32; typedef uint32_t FLAC__uint32;
typedef uint64_t FLAC__uint64; typedef uint64_t FLAC__uint64;
#endif
typedef int FLAC__bool; typedef int FLAC__bool;
typedef FLAC__uint8 FLAC__byte; typedef FLAC__uint8 FLAC__byte;
#ifdef true
#undef true
#endif
#ifdef false
#undef false
#endif
#ifndef __cplusplus
#define true 1
#define false 0
#endif
#endif #endif

View file

@ -1,6 +1,6 @@
/* libFLAC - Free Lossless Audio Codec library /* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2000-2009 Josh Coalson * Copyright (C) 2000-2009 Josh Coalson
* Copyright (C) 2011-2022 Xiph.Org Foundation * Copyright (C) 2011-2023 Xiph.Org Foundation
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -681,7 +681,7 @@ typedef FLAC__bool (*FLAC__StreamDecoderEofCallback)(const FLAC__StreamDecoder *
* samples of length \a frame->header.blocksize. * samples of length \a frame->header.blocksize.
* Channels will be ordered according to the FLAC * Channels will be ordered according to the FLAC
* specification; see the documentation for the * specification; see the documentation for the
* <A HREF="../format.html#frame_header">frame header</A>. * <A HREF="https://xiph.org/flac/format.html#frame_header">frame header</A>.
* \param client_data The callee's client data set through * \param client_data The callee's client data set through
* FLAC__stream_decoder_init_*(). * FLAC__stream_decoder_init_*().
* \retval FLAC__StreamDecoderWriteStatus * \retval FLAC__StreamDecoderWriteStatus

View file

@ -1,6 +1,6 @@
/* libFLAC - Free Lossless Audio Codec library /* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2000-2009 Josh Coalson * Copyright (C) 2000-2009 Josh Coalson
* Copyright (C) 2011-2022 Xiph.Org Foundation * Copyright (C) 2011-2023 Xiph.Org Foundation
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -129,8 +129,8 @@ extern "C" {
* Unlike the decoders, the stream encoder has many options that can * Unlike the decoders, the stream encoder has many options that can
* affect the speed and compression ratio. When setting these parameters * affect the speed and compression ratio. When setting these parameters
* you should have some basic knowledge of the format (see the * you should have some basic knowledge of the format (see the
* <A HREF="../documentation_format_overview.html">user-level documentation</A> * <A HREF="https://xiph.org/flac/documentation_format_overview.html">user-level documentation</A>
* or the <A HREF="../format.html">formal description</A>). The * or the <A HREF="https://xiph.org/flac/format.html">formal description</A>). The
* FLAC__stream_encoder_set_*() functions themselves do not validate the * FLAC__stream_encoder_set_*() functions themselves do not validate the
* values as many are interdependent. The FLAC__stream_encoder_init_*() * values as many are interdependent. The FLAC__stream_encoder_init_*()
* functions will do this, so make sure to pay attention to the state * functions will do this, so make sure to pay attention to the state
@ -330,7 +330,7 @@ typedef enum {
/**< The specified block size is less than the maximum LPC order. */ /**< The specified block size is less than the maximum LPC order. */
FLAC__STREAM_ENCODER_INIT_STATUS_NOT_STREAMABLE, FLAC__STREAM_ENCODER_INIT_STATUS_NOT_STREAMABLE,
/**< The encoder is bound to the <A HREF="../format.html#subset">Subset</A> but other settings violate it. */ /**< The encoder is bound to the <A HREF="https://xiph.org/flac/format.html#subset">Subset</A> but other settings violate it. */
FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA, FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA,
/**< The metadata input to the encoder is invalid, in one of the following ways: /**< The metadata input to the encoder is invalid, in one of the following ways:
@ -742,7 +742,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_ogg_serial_number(FLAC__StreamEncod
*/ */
FLAC_API FLAC__bool FLAC__stream_encoder_set_verify(FLAC__StreamEncoder *encoder, FLAC__bool value); FLAC_API FLAC__bool FLAC__stream_encoder_set_verify(FLAC__StreamEncoder *encoder, FLAC__bool value);
/** Set the <A HREF="../format.html#subset">Subset</A> flag. If \c true, /** Set the <A HREF="https://xiph.org/flac/format.html#subset">Subset</A> flag. If \c true,
* the encoder will comply with the Subset and will check the * the encoder will comply with the Subset and will check the
* settings during FLAC__stream_encoder_init_*() to see if all settings * settings during FLAC__stream_encoder_init_*() to see if all settings
* comply. If \c false, the settings may take advantage of the full * comply. If \c false, the settings may take advantage of the full
@ -850,7 +850,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_sample_rate(FLAC__StreamEncoder *en
* <tr> <td><b>5</b></td> <td>true</td> <td>false</td> <td>tukey(0.5)</td> <td>8</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>5</td> <td>0</td> </tr> * <tr> <td><b>5</b></td> <td>true</td> <td>false</td> <td>tukey(0.5)</td> <td>8</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>5</td> <td>0</td> </tr>
* <tr> <td><b>6</b></td> <td>true</td> <td>false</td> <td>subdivide_tukey(2)</td> <td>8</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>6</td> <td>0</td> </tr> * <tr> <td><b>6</b></td> <td>true</td> <td>false</td> <td>subdivide_tukey(2)</td> <td>8</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>6</td> <td>0</td> </tr>
* <tr> <td><b>7</b></td> <td>true</td> <td>false</td> <td>subdivide_tukey(2)</td> <td>12</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>6</td> <td>0</td> </tr> * <tr> <td><b>7</b></td> <td>true</td> <td>false</td> <td>subdivide_tukey(2)</td> <td>12</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>6</td> <td>0</td> </tr>
* <tr> <td><b>8</b></td> <td>true</td> <td>false</td> <td>subdivide_tukey(2)</td> <td>12</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>6</td> <td>0</td> </tr> * <tr> <td><b>8</b></td> <td>true</td> <td>false</td> <td>subdivide_tukey(3)</td> <td>12</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>6</td> <td>0</td> </tr>
* </table> * </table>
* *
* \default \c 5 * \default \c 5
@ -1295,7 +1295,7 @@ FLAC_API void FLAC__stream_encoder_get_verify_decoder_error_stats(const FLAC__St
*/ */
FLAC_API FLAC__bool FLAC__stream_encoder_get_verify(const FLAC__StreamEncoder *encoder); FLAC_API FLAC__bool FLAC__stream_encoder_get_verify(const FLAC__StreamEncoder *encoder);
/** Get the <A HREF="../format.html#subset>Subset</A> flag. /** Get the <A HREF="https://xiph.org/flac/format.html#subset">Subset</A> flag.
* *
* \param encoder An encoder instance to query. * \param encoder An encoder instance to query.
* \assert * \assert
@ -1781,7 +1781,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_finish(FLAC__StreamEncoder *encoder);
* *
* For applications where channel order is important, channels must * For applications where channel order is important, channels must
* follow the order as described in the * follow the order as described in the
* <A HREF="../format.html#frame_header">frame header</A>. * <A HREF="https://xiph.org/flac/format.html#frame_header">frame header</A>.
* *
* \param encoder An initialized encoder instance in the OK state. * \param encoder An initialized encoder instance in the OK state.
* \param buffer An array of pointers to each channel's signal. * \param buffer An array of pointers to each channel's signal.
@ -1810,7 +1810,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, c
* *
* For applications where channel order is important, channels must * For applications where channel order is important, channels must
* follow the order as described in the * follow the order as described in the
* <A HREF="../format.html#frame_header">frame header</A>. * <A HREF="https://xiph.org/flac/format.html#frame_header">frame header</A>.
* *
* \param encoder An initialized encoder instance in the OK state. * \param encoder An initialized encoder instance in the OK state.
* \param buffer An array of channel-interleaved data (see above). * \param buffer An array of channel-interleaved data (see above).

Binary file not shown.

Binary file not shown.