---
libavcodec/pthread_frame.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index 601f170447..3626e745f5 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) {
--
2.26.2
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".