diff options
author | Anton Khirnov <anton@khirnov.net> | 2016-11-07 14:21:18 +0100 |
---|---|---|
committer | wm4 <nfxjfg@googlemail.com> | 2017-03-21 06:16:49 +0100 |
commit | 98f89d615b6490a5b93930c7bfa74c427dedf04e (patch) | |
tree | 6075ff22032f02de26db54071d4df15fb61a642b /libavcodec | |
parent | b6587421c7799f18038c7c802b62d034ede52f8f (diff) |
pthread_frame: properly propagate the hw frame context across frame threads
Merges Libav commit 84f22568.
Signed-off-by: wm4 <nfxjfg@googlemail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/pthread_frame.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c index 2a5dfc6723..18f89ee73d 100644 --- a/libavcodec/pthread_frame.c +++ b/libavcodec/pthread_frame.c @@ -235,6 +235,17 @@ FF_ENABLE_DEPRECATION_WARNINGS dst->sample_fmt = src->sample_fmt; dst->channel_layout = src->channel_layout; 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) { |