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 BA37740E43 for ; Tue, 10 May 2022 22:59:41 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AE0AD68B3C5; Wed, 11 May 2022 01:59:38 +0300 (EEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12olkn2098.outbound.protection.outlook.com [40.92.21.98]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 758DB68B38C for ; Wed, 11 May 2022 01:59:32 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Of123Z00+sciM5JRBMw21YQA5+29bXH3yFlFKSpWz0FxYoLo8WPHyqonoPbGtpPKk3Pb9VJdXJh+fPBW1ZdjT07W60fbHn2CQTN1CSua23SQtffj1cSu/+eQqmwgaJxGOKeLIPjJCaVlIb/I9PgrT//9ybOA96QTaaVg1CeuB/nABsfVFsNHQF0mydC7J9DXo8JJ1rKoR0l/JNmSo4HqekWxxwXZg2SuqVPfIhvO5UxRWN3sz/u6q2wWMaGeog/BMoZtRp2EYQ4g6QDZ+yQ6yGkA/BYlZ8GAdd56RzWD7qX9ZpqPOPWr1ejN1k4mNbte7nTu90xbhe8OYn7TpQIN6A== 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=bCsABIzb6b7Wd1AQnMPXpEJ9V2vaKgH9L48tySCwjb0=; b=oMXxUAdYE1syFGOEgx4+zTdwSxeW3iPQ8h0X9kGqWNSFn67d0dmyu6Odi9GfWn1QsG7lJ9fk12O8mHWVh01mtDYZqn+CqiKti64Bb1fuK0Do8U/yZKUEhzEqyB7GwDdNiPcMn7eFyqAl1Lp802Oo//AI6g1XnMkSY78SXiGqEQH20GmXiFLZOu0s6nNdBjhgvUvLmntn5tXEcr8/Pu2EIS9olE+Gj9u58AimfK6L+2K4R17POsl7A6GMmhmJT9IrTlHbyoNHTw6AaNDlsd4xfl9I/Pu55itENCmeKT8v96bfUAZUmkvQQdX9qMr6V4d1M8J4OkuFvPCGdKzbBdttBQ== 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=bCsABIzb6b7Wd1AQnMPXpEJ9V2vaKgH9L48tySCwjb0=; b=MaeRZbuxYfa1Y/n0+6ymNjfL/VOwn4ebeRq8TCEmukZMrJB4Q7yctdKVNgLKF9eUv5qnyaahKOBPQhVQoMSKfsx/vthmJY7oKkQw3fmnfNFuCKwfYrySW5c/SCdC5Qd1F+ufH35WzraaUyiHRGZsVtUYhBLuRy7/BohdtIdfNvE3UIawcT6kyO0/3GuaMCjUzvsZDh4FerEeLudwhAfDCbckWrhLA4wDAPoKDMZ30JynVy93D2andVs1fLLo7xywOrt2PbIlkVj+e9qnaCcgzyVKROv6iraIQydQrg7J73ZRTxrsnM9IiPFfKhTSJ8et+Uim1CCK8A0Sj+0Nl+1TfQ== Received: from DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM (2603:10b6:8:b::20) by SJ1P223MB0529.NAMP223.PROD.OUTLOOK.COM (2603:10b6:a03:45c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.23; Tue, 10 May 2022 22:59:29 +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 22:59:29 +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/hzrQgADP4ACAAAFRMIAADCEAgAACGVCABt4dAIABGaBQgAhtCoCAABn5QIABMduAgACxSQCAAPjgAIAAApjggAT0jICAAAyyUA== Date: Tue, 10 May 2022 22:59:29 +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: [q7qcsggl2cLJAWZrYeAEe7uHol7OFXOQ] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 15093788-f419-4028-7c79-08da32d8bd2b x-ms-traffictypediagnostic: SJ1P223MB0529:EE_ x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DtFzrcwvXHWfPZHH55jfmPttmBvWNKPZqWPYpCxNcHlirrcUGbcgqLLJW6V5PHv0uzr058GJCvXkuIeVsCg5l+YrjhdJihl3Z9nya63tK83Dxl2rgV9LaeUL7cUraEOu3tJLVeIl6P1pYFCqohvBZaglV0aGJI+DrL05alxKP+dmXwLZ7dcYn2JShZ9iZuvyWB83ASHI9FeReDIba8dGQFZ60xE7VNoTZydybJIngHwM6+Bl4QANROY1pknAHYbmPQ8+ZxU91rmzD2aOIEciELDv5TG+E5hrr/Y9qjTEEEaacT+hNb9UqaSFSO73T/OEirykPUpUQDHPBYTzc74twvX0cMvhnH9uHoUPQp9NbyCx2vKKe6W+DFThKLylzRA6d6c6l9sPt9XMMX8MvCWYyloTAQes5SWr7twG7Zgi1cABixXUpNYqj+YMX0d3smmovu7jGjAbJ1uuTPGgJUlMWQhbOpxLQkv/nsNH4tkmkUQ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WFNaGhBeXc5YzBuMGtaM0Zqb3Rm?= =?utf-8?B?ZStJQW16WEpPZVo4MitrK2NSMnlDNWVnSEZkdWhQcUdnU2FFdlBzd0c2bkg3?= =?utf-8?B?Nmx4Wkg0YTN5K1RjdFJPdFVUK3VpdCsxa05ndmhaM1Rab29LWFNFcE9JVU8r?= =?utf-8?B?alZRNW5td2RoYm1jcDlTbG1Jam5VQzVwL1F6ekx2R0VWQ3ZiUTlEcnBQdFl3?= =?utf-8?B?Yit3U05xNi95aTRjV2RaWE52SlliY2lWNGFVVmVWOEZWcXROblRGVGpxQjRZ?= =?utf-8?B?UmVjWEVNYjVWb01EMVhiWWFYSDgra2l0V3ZndGdTTXJOY2s5ZWFoMTZBa0VW?= =?utf-8?B?MTZNeUdWQjhsbG5PSHNYTEt2eGdPYzR1UEp5Vm1FQmZ2c2tpbG40cDdmMkhm?= =?utf-8?Q?hM+WWNzCj9E=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: 15093788-f419-4028-7c79-08da32d8bd2b X-MS-Exchange-CrossTenant-originalarrivaltime: 10 May 2022 22:59:29.3946 (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: SJ1P223MB0529 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 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. 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".