Displaying 2 results from an estimated 2 matches for "flac__min_bits_per_sample".
Did you mean:
flac__max_bits_per_sample
2018 Mar 22
2
Crash when writing 32bit flac files, am I doing something wrong ?
Hello,
I manage to successfully write 8, 16 and 24 bit, all stereo, FLAC files.
But when I try to write 32 bit FLACs my program crashes.
*FLAC__stream_encoder_set_bits_per_sample *is called to match the desired
bit depth (8, 16, 24, 32)
It's the same code for all bit depths, i provide a fixed-size signed int
buffer to the lib (size=16384), with values with appropriate ranges for
each bit
2018 Mar 24
0
Crash when writing 32bit flac files, am I doing something wrong ?
...urrently limited to 24 bits because
* of prevalent 32-bit math, so make sure and use this value when
* appropriate.
*/
#define FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE (24u)
also, init_stream_internal_() function already checks bit depth:
if(encoder->protected_->bits_per_sample <
FLAC__MIN_BITS_PER_SAMPLE || encoder->protected_->bits_per_sample >
FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE)
return FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BITS_PER_SAMPLE;
so, maybe you forgot to check return value for errors?