diff options
author | Bryce Van Dyk <[email protected]> | 2018-01-19 08:55:06 -0500 |
---|---|---|
committer | Paul Adenot <[email protected]> | 2018-03-01 13:32:24 +0100 |
commit | b189926890c44df9b2e9a6397922bf785f675c2b (patch) | |
tree | 1a884961a4f029b886daabe96623502231e732b6 /include | |
parent | eb3409e201daaaf03401ff234de5e1f69ba10c8d (diff) | |
download | cubeb-b189926890c44df9b2e9a6397922bf785f675c2b.tar.gz cubeb-b189926890c44df9b2e9a6397922bf785f675c2b.zip |
Clarify cubeb_data_callback ret value for input only streams.
The description of the ret value of cubeb_data_callback specifies that it is
the number of frames written to the output buffer. However, in the input only
stream case no data should be written to the output buffer and the output
buffer arg will be NULL.
This leaves it unclear as to the value that should be returned in the input
only case. To prevent a drain nframes should be returned, however, reading the
documentation left me unsure as to if I should return 0 or nframes.
This commit attempts to clarify the doc comment for input only streams.
Diffstat (limited to 'include')
-rw-r--r-- | include/cubeb/cubeb.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/cubeb/cubeb.h b/include/cubeb/cubeb.h index b7dc862..d690a0a 100644 --- a/include/cubeb/cubeb.h +++ b/include/cubeb/cubeb.h @@ -366,8 +366,12 @@ typedef struct { @param output_buffer A pointer to a buffer to be filled with audio samples, or nullptr if this is an input-only stream. @param nframes The number of frames of the two buffer. - @retval Number of frames written to the output buffer. If this number is - less than nframes, then the stream will start to drain. + @retval If the stream has output, this is the number of frames written to + the output buffer. In this case, if this number is less than + nframes then the stream will start to drain. If the stream is + input only, then returning nframes indicates data has been read. + In this case, a value less than nframes will result in the stream + being stopped. @retval CUBEB_ERROR on error, in which case the data callback will stop and the stream will enter a shutdown state. */ typedef long (* cubeb_data_callback)(cubeb_stream * stream, |