From patchwork Fri Nov 3 16:09:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 44496 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:671c:b0:181:818d:5e7f with SMTP id q28csp660673pzh; Fri, 3 Nov 2023 09:08:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHJ/haT7S1wg6Mk7KyYqD4bOtZOYJIkH6tO2P3zI5PfTKI7oDn+Y3Fdrb3k+WsIOlXF1GFX X-Received: by 2002:a17:907:31ca:b0:9bf:4915:22c4 with SMTP id xf10-20020a17090731ca00b009bf491522c4mr7705724ejb.67.1699027727402; Fri, 03 Nov 2023 09:08:47 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id u16-20020a170906109000b0098e1bbc3db1si1071373eju.791.2023.11.03.09.08.46; Fri, 03 Nov 2023 09:08:47 -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=@outlook.com header.s=selector1 header.b=PIp5waym; arc=fail (body hash mismatch); 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=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8E99668CD7B; Fri, 3 Nov 2023 18:08:42 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01olkn2093.outbound.protection.outlook.com [40.92.65.93]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1373068CCFE for ; Fri, 3 Nov 2023 18:08:35 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fksQb3dA3+tdDl1J3tPHanLeT8CLUPYhm5UW/hklCyeHaa6MuO482HSWfbyhcWoZ4QxPi1Yx333f4lz84Ty5pJve2pljZ8808XO7T7GjtSU9NkIcnNiZxayVUROL/kd7y/6FcT30RNXHSoYZDX31BcFk23nH5W5ay7Z7EkyDVPO49Fsr/WM8yOIvyN9eUjGadvjV2m3GiNuaUf5OZ2n05Fs7vNfayDU8+/97Hx4fueOp6a3IO17QXtrZaz8eFYC9s1BGtKrOpIUG2VopgADTOJEShqrl3ddD6Ewr3C5mM2dfZtxE6jeOq+5y83foBIovHdDXRnCdfSuRLYS8PYdXRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NNAyiB9RHxVkiiDAbQ8sGIS/XQaJJeauxuHHgFgQa2s=; b=fmVWL9ZJKDqUIooSvyGd4LPtLjIiZz2BPMZASnSoxE+cnaGEGy2AvlgVNJsN4s49mFuGQQVqKZgudenAa055IMPP/uBkzftYeE//OS5ZnH1FN+WsftG8cyUcEqq0NUgSYe5OdYGOvdcHzugwJ0eWyeIZIP0q+Y0wlwssEdv+V2f/StNRsK3NTINkcevTlabvlGO0NRJS0BobcCZShXgFlyK1/eU/3yhM4Cd7iv+9SpS7AuLOn8Zvr84iTj7Mu8CKu8OBAbPYHwlSMSN3rnYPhU55Hl1MS17ORG2sNviTAqMEoL9UK7wcN/Ly4CFHF6czQkznADiSHFf4f/oKx1n5Zg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NNAyiB9RHxVkiiDAbQ8sGIS/XQaJJeauxuHHgFgQa2s=; b=PIp5waymTHMui8qn5fMY0N3os9z5BlRGF3XFTIITE0BDx49EjPSx/C4Bx5GukCqMY/w8E9D8/fmh9qKWkSBTtG1vrKuw+WFUGo55znz89nMEKjYnkkAx9ZNTr092Al1X1CdIh9ycyQsTDcAed17ZxnUrX/P1VD1QDcjGqG+oybsihKOFg+ru1N2wVlNiGcaUZHi/XVUFY3G6PZFHU3BP7bjuyse5SVWH5+PWadhFvsQ2MuAIT5BX6c0BhRBbwijLr5n4gJpTloMakHfdyEeYo2nKpK9Zc2B+GkmlL/N6yRNtpZSrkll6Zxk+s47dpy1hd/SP7FXGgghjmnKSBIxjng== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AS8P250MB0331.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:37e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21; Fri, 3 Nov 2023 16:08:32 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f59c:9cff:a42d:bde]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f59c:9cff:a42d:bde%3]) with mapi id 15.20.6954.020; Fri, 3 Nov 2023 16:08:32 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 3 Nov 2023 17:09:44 +0100 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [7yrW6uuJfp4hiN8pLKl6OK7VCyej8tbKf4/igp38d5c=] X-ClientProxiedBy: ZR0P278CA0101.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:23::16) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20231103160946.81095-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|AS8P250MB0331:EE_ X-MS-Office365-Filtering-Correlation-Id: 11b296dc-6e91-4420-dbb2-08dbdc87205d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yDD5eK3LWwq7075HjT9CYmsy6bwfsDcAC0js2XMhl7wVsSDbeEVl9zNAyldlcBqJ+14E5/5QojwMpZz+79LfNjv32ooYAXs6iA/4/Mq8X+5XuwFwizfDCVlshHwJ9FqPnKhX8YXTpFUDPv+J52HY9BjQKasQxR/XhsMUGxteybYBZliUAADuMrkeF+eKujBu98UsQOh5YX12JJX1wXTwaptP7/gIvWokaK3sey8iOgENVwlPzDeGx4dfrasklJg+hTGgg8XkD7iQVQiSvKJoiLDuU6LKfyLuweI8hFhDmiZsUIi/Q8YHABsBOMDAWVueljw9mdaSc9bPkEdu4TmfXFTZRBmEU7iunz4bRiEbzv0gcc6OaTEUL6zvxdXUgpxZ+zI7JfuZCN5oAu0NyksJgF59jI0+y76OKtxpVw1RIGyoh6cHEM0j0jo+RFBFlEAHysNBKFOll8AKTdum3lRbkhJLIhk4lxxt0MsIXPIfu7kY82dZiJzIMrPa9XCPCzN/NS2bcWuRX75aCeKqC1hJJjhSYN5NcO/7WOtDf3hSeFIxb7E3w40D3jeLfwLorBu9uZWdU4GVxBkDyqzjwFljJViF8GeUWZRVAS2hXGbsu/PqsRrgW6UyoYHtr4XG11Hb X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rhiC9Lqs7m9fIatYz0oXT5NiYfMKSph3YeeuYv7B938OjbpdoCe9OzrlPj4jfT8RSQ+mMPI+vPPKTgWmdmK3bAj/SoDo+xbpRvUuO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7rCRvwZKAUvVJkC/5Xs2+vYR6V6JtAxO1gPAGZqzJdEa63EtWRScd68i4tkwOGe+VugpyaaWyLL8Ck9erbKWX3jZ97zD8DQ48 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11b296dc-6e91-4420-dbb2-08dbdc87205d X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2023 16:08:32.7827 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8P250MB0331 Subject: [FFmpeg-devel] [PATCH 1/3] avformat/webpenc: Return early to reduce indentation X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: d7pwv8qVh0iv Signed-off-by: Andreas Rheinhardt --- libavformat/webpenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavformat/webpenc.c b/libavformat/webpenc.c index fb0cca3922..9ac353c967 100644 --- a/libavformat/webpenc.c +++ b/libavformat/webpenc.c @@ -80,12 +80,13 @@ static int flush(AVFormatContext *s, int trailer, int64_t pts) { WebpContext *w = s->priv_data; AVStream *st = s->streams[0]; - - if (w->last_pkt->size) { int skip = 0; unsigned flags = 0; int vp8x = 0; + if (!w->last_pkt->size) + return 0; + if (AV_RL32(w->last_pkt->data) == AV_RL32("RIFF")) skip = 12; @@ -139,7 +140,6 @@ static int flush(AVFormatContext *s, int trailer, int64_t pts) } avio_write(s->pb, w->last_pkt->data + skip, w->last_pkt->size - skip); av_packet_unref(w->last_pkt); - } return 0; }