From patchwork Tue May 24 08:43:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aman Karmani X-Patchwork-Id: 35905 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6914:b0:82:6b11:2509 with SMTP id q20csp427058pzj; Tue, 24 May 2022 01:44:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaGcLo8dbv+PoAMBFUFvplp9Nl0vk0q8KWKLM7WEN2vmZcDHyDoLhJFCwpoiBcFPf2wghJ X-Received: by 2002:a17:907:7244:b0:6f4:b93e:58a6 with SMTP id ds4-20020a170907724400b006f4b93e58a6mr23425936ejc.543.1653381842013; Tue, 24 May 2022 01:44:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653381842; cv=none; d=google.com; s=arc-20160816; b=gnPRzL19S1M4QDeaYAY4GOXKwO3tD2KhpTojI1evrAJzUuITfW+rl9tWPcaiFZwy2M J+YMU8Gs8HxlynYK67XPvgzw6itaE+JufakahlybyX0uYBiXPEP4RbPfhzDXxfKgzOU/ I3aX0jqub7HbI1nnLgdyOzmhOKTD7Q3qGgYval0xCIgkK7YJicwdnZXicZifjUHYVBdf oJOfD7ahkAp3f05lkDxpUQoaVh0z4mJ+ty0AK8l4C0gJsWh4vh4qDTliSpBwZluh7t41 4j/id6W8laswz132lrqFQAYjGMKa1T4CGBux+V5d7gEM/db/y5BgkMXP2MJZV/TTpRCx fiiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:to:mime-version:fcc:date:references :in-reply-to:message-id:from:dkim-signature:delivered-to; bh=4lGGhnQrvhE/5Bhp3b8PgMPeTiTCcVSUhTqws6omh1o=; b=AhQbpcsx6bolmnehBOxCxwzxIU5GCpkA2bEcf/u7vbkqLEebO8Lj5tPbvUs294Tngx 2eWV1I1p4MYSonUUCg1a9nU0NHx4jVhJMbyc92QtZGFvU+rJFjCM/iWvU5jZZc7+Gwox kAZWxPL3UW5Z/OsYw/XE8lOlqfTM/je24XW+LKYmdhfOZTKPia2rU3jjIVcqPNGuju4M Er3h/Zhc9Qgov9eOBBgQVejF8MsBjCcb3RyB9ge+F3+jATlRvpPWwHTw9xsiF3Uy7Er9 ZddyzdsV7xjQUI/ljbSt1rXLXJLrON/MpDrwV/yBEtcyIZ1asYaJz7I64ttgHJUDosKX 9HMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=CDFjaium; 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=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m10-20020aa7d34a000000b0042a4486a236si15824632edr.114.2022.05.24.01.44.01; Tue, 24 May 2022 01:44:02 -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=@gmail.com header.s=20210112 header.b=CDFjaium; 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=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7F28C68B53F; Tue, 24 May 2022 11:43:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E725F68B52A for ; Tue, 24 May 2022 11:43:33 +0300 (EEST) Received: by mail-pl1-f172.google.com with SMTP id m12so15294042plb.4 for ; Tue, 24 May 2022 01:43:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:message-id:in-reply-to:references:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=Mcocx7c/oqsviSbsrznnUL26TMr3rxYWNRdcu4kbS8I=; b=CDFjaiumoQDh6kOyNy6tvWISCyDNGkx4RM8s9SXRlFB4oDGTkUrcA1mH2QJI1aMbhF Jj96qxWlkB/BIrzZ3kWyBkkSM0u88HIrY3sM+jgJwGqX0H0rB86bq7Mfi2RbR33v2wOS haoogO6uuDimm/eC0ZMMi3yYsMtlGXnYtybcRDiYTPnGtoJslTbrORioN/qHpAo+RTDo Rexr167xBzM4inDUvAE+wj1QcV+1NyJGB6cbX/w6+jBdS52FrfNV4T70d2SHN18RlG0w V0VDi3fTEfJhHQS2TTJKSWyWxXdUjoK11qiIo+F5kXB7StY3JtVxFtgjUoqA7GJq6EXw QQrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:in-reply-to:references:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=Mcocx7c/oqsviSbsrznnUL26TMr3rxYWNRdcu4kbS8I=; b=g1dmJFApgtGxTGzQAgkCG4AZ+S+rR6Ps+N/9nQGVcwwKWp3vtCdB6xpXYItLL1nU6I 4SfZnUoJlpC48I3q9qUnQm/ws5yAYtB8rebJXLUVGg66YKL8yy9I1Vku6WFlqHPdlkxJ b670uworZ/cGLop+JMBXf43/KEQR5oliIXpmK3MlY/93aoi2oSfEt6UPWbgBqiy0p4mJ b/P+OWsUE5HQR1A0ICW5MEohsTUf3wPWV56bSJDWG/WQuoOA4aJMsA43Ru85etBXKLcK Wm60PKwR6uWjJ0UNbO4YJtRT4Z8OBvkiQ5BG3gsCXmJkhJfc2tMeBILn6MmMFKkYVHmO Y5Ag== X-Gm-Message-State: AOAM531d7zDHH67vAtQrSWwB196ZfBhp69CG32D8ylou0mEbWvT4Jx+2 bERefiITTQOskNpSmtAvi9xT2GCV4hgg6Q== X-Received: by 2002:a17:903:22ce:b0:162:4b18:4f95 with SMTP id y14-20020a17090322ce00b001624b184f95mr1021090plg.122.1653381812334; Tue, 24 May 2022 01:43:32 -0700 (PDT) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id z24-20020aa79598000000b0050dc762818csm8731318pfj.102.2022.05.24.01.43.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 May 2022 01:43:31 -0700 (PDT) From: softworkz X-Google-Original-From: softworkz Message-Id: <5313aeec0ee25dfe6255d75e37db29e436c906fb.1653381808.git.ffmpegagent@gmail.com> In-Reply-To: References: Date: Tue, 24 May 2022 08:43:28 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH v5 2/2] avformat/os_support: Support long file names on Windows 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: softworkz , Hendrik Leppkes Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 1i+tSaeSjkzH From: softworkz Signed-off-by: softworkz --- libavformat/os_support.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/libavformat/os_support.h b/libavformat/os_support.h index 5e6b32d2dc..d4c07803a5 100644 --- a/libavformat/os_support.h +++ b/libavformat/os_support.h @@ -49,7 +49,13 @@ # ifdef stat # undef stat # endif -# define stat _stati64 +# define stat win32_stat + + struct win32_stat + { + struct _stati64; + }; + # ifdef fstat # undef fstat # endif @@ -153,7 +159,7 @@ static inline int win32_##name(const char *filename_utf8) \ wchar_t *filename_w; \ int ret; \ \ - if (utf8towchar(filename_utf8, &filename_w)) \ + if (get_extended_win32_path(filename_utf8, &filename_w)) \ return -1; \ if (!filename_w) \ goto fallback; \ @@ -177,7 +183,7 @@ static inline int win32_##name(const char *filename_utf8, partype par) \ wchar_t *filename_w; \ int ret; \ \ - if (utf8towchar(filename_utf8, &filename_w)) \ + if (get_extended_win32_path(filename_utf8, &filename_w)) \ return -1; \ if (!filename_w) \ goto fallback; \ @@ -199,9 +205,9 @@ static inline int win32_rename(const char *src_utf8, const char *dest_utf8) wchar_t *src_w, *dest_w; int ret; - if (utf8towchar(src_utf8, &src_w)) + if (get_extended_win32_path(src_utf8, &src_w)) return -1; - if (utf8towchar(dest_utf8, &dest_w)) { + if (get_extended_win32_path(dest_utf8, &dest_w)) { av_free(src_w); return -1; }