summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-02-28 19:58:41 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-03-02 02:51:55 +0100
commitb295aafb08209a76b0052b9163a4f2e0c533ba1e (patch)
treef5b15acd0417e8e8d72c30007beb847e002c9d37
parent58e3ef7f54685f967acd06a71de624882258902d (diff)
swresample/swresample: Constify swr_convert()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--doc/APIchanges3
-rw-r--r--libswresample/swresample.c7
-rw-r--r--libswresample/swresample.h4
-rw-r--r--libswresample/version.h2
4 files changed, 10 insertions, 6 deletions
diff --git a/doc/APIchanges b/doc/APIchanges
index fb2b1440fb..7d46ebb006 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -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.
diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index 1cf83a803f..6948892d76 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -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;
diff --git a/libswresample/swresample.h b/libswresample/swresample.h
index d4dcaebdcf..78495a0d4c 100644
--- a/libswresample/swresample.h
+++ b/libswresample/swresample.h
@@ -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
diff --git a/libswresample/version.h b/libswresample/version.h
index 46a4e2fc62..dfaf6f8c42 100644
--- a/libswresample/version.h
+++ b/libswresample/version.h
@@ -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, \