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 22FD640AFF for ; Sun, 5 Jun 2022 08:55:32 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C4B6A68B6B1; Sun, 5 Jun 2022 11:55:28 +0300 (EEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12olkn2011.outbound.protection.outlook.com [40.92.22.11]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7B13868B5DF for ; Sun, 5 Jun 2022 11:55:22 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c9XUcc4MvldgVQ86KjHfxWxHWp8fHwAz2GidVFS29hY82ntTIwnaYs5qujkC8ROfTNeU8moSbzpzWsXbI4bEdTmPPwElXzThKOT1HPdstIVoLRToPsayhwaG2qOol1EOo5nb98D5ZCM3J3eaktpJ1vsRDISuw5Vhg0FnfKhTsPS9xeoVQSlMP6k5qtNEVE30dMOjjcqnRoVmrOYRKNFkkKQ1LmIxdXm52SF/7oI1s1Ub046TBUrMP4ctMjYpG+fQLA96AubgU/vs/pvIIokIz4gTOHtd3EaN1bK/gKdp+EfO/8tnQ9dkph6Nyw3OLDuPt8uZ68pq2BrHvW1lINUPQw== 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=wKYsLEq938KHJazG8ZJheLZ2D0Kya6H41Ez0yfg26tU=; b=kSAQlfRsk5u/nXvRo6e7o0ANHEA/aCe6uH6JUksfwaSmqQUTHm6CuKaN0oDFQlk7q5AfXI0anL/afz7DIZxN6yOvcC+Cip3It89YnGLtdcr7RIR+nGniwFdsLz8LhswRK/PRSNlLtt7w+v/BWuw/hr8MjNMb0J21EvFVYZd4AuKEDuAx4lHvtdavStrJGkOyEFzzoz5soeBICeGHWNM/S/EhhAlPMHbH3xU6tWkM+/lvZssqjXjnSPQBUGOGLEJqCenafunqQd1scyK87v+W8Lq0PpLQEq7rKywuVOd6kQqvecqL+lAfRSreMUq7xtcRtb92fUwmHPBBdaclZX6MHw== 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=wKYsLEq938KHJazG8ZJheLZ2D0Kya6H41Ez0yfg26tU=; b=I2xelI8w3CoTKfzePU3lNqrZgz13maKpSyM5NAng3NW2nEnPZof2iycYkZ722bLrzUbY08qJpHXIvJa1xA7bUnCENZjSxfx3YDHeyPHv/8xN8dXTZEaaJfkLh5/FTBh0aD9A97y539nY4WPH4gAZUejXkl0O6iM/qm8YIlgJGVAPsBs29mcpaZXa6XRiuKaoDvYTDl/c/SfN+gMA6oymIk2khmyrUBI6uoCx+XrmUsGZB0bRQy6o71QdhA4TKVxhbCL+KQLWGFGRQZpLJI4Qzia9zU5UtQyIEVrJv9aTdvh1v62bL9Ems21DFOO690x5GD/ekGGK8sxumTThZf0Ksw== Received: from BN0P223MB0358.NAMP223.PROD.OUTLOOK.COM (2603:10b6:408:145::16) by BL3P223MB0066.NAMP223.PROD.OUTLOOK.COM (2603:10b6:208:34d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.13; Sun, 5 Jun 2022 08:55:19 +0000 Received: from BN0P223MB0358.NAMP223.PROD.OUTLOOK.COM ([fe80::9058:ff52:ab56:5b9d]) by BN0P223MB0358.NAMP223.PROD.OUTLOOK.COM ([fe80::9058:ff52:ab56:5b9d%9]) with mapi id 15.20.5314.018; Sun, 5 Jun 2022 08:55:18 +0000 From: Soft Works To: FFmpeg development discussions and patches Thread-Topic: [FFmpeg-devel] [PATCH 1/8] lavc/avcodec: simplify codec id/type validity checking Thread-Index: AQHYPs69Q/NxwRSzxUypnCXsEU54I61A1pQ8gAAV+nWAAATN8A== Date: Sun, 5 Jun 2022 08:55:18 +0000 Message-ID: References: <20220323155720.20017-1-anton@khirnov.net> =?utf-8?q?=3CDM8P223M?= =?utf-8?q?B0365783CC5AF48817C137226BAA39=40DM8P223MB0365=2ENAMP223=2EPROD?= =?utf-8?q?=2EOUTLOOK=2ECOM=3E?= <165441247425.5088.1095760194724448724@lain.red.khirnov.net> =?utf-8?q?=3CD?= =?utf-8?q?M8P223MB036512ED3D29D532CECAF58DBAA39=40DM8P223MB0365=2ENAMP223?= =?utf-8?q?=2EPROD=2EOUTLOOK=2ECOM=3E?= <165441720181.5088.3725748658698613904@lain.red.khirnov.net> In-Reply-To: <165441720181.5088.3725748658698613904@lain.red.khirnov.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-tmn: [2tZtoDSQ7yp77+uqjk/rHK4eqF13X8Rj] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e2c577f7-d833-44b4-4525-08da46d11dcd x-ms-traffictypediagnostic: BL3P223MB0066:EE_ x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: KKUazIfGhQ7R2FvL287LapIYGucSBhPJHq2ltGPmEMJg7i0GPy5+LoS7L8jgEKwr6Rd4AMvhyXxqFSizNWp/jLQyVZh0v84CzBmKlMUmGRnMfIEyRXeJLpD14PCkalXRqI8ngiWeAT5F4LP+I+JV05Yif0ZQCvH+fgXYsmEU1vyjXCmOEwDGicbcMCd5i528XQoEjsCkXZr1WZhrV4lJ8dWes+LIm8hhuDTHHP4u4+1FwxoFp5RSiojd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wQ3NuWllybTlQZjZ6dVd2aEVRWGlwL1Jrd3JpaElGVi9yK1pVcWlP?= =?utf-8?B?SVhBM210N21Gc3hWcFNIZmExWWlJN0Zmc013Y09kemU4bU43OE1xYlA0Zkpx?= =?utf-8?B?YUkwd2ExQ2dGRjZ4NG1CWllKaytUTkhJZG5Sais3ZzFhVHRoTTg3Z0lpa3Fp?= =?utf-8?B?QnJwcGZaMkIzTUtNeXdvSCszZmRqNHpvSkFmdmVmODhlUjM4S25rK1RpUzNa?= =?utf-8?B?eEhnc3lQbmY2bCt0bmRKZEtJOStjT1BCb1hnNGx2VU0vRklDMUd3TnAyQXlY?= =?utf-8?B?UGNOMFNDZXQ0YjExaXo3SUVIVHpaem5MSVZ4eUNDU0NYUmFRSkpNYWFLQmc2?= =?utf-8?B?MW9uOEVVS1YxSG1SZjA5Mm9iWVRDUjVNVWpVZkw3S3NJZUh5QmdrRktOdkN0?= =?utf-8?B?TmErT2Rya21FcHBueVJleE8zQ2k1b3ZySk1mdHRydzJwdVVKTzVRenJibmZz?= =?utf-8?Q?ZQVcPgJwcow=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: BN0P223MB0358.NAMP223.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: e2c577f7-d833-44b4-4525-08da46d11dcd X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jun 2022 08:55:18.8292 (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: BL3P223MB0066 Subject: Re: [FFmpeg-devel] [PATCH 1/8] lavc/avcodec: simplify codec id/type validity checking 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 Anton > Khirnov > Sent: Sunday, June 5, 2022 10:20 AM > To: FFmpeg development discussions and patches > Subject: Re: [FFmpeg-devel] [PATCH 1/8] lavc/avcodec: simplify codec id/type > validity checking > > Quoting Soft Works (2022-06-05 09:54:51) > > > > > > > -----Original Message----- > > > From: ffmpeg-devel On Behalf Of Anton > > > Khirnov > > > Sent: Sunday, June 5, 2022 9:01 AM > > > To: FFmpeg development discussions and patches > > > Subject: Re: [FFmpeg-devel] [PATCH 1/8] lavc/avcodec: simplify codec > id/type > > > validity checking > > > > > > Quoting Soft Works (2022-06-05 07:23:18) > > > > This is causing a regression in ffprobe. > > > > > > > > The commit removes the special-case check for AVMEDIA_TYPE_ATTACHMENT > which > > > > was required for ffprobe and had been added with > > > e83c716e16c52fa56a78274408f7628e5dc719da. > > > > > > > > The demand from the commit message is not yet guaranteed to be > fulfilled: > > > > > > > > > On entry to avcodec_open2(), the type and id either have to be > > > > > UNKNOWN/NONE or have to match the codec to be used. > > > > > > > > I have one verified example (maybe a second will follow), which is an > MKV > > > with > > > > an attachment "stream" of type "text". > > > > The found codec will be textdec of type 'subtitle' even though the > stream > > > type > > > > is attachment. Without the special condition for attachment streams, > this > > > > is now causing ffprobe to error out with non-zero exit code and > incomplete > > > > output. > > > > > > > > > > > > ----------------------------------------------------------------------- > - > > > > Example: > > > > > > > > [...] > > > > Stream #0:9: Attachment: text > > > > Metadata: > > > > filename : textfile.text > > > > mimetype : text/plain > > > > [text @ 000001AC32310340] Codec type or id mismatches > > > > Could not open codec for input stream 9 > > > > ----------------------------------------------------------------------- > - > > > > > > This sounds very much like a bug in ffprobe. It makes no sense to call > > > avcodec_open2() with the AVMEDIA_TYPE_ATTACHMENT type. > > > > You make a behavioral change to an API function that had this behavior > > established and constant over more than 10 years, and when that change > > breaks functionality, it's the callers' fault? > > How does this go together with all that peanut counting of major, minor > > and micro version numbers per library? What is this versioning good for, > > when you can make breaking changes and declare the breakage as bugs? > > We maintain compatibility for valid API usage. We do not maintain bug > compatibility. > I fail to see how calling avcodec_open2() with AVMEDIA_TYPE_ATTACHMENT > is valid API usage. What do you expect it to do? There are no > AVMEDIA_TYPE_ATTACHMENT decoders. > > More generally, arguments along the line of "change is needed to > keep program working>" on their own sound very shady to me and > suggest that perhaps program should not be doing whatever it is > doing. I might agree to that when: - the function documentation would have been clear about it - it wouldn't be ffprobe code getting invalidated by the change When looking at all the APIs that you are so carefully protecting with those version numbers, there is a small number of APIs, with good to great documentation, but a large number where you can't get the slightest clue about how it is supposed to be used and called and which conditions need to be met, which prerequisites are required before calling, how to interpret and what to do with the results, etc. ...without looking at the ffmpeg/ffprobe code for how these tools are using the APIs. I mean - almost everybody does that. And when somebody is looking at the code of ffprobe to understand how to use the ffmpeg API, then one needs to be able to rely on the code he sees there being correct. And even if it isn't from an ffmpeg internal perspective, I would still consider it as an API break when a change would cause such code fail. sw _______________________________________________ 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".