diff mbox series

[FFmpeg-devel,33/39] avcodec/frame_thread_encoder: Remove redundant memcpy

Message ID HE1PR0301MB2154B7EC2E38841B8AD511188F299@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Commit cbf6047c83c8142dd13fabd07906a844f4165f19
Headers show
Series [FFmpeg-devel,01/39] avcodec/audiotoolboxenc: Remove AV_CODEC_CAP_DR1 | expand


Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt May 21, 2021, 9:17 a.m. UTC
In case the underlying AVCodec has no private class, the private data
of both the main as well as each worker AVCodecContext is just zeroed
(the codec's init function has not been called on any of them and
without a private class there is no way to legitimately set anything
before the aforementioned init function).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
 libavcodec/frame_thread_encoder.c | 2 --
 1 file changed, 2 deletions(-)
diff mbox series


diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c
index 5d14442c01..b3e571f4b0 100644
--- a/libavcodec/frame_thread_encoder.c
+++ b/libavcodec/frame_thread_encoder.c
@@ -215,8 +215,6 @@  int ff_frame_thread_encoder_init(AVCodecContext *avctx)
             int ret = av_opt_copy(thread_avctx->priv_data, avctx->priv_data);
             if (ret < 0)
                 goto fail;
-        } else if (avctx->codec->priv_data_size) {
-            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;