libsamplerate icon indicating copy to clipboard operation
libsamplerate copied to clipboard

[docu] src_callback_read result on error documented inconsistently

Open Flamefire opened this issue 5 years ago • 0 comments

For the function src_callback_read the documentation on what is reported on error is inconsistent.

  • https://github.com/erikd/libsamplerate/blob/7dcc9bb727dae4e2010cdc6ef7cda101b05509a4/src/samplerate.h#L90 says -1
  • https://github.com/erikd/libsamplerate/blob/7dcc9bb727dae4e2010cdc6ef7cda101b05509a4/doc/api_callback.html#L157 says zero but also zero when there is no more input
  • The implementation does never return -1: https://github.com/erikd/libsamplerate/blob/9225471ff240746d1e764845c5e6a97e76ee7486/src/samplerate.c#L190-L281

Using -1 for error makes that case distinguishable from "no more input", however I guess at that point it might be a breaking change. So I guess the documentation in the header should be updated and maybe tests for the error cases added to avoid possible confusion

Flamefire avatar Aug 16 '20 09:08 Flamefire