diff mbox series

[FFmpeg-devel,v2,18/22] avutil/audio_fifo: Constify some pointees

Message ID AS8P250MB0744CD29165CB963F009EECC8FEEA@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Headers show
Series [FFmpeg-devel,v2,01/22] fate/demux, lavf-container: Workaround for AV1-aspect ratio issue | expand

Commit Message

Andreas Rheinhardt Sept. 7, 2023, 1:05 a.m. UTC
Also constify AVAudioFifo* in the peek functions
besides constifying intermediate pointers (void**->void * const *).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 doc/APIchanges         | 4 ++++
 libavutil/audio_fifo.c | 9 +++++----
 libavutil/audio_fifo.h | 9 +++++----
 3 files changed, 14 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/doc/APIchanges b/doc/APIchanges
index c9f7a61e4d..2dbcd47fc3 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.xx.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.xx.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.