diff mbox series

[FFmpeg-devel,4/4] avformat/utils: change stream side data related public functions and struct size types to size_t

Message ID 20200601172539.17081-4-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/4,v2] avutil/buffer: change public function and struct size parameter types to size_t
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

James Almer June 1, 2020, 5:25 p.m. UTC
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@gmail.com>
---
Same sitaution as Patch 3/4 but for av_stream_get_side_data().

 libavformat/avformat.h | 8 ++++++++
 libavformat/utils.c    | 8 ++++++++
 2 files changed, 16 insertions(+)
diff mbox series

Patch

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 21c282a100..ae00c50a32 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -2183,7 +2183,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.
  *
@@ -2193,7 +2197,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 c9385318f6..03ddf955a2 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -5496,7 +5496,11 @@  int ff_generate_avci_extradata(AVStream *st)
 }
 
 uint8_t *av_stream_get_side_data(const AVStream *st,
+#if FF_API_BUFFER_SIZE_T
                                  enum AVPacketSideDataType type, int *size)
+#else
+                                 enum AVPacketSideDataType type, size_t *size)
+#endif
 {
     int i;
 
@@ -5549,7 +5553,11 @@  int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type,
 }
 
 uint8_t *av_stream_new_side_data(AVStream *st, enum AVPacketSideDataType type,
+#if FF_API_BUFFER_SIZE_T
                                  int size)
+#else
+                                 size_t size)
+#endif
 {
     int ret;
     uint8_t *data = av_malloc(size);