summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/av_common.c13
1 files changed, 13 insertions, 0 deletions
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