diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-06-05 11:24:19 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-09-28 11:33:36 +0200 |
commit | 56ff01e6ec915963b467d3d2d488e400f67f46a3 (patch) | |
tree | 161ff4c73c2f35aa32369a7bc10da047741db7d6 /libavcodec/pthread_frame.c | |
parent | 16f8b96dfa10b6b21ed1b2fbb8d356d7672c7251 (diff) | |
download | ffmpeg-56ff01e6ec915963b467d3d2d488e400f67f46a3.tar.gz |
pthread_frame: use av_buffer_replace() to simplify code
Diffstat (limited to 'libavcodec/pthread_frame.c')
-rw-r--r-- | libavcodec/pthread_frame.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c index 3255aa9337..f8a01ad8cd 100644 --- a/libavcodec/pthread_frame.c +++ b/libavcodec/pthread_frame.c @@ -297,16 +297,9 @@ static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src, dst->hwaccel_flags = src->hwaccel_flags; - if (!!dst->internal->pool != !!src->internal->pool || - (dst->internal->pool && dst->internal->pool->data != src->internal->pool->data)) { - av_buffer_unref(&dst->internal->pool); - - if (src->internal->pool) { - dst->internal->pool = av_buffer_ref(src->internal->pool); - if (!dst->internal->pool) - return AVERROR(ENOMEM); - } - } + err = av_buffer_replace(&dst->internal->pool, src->internal->pool); + if (err < 0) + return err; } if (for_user) { |