[FFmpeg-cvslog] avformat/utils: change AVStream side data related public function and struct size types to size_t

James Almer git at videolan.org
Thu Mar 11 01:43:50 EET 2021


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sat Mar  6 15:40:58 2021 -0300| [42e68fe01587b541c9ced34906b09e3c9c894e74] | committer: James Almer

avformat/utils: change AVStream side data related public function and struct size types to size_t

av_stream_add_side_data() already defines size as a size_t, so this makes it
consistent across all side data functions.

Signed-off-by: James Almer <jamrial at gmail.com>

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

 doc/APIchanges         | 4 ++++
 libavformat/avformat.h | 8 ++++++++
 libavformat/utils.c    | 4 ++--
 libavformat/version.h  | 2 +-
 4 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 864d32053d..13350c0db0 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,10 @@ libavutil:     2017-10-21
 
 API changes, most recent first:
 
+2021-03-10 - xxxxxxxxxx - lavf 58.72.100 - avformat.h
+  Change AVBufferRef related AVStream function and struct size
+  parameter and fields type to size_t at next major bump.
+
 2021-03-10 - xxxxxxxxxx - lavc 58.130.100 - packet.h
   Change AVBufferRef related AVPacket function and struct size
   parameter and fields type to size_t at next major bump.
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 7da2f3d98e..e3bd01ec7f 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -2083,7 +2083,11 @@ int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type,
  * @return pointer to fresh allocated data or NULL otherwise
  */
 uint8_t *av_stream_new_side_data(AVStream *stream,
+#if FF_API_BUFFER_SIZE_T
                                  enum AVPacketSideDataType type, int size);
+#else
+                                 enum AVPacketSideDataType type, size_t size);
+#endif
 /**
  * Get side information from stream.
  *
@@ -2094,7 +2098,11 @@ uint8_t *av_stream_new_side_data(AVStream *stream,
  * @return pointer to data if present or NULL otherwise
  */
 uint8_t *av_stream_get_side_data(const AVStream *stream,
+#if FF_API_BUFFER_SIZE_T
                                  enum AVPacketSideDataType type, int *size);
+#else
+                                 enum AVPacketSideDataType type, size_t *size);
+#endif
 
 AVProgram *av_new_program(AVFormatContext *s, int id);
 
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 36164e0f0d..98e6c55602 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -5471,7 +5471,7 @@ int ff_generate_avci_extradata(AVStream *st)
 }
 
 uint8_t *av_stream_get_side_data(const AVStream *st,
-                                 enum AVPacketSideDataType type, int *size)
+                                 enum AVPacketSideDataType type, buffer_size_t *size)
 {
     int i;
 
@@ -5524,7 +5524,7 @@ int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type,
 }
 
 uint8_t *av_stream_new_side_data(AVStream *st, enum AVPacketSideDataType type,
-                                 int size)
+                                 buffer_size_t size)
 {
     int ret;
     uint8_t *data = av_malloc(size);
diff --git a/libavformat/version.h b/libavformat/version.h
index a05676d979..2a2804582c 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,7 +32,7 @@
 // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
 // Also please add any ticket numbers that you believe might be affected here
 #define LIBAVFORMAT_VERSION_MAJOR  58
-#define LIBAVFORMAT_VERSION_MINOR  71
+#define LIBAVFORMAT_VERSION_MINOR  72
 #define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \



More information about the ffmpeg-cvslog mailing list