From patchwork Mon Jul 10 01:19:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 4280 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.1.76 with SMTP id 73csp2908564vsb; Sun, 9 Jul 2017 18:20:11 -0700 (PDT) X-Received: by 10.223.175.18 with SMTP id z18mr6383375wrc.22.1499649611144; Sun, 09 Jul 2017 18:20:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499649611; cv=none; d=google.com; s=arc-20160816; b=uzAtQido7/IfWBmiw5XXbBqrD4OAbWo3aixfFy3JLZN/9TCo/yJS81X0Fs8l948kXx PBVwsUggFjve4+u/Wer+4UvUzEEkIubKF0PeVOMuQAgT8mBpS+BcaA0jS2dfLOBjYuYZ Lo+0N5qRkSgDSSIqtyXMyYWXDUz7jDTszalnArnyZ/fTP8zTyQo6w1qhZb45X5IFEY8X T0z40SPiYX9yDTS9AxDbim0L17ARccIYc11D4F255kd5sBeHO4dJ3eczQ0oVdTmZ6eUo OY9O/fOLT8t9XX2dQ9Oh4t31GAjFOngRkZP+b+8GAFxm7vXjDLQMDMY6p2/yZKi4wC1W EiiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=oi6jN+8acS2fEz2IsNilVNTKXwUguXr7JtgACnrZbFM=; b=pfwRy2WlTdHRNGwdtl3xQeZ3JmM7DuxE7O/1454hV4VOVMEXzb8O3gyXc9Ojs/F0Rr eUgAAVMjZlzrjvGBw2+s5VgxO8Ef03lKq3Lcq+gXeUxONfKBCsnuvSE4pCVdoLUB6ZUk LPsTQRiOTagNa2Gj/psoMzO/K/vZGnvy/iplIt2gPvWrupddf3/oVSlWmvCjGc/tqpbl VTeXBIgteI4175rcP2kpR7W4uXXnwmrBsESTHtZSzIh5REEVdVQynoEiiM9c+KzveA4p eBpVLhmyYVoqaMKPjNTJWkEgdMSzA9jcFiuIaFJbdbsoEL9oOlfKWr5PFhGUgzVfEzhN Fogg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l65si7059478wrc.351.2017.07.09.18.20.09; Sun, 09 Jul 2017 18:20:11 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 03FC7689D42; Mon, 10 Jul 2017 04:20:03 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe04-1.mx.upcmail.net (vie01a-dmta-pe04-1.mx.upcmail.net [62.179.121.163]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 27D77689C64 for ; Mon, 10 Jul 2017 04:19:57 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe04.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dUNMm-0000Ll-Em for ffmpeg-devel@ffmpeg.org; Mon, 10 Jul 2017 03:20:00 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id ipKs1v00N0S5wYM01pKtMX; Mon, 10 Jul 2017 03:19:53 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 10 Jul 2017 03:19:51 +0200 Message-Id: <20170710011951.1435-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.13.0 Subject: [FFmpeg-devel] [PATCH] avcodec/mpegvideo: Fix all but one tsan warning in fate-vsynth1-mpeg4 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- libavcodec/mpegvideo.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index e29558b3a2..574b3854e0 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -495,7 +495,20 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, // in that case dst may need a reinit if (!s->context_initialized) { int err; - memcpy(s, s1, sizeof(MpegEncContext)); +#define COPY(x) s->x = s1->x; +#define COPYR(a, b) memcpy(&s->a, &s1->a, ((uint8_t*)&s->b) - ((uint8_t*)&s->a)) + COPYR(h263_aic, qscale); + COPYR(lambda, mv_dir); + COPYR(no_rounding, dest); + COPYR(mb_index2xy, resync_mb_x); + COPYR(next_p_frame_damaged, h263_aic_dir); + COPYR(h263_slice_structured, mcsel); + COPYR(quant_precision, first_slice_line); + COPYR(flipflop_rounding, gb); + COPYR(gop_picture_number, picture_structure); + COPYR(picture_structure, pblocks); + COPYR(decode_mb, er); + COPYR(error_rate, noise_reduction); s->avctx = dst; s->bitstream_buffer = NULL;