[Flac-dev] Legal sample rates

Erik de Castro Lopo erikd-flac at mega-nerd.com
Thu Nov 11 23:22:32 PST 2004


On Thu, 11 Nov 2004 13:33:42 -0800 (PST)
Josh Coalson <xflac at yahoo.com> wrote:

> I guess FLAC__STREAM_ENCODER_NOT_STREAMABLE could be expanded
> to FLAC__STREAM_ENCODER_NOT_STREAMABLE_BAD_SAMPLE_RATE,
> FLAC__STREAM_ENCODER_NOT_STREAMABLE_BAD_BITS_PER_SAMPLE etc
> but it doesn't seem worth changing the API for.

Here's what I do in libsndfile:

   - Errors are integers from 0 (SFE_NO_ERROR) through to some 
     maximum error number (which can change from release to 
     release).
   - API functions can return an error number.
   - The API supplies a function (rather than a string array)
     to convert the error number into a "const char *" string
     after checking that the error number is in the valid range.
   - Using a function means that error messages can be added and
     removed from release to release without breaking the API.

Hope this helps,
Erik
-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo  nospam at mega-nerd.com (Yes it's valid)
+-----------------------------------------------------------+
"If POSIX threads are a good thing, perhaps I don't want to know what
they're better than."                                   -- Rob Pike


More information about the Flac-dev mailing list