mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
add FLAC__format_blocksize_is_subset()
This commit is contained in:
@@ -115,12 +115,12 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Interface changes (see also the <a href="http://flac.sourceforge.net/api/group__porting__1__2__1__to__1__2__2.html">porting guide</a> for specific instructions on porting to FLAC 1.2.2):
|
Interface changes:
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
libFLAC:
|
libFLAC:
|
||||||
<ul>
|
<ul>
|
||||||
<li>(none)</li>
|
<li><b>Added</b> FLAC__format_blocksize_is_subset()</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@@ -213,7 +213,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Interface changes (see also the <a href="http://flac.sourceforge.net/api/group__porting__1__2__0__to__1__2__1.html">porting guide</a> for specific instructions on porting to FLAC 1.2.1):
|
Interface changes:
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
libFLAC:
|
libFLAC:
|
||||||
|
|||||||
@@ -879,6 +879,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);
|
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
|
/** 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
|
* for valid sample rates are slightly more complex since the rate has to
|
||||||
* be expressible completely in the frame header.
|
* be expressible completely in the frame header.
|
||||||
|
|||||||
@@ -223,6 +223,16 @@ FLAC_API FLAC__bool FLAC__format_sample_rate_is_valid(unsigned sample_rate)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FLAC_API FLAC__bool FLAC__format_blocksize_is_subset(unsigned blocksize, unsigned sample_rate)
|
||||||
|
{
|
||||||
|
if(blocksize > 16384)
|
||||||
|
return false;
|
||||||
|
else if(sample_rate <= 48000 && blocksize > 4608)
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
FLAC_API FLAC__bool FLAC__format_sample_rate_is_subset(unsigned sample_rate)
|
FLAC_API FLAC__bool FLAC__format_sample_rate_is_subset(unsigned sample_rate)
|
||||||
{
|
{
|
||||||
if(
|
if(
|
||||||
|
|||||||
Reference in New Issue
Block a user