Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-11-07 16:21:18 +0300
committerAnton Khirnov <anton@khirnov.net>2016-11-10 11:00:11 +0300
commit84f225684cd389747907381122c073aa1c8b6bf1 (patch)
treeaed7fde54f2d73e39f5704ce653f1f85d07b0907 /libavcodec/pthread_frame.c
parent72a19f4013ec2c7f8581416f8ad4bf81df163fb6 (diff)
pthread_frame: properly propagate the hw frame context across frame threads
Diffstat (limited to 'libavcodec/pthread_frame.c')
-rw-r--r--libavcodec/pthread_frame.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index 210ee69dae..671c551f29 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -223,6 +223,17 @@ FF_ENABLE_DEPRECATION_WARNINGS
dst->hwaccel = src->hwaccel;
dst->hwaccel_context = src->hwaccel_context;
dst->internal->hwaccel_priv_data = src->internal->hwaccel_priv_data;
+
+ if (!!dst->hw_frames_ctx != !!src->hw_frames_ctx ||
+ (dst->hw_frames_ctx && dst->hw_frames_ctx->data != src->hw_frames_ctx->data)) {
+ av_buffer_unref(&dst->hw_frames_ctx);
+
+ if (src->hw_frames_ctx) {
+ dst->hw_frames_ctx = av_buffer_ref(src->hw_frames_ctx);
+ if (!dst->hw_frames_ctx)
+ return AVERROR(ENOMEM);
+ }
+ }
}
if (for_user) {