diff options
author | Anton Khirnov <anton@khirnov.net> | 2022-07-16 17:48:11 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-08-02 10:44:37 +0200 |
commit | eede1d2927db18b962741e6a09ec1401fdad6277 (patch) | |
tree | 895d6736a3fd518de00f4aacd13123584bb0c675 /libavutil | |
parent | d9cd192dddb459e85a243dd0349f32e9a4f7a9d8 (diff) |
lavu/frame: allow calling av_frame_make_writable() on non-refcounted frames
This is an easy way to make a refcounted frame from a non-refcounted
one.
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/frame.c | 3 | ||||
-rw-r--r-- | libavutil/frame.h | 3 | ||||
-rw-r--r-- | libavutil/version.h | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/libavutil/frame.c b/libavutil/frame.c index 9c9bab3fcf..de4ad1f94d 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -552,9 +552,6 @@ int av_frame_make_writable(AVFrame *frame) AVFrame tmp; int ret; - if (!frame->buf[0]) - return AVERROR(EINVAL); - if (av_frame_is_writable(frame)) return 0; diff --git a/libavutil/frame.h b/libavutil/frame.h index 856959f979..6d9563bc5d 100644 --- a/libavutil/frame.h +++ b/libavutil/frame.h @@ -828,7 +828,8 @@ int av_frame_is_writable(AVFrame *frame); * Ensure that the frame data is writable, avoiding data copy if possible. * * Do nothing if the frame is writable, allocate new buffers and copy the data - * if it is not. + * if it is not. Non-refcounted frames behave as non-writable, i.e. a copy + * is always made. * * @return 0 on success, a negative AVERROR on error. * diff --git a/libavutil/version.h b/libavutil/version.h index ee4c531b80..e9eefcdb2c 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 57 -#define LIBAVUTIL_VERSION_MINOR 30 +#define LIBAVUTIL_VERSION_MINOR 31 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |