summaryrefslogtreecommitdiff
path: root/libavcodec/frame_thread_encoder.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-06-25 21:50:15 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-06-26 01:06:04 +0200
commit7d317d4706b49d572a1eb5269438753be18362c7 (patch)
tree8e6a9af364a552de36257de6f6b4dbb02409b246 /libavcodec/frame_thread_encoder.c
parent4bd4fc56abf946322fdd30fdc5cad11a309daabd (diff)
avcodec/frame_thread_encoder: Fix AV_OPT_TYPE_STRING handling in priv_data
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/frame_thread_encoder.c')
-rw-r--r--libavcodec/frame_thread_encoder.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c
index 6cf1a68fe7..33928fe5f0 100644
--- a/libavcodec/frame_thread_encoder.c
+++ b/libavcodec/frame_thread_encoder.c
@@ -23,6 +23,7 @@
#include "libavutil/fifo.h"
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
+#include "libavutil/opt.h"
#include "libavutil/thread.h"
#include "avcodec.h"
#include "internal.h"
@@ -197,7 +198,12 @@ int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options){
*thread_avctx = *avctx;
thread_avctx->priv_data = tmpv;
thread_avctx->internal = NULL;
- memcpy(thread_avctx->priv_data, avctx->priv_data, avctx->codec->priv_data_size);
+ if (avctx->codec->priv_class) {
+ int ret = av_opt_copy(thread_avctx->priv_data, avctx->priv_data);
+ if (ret < 0)
+ goto fail;
+ } else
+ memcpy(thread_avctx->priv_data, avctx->priv_data, avctx->codec->priv_data_size);
thread_avctx->thread_count = 1;
thread_avctx->active_thread_type &= ~FF_THREAD_FRAME;