From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 81BDC40E70 for ; Tue, 10 May 2022 23:32:40 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 03B4068B3B0; Wed, 11 May 2022 02:32:37 +0300 (EEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02olkn2033.outbound.protection.outlook.com [40.92.44.33]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E9F3E68B072 for ; Wed, 11 May 2022 02:32:29 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XZ+Eagosj1KGwaUfy0pF0ku0I5rIYhRReZhr/zGs9PE0qtSAVPwpH/MemE3r2g+NsSXFtesnEcXQzVtwbLI86mJzc64nPn+lvCtnCw8NbO/mSUHzqGVc7SS3ZFNdOYu56uzxZ/ddDaLi3tjTyl6YmVLDMp0PCZMLarUWQPE/ppA9l1N5HNJXgk5Z48+go1/yIhfK8Uo22GueM1+zl80qrpRcGPtTA71SbE+jk856XlMHjDzL1CpxCwK6apRCxNVTCWgRI5FMQ/gMYlMDP1lJ78Gi5g5UtsyDaN+rjWeThKwwsj/YKquHFBYvu1VkoKIOn8O9cDGRt8i81rcOhCcxLw== 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=EQAF01SxQNLK3xdvQDLx84RCfaDed79VuqpzJk+w+Rc=; b=NmDwN+4WEp1l37z+QYLsamZNWf48XLufrd37L94V0BsqU2eTS4zQw9Mn6KE0zO8OF2ozqvhWJF2259eYbMQY6DkPeKVngMG0ChYcseSJAk4dblht8aGKyIrFVwSnLzFe2iLM5SFrqJ4B0hMAgQYS25MNoxPrNT+lfBdUw54CsPNNEBeWW4qN2OiiSRY+bw2HuCBs3oKNM8kc1OUWHdxrKSxihQDNCiDo4hE/zdCsPGeN9wYGjyMH+paBHq0HMhPWi3ltf26qO4foLE/tWJP3m09IBzD7UxPD1UVuuU/maEPti9o7FVKyIgw9YxYKB7QSM7F4gyJdiq3Z2lGHSQkxVA== 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=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EQAF01SxQNLK3xdvQDLx84RCfaDed79VuqpzJk+w+Rc=; b=OJ+4s6Uqc2dvvQtekC+G8sPEckq3yJAYusEwP77jJYKF+5grm32R+iJseiIkZlwlgoDykhT0/SNKja6L9xK39as5zvCBqMVTr8Rqimuz2gT7VSTNjr4jSsypXqeTPHZcjLiqhpO3jKZ33kwDVX8oreAGuVQamIBxIR7STKHkXW/AMMvZ+bhvQ7UujacSD66LVtDbj3a+E+53J+99t3TF8G82Nc/u2U99VwNCO3Sq3YbDKQTNWcdX8uQlCR7npd3oAnb9r4t9HZz1F1GwAtH5EcDcdpzaCb/Fh6y7vQlNQRKUbPu5T0yp6yXtt3YcSNtzDe7NKaBNo8au5Eb6PHY7Qg== Received: from DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM (2603:10b6:8:b::20) by CH0P223MB0027.NAMP223.PROD.OUTLOOK.COM (2603:10b6:610:fc::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.21; Tue, 10 May 2022 23:32:26 +0000 Received: from DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM ([fe80::7472:6f83:eeb:45e3]) by DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM ([fe80::7472:6f83:eeb:45e3%9]) with mapi id 15.20.5227.023; Tue, 10 May 2022 23:32:26 +0000 From: Soft Works To: FFmpeg development discussions and patches Thread-Topic: [FFmpeg-devel] [PATCH v11 1/6] libavutil/wchar_filename.h: Add whcartoutf8, wchartoansi and utf8toansi Thread-Index: AQHYV9QNP/PRify4SkipW5U65/+zkqz/hzrQgADP4ACAAAFRMIAADCEAgAACGVCABt4dAIABGaBQgAhtCoCAABn5QIABMduAgACxSQCAAPjgAIAAApjggAT0jICAAAyyUIAAFw9Q Date: Tue, 10 May 2022 23:32:26 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-tmn: [Kxk3h/7GrHDeN3GY2hyBOmgcSmjuB56w] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4ecf5a0e-e7c0-4b31-8411-08da32dd577f x-ms-traffictypediagnostic: CH0P223MB0027:EE_ x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: WfSMudf+Q13O5fMmlBycUF2JMvtAMHRJ3W5FZo61TC3ozo690ivgPPzsfld/Hx+5ytaOdwwn0yzYNePu408EQIxgw/qKUVBKL6GuJPJIUgOpotat4d/ief+2Ut+ReWzyAOurbBDj/L0JSOU/2Cf1dE4Ji3pwCFP/6573+BspHiLooLJMEsGSlzgXjkLSc5JYZESSSuoiUAwoT8VwmGD6fGDVb0RJtzTUGB/XBJW9oulzSiZM/JZfEbyFrMEUWxE6XXn/LCnJg122VwpJhA/gJphE2c2sy3cHGpTq//mMRfqLlK4ZzLTY7Ext4gsVAV7CPAQB+qLx6DBHcG9wbQ7ysgoGubV5454sijAhijwJ8Arb9fA2gsuVPgK3kIjfKY/vAtCBsC9/U9//xnH9rxfuEeEs0IUEgMfECKV/wPZuxCyAswdxOs33MYNXs/d8wtPQMU64wL+qT7llCwAyWlmtUyP8Fxne13DbFw/uxQ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vbkt6Y3BIYzRaY3JSeDZtSXlBY21BMDN2?= =?utf-8?B?bU9PTWNLT0hOaEJRMjg0SFEyRGZzUmw1MFEyVDJRYWtWd3dJNnZxbFRRNjNH?= =?utf-8?B?dUoreGVGaHpuWDlodWVaN09qTzlWRk1IYnIzS2NTL0lzL2ZIYjF2a0paWG0z?= =?utf-8?B?cnpvNDlPdWRlbzhNYnIvOEx5N3VuWlk4QVQ1UFVLb0FFRFR0Vk5PNVNBOEwr?= =?utf-8?B?Z3k2ZXpCWXlzem9TSW1scWVXTi9FT1MrWkdMSk9WRDVaNUdRZlhpY3ZWVmEr?= =?utf-8?B?em90NlJ0UmJ2SDg2elV0MnV3ck1HNXU0MkQ3YmpaaG9mamdwNzhmSlNHdDZx?= =?utf-8?B?YW9XMCs0YXdPTHFIVUVIaFBDaHhMK2F0L1d4SHE3T0k1SjFmUXMrVmlQMTJS?= =?utf-8?Q?C+3UQWaDZug=3D?= MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-1ff67.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 4ecf5a0e-e7c0-4b31-8411-08da32dd577f X-MS-Exchange-CrossTenant-originalarrivaltime: 10 May 2022 23:32:26.3169 (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: CH0P223MB0027 Subject: Re: [FFmpeg-devel] [PATCH v11 1/6] libavutil/wchar_filename.h: Add whcartoutf8, wchartoansi and utf8toansi 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: > -----Original Message----- > From: ffmpeg-devel On Behalf Of Soft > Works > Sent: Wednesday, May 11, 2022 12:59 AM > To: FFmpeg development discussions and patches devel@ffmpeg.org> > Subject: Re: [FFmpeg-devel] [PATCH v11 1/6] > libavutil/wchar_filename.h: Add whcartoutf8, wchartoansi and > utf8toansi > > > > > -----Original Message----- > > From: ffmpeg-devel On Behalf Of > nil- > > admirari@mailo.com > > Sent: Tuesday, May 10, 2022 11:23 PM > > To: ffmpeg-devel@ffmpeg.org > > Subject: Re: [FFmpeg-devel] [PATCH v11 1/6] > > libavutil/wchar_filename.h: Add whcartoutf8, wchartoansi and > > utf8toansi > > > > > Paths are strings. > > > > In other languages, paths are represented with classes, e.g. > > std::filesystem::path in C++ > > or pathlib.Path in Python. In C classes have to be emulated with > > structs and functions. > > Even plain strings would've been OK to represent paths, if there was > a > > set of functions > > everyone uses for path operations, but there is none. Which brings > us > > to your second question. > > > > > It needs to be found out why it was added to decide in which way > it > > > can be adjusted. > > > > Backward to forward slash adjustment is there from the very > beginning: > > > https://github.com/FFmpeg/FFmpeg/commit/1b30e4f5865260323da5232174fc68 > > d6cc283f45. > > > > Apparently it's needed for path concatenation, which is implemented > > with snprintf, > > whose pattern uses / as a separator even on Windows: > > > https://github.com/FFmpeg/FFmpeg/blame/master/fftools/cmdutils.c#L843. > > I think that can be changed easily. A path using forward slashes can > still be prefixed with '\\?\', so it will just require to go through > the few lines of code and fix cases where this might cause an issue. > > > > Now back to classes. If there was a Path class, you could've changed > > the constructor > > and the path concat operation to normalise the path and prepend it > > with \\?\ > > when it exceeds MAX_PATH, which is what you want me to do. Two > places > > only > > (maybe some more), and the entire application becomes long-path > aware. > > > > But there is no Path class. Instead there are 587 occurrences of > > snprintf, each of which > > potentially does path concat. snprintf is not alone, strcat and the > > likes can also be used > > for path concat. > > > > These hundreds of places have to be examined and potentially changed > > to prepend \\?\. > > And a couple dozen of places will surely be missed in the process. > > I'm afraid, it's not clear to me what you are talking about here. > > The prefixing can be implemented as a function and then be used > in file_open.c. > > Other file system related functions like mkdir, rename, rmdir, etc. > are already intercepted in os_support.h, and the prefixing can be > applied there. > > Maybe I missed some cases, I have not fully analyzed the situation, > but surely there are just a small number of places that need to > be changed and not 587. > > > For the procedure of prefixing I would take a look at how it's done > in .NET. This is probably the most mature code for handling this > and might save us from dealing with issues and regressions until we > got it right. The logic they use is here: https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/IO/PathHelper.Windows.cs Probably it can be simplified a bit. Kind regards, softworkz _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".