diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-11-25 20:23:32 +0100 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-11-25 23:23:24 +0100 |
commit | b473c9937ebe9aafef9d2e07f080fb12ecc53ef4 (patch) | |
tree | 98ff7ca2cd36d57b928ddc0ff45d3801494b9e8b /libavutil/samplefmt.h | |
parent | 329b8f85b0489fad819c52866dcc66170eef5d32 (diff) | |
download | ffmpeg-b473c9937ebe9aafef9d2e07f080fb12ecc53ef4.tar.gz |
lavu/samplefmt: return the size of the allocated samples buffer at the next bump
Make the functions av_samples_fill_arrays, av_samples_alloc, and
avcodec_fill_audio_frame return a buffer size rather than 0 in case of
success. This will be enabled at the next libavutil major bump, in order
to preserve backward compatibility.
Returning the size allows to simplify the code, avoiding a few function
calls.
Diffstat (limited to 'libavutil/samplefmt.h')
-rw-r--r-- | libavutil/samplefmt.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavutil/samplefmt.h b/libavutil/samplefmt.h index 17300d1e95..e222ba2ad9 100644 --- a/libavutil/samplefmt.h +++ b/libavutil/samplefmt.h @@ -183,7 +183,9 @@ int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples, * @param nb_samples the number of samples in a single channel * @param sample_fmt the sample format * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return 0 on success or a negative error code on failure + * @return >=0 on success or a negative error code on failure + * @todo return minimum size in bytes required for the buffer in case + * of success at the next bump */ int av_samples_fill_arrays(uint8_t **audio_data, int *linesize, const uint8_t *buf, @@ -204,7 +206,8 @@ int av_samples_fill_arrays(uint8_t **audio_data, int *linesize, * @param nb_channels number of audio channels * @param nb_samples number of samples per channel * @param align buffer size alignment (0 = default, 1 = no alignment) - * @return 0 on success or a negative error code on failure + * @return >=0 on success or a negative error code on failure + * @todo return the size of the allocated buffer in case of success at the next bump * @see av_samples_fill_arrays() */ int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels, |