swresample/swresample: Constify swr_convert()

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2024-02-28 19:58:41 +01:00
parent 58e3ef7f54
commit b295aafb08
4 changed files with 10 additions and 6 deletions

View File

@ -2,6 +2,9 @@ The last version increases of all libraries were on 2023-02-09
API changes, most recent first:
2024-02-28 - xxxxxxxxxx - swr 4.14.100 - swresample.h
swr_convert() now accepts arrays of const pointers (to input and output).
2024-02-28 - xxxxxxxxxx - lavu 58.40.100 - timestamp.h
av_ts_make_time_string() now accepts a pointer to const AVRational.

View File

@ -563,7 +563,8 @@ static void copy(AudioData *out, AudioData *in,
memcpy(out->ch[0], in->ch[0], count*out->ch_count*out->bps);
}
static void fill_audiodata(AudioData *out, uint8_t *in_arg [SWR_CH_MAX]){
static void fill_audiodata(AudioData *out, uint8_t *const in_arg [SWR_CH_MAX])
{
int i;
if(!in_arg){
memset(out->ch, 0, sizeof(out->ch));
@ -835,8 +836,8 @@ int swr_is_initialized(struct SwrContext *s) {
}
int attribute_align_arg swr_convert(struct SwrContext *s,
uint8_t **out_arg, int out_count,
const uint8_t **in_arg, int in_count)
uint8_t * const *out_arg, int out_count,
const uint8_t * const *in_arg, int in_count)
{
AudioData * in= &s->in;
AudioData *out= &s->out;

View File

@ -340,8 +340,8 @@ void swr_close(struct SwrContext *s);
*
* @return number of samples output per channel, negative value on error
*/
int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
const uint8_t **in , int in_count);
int swr_convert(struct SwrContext *s, uint8_t * const *out, int out_count,
const uint8_t * const *in , int in_count);
/**
* Convert the next timestamp from input to output

View File

@ -30,7 +30,7 @@
#include "version_major.h"
#define LIBSWRESAMPLE_VERSION_MINOR 13
#define LIBSWRESAMPLE_VERSION_MINOR 14
#define LIBSWRESAMPLE_VERSION_MICRO 100
#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \