[FFmpeg-cvslog] avutil/audio_fifo: Constify some pointees

Andreas Rheinhardt git at videolan.org
Tue Sep 12 11:05:36 EEST 2023


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Wed Sep  6 22:47:24 2023 +0200| [fa4bf5793a0aa85a031a729fc8de7412f85b0c10] | committer: Andreas Rheinhardt

avutil/audio_fifo: Constify some pointees

Also constify AVAudioFifo* in the peek functions
besides constifying intermediate pointers (void**->void * const *).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fa4bf5793a0aa85a031a729fc8de7412f85b0c10
---

 doc/APIchanges         | 4 ++++
 libavutil/audio_fifo.c | 9 +++++----
 libavutil/audio_fifo.h | 9 +++++----
 libavutil/version.h    | 2 +-
 4 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index ce583c6473..030e219b80 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,10 @@ The last version increases of all libraries were on 2023-02-09
 
 API changes, most recent first:
 
+2023-09-07 - xxxxxxxxxx - lavu 58.22.100 - audio_fifo.h
+  Constify some pointees in av_audio_fifo_write(), av_audio_fifo_read(),
+  av_audio_fifo_peek() and av_audio_fifo_peek_at().
+
 2023-09-07 - xxxxxxxxxx - lavu 58.21.100 - samplefmt.h
   Constify some pointees in av_samples_copy() and av_samples_set_silence().
 
diff --git a/libavutil/audio_fifo.c b/libavutil/audio_fifo.c
index f4103178ba..dc2dea9b2d 100644
--- a/libavutil/audio_fifo.c
+++ b/libavutil/audio_fifo.c
@@ -116,7 +116,7 @@ int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples)
     return 0;
 }
 
-int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples)
+int av_audio_fifo_write(AVAudioFifo *af, void * const *data, int nb_samples)
 {
     int i, ret, size;
 
@@ -142,12 +142,13 @@ int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples)
     return nb_samples;
 }
 
-int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples)
+int av_audio_fifo_peek(const AVAudioFifo *af, void * const *data, int nb_samples)
 {
     return av_audio_fifo_peek_at(af, data, nb_samples, 0);
 }
 
-int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offset)
+int av_audio_fifo_peek_at(const AVAudioFifo *af, void * const *data,
+                          int nb_samples, int offset)
 {
     int i, ret, size;
 
@@ -171,7 +172,7 @@ int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offs
     return nb_samples;
 }
 
-int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples)
+int av_audio_fifo_read(AVAudioFifo *af, void * const *data, int nb_samples)
 {
     int i, size;
 
diff --git a/libavutil/audio_fifo.h b/libavutil/audio_fifo.h
index d1e4c856dc..fa5f59a2be 100644
--- a/libavutil/audio_fifo.h
+++ b/libavutil/audio_fifo.h
@@ -91,7 +91,7 @@ int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples);
  *                    code on failure. If successful, the number of samples
  *                    actually written will always be nb_samples.
  */
-int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples);
+int av_audio_fifo_write(AVAudioFifo *af, void * const *data, int nb_samples);
 
 /**
  * Peek data from an AVAudioFifo.
@@ -107,7 +107,7 @@ int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples);
  *                    be greater than nb_samples, and will only be less than
  *                    nb_samples if av_audio_fifo_size is less than nb_samples.
  */
-int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples);
+int av_audio_fifo_peek(const AVAudioFifo *af, void * const *data, int nb_samples);
 
 /**
  * Peek data from an AVAudioFifo.
@@ -124,7 +124,8 @@ int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples);
  *                    be greater than nb_samples, and will only be less than
  *                    nb_samples if av_audio_fifo_size is less than nb_samples.
  */
-int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offset);
+int av_audio_fifo_peek_at(const AVAudioFifo *af, void * const *data,
+                          int nb_samples, int offset);
 
 /**
  * Read data from an AVAudioFifo.
@@ -140,7 +141,7 @@ int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offs
  *                    be greater than nb_samples, and will only be less than
  *                    nb_samples if av_audio_fifo_size is less than nb_samples.
  */
-int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples);
+int av_audio_fifo_read(AVAudioFifo *af, void * const *data, int nb_samples);
 
 /**
  * Drain data from an AVAudioFifo.
diff --git a/libavutil/version.h b/libavutil/version.h
index f1946b780f..541e1c0685 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  58
-#define LIBAVUTIL_VERSION_MINOR  21
+#define LIBAVUTIL_VERSION_MINOR  22
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \



More information about the ffmpeg-cvslog mailing list