From patchwork Tue Mar 19 03:29:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 47210 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:958e:b0:1a3:31a3:7958 with SMTP id iu14csp1423489pzb; Mon, 18 Mar 2024 20:29:32 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXXpNHO0DWUHqMYpNcRiZVKAwIizKD3sVgUka0Bt4eCK/VRYwSz3w86Z7bLo6Eg0ZG+ZgdXfrClui41D1cHmc37ltx9E1CYJCR8wg== X-Google-Smtp-Source: AGHT+IEMCu2x6cQKEmZ7gHOCAKD5iRapoPmu/c3MnT4+v1wFZIkoYEZ9DUiW+iGTgKpip64zI7fo X-Received: by 2002:a50:d71b:0:b0:568:ab85:d85 with SMTP id t27-20020a50d71b000000b00568ab850d85mr1339638edi.5.1710818972680; Mon, 18 Mar 2024 20:29:32 -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 dh15-20020a0564021d2f00b00568c14e505csi2903128edb.532.2024.03.18.20.29.32; Mon, 18 Mar 2024 20:29:32 -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=Lh1xge5e; 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 BCBD668CAF7; Tue, 19 Mar 2024 05:29:28 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01olkn2027.outbound.protection.outlook.com [40.92.66.27]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 625E968CAF7 for ; Tue, 19 Mar 2024 05:29:22 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=blb61jnN00hMekHHg0tte0EWWfE8RrO9nnVTl6n3kzoaftgvyNGXndjKjZ5ZkH+LBFJk/IUwIKw+hpzWsnHtBPO1K3FTGmDZMhLONLEhulRU2+dx+nyh2CahXz+OhqT5ebEulxfJ1rjzWXdxjfK4/leoovaQ8GbkVFfV8zYKWafVsQJUIygDtiVY0ZwgORnJDxsCQt/WcaalJeEA9FwF+6pPCcGNA1jCz4nH/6aX9iThObTLagNbZIUjiNvv5noTNX1H59dNw/l1kzBce2Wb2T7/bpPUKdry5PaRDSr/xZt0Wguvhqj7OvBRLS6GkUKgZYFYJRvYL4yG2IrninaIiQ== 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=u7QurnOztkpC5zuC1bCaeH/vvlXUGKoesD+DOqsmxVY=; b=YGt0jTBo+ZZwrsIkdFaGFf4c60VJXXxapub3lV4sGSl9WZ6fSYFnY0fzWz7/hQQw7QzgD6J2OlVkoakgY4Esr+8kDS7xX3EZfmyrc5IUlsx9Pdux6dGRIdj18fTIsj+W1SwnMRMnejKvhKwKoH6UYSh3s8HDDVSBxVqgE8ZHcgu0/Lw2Ck9m5tu9wpy0kWqsh9zBTCeeBV+XvMtMnh/L53d+JECCLOfhYCHNCwzzHP04xgmZtFFWg7a0nPobsbQIHU3rLZAgP2PdecnpWkNWsdThN8LbGF07vKI2hGlKCRTeDX6tQMwzHviixqjNExXWWHMozaTziYLlkxXcYgoleg== 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=u7QurnOztkpC5zuC1bCaeH/vvlXUGKoesD+DOqsmxVY=; b=Lh1xge5edDjI7nmlQh3qt/PYG81NaN6VlIlK6nz7F2xOnxC0hGIbaAlF1ochD6HuXdPB+QeHNdKa1e59JxoNwLpoRHfAwtoxaDSjjOZiUemk2yfnDBA348egEIiBlkRNaFLJ0BdVihYzk2Zluf/WUYcPi+TSo1vQw+Qy+APrx7KEwKZspWE1a/ie6+3kWO7SMygrLiR4JFDe0DRSh0+aJSLEq9RGU5FM0PCh6S9+4OL4Y8g0tjQi2gCL7X9OrbUjrUTJhg9HvIw10ftnCbane0UgyVo39TZPcIEM+9Umd8YMzfYrqkiNNhG+U6+3Wwnj3wl6Hw1+cfLoFb/f+6SESQ== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0253.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:279::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.28; Tue, 19 Mar 2024 03:29:20 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::228d:8c6f:ed10:82eb]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::228d:8c6f:ed10:82eb%7]) with mapi id 15.20.7362.035; Tue, 19 Mar 2024 03:29:20 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 19 Mar 2024 04:29:13 +0100 Message-ID: X-Mailer: git-send-email 2.40.1 X-TMN: [/AckZR143pxqmidykz5fa33tSsiDiGOGkoT7XxWMNiI=] X-ClientProxiedBy: FR3P281CA0030.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::16) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240319032913.2703127-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0253:EE_ X-MS-Office365-Filtering-Correlation-Id: cc9a6072-e168-4c67-254b-08dc47c4c380 X-MS-Exchange-SLBlob-MailProps: Cq7lScuPrnr9wYTvfIwcniUcOEk7m2BTq/v0GP/3nJoYTwZEh5YZRSRlcEbxn04qXEmVCowiZ2+Qum+rgu+8exzifpbAWVLdtZpy8Pl10+jHc/DqYbwA2q7uYm7NOFnSuDnhKUf/hEtKpIBJ9N5d45+YFhMoL3UPTSiB4UKizfpfoZK+wwqrb7poQRbpKTFQJFuap4fmZdmHQr/RDEelkB7CF8pYt0blEIhPqtAOBfZsI7L5ZNU3tOXcag7GzRih3cZZho/7ew9cd5sNIyMNw8xwrETfzfGFLm11nVuoq1BJk9lzoqZnzMtsdLNv1WZ6ppqDTPFSmlcEI/QowEmtN7UmXcOioca4uc8inR/EIANLSoutLW0slhGgZbiIpiOW87FDWTUdknpvY2MYpG7tJWYR1PjOwJahQrmssbCLgCD5wmDP9PuYjM69juYjaTMo5llLs8XWdYdECEBO9MpOJgDfRiRMrsQukyy6GIWOlf0WV4lHMg5X4rE1YKfrR3jvEwcKHeGZLW2TgiT1IZjUWzIVgsx7OM/I3n/e+1BuzgDxdcdWdP3hf05bBuB1ZPuy8pWLA4UhDOs0Z8pdegROVvqmZsJ/BYc5N82PgHxK8fIR5tLXfxGNxGIpARG3e6rchvFkwJtLbpCphEIw8zOCt8kXa2RrY+aatmG6FHGAHVJMaDLMyU4x2lAUkt2MbeScLJdRft2qNR1j5J9rj2hhqxo+Zcz2j4cEOcWy+a8nWMHwgcVnGuKZi5iUKW0qh/ArdwPopMz7OI8= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wy1nJwxWX/t/0ertWYbK1sEB+zW9Sm3N7Cy7/p/iG+/WEMlSQzpclLf+Fo+37ZJTauyKT13wwEPci493IpJQt4NtImx9H+CFfDFkk0oGu6s9RLWAfBrf29bDCXwNolCIU00xYMTL8SHUpVa6U8/a7l9+Q2UnP1Gtpo5tYGZracrYPoje5A0goz2SSLs71oegGAADAuAfhaZnrhtd7J1m1zcRS/kz5BByboTakhTcVkvm6fROcCa0CXg/wQ/m/UPdBdVCy4rMCL7Kq3di5VpI1SaTnKrzkYmJqTtNNhRXJHgnhILEykSt0ke1PhTdmE7xX+juX7h349p2xjtZ62Uha1LLLZeEICpq1NB8h/no5hR59NUEyp2NxXvCtYn+JiMn28b0JKNRy9uppxuMHJQLgQCPrUInTeTRJU4l3b+aovQWLh2XiQxJCCwea+j84dee2WBl6fv0ydu/ggLb4eqSRZvAMA/L6LSxOHLhP/4PXe1H0ndPS9vHfsdCjBi3U2+e/IqL2oTGtoSU4s7knJGS8KXTtKKsbnslP555TR3o4uUwkKSYSxBfKkfP6v1o0UlCqIDtUuTEYeoVxSrERhXamFdk2Il0176Z1JsZvoyuAPdSCiffljjVusleQLFNvdOd X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0BJ+3lD5KICcBlcMx8B+9W40HVCLfUKD9l3dpq9Tk6unmsOTq951SMeNuN6Ls0bDzLzlNml/rehJEtvCP03en/QmCICbDeQe6a9MKAsbfqouKZzF0M7+GAX9yG5mpIRggFX9oAx6F7AWbUtoTpNx70N6XzD5LbLt7EkMmU7os4dEIGeEZ/Jqdh0zOV8NrBSDMLsNQnT9c6020j83Tyq2NSfdIJkcMNIefWUw+SQpo/bLg+UVmCHPpS7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look.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc9a6072-e168-4c67-254b-08dc47c4c380 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2024 03:29:20.1172 (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: DU2P250MB0253 Subject: [FFmpeg-devel] [PATCH] avformat/flvenc: Avoid avio_write(pb, "", 0) 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: iAIJJsJVp3g0 When the compiler chooses to inline put_amf_string(pb, ""), the avio_write(pb, "", 0) can be avoided. Happens with Clang-17 with -O1 and higher and GCC 13 with -O2 and higher here. Signed-off-by: Andreas Rheinhardt --- libavformat/flvenc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 7e410e627e..d6c9124d5d 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -231,6 +231,8 @@ static void put_amf_string(AVIOContext *pb, const char *str) { size_t len = strlen(str); avio_wb16(pb, len); + if (av_builtin_constant_p(len == 0) && len == 0) + return; avio_write(pb, str, len); }