[FFmpeg-devel] [PATCH 4/4] avformat/utils: change stream side data related public functions and struct size types to size_t
James Almer
jamrial at gmail.com
Mon Jun 1 20:25:39 EEST 2020
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>
---
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 --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);
--
2.26.2
More information about the ffmpeg-devel
mailing list