From patchwork Sat Mar 23 12:19:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 47366 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c889:b0:1a3:b6bb:3029 with SMTP id hb9csp185411pzb; Sat, 23 Mar 2024 05:19:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUCXxUSpt6MbUaZQO5lA3DU7Fkv3akBptXHel2TOsRbbGbOWRfPjgeiL5YhD1qiiqcDiODY9hzC9PpfUQDgXrjs9dgbtwtp0u6kNQ== X-Google-Smtp-Source: AGHT+IEoXpp84IkDdYO3lqBSjT8wWY84+L3gxx0iShCUdcIqG8LviSwVHCiJZFYRI7suMPhGYYcT X-Received: by 2002:a17:907:7d88:b0:a47:4862:268b with SMTP id oz8-20020a1709077d8800b00a474862268bmr644527ejc.61.1711196391001; Sat, 23 Mar 2024 05:19:51 -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 w11-20020a170906130b00b00a46a7d00bcbsi857482ejb.352.2024.03.23.05.19.50; Sat, 23 Mar 2024 05:19:50 -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=N7TK2vsV; 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 4A82D68D496; Sat, 23 Mar 2024 14:19:48 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04olkn2088.outbound.protection.outlook.com [40.92.75.88]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A785868CD10 for ; Sat, 23 Mar 2024 14:19:41 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SttjcVAorX5yxdk3lpJNjYxEFPRpe9s2HomG1qx/X0/iQPDZpSEpPI18/x5l6uAp3c1lWuW0TCHnyS9lD36eP2C7NGX0dDQcVITNhIWjDqxuIOuIQ43gmGN0SLEVM3jQA3C4r1bBwZv+38lAFRRzdPjLQC1BPc2m4s8tY+0qIeU4Bga994zXTc+Jfp0Z64yhjOkNdE1c8EqT6jFqm6sGUd+5sBkBzUdaf45OPeBm4eSDxvMzcZ4KRSV2IG+Mm5VkiEpl/FAuuChczLP6TArpvaRN/b0bh021siCMKZuGGe+mgTo4VcgeqeSnqGqY3YKl+TQBXermRmWSTXxkv95bXw== 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=OK3cqg4NjuJeHpjCjt4+91grtxV30l5s95r4VLvWQEQ=; b=RABhD2JsENAxaF0YrcUbqUY1NS+CLzTpQm4COZwyWGnMy1ZpbXeYTXL91wPPrKz+jeInP3R9leKWyygCkWZjMjp51fbOuU65RtjFRj2u5ui0peRzFbWW35BimeVxi/LumlkFf5s29G5HRW0deNAOdoHF0vJyHX6bXDXBtv9pbY4xynXhKS+bOiszt9HVdCHJS4VZUGKT4+fTboWx/bJcYcOe/2oTHhnXE3D4HJEt03U4vmEQNqQLREKyirxcVtoMtYVxNG00x8n89IhClBlBsQfRd0PrgvKoAylQ6CoUEDfyLsjzY0F5QDRPAJGGld/eJyZtq9Ja0quEczT2Budr7A== 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=OK3cqg4NjuJeHpjCjt4+91grtxV30l5s95r4VLvWQEQ=; b=N7TK2vsVp4J1DWtbJ55VLmTZSInwe/IGi2UxNeFN+32Z5jEEtSjnyQCevBBBbFDpPvgdAKWwAaaTW6qx/8ktqhw3+2XjGZayQ6LStTlRe4Je5mJ2Sh5sI4A0at9hQbTuh/fo3nk8tsScGhtCg5iO0pYYf2LDIMfN+CoU0I/RUZ8H0A5sK29x9w3ardL36Rr6BS0hyL2MmSiAiB1gnKj3ce2Er6anRXmnO1aVqiaL/LIaXCak7lFJPi8oMKItHfK7ZPWpq0nW8BUHM/G/cGPa5rZP4go1i5tkBESxZkr26scZjFvZc8tGvl6DWG+h4wE7NK6kKSDrup04lGvgbISF0w== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PAXP250MB0600.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:275::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.15; Sat, 23 Mar 2024 12:19:40 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::4a3b:cf76:cddc:c68d]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::4a3b:cf76:cddc:c68d%4]) with mapi id 15.20.7386.025; Sat, 23 Mar 2024 12:19:40 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 23 Mar 2024 13:19:29 +0100 Message-ID: X-Mailer: git-send-email 2.40.1 X-TMN: [8fEtgu+cHflOdUYGYOASQuzHivSfQ+IwTjJAWFyLdTs=] X-ClientProxiedBy: ZR0P278CA0081.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:22::14) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20240323121930.1587630-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PAXP250MB0600:EE_ X-MS-Office365-Filtering-Correlation-Id: dbcc7982-9ca8-419a-381c-08dc4b338366 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MVcoYid8/Yskm/4aPuXYCG0inmaNhg0KhoqWSCN/RlRQaduJ0gi0p/+/uanPwswjYbwFA2D0asSDUWnljMDTlUwmehkgFG1shEyeiiBBQaX7dZnyrbeC9RhIEsG/aFQ1UgMiwZxuosi4beM0Lgi4MrHMl01EAk9TUo1uNW6O3+zw4fvdcLtgvazqgMGU0x79vz8Dprc6o+Vrl2QfEz1KUxb8dbD4n0Gng01OlybXmg2pEQCM3l6G8IswZGC1KaOmjJXAklbk7aXnJT65MjNdV65Bd2tlm+sS0PP15r7H6D6IaRBso8SEb8Lt/7UyW6djgZ2A8h/nMbmycaWcIJenAVFmJ2XzIqmQYFpyB4hDGLAKlWM+chK8pjVvQOSYe+C2lPpHWKtipnUWpxlm9L8gTtguGT7D46IUYKQkPEv/yMFvABa77+l6nT2EUAWHH/cI26AfOoVvG1q03RAwJNRSfmcUyf0YOZBHMYhgPz6l2LymD/NsRqeL43pR5YlcnCqs2ZdwuivlQ6GeK3jG7yH+D12ozn/yxaOVzCzWHY97pOrSzvH3KWzp7LQct+ThDYNejz+jReQTsytNwByu8vbKg8IWYvyuXpXNGwxBdcy08Z0j/IAXNKOznNJmnwkXJNcC X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Ex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CQ4mwcJ48u/9/KIxkhuhMvLezgBUZcDQXSyd+uOsWPayOw94Y7LscAdeVmk0HYcKdV2liyJNL2ItBwTF+1mQWOyvdyu2dYR5+AOeVvnIyZuNhjRX5Vhsnzloduzix7WL8ig5W4zbai8r3V+dqsaIgjdc/HbwlyWBPJH9R4RLebZQf3LPhSsPEblTblQLvd7NLSV8YWw2Is0CDzfbRwQnm4qZGDyB3zHYd1Cd8JRX1/ce85vbcEKus5jAoR+Q== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: dbcc7982-9ca8-419a-381c-08dc4b338366 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2024 12:19:40.4291 (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: PAXP250MB0600 Subject: [FFmpeg-devel] [PATCH 1/2] avformat/file: Constify android content protocol 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: thpsmhhG1Z+j (The discrepancy between the definition and the declaration in protocols.c is actually UB.) Signed-off-by: Andreas Rheinhardt --- This and the next patch have not been tested (apart from "it compiles when the android content protocol is disabled"). libavformat/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/file.c b/libavformat/file.c index dd5819c06f..8f3b35c795 100644 --- a/libavformat/file.c +++ b/libavformat/file.c @@ -670,7 +670,7 @@ done: return ret; } -URLProtocol ff_android_content_protocol = { +const URLProtocol ff_android_content_protocol = { .name = "content", .url_open = android_content_open, .url_read = file_read, From patchwork Sat Mar 23 12:20:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 47367 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c889:b0:1a3:b6bb:3029 with SMTP id hb9csp185722pzb; Sat, 23 Mar 2024 05:20:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVyFGl3dzALCNactaUWSDM2WCG/BVDT0y7O4hLbjLn73Vs9ANiju/n5XsBq7iIvYK7SIq7khNsLHe5VIKP+W3nP7kv84FjN5QBkCA== X-Google-Smtp-Source: AGHT+IFnyA7Iwas0WMxQbR0d+a1zU42aGgLbbjkiQEnzXPf2OigAK6qjIXvfOkrvjrt3dS4c01c6 X-Received: by 2002:a17:906:3498:b0:a46:ed8d:9e44 with SMTP id g24-20020a170906349800b00a46ed8d9e44mr1578202ejb.33.1711196426076; Sat, 23 Mar 2024 05:20:26 -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 gy14-20020a170906f24e00b00a47350334edsi759858ejb.495.2024.03.23.05.20.25; Sat, 23 Mar 2024 05:20:26 -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=GiFy0jfm; 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 71F6B68C72F; Sat, 23 Mar 2024 14:20:23 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04olkn2063.outbound.protection.outlook.com [40.92.75.63]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 86CC868C72F for ; Sat, 23 Mar 2024 14:20:21 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KD8KOBZHb0hKFRmr52/SEUOA5SsXRQC+fn+Xg4vQLCVjRu3UQZKGDn+XXQ0qIb7/Hw08ViYQiH8ojS8FhsuUT5wxNpj5R9lzCG3oeKYVerxamR7mu6yCo1DqFrLl8C8E6Yea5vDkufayxjKJNGc+C7CA6WpRKe+/GJ8YD1BG+Elro5LsjeYPkIPRfUo/dURcJ4wb40fsR2hwt7iMaS2SRFJb6dRD4wWREAzctme2iWD0jIOycxUZfXVsYNYmB1T0LwKrmaH5DHMUrM0P1psdAsIzK/t2wv6PUeIB/MAwvByv4ep8HL6Cx6dwqs8dLohN73+0zo4qCI0Wi7DgpLcP3g== 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=El3rFcuye9hDiTg4vAithPmmVBWMWvPsuEOlZKhKQHg=; b=m3/eKl055Xu/qCSBv4b+pQh+1boFQ9ZtQ6ZZc59f46WINNTUYLwrqyP0VblSYSxmrOZBOcl+Qr0mOZLLGcrmmZGVMJCaAXQrjyx6yeS9AZa1FZwIrUwjyzgxG7y5wJHTaa3EddCbA9kneX3D83KfySjG5GP7t402OE1H8pz9X+3tGLgFgRPdD+H1BEfZHs0lMQA7pgKOhovpKG+USmpBIMGNQnxnmxcdp7htetUH3OtXUAX+Fd7GFDp5RM68LPsSsI9NCHS+SXOyDDOQKSk427uIeDtYRp3DX77Vk0i+2B+g8lQciocESqrRca1nyTRDEkymHc5exU3Z+NXjcisXYg== 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=El3rFcuye9hDiTg4vAithPmmVBWMWvPsuEOlZKhKQHg=; b=GiFy0jfm3/CFvC6obnEmdgPkDM4qh4fQQDW42ao46dL39U3uqOJTm2rqGlrAkU7ZckHq9Sbq2Wo3eoVrE8PC0nTAIr+S61CYkf+dHUJrAna0a17z+Jp9ur0PLsArA6iFVlC9948a5Nqki2QE5402inSZW9bFrUykZAbH5Bfb/tNitRAHlM0pdCpbsz9Lpd9do5I3DKS7hSMYIQMX+ojLL17ObgGQ0oZG51NZQIUtzmRJZs9i1LMhUQ3G5rK3dT8y1JKoh3TmCnB821T309bHkWDlN+1Pj4iXAfIUIn/ftPuNk8L3+toVuuv/NkWm5IfBpNfTQGHlaMsTPmQvrviULg== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PAXP250MB0600.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:275::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.15; Sat, 23 Mar 2024 12:20:20 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::4a3b:cf76:cddc:c68d]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::4a3b:cf76:cddc:c68d%4]) with mapi id 15.20.7386.025; Sat, 23 Mar 2024 12:20:20 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 23 Mar 2024 13:20:12 +0100 Message-ID: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: X-TMN: [6RYOlvvhKiTuWhVKdOAjt+YRhJu8CsQOS6uDbPA7E+8=] X-ClientProxiedBy: ZR2P278CA0007.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:50::13) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20240323122012.1587694-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PAXP250MB0600:EE_ X-MS-Office365-Filtering-Correlation-Id: a63e0c22-626e-41c6-d924-08dc4b339b21 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1gyFO0mbmssTqxclTMQ+CM8CrXk3NXgo5QRymiYZOOTwc7WGnDT3M/hCeBWasTxJcLWSV1dmGKOPp8M/04J6d8TdWo/yuLwMIsyN7SVQl6LKh18ZgIMIzSBJ7MUg0MtYg/4j2lIRlIFra3kOfBP83jWnP2zM2Ul46PgDGg/fm23OS6j+kAVjZ69hDE+0FsdnmYPcZUx//un87G9d+3SrfIYddOqAExN/LP9sc9ud4j0k6sUetRZmL/lsfN2gh2wNugrizKwwsxWIIjqphw2ANppsGJMGjC1xj16XX+VgshA1f7ScfqVwP+vJ1BBOID/0ac0G13Jj/OjaZ5QfJxV/cJvM1O/4jxYaQsRmaeWeR8zN/5A5M7MO1jOL4HP8LJVkreF5e8agHuCJBuQqXnwe6wVrJ6RV+BgWMSMjXBJF43CAWerLAmOu5TVagw1Gr82OgjhLGOdLF9fY7czoM9f/qqE0yN7TJHIqPbv7b7aqbWPbygOlYr998TL4I3ANoFMi0AW4zrIWlNxJKynJoCO6ldwggj1JNUk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RG233nUquNcJSzH0n+h9fOFd6E8oQdGuKHgFiZGQyLp/mmGwvK7cGOuHa8b2YwnIcanoD2DargIDvX6+KSS62JXUFlix/5TRUvQuGTqWi0v80BjvKz8vaMygKGLOhckOeJfQO6PH8fiS2gRcLffn4/y0N1TS5iOxT7GZntjMXDhBzPwZUnohM24E4/1IfwbxNgcUimE8gTrsjT9xMaIZj4bwalzTa5bbF6u2ZEaWHjrH+0mwkc6fHrEdvOmYIz+nT8VYae0B0rRmKmw17z08T3jZ0QDuoaCcAJawHz0rCvXWna/rCui2e2bhT4ntz6zHdXINedAHxH2o02n8EPIQILtnNIKqQEytszXGzZnASJN0bzTQ+AiV42swbuV8OziF9wg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a63e0c22-626e-41c6-d924-08dc4b339b21 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2024 12:20:20.1147 (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: PAXP250MB0600 Subject: [FFmpeg-devel] [PATCH 2/2] avformat/file: Combine all CONFIG_ANDROID_CONTENT_PROTOCOL blocks 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: oldyb8otZwJj Besides improving readability this also ensures that a developer who has the android content protocol enabled and works on the other parts of the file will not forget to add necessary inclusions just because of (indirect) inclusions from the files included only when said protocol is enabled. Signed-off-by: Andreas Rheinhardt --- libavformat/file.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/libavformat/file.c b/libavformat/file.c index 8f3b35c795..182995717a 100644 --- a/libavformat/file.c +++ b/libavformat/file.c @@ -40,12 +40,6 @@ #include #include "os_support.h" #include "url.h" -#if CONFIG_ANDROID_CONTENT_PROTOCOL -#include -#include "libavcodec/jni.h" -#include "libavcodec/ffjni.c" -#endif - /* Some systems may not have S_ISFIFO */ #ifndef S_ISFIFO @@ -107,21 +101,6 @@ typedef struct FileContext { int64_t initial_pos; } FileContext; - -#if CONFIG_ANDROID_CONTENT_PROTOCOL -static const AVOption android_content_options[] = { - { "blocksize", "set I/O operation maximum block size", offsetof(FileContext, blocksize), AV_OPT_TYPE_INT, { .i64 = INT_MAX }, 1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM }, - { NULL } -}; - -static const AVClass android_content_class = { - .class_name = "android_content", - .item_name = av_default_item_name, - .option = android_content_options, - .version = LIBAVUTIL_VERSION_INT, -}; -#endif - static const AVOption file_options[] = { { "truncate", "truncate existing files on write", offsetof(FileContext, trunc), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, AV_OPT_FLAG_ENCODING_PARAM }, { "blocksize", "set I/O operation maximum block size", offsetof(FileContext, blocksize), AV_OPT_TYPE_INT, { .i64 = INT_MAX }, 1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM }, @@ -547,6 +526,9 @@ const URLProtocol ff_fd_protocol = { #endif /* CONFIG_FD_PROTOCOL */ #if CONFIG_ANDROID_CONTENT_PROTOCOL +#include +#include "libavcodec/jni.h" +#include "libavcodec/ffjni.c" typedef struct JFields { jclass uri_class; @@ -670,6 +652,18 @@ done: return ret; } +static const AVOption android_content_options[] = { + { "blocksize", "set I/O operation maximum block size", offsetof(FileContext, blocksize), AV_OPT_TYPE_INT, { .i64 = INT_MAX }, 1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM }, + { NULL } +}; + +static const AVClass android_content_class = { + .class_name = "android_content", + .item_name = av_default_item_name, + .option = android_content_options, + .version = LIBAVUTIL_VERSION_INT, +}; + const URLProtocol ff_android_content_protocol = { .name = "content", .url_open = android_content_open,