From patchwork Wed Feb 24 10:03:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 25940 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 E009944B9E9 for ; Wed, 24 Feb 2021 12:04:10 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B231068A5A8; Wed, 24 Feb 2021 12:04:10 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 26FCC68004A for ; Wed, 24 Feb 2021 12:04:05 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id D7083240694 for ; Wed, 24 Feb 2021 11:04:04 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id b0Zhe3auVsww for ; Wed, 24 Feb 2021 11:04:04 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 676C524048A for ; Wed, 24 Feb 2021 11:04:04 +0100 (CET) Received: by libav.khirnov.net (Postfix, from userid 1000) id 28E1B3A01E6; Wed, 24 Feb 2021 11:04:04 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Feb 2021 11:03:58 +0100 Message-Id: <20210224100402.22300-1-anton@khirnov.net> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/5] tests/api-band-test: simplify code 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" --- tests/api/api-band-test.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/api/api-band-test.c b/tests/api/api-band-test.c index 34bed1d6be..717c9441a4 100644 --- a/tests/api/api-band-test.c +++ b/tests/api/api-band-test.c @@ -167,10 +167,8 @@ static int video_decode(const char *input_filename) continue; } - if (result < 0) - result = avcodec_send_packet(ctx, NULL); - else - result = avcodec_send_packet(ctx, pkt); + // pkt will be empty on read error/EOF + result = avcodec_send_packet(ctx, pkt); av_packet_unref(pkt);