[FFmpeg-cvslog] avutil/fifo: Constify AVFifo pointees in peek functions

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


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Wed Sep  6 23:07:41 2023 +0200| [5094d1f429e58a67c542f1c5940a3de5184c35ca] | committer: Andreas Rheinhardt

avutil/fifo: Constify AVFifo pointees in peek functions

They do not modify the AVFifo state.

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

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

 doc/APIchanges      | 3 +++
 libavutil/fifo.c    | 4 ++--
 libavutil/fifo.h    | 4 ++--
 libavutil/version.h | 2 +-
 4 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 030e219b80..bf4fe9419e 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:
 
+2023-09-07 - xxxxxxxxxx - lavu 58.23.100 - fifo.h
+  Constify the AVFifo pointees in av_fifo_peek() and av_fifo_peek_to_cb().
+
 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().
diff --git a/libavutil/fifo.c b/libavutil/fifo.c
index 9b32f708fc..b0807abbf7 100644
--- a/libavutil/fifo.c
+++ b/libavutil/fifo.c
@@ -252,12 +252,12 @@ int av_fifo_read_to_cb(AVFifo *f, AVFifoCB write_cb,
     return ret;
 }
 
-int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset)
+int av_fifo_peek(const AVFifo *f, void *buf, size_t nb_elems, size_t offset)
 {
     return fifo_peek_common(f, buf, &nb_elems, offset, NULL, NULL);
 }
 
-int av_fifo_peek_to_cb(AVFifo *f, AVFifoCB write_cb, void *opaque,
+int av_fifo_peek_to_cb(const AVFifo *f, AVFifoCB write_cb, void *opaque,
                        size_t *nb_elems, size_t offset)
 {
     return fifo_peek_common(f, NULL, nb_elems, offset, write_cb, opaque);
diff --git a/libavutil/fifo.h b/libavutil/fifo.h
index 70f9376d97..ce3a2aed7c 100644
--- a/libavutil/fifo.h
+++ b/libavutil/fifo.h
@@ -200,7 +200,7 @@ int av_fifo_read_to_cb(AVFifo *f, AVFifoCB write_cb,
  *
  * @return a non-negative number on success, a negative error code on failure
  */
-int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset);
+int av_fifo_peek(const AVFifo *f, void *buf, size_t nb_elems, size_t offset);
 
 /**
  * Feed data from a FIFO into a user-provided callback.
@@ -217,7 +217,7 @@ int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset);
  *
  * @return a non-negative number on success, a negative error code on failure
  */
-int av_fifo_peek_to_cb(AVFifo *f, AVFifoCB write_cb, void *opaque,
+int av_fifo_peek_to_cb(const AVFifo *f, AVFifoCB write_cb, void *opaque,
                        size_t *nb_elems, size_t offset);
 
 /**
diff --git a/libavutil/version.h b/libavutil/version.h
index 541e1c0685..b9a86e50a1 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  58
-#define LIBAVUTIL_VERSION_MINOR  22
+#define LIBAVUTIL_VERSION_MINOR  23
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \



More information about the ffmpeg-cvslog mailing list