From patchwork Tue Dec 7 09:55:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 32106 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp6025052iog; Tue, 7 Dec 2021 01:55:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7+NGgZdQWQF1KkDoq+mWPcWBeYzNF7q9QD3pTI3vfO4QYPGSdL7hQQR0DHJVSn/pTHCQP X-Received: by 2002:a17:907:7dac:: with SMTP id oz44mr21483220ejc.307.1638870941094; Tue, 07 Dec 2021 01:55:41 -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 x16si21602034ejo.660.2021.12.07.01.55.40; Tue, 07 Dec 2021 01:55:40 -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=RLA3OCnd; 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 05EC668AE3C; Tue, 7 Dec 2021 11:55:38 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (unknown [40.92.75.20]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7541A68AE3C for ; Tue, 7 Dec 2021 11:55:31 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FIEI8SSNp++pMnIlYHStfNeUhMynbUAQamiW++x7LrJtGlKgDIDXdtsS7s+JdsMxhLDnov2b0rMsNMkCFdvgI7uko1xSgFr5C9PxIBagE8BkLJZhGnPFb9Q7nldz0zVdyBgM90WmB94JpBH3RxChQvW1nogvyD7fEsPeKL7iUcRehdoxOocM0YLlYlNN5Az4w12w1WrT34bowhH5HA2FL5ZClGE+Zo+YOFvjxEzwNMIPQuWzWL/9S00WiBsPguwjYMx/fpkNyzeF0jYGexuVWiolgKX3M7YryUs5H0lD+yIfcJFbqfT3KsVjAs6rPFk0NtpEDeGvl2aHkUb5UIBFMg== 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=i9+AkRKrflBZ2UIq0JR35qoO+hpMuRPRiDOeK8aRBEI=; b=fqCYqcrEhgD1yuSIDtVZADMuKHs56RfXHn1tHMVCCjUMyio3SortISEw48Qt4Zs7SxQ8Gi4QvGOLi+vnlZpgr+9fwv2fatG/hNlc2P5qVq5vwm1uyHuBSMGWUj/LZFbuZ7aGr0UwLoWhNalE0/CleYyZtL91+OmjkHOb2U8NcagW/3o6WPMTCDeQqRkIGL19ty22DyKxF2VbxrjK1r2e3hRThjNOGY8nd6oc+LTXrGvZKmXLzngX5cCQBgLnhSMCjO8+f0krDvHbUHtGb30nkNra4SO5SX8VVUw+JgbKZN/aOuUVMvsevSptAZ4PdxRcazOnXnIM1pAzjgYxsfjnMA== 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=i9+AkRKrflBZ2UIq0JR35qoO+hpMuRPRiDOeK8aRBEI=; b=RLA3OCndj1hbBmlnKTazha5nnQoOMx8aSwjrqR5ypUKCb0uMR0A9d7kmrrzV11A0WGisj94AVgNe0XP00b7nYp9KERQKynDbjIDQs18k89thrrnDBXlbL7uy1xduXdMiKX0CyFPuoeY7f5JPfuV5DaI8l+H3XhXGXzSMCx91QXTlvSTajLPwo5et/tnmalpN+bE1xuylVC+LXjZhSQcl5QIs9BEg8ZpIVJNdWjl/MyjJsxbTHADPDKbecKEs/7JQb+ePSwAHq62bNW7XN2637ZmaX3zpvoj8OSfcxz8ElDEvlfFUDolVIiXqwX3ipaURkb9Z3Hx2s+p/k9P4m90Bjg== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB6007.eurprd03.prod.outlook.com (2603:10a6:20b:e8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.16; Tue, 7 Dec 2021 09:55:30 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f0dc:92f5:6bc2:45ca]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f0dc:92f5:6bc2:45ca%4]) with mapi id 15.20.4755.022; Tue, 7 Dec 2021 09:55:30 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 7 Dec 2021 10:55:21 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 X-TMN: [6hk4SGxIiEsGsuXCrqXP5pOo18eF/MwG] X-ClientProxiedBy: AM3PR04CA0133.eurprd04.prod.outlook.com (2603:10a6:207::17) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211207095522.433768-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.248.74) by AM3PR04CA0133.eurprd04.prod.outlook.com (2603:10a6:207::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11 via Frontend Transport; Tue, 7 Dec 2021 09:55:29 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a4761fc8-08dd-4cad-8f22-08d9b967b3bf X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiSZafVhYkhL3gJcf531Of0WOagnzngbTaCLOlb7YaqugFkslPHQhnCbPIYSa8WvDfmbL6+zw9a0qoMvM8MI8/VGnBR+6Nykve7X/6VZ0DR1mo9K273QH6fzYbWJ+P66VHS284/I8Ar4Ed2YAqA4t9ZuZnufXGBw9apICDnrhcdc1h53ksn4HC03+PLMj4eHoQ72HuaPooSVZ2RU0yGCODD5seOz4MKeK8zFbVh2GeYXAMF3zu89HSx6hf0fjBbQVDRRnd92ilIXCZvvNTy/e3pMHvwDTf52YDdVHP01ZGFK4IzphdXBJlpXaDFlEjmKqfwlU62YPDpSGw6aR9/5A25BRCjSjiBVDvUEATTPgkiGg+CGXcoY66upDQQT0kFU4MdEWWb5nGTzgUZrd7f9bmyc4qDo6aATbDmaobNDbzE+vwF5RZ1xS2EQAyxGljsgJabcanVD5sKFV1BX/yvwmPl+5RZA6O3tEnyu5r7iCw3dwPhiieYSLwo2qCXTr1M3jmwyR5SNAJ/icEQnRYGYABP7D15ron8dswMAPto2lO+JyxPHwGZnJlOdqa2HXIbb0xUsEMZ8xD2rJ12o8G7aaOFblvhNvwVXVe3ODk7yP0wwbXVfJqWLJIuR8tItKYo0hp2HRfmdpRrYKPgvxBmr6kzX/JEPhYRl2UX3+4+s2xi2iVD4KBJrYzg9+//X7ugFpNXeuBPK/EJJaiQxQyzRrZy8w7q0oA1gFqN/HrwTNHBALe2J9k/U9GjjRvNozAn79Ms= X-MS-TrafficTypeDiagnostic: AM6PR03MB6007:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Eh3XiiiPw5slR0CnU+wN5ip4yEerodETTTURac+gvCqHHHRgRi7sHHRuLChdXiOy//fGrCJAkQR95BWuh9B5suV/312hHd6R+kkIubK6XU7dFwIlzW8jmh9XneRjP0TbgnWUrP9refjGVv6Fgqmy5AzgFGQghStS6L9Lte3DjETJxaTeTnOQI2StKSkcfxgkxT65VPQoe4qo/ISLKw9hXN9hncfv8Mk5f8Yz123N/Lz1njXctGFmafZhXaXbr1DtLa/P30fqAiV9hNYYwT9y6CKH9RSRoNQmJYi/7vF0kwkYMmYmuMXjWjVTbXHtWJIiLdUqTPOi2v8FE0dAPrARjWqaGyyAQ9hvrz/w2Um63bM641FbQyZstVnUivSHQ2nyF2yjzioONxGbdrQ34hIwRdcNTBZrBkp6lyE6OiZ56Yq5G0lINhb4wHTus2dJbqPrm5AtdNLLisxPcj6Ir3H3f6EIi7g909f9PZYknSLLng6xD4CDMY6cPf+dghWW4Ioct/bPBUBCukMxMA0u5lKvi9zquoT2oAYiuo+omQUTuD1KRPr+rkjBafDe9r4SEKM6/+YKzoH/V5HqwbtOQwS8EA== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1uGEi1LduKBrgW6LgPf1lUjqjiAd+QLVfzoRRmcF0TvqDQWQ3TZV3dRt6jcIuUCijB9eFKzP8HS1B+gfSNf6MJq41MeyNV/ZcEX0NiRCZAHsSqj2K3ZXDItQzwKpbh5StmjfJi8r9jfEsoQy2se3CjcVcdrNzlvZzqg6oCEMmbpfRZIG4pjcBMJRfdESvwNUMb1/xS46kykt+Ec7aF7ME/8womzzbxr8CD+giKlpGl5gRcbZd2iQa7HpQEbhc8+PLhuPY0O4U1M/tg259jWcihHh2GccLTgRW5FpNHzE1b7DVW0OExcFsi6mr/Ohs34rirsd0aoZAHX8ho9XfHwnDLAv07V8icNBOtzIN62xyF7GxN9sEiwM4nH72GyOXtNTgAf7/EwXzEvjI9Hwca+b2v2RjdVFBeA6/u1EcmYdIYPo48nVFlgTFAVFDmKL04C/IjKDdP9mskc1s5AKeFbjrgIYpwKDo0/YEAcJ8B1sp0t+w9UPQzL86tcBDI1dJnDacUvBS71rSb8gU9YICOFXUeCWVkfiQvpvFzvj6QAVokY03a6XC83tNigJgyVLyVaEilkZ+k/7/UqE5ckY2n+CP2uY+HPsfITlq0yZqsbs/a3a+8YwXGDqcqJTdBGd4dCpuqwF3Zw0P/Qx3bnAx+aVvx5nJIPcDAt134wmMjNHi9KFCtfrwOd2JEsBp4FvwYMAyjH0iEzvz77wDIemc/MSGZ2Fbcq6rp/vz4rcNBZn5MisqOlr9EFoxaZf2aY6m+aE2y6X1vrzWWyrqVslbcEp2qdtTpPtEqwMNfcCGpAm/e/TaYhVKolHnulUd4SqnVvj+nVuzEwyO0+rBfvVqUQ9awdy/b+b3N3igzAaGedM63g7mTMLjwGM00VCwxjOFk9vS8FBqtOJs9XOFL4Zpl2VwF0aPS/T8QH3pKr/PGZEwstxtEfPcCkwzxir9d5eT1xHnH54Tu6I40wn6qSwwig5bQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4761fc8-08dd-4cad-8f22-08d9b967b3bf X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2021 09:55:30.0893 (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: AM6PR03MB6007 Subject: [FFmpeg-devel] [PATCH 1/2] avformat/utils: Fix wrong indentation 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: KIoKatsVLWf1 Signed-off-by: Andreas Rheinhardt --- libavformat/utils.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index 7840e8717c..827e7c8d5a 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1479,23 +1479,23 @@ static int match_stream_specifier(AVFormatContext *s, AVStream *st, int ret; if (match) { - spec += 2; - val = strchr(spec, ':'); - - key = val ? av_strndup(spec, val - spec) : av_strdup(spec); - if (!key) - return AVERROR(ENOMEM); - - tag = av_dict_get(st->metadata, key, NULL, 0); - if (tag) { - if (!val || !strcmp(tag->value, val + 1)) - ret = 1; - else - ret = 0; - } else - ret = 0; - - av_freep(&key); + spec += 2; + val = strchr(spec, ':'); + + key = val ? av_strndup(spec, val - spec) : av_strdup(spec); + if (!key) + return AVERROR(ENOMEM); + + tag = av_dict_get(st->metadata, key, NULL, 0); + if (tag) { + if (!val || !strcmp(tag->value, val + 1)) + ret = 1; + else + ret = 0; + } else + ret = 0; + + av_freep(&key); } return match && ret; } else if (*spec == 'u' && *(spec + 1) == '\0') { From patchwork Tue Dec 7 09:56:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 32105 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp6025794iog; Tue, 7 Dec 2021 01:56:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJynDyIfOmohnKvt35PHLhgpTh2OKChIAczRov2IM7i8+u9nBeru2P0aCFPwMcvz47wsdj25 X-Received: by 2002:a17:906:b1c6:: with SMTP id bv6mr3964358ejb.30.1638870985790; Tue, 07 Dec 2021 01:56:25 -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 z2si24006699ejm.238.2021.12.07.01.56.25; Tue, 07 Dec 2021 01:56:25 -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=ar1wuLd1; 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 3AB1968AE83; Tue, 7 Dec 2021 11:56:23 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2084.outbound.protection.outlook.com [40.92.91.84]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 187A768AE0F for ; Tue, 7 Dec 2021 11:56:17 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BCFrzyxfWmILobGtF9Ubi/o+CqTPl9vysrclvkuHRN6hNAoPAoDqpqINrgM1pQBcnsqnCOwqN7xjnsAzoUl1ENqKLddRCExE/owcFkDt/bbtuMgy25oSYzbcVJ2Rge/oHJfIABnCxLTgGW4+o7w12ZZ1N6G6aGKhIzC6Xq5Bu7+aDIN+s+A2kJfqEYgGtslNf8gh5JTysJsDvLGSqHzENmuKFoLDQnBevGNMey7p5nGhljoysobqYGsghaDluF/nzdB9hq+oA0Cp0sASzB0l+1FhDdMALqBBI6/tzu45xHgg9UQHAmOs5YS0YDK7ForsEaFLS02VFWAMQ6cW71/NFw== 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=IDHdsrVIyIQxt2XW8X6Awbg2X03WjuxAwO3TKlyCT/A=; b=ad14nuCsznTs22H6kGAHaZADPB76/m+/5K9Yk51RF6xoybIbCnLgfdvEJmR0fc1frtbLOlCQ/n7mVVq6Zna/2/LvT1Qrayd8TCKO3eOIpuQ3EstZ5BFs2l+yxbGd1AgZkpavMxt536PxurzK4bySv9cJ66Hw30oS8hGOhNJD3YuBYX0Qd+P3x/FKvwmxtIZOvIinL0+G2sFAvT0XaxGn63gXW5ItXJpLqqvYr7ap9gWrlEZ09AlP2DPVdXzVHnjLANUG/hfJXW1l4Td46ezaVaaOt8/VbV+3Q/uOuzo2SvIeInpYMDvuwijcvUCKCVIALNwGFjtt7e26JV7Xgg5sug== 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=IDHdsrVIyIQxt2XW8X6Awbg2X03WjuxAwO3TKlyCT/A=; b=ar1wuLd12RO6u8OwT/FjiuOmA4b7Lsf4a2Q05RZDP0XFJEfOO1fW5eSsHVfexTaFmXg+QLBn6lt+PXDE25hhXFJn8Gx5Kr/vH+SVBWWPyG6Mts8Px3k7ORMrd0XXDBDOKWaolx9UfYD/KCsM0gVxlMkB/2MzNm446BtbDpKh/CpWHwGx+DujyePvMOO/AoJBvtIR06njoF0SXmovGla/RM4nfduDp8po4tx7tQzNn6MNAmPsFexNoleNM3uU6t4NORDzGRwuBVMb0wI4rNUw+qP04hPRvVjYm9hfjd9p2qwTRg+jMiMtJHQdOl0IrRY5pipPZAv7EuU1LOFQZ2qRcg== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB5299.eurprd03.prod.outlook.com (2603:10a6:20b:c4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.16; Tue, 7 Dec 2021 09:56:15 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f0dc:92f5:6bc2:45ca]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f0dc:92f5:6bc2:45ca%4]) with mapi id 15.20.4755.022; Tue, 7 Dec 2021 09:56:15 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 7 Dec 2021 10:56:06 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [+Wxv8jFBi5yJopJCwDcEfnHUp6g84h3+] X-ClientProxiedBy: AM4PR07CA0001.eurprd07.prod.outlook.com (2603:10a6:205:1::14) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211207095606.433838-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sblaptop.fritz.box (188.192.248.74) by AM4PR07CA0001.eurprd07.prod.outlook.com (2603:10a6:205:1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=) via Frontend Transport; Tue, 7 Dec 2021 09:56:15 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a46a2974-45c5-4f40-8eb7-08d9b967cf00 X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiSZafVhYkhL3gJcf531Of0WSvxhd8P8hiIG/bh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RvZEdh4anVjMjeWfXTi5xEW8BH7swt2hwtsDpYJv6gW+aEkKSn/gOKLDaO68TQ//1D2+NRdhhnShPmEr8n+v24PEpf3EfcpQNhVVgU5kK8FTs7XZES3ssvo+N2GCssQrd7L6RjLIZ6+WbAbLuQ1lPQ2bbzC0Ci1L7mqlbT3qn5eTtcBIf+5LLD8XR94BNY5T/uG/CUXcxqCKLpi6dWP6M9G4yLjaJ+kdFfZAYEaTXuMu4o4TSRE2mu7vVMm0JxedJYPY6FmM/YnlHjij4uopRdZX82CzirrXFTR+JrczwBedZ3Mg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a46a2974-45c5-4f40-8eb7-08d9b967cf00 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2021 09:56:15.7200 (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: AM6PR03MB5299 Subject: [FFmpeg-devel] [PATCH 2/2] avformat/utils: Add const where appropriate 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: c0lh7r1upc/O Signed-off-by: Andreas Rheinhardt --- libavformat/internal.h | 2 +- libavformat/utils.c | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libavformat/internal.h b/libavformat/internal.h index 20e93d9267..cdc398c49e 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -619,7 +619,7 @@ void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf, * Find stream index based on format-specific stream ID * @return stream index, or < 0 on error */ -int ff_find_stream_index(AVFormatContext *s, int id); +int ff_find_stream_index(const AVFormatContext *s, int id); /** * Internal version of av_index_search_timestamp diff --git a/libavformat/utils.c b/libavformat/utils.c index 827e7c8d5a..fe1699136c 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1263,7 +1263,7 @@ void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf, } } -int ff_find_stream_index(AVFormatContext *s, int id) +int ff_find_stream_index(const AVFormatContext *s, int id) { for (unsigned i = 0; i < s->nb_streams; i++) if (s->streams[i]->id == id) @@ -1406,8 +1406,9 @@ AVRational av_guess_frame_rate(AVFormatContext *format, AVStream *st, AVFrame *f * 0 if st is NOT a matching stream * >0 if st is a matching stream */ -static int match_stream_specifier(AVFormatContext *s, AVStream *st, - const char *spec, const char **indexptr, AVProgram **p) +static int match_stream_specifier(const AVFormatContext *s, const AVStream *st, + const char *spec, const char **indexptr, + const AVProgram **p) { int match = 1; /* Stores if the specifier matches so far. */ while (*spec) { @@ -1474,7 +1475,7 @@ static int match_stream_specifier(AVFormatContext *s, AVStream *st, return AVERROR(EINVAL); return match && (stream_id == st->id); } else if (*spec == 'm' && *(spec + 1) == ':') { - AVDictionaryEntry *tag; + const AVDictionaryEntry *tag; char *key, *val; int ret; @@ -1499,7 +1500,7 @@ static int match_stream_specifier(AVFormatContext *s, AVStream *st, } return match && ret; } else if (*spec == 'u' && *(spec + 1) == '\0') { - AVCodecParameters *par = st->codecpar; + const AVCodecParameters *par = st->codecpar; int val; switch (par->codec_type) { case AVMEDIA_TYPE_AUDIO: @@ -1535,7 +1536,7 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st, int ret, index; char *endptr; const char *indexptr = NULL; - AVProgram *p = NULL; + const AVProgram *p = NULL; int nb_streams; ret = match_stream_specifier(s, st, spec, &indexptr, &p); @@ -1558,7 +1559,7 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st, /* If we requested a matching stream index, we have to ensure st is that. */ nb_streams = p ? p->nb_stream_indexes : s->nb_streams; for (int i = 0; i < nb_streams && index >= 0; i++) { - AVStream *candidate = p ? s->streams[p->stream_index[i]] : s->streams[i]; + const AVStream *candidate = s->streams[p ? p->stream_index[i] : i]; ret = match_stream_specifier(s, candidate, spec, NULL, NULL); if (ret < 0) goto error;