From fd90c003d29e4de1def462c7d6fd127e9e9d75d2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 1 Mar 2018 22:12:16 +0100 Subject: mp_image: replace rude function with less rude FFmpeg upstream function This is new, thus a dependency bump is required. --- common/av_common.c | 48 ------------------------------------------------ common/av_common.h | 3 --- 2 files changed, 51 deletions(-) (limited to 'common') diff --git a/common/av_common.c b/common/av_common.c index a76dd37117..00c7d79a74 100644 --- a/common/av_common.c +++ b/common/av_common.c @@ -365,51 +365,3 @@ int mp_set_avopts(struct mp_log *log, void *avobj, char **kv) } return success; } - -#if LIBAVUTIL_VERSION_MICRO >= 100 -AVFrameSideData *ffmpeg_garbage(AVFrame *frame, - enum AVFrameSideDataType type, - AVBufferRef *buf) -{ - AVFrameSideData *ret, **tmp; - - if (!buf) - return NULL; - - if (frame->nb_side_data > INT_MAX / sizeof(*frame->side_data) - 1) - goto fail; - - tmp = av_realloc(frame->side_data, - (frame->nb_side_data + 1) * sizeof(*frame->side_data)); - if (!tmp) - goto fail; - frame->side_data = tmp; - - ret = av_mallocz(sizeof(*ret)); - if (!ret) - goto fail; - - ret->buf = buf; - ret->data = ret->buf->data; - ret->size = buf->size; - ret->type = type; - - frame->side_data[frame->nb_side_data++] = ret; - - return ret; -fail: - av_buffer_unref(&buf); - return NULL; -} -#else -AVFrameSideData *ffmpeg_garbage(AVFrame *frame, - enum AVFrameSideDataType type, - AVBufferRef *buf) -{ - AVFrameSideData *sd = av_frame_new_side_data(frame, type, buf->size); - if (sd) - memcpy(sd->data, buf->data, buf->size); - av_buffer_unref(&buf); - return sd; -} -#endif diff --git a/common/av_common.h b/common/av_common.h index 0e7c838884..6cbadb4a96 100644 --- a/common/av_common.h +++ b/common/av_common.h @@ -47,8 +47,5 @@ const char *mp_codec_from_av_codec_id(int codec_id); void mp_set_avdict(struct AVDictionary **dict, char **kv); void mp_avdict_print_unset(struct mp_log *log, int msgl, struct AVDictionary *d); int mp_set_avopts(struct mp_log *log, void *avobj, char **kv); -AVFrameSideData *ffmpeg_garbage(AVFrame *frame, - enum AVFrameSideDataType type, - AVBufferRef *buf); #endif -- cgit v1.2.3