diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-11-08 23:55:00 +0100 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2017-11-10 16:44:17 +0100 |
commit | 1fa3a9a31de11a2dee0efc75b89862e80ab3c90f (patch) | |
tree | 6a6ac3856ec0fbb1378a5111dc37edad93181d6d /libavutil/frame.c | |
parent | dd435c957aa48349f25c58bac88010d5af696227 (diff) | |
download | ffmpeg-1fa3a9a31de11a2dee0efc75b89862e80ab3c90f.tar.gz |
avutil/frame: Add private_ref to AVFrame
This gives FFmpeg libs a field that they can freely and safely use.
Avoiding the need of wrapping of a users opaque_ref field and its issues.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavutil/frame.c')
-rw-r--r-- | libavutil/frame.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavutil/frame.c b/libavutil/frame.c index 982fbb5c81..662a7e5ab5 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -383,12 +383,17 @@ FF_ENABLE_DEPRECATION_WARNINGS #endif av_buffer_unref(&dst->opaque_ref); + av_buffer_unref(&dst->private_ref); if (src->opaque_ref) { dst->opaque_ref = av_buffer_ref(src->opaque_ref); if (!dst->opaque_ref) return AVERROR(ENOMEM); } - + if (src->private_ref) { + dst->private_ref = av_buffer_ref(src->private_ref); + if (!dst->private_ref) + return AVERROR(ENOMEM); + } return 0; } @@ -524,6 +529,7 @@ void av_frame_unref(AVFrame *frame) av_buffer_unref(&frame->hw_frames_ctx); av_buffer_unref(&frame->opaque_ref); + av_buffer_unref(&frame->private_ref); get_frame_defaults(frame); } |