Skip to content
Snippets Groups Projects
Commit 7d317d47 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

avcodec/frame_thread_encoder: Fix AV_OPT_TYPE_STRING handling in priv_data

parent 4bd4fc56
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "libavutil/fifo.h" #include "libavutil/fifo.h"
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/imgutils.h" #include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/thread.h" #include "libavutil/thread.h"
#include "avcodec.h" #include "avcodec.h"
#include "internal.h" #include "internal.h"
...@@ -197,7 +198,12 @@ int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options){ ...@@ -197,7 +198,12 @@ int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options){
*thread_avctx = *avctx; *thread_avctx = *avctx;
thread_avctx->priv_data = tmpv; thread_avctx->priv_data = tmpv;
thread_avctx->internal = NULL; 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->thread_count = 1;
thread_avctx->active_thread_type &= ~FF_THREAD_FRAME; thread_avctx->active_thread_type &= ~FF_THREAD_FRAME;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment