[Flac-dev] flac fails encoding 88.2

Roland Rabien Roland.Rabien at mackie.com
Tue Mar 13 16:35:15 PDT 2007


I do the following to init flac:

        encoder = FLAC__stream_encoder_new();

        e = FLAC__stream_encoder_set_do_mid_side_stereo (encoder,
numChannels == 2);
        e = FLAC__stream_encoder_set_loose_mid_side_stereo (encoder,
numChannels == 2);
        e = FLAC__stream_encoder_set_channels (encoder, numChannels);
        e = FLAC__stream_encoder_set_bits_per_sample (encoder, jmin (24,
bitsPerSample));
        e = FLAC__stream_encoder_set_sample_rate (encoder, sampleRate);
        e = FLAC__stream_encoder_set_blocksize (encoder, 2048);
        e = FLAC__stream_encoder_set_do_escape_coding (encoder, true);
        e = FLAC__stream_encoder_set_write_callback (encoder,
&encodeWriteCallback);
        e = FLAC__stream_encoder_set_metadata_callback (encoder,
&encodeMetadataCallback);
        e = FLAC__stream_encoder_set_client_data (encoder, (void*)this);

And everything goes ok.

But then when I go:

bool ok = (FLAC__stream_encoder_init (encoder) == FLAC__STREAM_ENCODER_OK);

It fails if sampleRate is 88200, but ti works if the sampleRate is 44100.

Any idea what I'm doing wrong?

I'm not sure what version of flac I am using, it is fairly old, but I
don't see any version numbers in the headers. Is this a known bug that
has been fixed?

R



More information about the Flac-dev mailing list