From patchwork Sat Mar 9 15:44:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter F X-Patchwork-Id: 12275 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id BD2C1448878 for ; Sat, 9 Mar 2019 17:45:10 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A904A68A50D; Sat, 9 Mar 2019 17:45:10 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-it1-f182.google.com (mail-it1-f182.google.com [209.85.166.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E2CDE689BFC for ; Sat, 9 Mar 2019 17:45:03 +0200 (EET) Received: by mail-it1-f182.google.com with SMTP id d125so12941036ith.1 for ; Sat, 09 Mar 2019 07:45:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=FQSH2c/7XBtWEEn/T/FTJubiS4erecLhIr470+vYZrI=; b=qxA2eL539PpLB0119HIdFlupslyNGiD4cIGpK9CITjqxwIqvfOvysOefyXlNem0TTl G8U2EXB9RNS4NGXSLPSq4KBBr+Xw9JYbOtSb85znmC1kFu+VJe7Og3x1hFxt6cXGOADl 5yjA49CXS2ez0bNfPAKMW53u1scLB+ZAILs5ZKt3bsG+4gmEGKtvVWejeCKYMMHZ1aiJ n97DyQ9lGwKUy64l0yLVHJADfUO/oDILWbIyz0n1YZCY+o1cILTYr5lhqsE+NSEZ3Y6q i+dN2LnekCj/9JbGObJg/rpDsUlm4RYP2zaUdpQ/uQb9ipws+DmgSGQQLGAC7hVlzNcp 0Ryg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=FQSH2c/7XBtWEEn/T/FTJubiS4erecLhIr470+vYZrI=; b=DvODjAJN6tBevvk/vEG89ov6unzcXkXTEL9r3NZ201DAY/oKfmVk22BM4Fz2HOx+CA ZjlUqqSpxApk3UW7cRu7irRthBkxbpdiLBQo13K4iWvz8s5vTg31kUB/6Lx3hofrN1zG E6dPSpTVbp+VYUvdrJGKgU4hPqbw8S9efI4svOLcfDleSXBKXM+ZGOA8WoDEm7mE9jY7 u+axXSaPY0i/idyP8HuhdY5zfVwn7LovFXda9tIipkVqMGITjRmYjTnmHV1ctw0p1iJ0 79AqLtTjVEzbAXqDW6dKHXeI4ejuj1BpBgZh2XRsQcxODVEINX04dGUPUQIHg2Nu/U0M XDzA== X-Gm-Message-State: APjAAAUs9L6LFnZ/QRVdVIlak2EVIum3mqapCj4i2Ff1Ck4OD/aq9hix Lk7yhwaSH2P6Ys6AdEVkw+WeIRSzL8t3Iwr96765ZQ== X-Google-Smtp-Source: APXvYqzFoMaVz6OJmWcwtDjDWu0qQsRJUu7WwC8dQlbCz3qle+7fzXpsez85+alwmyX9po0SVi2L4SZuTBeT09XwTZw= X-Received: by 2002:a24:674a:: with SMTP id u71mr11554843itc.12.1552146301888; Sat, 09 Mar 2019 07:45:01 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Peter F Date: Sat, 9 Mar 2019 16:44:50 +0100 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] avcodec/vaapi_h264: skip decode if pic has no slices 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" Yes, that makes sense. Thank you very much. Attached you find the updated version. Am Sa., 9. März 2019 um 16:32 Uhr schrieb Thomas Xu : > > should we return AVERROR_INVALIDDATA instead of -1? > thanks > > On Sat, Mar 9, 2019 at 8:25 PM Peter F wrote: > > > From 816e9156235a5d7d895b09c0235c9f8f1f7703e7 Mon Sep 17 00:00:00 2001 > > From: xbmc > > Date: Sat, 26 Jan 2019 19:48:35 +0100 > > Subject: [PATCH] avcodec/vaapi_h264: skip decode if pic has no slices > > > > --- > > libavcodec/vaapi_h264.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c > > index 5854587a25..81a46fa747 100644 > > --- a/libavcodec/vaapi_h264.c > > +++ b/libavcodec/vaapi_h264.c > > @@ -317,6 +317,11 @@ static int vaapi_h264_end_frame(AVCodecContext *avctx) > > H264SliceContext *sl = &h->slice_ctx[0]; > > int ret; > > > > + if (pic->nb_slices == 0) { > > + ret = -1; > > + goto finish; > > + } > > + > > ret = ff_vaapi_decode_issue(avctx, pic); > > if (ret < 0) > > goto finish; > > -- > > 2.19.1 > > _______________________________________________ > > ffmpeg-devel mailing list > > ffmpeg-devel@ffmpeg.org > > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel From 386c94489a86bb747b6531f727843cf259a24f5d Mon Sep 17 00:00:00 2001 From: xbmc Date: Sat, 26 Jan 2019 19:48:35 +0100 Subject: [PATCH] avcodec/vaapi_h264: skip decode if pic has no slices --- libavcodec/vaapi_h264.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c index 5854587a25..f12fdc457a 100644 --- a/libavcodec/vaapi_h264.c +++ b/libavcodec/vaapi_h264.c @@ -317,6 +317,11 @@ static int vaapi_h264_end_frame(AVCodecContext *avctx) H264SliceContext *sl = &h->slice_ctx[0]; int ret; + if (pic->nb_slices == 0) { + ret = AVERROR_INVALIDDATA; + goto finish; + } + ret = ff_vaapi_decode_issue(avctx, pic); if (ret < 0) goto finish; -- 2.20.1