From f18d1a93390fedbb03f81db82322215ce027c1e0 Mon Sep 17 00:00:00 2001 From: Robert Shih Date: Mon, 5 Jan 2015 17:35:54 -0800 Subject: libFLAC: merge master from Xiph remote: https://git.xiph.org/flac.git commit: 775eb93 Bug: 18872897 Bug: 18910747 Change-Id: I6e450e44c96b97c3323e428b9e6d420422f24a4e (cherry picked from commit 31e4f3166a91a2ebb34f643787122a638d9f1471) Tested-by: Wolfgang Wiedmeyer --- include/FLAC/format.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'include/FLAC/format.h') diff --git a/include/FLAC/format.h b/include/FLAC/format.h index 77e2d01..7424565 100644 --- a/include/FLAC/format.h +++ b/include/FLAC/format.h @@ -1,5 +1,6 @@ /* libFLAC - Free Lossless Audio Codec library - * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson + * Copyright (C) 2000-2009 Josh Coalson + * Copyright (C) 2011-2014 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -508,9 +509,11 @@ typedef enum { FLAC__METADATA_TYPE_PICTURE = 6, /**< PICTURE 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 */ + FLAC__MAX_METADATA_TYPE = FLAC__MAX_METADATA_TYPE_CODE, + /**< No type will ever be greater than this. There is not enough room in the protocol block. */ } FLAC__MetadataType; /** Maps a FLAC__MetadataType to a C string. @@ -879,6 +882,18 @@ extern FLAC_API const unsigned FLAC__STREAM_METADATA_LENGTH_LEN; /**< == 24 (bit */ FLAC_API FLAC__bool FLAC__format_sample_rate_is_valid(unsigned sample_rate); +/** Tests that a blocksize at the given sample rate is valid for the FLAC + * subset. + * + * \param blocksize The blocksize to test for compliance. + * \param sample_rate The sample rate is needed, since the valid subset + * blocksize depends on the sample rate. + * \retval FLAC__bool + * \c true if the given blocksize conforms to the specification for the + * subset at the given sample rate, else \c false. + */ +FLAC_API FLAC__bool FLAC__format_blocksize_is_subset(unsigned blocksize, unsigned sample_rate); + /** Tests that a sample rate is valid for the FLAC subset. The subset rules * for valid sample rates are slightly more complex since the rate has to * be expressible completely in the frame header. -- cgit v1.1