From 2defa64d3bad1e1ebe3254e3e7968b9305042ab9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 16 Oct 2017 17:24:07 +0200 Subject: av_common: fix Libav build Fucking shit. --- common/av_common.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/common/av_common.c b/common/av_common.c index d3237250ef..1520b7ee1e 100644 --- a/common/av_common.c +++ b/common/av_common.c @@ -353,6 +353,7 @@ 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) @@ -387,3 +388,15 @@ 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 -- cgit v1.2.3