From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 3E1C44EACE for ; Fri, 13 Jun 2025 10:58:16 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 5372568C5FF; Fri, 13 Jun 2025 13:58:14 +0300 (EEST) References: In-Reply-To: Date: Fri, 13 Jun 2025 12:57:55 +0200 To: Devin Heitmueller MIME-Version: 1.0 Message-ID: List-Id: FFmpeg development discussions and patches List-Post: From: Maryla Ustarroz via ffmpeg-devel Precedence: list Cc: Maryla Ustarroz , FFmpeg development discussions and patches X-Mailman-Version: 2.1.29 X-BeenThere: ffmpeg-devel@ffmpeg.org List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: FFmpeg development discussions and patches List-Help: Subject: Re: [FFmpeg-devel] [PATCH] avcodec/itut35: always check the provider code and country code together Content-Type: multipart/mixed; boundary="===============2032621996962245343==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2032621996962245343== Content-Type: message/rfc822 Content-Disposition: inline Return-Path: X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 42F8168C445 for ; Fri, 13 Jun 2025 13:58:08 +0300 (EEST) Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-6fb0a05b56cso37334326d6.3 for ; Fri, 13 Jun 2025 03:58:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1749812287; x=1750417087; darn=ffmpeg.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=v1UNVkU38RKweJZkwjEhhPbuWaxlIMMiMkA0gNSjvik=; b=yocPmXHBxpnBv8THKt85VIEGMFHXT7zfjE8nS59o1190RIlCZKdq/NK5psNzrFaXHo VVaUCMudrGJ9bXGY8TSN/zTAbOk+xfjAk+d2pyy7enSKq4WpaL2lk/Z1v3ZZlOBHk5pl Kc3agmCKOODgbdnxdoUaIYOfhLPydPVyXIvtERcBFE48r5sQ4l+2uypcL6oYPsaI+bLX SZEWzizrR7ZMTkdvCMZiEfi1HJLgn7Bxlba4WdtizH8KYuwC1i56plQmwD2WgOE7FDTf RhWg+GFgLJ5tqm7Y9c7CvAwSF+1MoAHmgLljDNMg7oqogTAXlXJciAosnWjhnLw6UKL2 M87w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749812287; x=1750417087; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v1UNVkU38RKweJZkwjEhhPbuWaxlIMMiMkA0gNSjvik=; b=lu5hdVw/LaYlPsUkZjCTsk0mpvTj/VlhmIdaXRF5iohQ4Sj0fF+TOAJajDaIglbOy2 yxNFKKnehont9dWief2KFXJdrvhchplwrFthVzJT+PyIdEXZRq1XaimGRi+tRv0p83j/ wrBbmM26Pw05dnIvsBXBM/88l/Fx9cm2XN8xLkw1nJaZC3KDwzNRywrP78VE6D+zTgqL B+5sMjBui2oPRG0Pmt4DDolxMYanmyHQHW60zB32dKArob5utRI+kpcFmJDtCgvsm22A PaidfQ8xMT9FoWIau0wX+828yfXKI3DKty1OZjtf4by4wv6i7H2/rCYCxvQS5uri3zKC GCOQ== X-Gm-Message-State: AOJu0YxRTA1jyDWATxXl6FCXA5D6PLY/Htu6rJ76SXjvcweAG67bmvdP Rg6JE2UuKZ56eT9wyxDfFFPREpP7wZhNNEuqWFGa7LDfpL9wB2gKRyol2oR31lG6BkcDbVgVehA /50hxSY/I+nspjPgI2lKQz9PlMQKhtPKQuB629b521um9YdSocAKHq5rD X-Gm-Gg: ASbGncum5KRMdzTZsYsgCVtjoLDHsUIu2goKAd1WFAHC0YN65qdb2EJMtuThDOgY1xL choeBPNYVXsK00IhCowWveiGRrPpFCR1h3nEJvlX7/VoHNQqBOIgRETbzyl1GeoRT5dPCSXIGA8 xrtnbGAW4JDb2DSgmgJ0wOh8Dlni+ixEEXB4shKFSSfCtyK1SLmVMQ00ln5iZFpQZxL2Y/8taLB A== X-Google-Smtp-Source: AGHT+IEbjfHRN9YNcu3ePH8n+JU6rbUOsyhRvfa5yV+v75zxLB7JKxLgzOd3dUyixNoK6zfjwnxJI2p24XV9f8JWCvc= X-Received: by 2002:a05:6214:ca6:b0:6fb:15d3:7f3d with SMTP id 6a1803df08f44-6fb3e5716ecmr36052036d6.13.1749812286716; Fri, 13 Jun 2025 03:58:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Maryla Ustarroz Date: Fri, 13 Jun 2025 12:57:55 +0200 X-Gm-Features: AX0GCFsCE--0pVg08iodPl0w24EMPBpjkIUXY3Zn3erqo7HWWIGdj7J3nsiZ4EM Message-ID: Subject: Re: [FFmpeg-devel] [PATCH] avcodec/itut35: always check the provider code and country code together To: Devin Heitmueller Cc: FFmpeg development discussions and patches Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jun 12, 2025 at 6:48=E2=80=AFPM Devin Heitmueller wrote: > > On Thu, Jun 12, 2025 at 12:27=E2=80=AFPM Maryla Ustarroz-Calonge via > ffmpeg-devel wrote: > > ---------- Forwarded message ---------- > > From: Maryla Ustarroz-Calonge > > To: ffmpeg-devel@ffmpeg.org > > Cc: > > Bcc: > > Date: Thu, 12 Jun 2025 18:27:43 +0200 > > Subject: [PATCH] avcodec/itut35: always check the provider code and cou= ntry code together > > From: Maryla > > > > ITU-T T.35 provider codes are attributed by national bodies and it's > > possible to have collisions across countries. This is why the country c= ode > > must always be checked as well. > > In the code this could be done by having an outer switch on the country= code, > > then an inner switch on the provider code, but this would add an extra = level of > > indentation and is not necessary as long as the codes used don't collid= e. > > > > Rename some of the constants to match the corresponding organization. > > Add a constant for AOM. > > Write all constants with 4 hex digits to make it clear that they are 2-= byte ids. > > While it's a bit more annoying, I think the checks should actually be > inverted. It should be looking at the country codes first, and then > within those country codes it should look at the provider. Thank you for the feedback. I agree this would be cleaner on paper, but I just tried it and I actually find it really hard to read and follow with all the nested switches. I think that simple ifs like this would be clearer: if (country_code =3D=3D ITU_T_T35_COUNTRY_CODE_US && provider_code =3D=3D ITU_T_T35_PROVIDER_CODE_ATSC) { ... } else if (country_code =3D=3D ITU_T_T35_COUNTRY_CODE_US && provider_code =3D=3D ITU_T_T35_PROVIDER_CODE_SAMSUNG) { ... } else if (...) { etc. This would also avoid adding an extra indentation level. Of course, nested ifs are also possible. Let me know what you think. > Devin > > -- > Devin Heitmueller, Senior Software Engineer > LTN Global Communications > o: +1 (301) 363-1001 > w: https://ltnglobal.com e: devin.heitmueller@ltnglobal.com --===============2032621996962245343== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============2032621996962245343==--