From patchwork Tue Nov 9 18:01:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 31343 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp1494879iob; Tue, 9 Nov 2021 10:04:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwuciDKaskQjkuR6eH5X6Me0ewyLw7+4W3EdBD5DI2K+K6TXoKemkehDa1bpG4dJrLimkIA X-Received: by 2002:a50:f157:: with SMTP id z23mr12375369edl.94.1636481051059; Tue, 09 Nov 2021 10:04:11 -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 c12si40700441edx.280.2021.11.09.10.04.10; Tue, 09 Nov 2021 10:04:11 -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; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=Wec5b9rA; 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 5EC9D68AE3F; Tue, 9 Nov 2021 20:02:39 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067055.outbound.protection.outlook.com [40.92.67.55]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8A17468ACAE for ; Tue, 9 Nov 2021 20:02:34 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IbE4T43ZZjl0o4RG4EAfQoBymT6iVPcuEjT9Y7/4iCSc5TU3/aLymtVSUQJr21HQPAPafs5X2TSw4UFf5AUERwvmP1xOfkKh556B5iPo/MR2NqP0GwcM33sz9MBs9tX/iw5rCg08OiSJw4nbIdvcMxGCoTe+NQDBCl4Kh/b3OxCH4xxFYORRS4hDdsXMyA08fdGxgxVIHNNDlK1q5CQyOlihzShClamQekN/SeQzCHKTNDN1nGp1I/MAUeKZ5yqTTyyzZ3OOYU3Gvoy1AVpOH36T+QZZCpEOq4t4JKpRJPDxS/vRrxbnP714oSZrUmQoxxG/5RUrlnnMsTj+vcbbpg== 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=WgobtENq9u2HOBtBAcZRFF0crfaVeI09Bww+INYgqJE=; b=JlZr8hjEWcB9txRNbb9CEP8wyzAMXIZS2fhkNajUEqO96LtMYgCMp1pH0YwZB0UDbmgnw0JuFG92DlJiDFHPeLqOsG/7dTaY7zlKRPYxGAQImRNi+dmgyZpEzgJJ0n54kUAdUWFJj+vIJRjh0YrcZXmfqNhiRV42Y/H6IHvYc7+XRgxz0GB3yyBLKe6ecyBIA4+aq6uTet44rBzy6YsJk5onj/ULw6z/UBHHZG/+fplOQa4M1oAFXUcI2nOAE1rxwY4eWDRtbBy+tEKaWNxuJU5ItA8md7j+Yog9ZLQc+nyyPoZKYQiSbu4X5hMkVw+0KFju84DV7HVN6e72tsuH5Q== 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=WgobtENq9u2HOBtBAcZRFF0crfaVeI09Bww+INYgqJE=; b=Wec5b9rAM8S+PtT7sAcg6NMIXMaJjQtcW+yxYXa1ZV5khQwFpPUO8/+zFyP8d1l+DzUzzlil4vlqx2Wy9ch7mXTlYLfwKiSx9JshMvT7WEMAh/wZeRAQ3t+MEz3jkZhfRvHRukecYGRg4Kl16adJ0EpPVbdOmOmHeXTFiuRQG9mA76vq5k7huOgy3fiuHQQXkIZBHnebNy/g3XbtrIqWsSe06Vh0Acwmz+lAFA0dWgLo/8poSnP3nf8Oh3jIGB46wW7y9rHwF62BxF6MpLrLSnWIn0b4OLfwFj4/hIrBgrp60ZDpJDPWQRmj4W5j8XvBUuWn+oRoWkB8ioem0wuxjg== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB4775.eurprd03.prod.outlook.com (2603:10a6:20b:d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.16; Tue, 9 Nov 2021 18:02:22 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::700f:d70b:3bb8:4d51%8]) with mapi id 15.20.4669.016; Tue, 9 Nov 2021 18:02:22 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 9 Nov 2021 19:01:48 +0100 Message-ID: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: X-TMN: [UC7pt78EEW7Fg8aXZlk/ap3ixZjZ67km] X-ClientProxiedBy: FR0P281CA0081.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1e::7) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211109180155.881111-9-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.193.171.90) by FR0P281CA0081.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.5 via Frontend Transport; Tue, 9 Nov 2021 18:02:22 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0888f586-3614-40d7-6588-08d9a3ab1413 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiRIlshE2JAC11E3nazVg9SyC2iCOyybFCJ8Q/4vw0uLUfwhM3HCxuX8Bk5Ar3apNM37H0laNndjfrnnzCmZIBGeqp/f6tb2qTDDNL6WsqbxmbNAZW19B8Qd2CrZmpNwOWQhk5AjZORa+4ppWwA8wMSqfP0QBsEdTEPrSGJ13nRl2UuRLnB+bCMSBjISzfpDcl4Ad19Vdhp9UGiJ1XO6okCJxAP8n+2HVPO5UI9p6bDDWxbfuqiyWVsbQvOQpPdWWnRyHbPpPAyZwLI3BxCSW7h831VNiyCrVFDeIWNr8e6JUn3vqqG5kiYkne/Uu/Xj2N2wDOlheeBlKpcWngZENglt3xtLOsqgIvzRaqlMFEIToHw9wX3tm2oP3QxR7PQT6lVJIiXV3OTb3uYcPT/F7AeF4SyCvDlp6y/2q+fSiZgQ28brYKdPvrSJfWCWA8y2u+PAE0WyD0JqiJmZVc/XkZlS1qEnBKr5KlW6HcJ1pqtYrncd/qiBxLLgGQDlf60rByY1X8uyTgeDinb+Wm+M2WwuvjdE0j7gMPo3ZNf44q0jONuYv/u60fFNwG8KUO8qVMDhbshW80Qnx6k1RNFOQc7DVOhmjKW57p6zEdjDDWk4kgAcn+ompin/aErkmChxC4jfRHo9eHLmCn39346rwrwRKv+ueHXNQPiP+uYg/ED40r1mfTzv6PlE7o5cuD+NJOxl2Xt5ONpLj0WMHlV3srElf9xMw4AucgSI8M6f//w8y9cRK/j5ki2gwXqAbAhSSFg= X-MS-TrafficTypeDiagnostic: AM6PR03MB4775: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OtMATKURrVweMWhGqRCo+SIrslLtpyEbQk/2+4bY4VUuSsIt/b0x6gkCUUCH4P9sSM49GyPOitPa0TM0BE76wXKm5mwq3KelcRME2hMtv+LFYufmhi+QYbMrsfbFm9ch8wAH7/y1QH2ZB41XlZwKnYDmspIt0j28DMstU3qLUaAIm2BcUDWcI8+CdMmBS/0VbXjCsNGmhqao3YtM8nEARrMN/ZyoRvdppwmflZrjJMkKLRvr1cwbd8ADfjeXxGxgnWpgUv76coN5lD2KUszB6XkUpR0RRH4wNp5ckZyhPtucTtr0ZbT01qx+znAFE14kZ4G2RdaVwV5PX8tQUGpk9ju0LDyQEl+zuC3Xij/Ebk0LTaslukzOlZoo/K59W1d+eKc5JKjA9yGWBD6+isLzzMjUzIE1FYAPRYix8TGAUHCcPgnrtOhDeprJ62T4vLifvCWJgECayJZyGzhL6oVYvYXxTcO34UgY4XlraQm3IS90ysgK9KvZnRyiuL5QA1nEeuy4zNtSzJTLf8+z1euZ8hX4iZyvq8uGPey3N8wwVLQ= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BLfxnO4q5E0d1LBEyPv9BAqrxC/EhUBjYoqusDMWT0SWDXvo3h2+gvU+QiPzNOfbfjl2kNlrxcYY1u4n1Y4WvD2S8Vp2qFySTEiVETMu/lv0lWnDm8TyYgzGA8U6TOS8Vu61mqTRaLuMF48VLBx5GeI+LVSKHDGi2sebP+Ynisg8+XMbVQXNtTBCF8qNhMVI6IlVjW+6qK7pdWtLh847Z/YWWeqT6VJkHt6NFutEObSjjRP9W0mMwFD+LWoOe5e1vSLN+Mmvz27RJIzkiDyozTUDU24FOLtFndZb97n7SVvjCPhZJjuELbrirK1APj3nF49jG6lRMI9Ieob6jWWs9SyhX3GOhCJC3T4ch4f6eTewK/TfwrBjBQy+FQnfop3PRtKM+xKOZNQxiztp37efchusydbXvbvZYd9aBzvReoQCy71lYOe+6YuxU5dP3ZAv+5jJLi4o6Ekq2gABZiJgEmFjjRGn2V5aaxWxKXqjWVEpkI55s9EFZCCWMYklTtsm3LDvQtpp6agB49XGzIpfokS+H0ZnR7jJfBxvcsx0ijQNQvsxKVAbhBUtw9nMRt2YJFkJoD41LevXYgyn+CM8jTto4X7ci1gCqiIlNFJAHUproV1nPupjSZ6z9b1imQRgQ4SjGbZuXXh+orbKa2rNDDhS7R66O4hlUlfzLCFQZfpxw6l2j2CDLV62IZ6XjZQ6L7iBByJPce2cRxdw8WDlEg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0888f586-3614-40d7-6588-08d9a3ab1413 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2021 18:02:22.3317 (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: AM6PR03MB4775 Subject: [FFmpeg-devel] [PATCH 10/17] avformat/mxfdec: Simplify data->hex string conversion 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: 1Pf6v7ecON9A Signed-off-by: Andreas Rheinhardt --- libavformat/mxfdec.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index af9d33f796..4191e82474 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -1984,22 +1984,15 @@ static int mxf_uid_to_str(UID uid, char **str) static int mxf_umid_to_str(UID ul, UID uid, char **str) { - int i; char *p; p = *str = av_mallocz(sizeof(UID) * 4 + 2 + 1); if (!p) return AVERROR(ENOMEM); snprintf(p, 2 + 1, "0x"); p += 2; - for (i = 0; i < sizeof(UID); i++) { - snprintf(p, 2 + 1, "%.2X", ul[i]); - p += 2; - - } - for (i = 0; i < sizeof(UID); i++) { - snprintf(p, 2 + 1, "%.2X", uid[i]); - p += 2; - } + ff_data_to_hex(p, ul, sizeof(UID), 0); + p += 2 * sizeof(UID); + ff_data_to_hex(p, uid, sizeof(UID), 0); return 0; }