From patchwork Mon Jan 23 21:35:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 2298 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp1433019vsb; Mon, 23 Jan 2017 13:35:24 -0800 (PST) X-Received: by 10.223.165.76 with SMTP id j12mr24996068wrb.17.1485207324654; Mon, 23 Jan 2017 13:35:24 -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 q6si8643190wra.224.2017.01.23.13.35.23; Mon, 23 Jan 2017 13:35:24 -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; 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 CE782689D42; Mon, 23 Jan 2017 23:35:03 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe01-3.mx.upcmail.net (vie01a-qmta-pe01-3.mx.upcmail.net [62.179.121.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DB69B68A31B for ; Mon, 23 Jan 2017 23:34:56 +0200 (EET) Received: from [172.31.218.36] (helo=vie01a-dmta-pe02-3.mx.upcmail.net) by vie01a-pqmta-pe01.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1cVmGa-0002PN-VI for ffmpeg-devel@ffmpeg.org; Mon, 23 Jan 2017 22:35:08 +0100 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe02.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1cVmGU-0007TX-WE for ffmpeg-devel@ffmpeg.org; Mon, 23 Jan 2017 22:35:03 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id bxb11u01T0S5wYM01xb2Ny; Mon, 23 Jan 2017 22:35:02 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 23 Jan 2017 22:35:01 +0100 Message-Id: <20170123213501.32189-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.11.0 Subject: [FFmpeg-devel] [PATCH] avcodec/h264dec: Fix regression with "make fate-h264-attachment-631 THREADS=8" 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" Found-by: ubitux Signed-off-by: Michael Niedermayer --- libavcodec/h264_picture.c | 2 +- libavcodec/h264dec.c | 4 +++- libavcodec/h264dec.h | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libavcodec/h264_picture.c b/libavcodec/h264_picture.c index f634d2a1a7..2313eff5d7 100644 --- a/libavcodec/h264_picture.c +++ b/libavcodec/h264_picture.c @@ -185,7 +185,7 @@ int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup) ff_vdpau_h264_picture_complete(h); #endif - if (!in_setup && !h->droppable) + if (!in_setup && !h->droppable && h->has_slice) ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, h->picture_structure == PICT_BOTTOM_FIELD); emms_c(); diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index 4ecaec267c..6f2bd79628 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -607,6 +607,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size) int idr_cleared=0; int i, ret = 0; + h->has_slice = 0; h->nal_unit_type= 0; h->max_contexts = h->nb_slice_ctx; @@ -672,6 +673,7 @@ again: h->has_recovery_point = 1; case H264_NAL_SLICE: sl->gb = nal->gb; + h->has_slice = 1; if ((err = ff_h264_decode_slice_header(h, sl, nal))) break; @@ -839,7 +841,7 @@ end: } #endif /* CONFIG_ERROR_RESILIENCE */ /* clean up */ - if (h->cur_pic_ptr && !h->droppable) { + if (h->cur_pic_ptr && !h->droppable && h->has_slice) { ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, h->picture_structure == PICT_BOTTOM_FIELD); } diff --git a/libavcodec/h264dec.h b/libavcodec/h264dec.h index c8b7e663b3..52e2e55b2a 100644 --- a/libavcodec/h264dec.h +++ b/libavcodec/h264dec.h @@ -541,6 +541,8 @@ typedef struct H264Context { int has_recovery_point; + int has_slice; + int missing_fields; /* for frame threading, this is set to 1