From patchwork Mon Oct 8 15:36:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Buitenhuis X-Patchwork-Id: 10618 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:ab0:73d2:0:0:0:0:0 with SMTP id m18csp3780019uaq; Mon, 8 Oct 2018 08:44:00 -0700 (PDT) X-Google-Smtp-Source: ACcGV61TefqCQEYYmEzd2cpG+aKVzZXrB0Vw9zgXFnljoJIjBY2j+sG0OXXd4P7R/04zgFk/hw49 X-Received: by 2002:a1c:2052:: with SMTP id g79-v6mr16397642wmg.42.1539013440444; Mon, 08 Oct 2018 08:44:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539013440; cv=none; d=google.com; s=arc-20160816; b=roNKfRMj/LuevpHQ/ZxQXPoR+gaVjtZDp3+KJtGBhb5yPqJOB2oJWXPuFIC83L00tX 9VVkfxegwRNLz0j9zzagOXXDkPjIE805K7pBiiwI6+HpWaxX3NALQqiaVpsdr7SPZdJW yKnZHkF1WQx2MWwDjK+EALrHCpCyfIR5IULfeI2Rmxqi4Xd18s+Ph4YDJVWW3zBuuuAc leHRMkInptzhnxwZ22zKXinCEb0a2vK1uiCgBYZm+C4RMIdoVzM45Q9ENOLLuu3iedhW 1IGPq+LMh/jV+SR3lMt4WGCXioiEcAnBqbBxknrxN5E0njdXSPtY7tV6lE+//7RFphxK BASA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=3jI+wVu4EgcSJZ4CKs9xZWBenicnSMe0yU0BojGtc1Y=; b=izd3MKaTzvrbT8s4w/FB+Rg3oJR3e9B9S4Hx93+iuDRD/ce6WaWMZVHlE+SCDmGAdd igmbwD0hvE6r/c/1u+b/2nLCuj9QzfsoBpQqSji7QXD5QBSKrE/19DpMMqDcFoHDRCHk AR6Gq5Cv3eSH1qYSsoKMxSt0PG+nw+U2AVHBBsVerqQjYyJdgUAkRFKGyESKhpF2h8tS AuLRiWilLHXG2jG8zUvCqaZupLeQyT95xBsHvqaJRytDqHVTDic+Ee9NlEaUqFxo0MoX Q8Q85jiEPr8MvnAhMDAZ2qaARBk/L8UrbOIAldmIswQbSh/QrGzrAxvwI9eRUzRMdbiB 2VjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=LfaSuEMM; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i2-v6si13178136wrq.178.2018.10.08.08.43.59; Mon, 08 Oct 2018 08:44:00 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=LfaSuEMM; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0AEB4689FDE; Mon, 8 Oct 2018 18:43:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1145F68920E for ; Mon, 8 Oct 2018 18:43:30 +0300 (EEST) Received: by mail-wm1-f67.google.com with SMTP id 189-v6so8615735wmw.2 for ; Mon, 08 Oct 2018 08:43:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=NCHF4mxQCnHoq9TYfBMmQrPAdDnAIZX5OdSUmBO5BeA=; b=LfaSuEMMf47daAff2+MA510FXXot0ceExKpU+7JNEhkfq2YtIMyGpegxJ0UGeVVUQu jR6IXj4HrfHs9LP+eMrMfxHOCx6ZBYX+aN9d3pLH9Iry0fCa9qNKSwntEo/5i7nRdd9K 39b7AcLJaTEiTMbJa1g2WuOUieG54MwkEtU63DBdDREMjboK/zuH7Q6cir/qFg3LXyxb AAVfIR48tf9IcCAcnNyH6wZv6Jtm9Ty54yGhcApawpIfXUxn0FiOEdXFl2DI6ldp7vdL r20Xx0ghsrgdEyyjAvsZfGza3QD8TJXpiLidZpbckmhwnLIpuvYcJeIhn3POlTnTaDeJ BTLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=NCHF4mxQCnHoq9TYfBMmQrPAdDnAIZX5OdSUmBO5BeA=; b=HxpjqDspnoy/6LYnvvZYfH7Hv+G4DdzX/rGy4UbCN+jDIIGVoAwkG2k35Spu5DfrDp S0HpjePzG2VcMVSoyd7uNilUXj64u+vm+Df3v30+vOVv9ci679W3nI8DzX+nJ77EOIRs J2LG+LTGBwsIHpJQOzO9redmOaYXLKSr1/2ov6yu4Iap8sdhr0djaleAWj3co+WhWh+N B1J7d57TTwpDAfO/+OS78km5nrRGO2O5O1DG/ZGWTOHaLdMU3TOdyBjq2WfD4PavvTAV SmUkLlmfZjQwk3tjIx0fgwT9e3VG++QMurSTcP5TgpHGzt9l+pyEYlrKgp9QI2CouZM2 YeTw== X-Gm-Message-State: ABuFfohObsT5FFS0+RgrAUmTfirQ8JH9NpaoxfSvupmS5NShUFWGz5B6 00VYtrbBE52dCsbfNbpdICKUXD6h X-Received: by 2002:a1c:a794:: with SMTP id q142-v6mr16512527wme.77.1539012998768; Mon, 08 Oct 2018 08:36:38 -0700 (PDT) Received: from localhost.localdomain ([81.2.170.96]) by smtp.gmail.com with ESMTPSA id y19-v6sm9171439wra.60.2018.10.08.08.36.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Oct 2018 08:36:38 -0700 (PDT) From: Derek Buitenhuis To: ffmpeg-devel@ffmpeg.org Date: Mon, 8 Oct 2018 11:36:27 -0400 Message-Id: <20181008153627.22264-1-derek.buitenhuis@gmail.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] h264_slice: Copy the value of x264_build before calling h264_slice_header_init during thread init 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" If we don't copy this value first, it is seen as 0 by h264_slice_header_init, due to zero-allocation of the new context, triggering an old hack that multiplied the denominator by 2 for files produced by old x264 versions, but only if more than one thread was used. Fixes #7475. Signed-off-by: Derek Buitenhuis --- libavcodec/h264_slice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 58e1aaf02f..d09cee4b13 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -358,6 +358,7 @@ int ff_h264_update_thread_context(AVCodecContext *dst, h->mb_num = h1->mb_num; h->mb_stride = h1->mb_stride; h->b_stride = h1->b_stride; + h->x264_build = h1->x264_build; if (h->context_initialized || h1->context_initialized) { if ((err = h264_slice_header_init(h)) < 0) { @@ -399,7 +400,6 @@ int ff_h264_update_thread_context(AVCodecContext *dst, h->enable_er = h1->enable_er; h->workaround_bugs = h1->workaround_bugs; - h->x264_build = h1->x264_build; h->droppable = h1->droppable; // extradata/NAL handling