From patchwork Thu Dec 8 15:24:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Buitenhuis X-Patchwork-Id: 1714 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.86 with SMTP id o83csp928504vsa; Thu, 8 Dec 2016 07:25:39 -0800 (PST) X-Received: by 10.28.43.198 with SMTP id r189mr2621994wmr.67.1481210739003; Thu, 08 Dec 2016 07:25:39 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id d7si29707495wjf.81.2016.12.08.07.25.38; Thu, 08 Dec 2016 07:25:38 -0800 (PST) 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; 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 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 18B0068A163; Thu, 8 Dec 2016 17:25:26 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 57A41689BD1 for ; Thu, 8 Dec 2016 17:25:19 +0200 (EET) Received: by mail-wm0-f68.google.com with SMTP id u144so4231166wmu.0 for ; Thu, 08 Dec 2016 07:25:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=/S7JdZUoL2h04j/obPqyo2NxHCXcyPBMRZ6YEZif/PA=; b=THS8u5zQv9hkscvEtsxvVQGVwLzXEQmn7CmZTkJIqt+XA+B/STHynNZmchT/86YHIy L7TG7r4gtl0/zjUfN49Qf6WCISrpjrcGJeGYoSGzWDtfq9J7+mhKqPscovVovxdsXsC6 Fn3T7SONjAp/IZ6n42ksP3tK765ckiwdISWRYwRQuCpNANm4etdiJ1vfUCl/q+Bwg/L9 BVn7eiVbrjAt61mADEd8gUDLZOAsN84gmJ+SKUEU0JaQRqTEvZX04qWb1eesdOg2iLvR kNrGIRMNPHWBY55xpnkMUchd3yy/y65xHDanMafQ1+UwjB8iG8Kcku3mMbSOteGAwIYm U+BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=/S7JdZUoL2h04j/obPqyo2NxHCXcyPBMRZ6YEZif/PA=; b=YyjhdFczujlehv7dzAd2lYWrZCxG8e+ZU/2P/YfvqCKrmaFi56dvopyXStV9aEjYlv Nmgvoz9FjdLLudVmKMWeB4pVv2hHozF6QHhP3caAKEYY/2hHIb3ySLu5254th9PbnZ2W ZVGwnMotXUfuhOyAiUS9keK47VHm4cjtzKcBhS7W4yQ+k6QfjNKfgAlMW83eJwy947Mc 6dCFdZpURcNKn6tOy+evrVvm5mF9hEX+YhozHaot6Y1Ri56BssY1Vewx5oYIuCl8Z9i8 Znhd0bhzReiAYAxiUBqNY3RSy//e52OB7Lpv0egvimcm0uMyR8leBzR+zck6JEjk11Ei iSbw== X-Gm-Message-State: AKaTC00nk+nyYDk8agMkGTKue94mQ+mD3gFAbULPRaVdV2aya6uBO7nxWA5nuZZaa5yb7Q== X-Received: by 10.28.105.78 with SMTP id e75mr2823086wmc.55.1481210722150; Thu, 08 Dec 2016 07:25:22 -0800 (PST) Received: from localhost.localdomain ([62.208.37.185]) by smtp.gmail.com with ESMTPSA id 81sm15797159wmw.7.2016.12.08.07.25.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Dec 2016 07:25:21 -0800 (PST) From: Derek Buitenhuis To: ffmpeg-devel@ffmpeg.org Date: Thu, 8 Dec 2016 15:24:32 +0000 Message-Id: <20161208152432.27707-3-derek.buitenhuis@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161208152432.27707-1-derek.buitenhuis@gmail.com> References: <20161208152432.27707-1-derek.buitenhuis@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/2] h264_slice: Wait for refs to be available before we use them in error concealment 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" This could happen when there was a frame number gap and frame threading was used. This fixes #5458. Debugging-by: Ronald S. Bultje Debugging-by: Justin Ruggles Signed-off-by: Derek Buitenhuis --- libavcodec/h264_slice.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index a8a8731138..50c5e6b692 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -1424,6 +1424,9 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl, h->short_ref[0]->f->width == prev->f->width && h->short_ref[0]->f->height == prev->f->height && h->short_ref[0]->f->format == prev->f->format) { + ff_thread_await_progress(&prev->tf, INT_MAX, 0); + if (prev->f->interlaced_frame) + ff_thread_await_progress(&prev->tf, INT_MAX, 1); av_image_copy(h->short_ref[0]->f->data, h->short_ref[0]->f->linesize, (const uint8_t **)prev->f->data,