Re: graphics/ffmpeg: update to 9.0.1

Brad Smith <[email protected]>
Newsgroups gmane.os.openbsd.ports
Message-ID <[email protected]>
On Sun, Aug 23, 2026 at 10:53:25AM +0200, Kirill A. Korinsky wrote:
> On Thu, 13 Aug 2026 12:13:54 +0200,
> Kirill A. Korinsky <[email protected]> wrote:
> > 
> > ports@, Brad,
> > 
> > here a diff to update graphics/ffmpeg to 9.0.1, and it fixes and bumps
> > x11/mplayer as well.
> > 
> > Bulk on amd64 with previous diffs and this one successeded, unsigned
> > packages available here: https://kirill.korins.ky/pub/packages/ffmpeg-9.0.1/
> > 
> > Tests and OKs are welcome.
> > 
> 
> The previous version was without subject what is fixed now.
> 
> Also, it survives a few bulks on amd64 but I haven't tested BTI/IBT amd64,
> so any tests are welcome.

Here is an updated diff. The configure patch SSL changes can be
simplified a bit and add in my MIPS fix for CABAC.


Index: graphics/ffmpeg/Makefile
===================================================================
RCS file: /cvs/ports/graphics/ffmpeg/Makefile,v
retrieving revision 1.260
diff -u -p -u -i -p -r1.260 Makefile
--- graphics/ffmpeg/Makefile	17 Jun 2026 17:13:06 -0000	1.260
+++ graphics/ffmpeg/Makefile	23 Aug 2026 09:30:43 -0000
@@ -1,7 +1,7 @@
 COMMENT=	audio/video converter and streamer
 
 # keep it synced with x11/mplayer
-V=		8.1.2
+V=		9.0.1
 DISTNAME=	ffmpeg-${V}
 CATEGORIES=	graphics multimedia
 SITES=		https://ffmpeg.org/releases/
@@ -22,13 +22,13 @@ USE_NOBTCFI-amd64=	Yes
 
 EPOCH=		1
 
-SHARED_LIBS=	avcodec		27.2 \
-		avdevice	15.1 \
-		avfilter	13.2 \
-		avformat	24.2 \
-		avutil		17.2 \
-		swresample	6.1 \
-		swscale		9.2
+SHARED_LIBS=	avcodec		28.0 \
+		avdevice	16.0 \
+		avfilter	14.0 \
+		avformat	25.0 \
+		avutil		18.0 \
+		swresample	7.0 \
+		swscale		10.0
 
 HOMEPAGE=	https://ffmpeg.org/
 
Index: graphics/ffmpeg/distinfo
===================================================================
RCS file: /cvs/ports/graphics/ffmpeg/distinfo,v
retrieving revision 1.74
diff -u -p -u -i -p -r1.74 distinfo
--- graphics/ffmpeg/distinfo	17 Jun 2026 17:13:06 -0000	1.74
+++ graphics/ffmpeg/distinfo	23 Aug 2026 09:30:43 -0000
@@ -1,2 +1,2 @@
-SHA256 (ffmpeg-8.1.2.tar.xz) = RkvrXnvwwxHmi0WuLwTpzCr4iFGrtAgiMXQqdNl7Ukw=
-SIZE (ffmpeg-8.1.2.tar.xz) = 11710924
+SHA256 (ffmpeg-9.0.1.tar.xz) = zzjg4ox+VgWULEp3dVNJsBRYBKOXrzfrH7THfLI39jU=
+SIZE (ffmpeg-9.0.1.tar.xz) = 12036420
Index: graphics/ffmpeg/patches/patch-configure
===================================================================
RCS file: /cvs/ports/graphics/ffmpeg/patches/patch-configure,v
retrieving revision 1.80
diff -u -p -u -i -p -r1.80 patch-configure
--- graphics/ffmpeg/patches/patch-configure	2 Jun 2026 21:29:05 -0000	1.80
+++ graphics/ffmpeg/patches/patch-configure	23 Aug 2026 09:30:43 -0000
@@ -3,7 +3,7 @@
 Index: configure
 --- configure.orig
 +++ configure
-@@ -6076,7 +6076,6 @@ case $target_os in
+@@ -6159,7 +6159,6 @@ case $target_os in
          enable section_data_rel_ro
          striptype=""
          SHFLAGS='-shared'
@@ -11,7 +11,7 @@ Index: configure
          SLIB_INSTALL_LINKS=
          oss_indev_extralibs="-lossaudio"
          oss_outdev_extralibs="-lossaudio"
-@@ -6451,7 +6450,7 @@ set_default libdir
+@@ -6534,7 +6533,7 @@ set_default libdir
  set_default $PATHS_LIST
  set_default nm
  
@@ -20,7 +20,7 @@ Index: configure
  
  enable_weak_pic() {
      disabled pic && return
-@@ -6745,11 +6744,19 @@ elif enabled x86; then
+@@ -6830,11 +6829,19 @@ elif enabled x86; then
      # As 'i' is stored on the stack, this program will crash
      # if the base pointer is used to access it because the
      # base pointer is cleared in the inline assembly code.
@@ -41,7 +41,7 @@ Index: configure
  
      # check whether EBX is available on x86
      check_inline_asm ebx_available '""::"b"(0)' &&
-@@ -7002,7 +7009,7 @@ check_headers asm/types.h
+@@ -7090,7 +7097,7 @@ check_headers asm/types.h
  #
  # some configurations also require linking to libatomic, so try
  # both with -latomic and without
@@ -50,22 +50,12 @@ Index: configure
      check_builtin stdatomic stdatomic.h                                \
          "atomic_int foo, bar = -1; atomic_store(&foo, 0); foo += bar"  \
          $LATOMIC && eval stdatomic_extralibs="\$LATOMIC" && break
-@@ -7489,13 +7496,13 @@ enabled omx_rpi           && { test_code cc OMX_Core.h
- enabled omx               && require_headers OMX_Core.h && \
-     warn "The OpenMAX encoders are deprecated and will be removed in future versions"
- 
--enabled openssl           && { { check_pkg_config openssl "openssl >= 3.0.0" openssl/ssl.h DTLS_get_data_mtu &&
-+enabled openssl           && { { check_pkg_config openssl "openssl >= 3.0.0" openssl/ssl.h OPENSSL_init_ssl &&
+@@ -7551,7 +7558,7 @@ enabled opengl            && { check_lib opengl GL/glx
+ enabled openssl           && { { check_pkg_config openssl "openssl >= 3.0.0" openssl/ssl.h DTLS_get_data_mtu &&
                                   { enabled gplv3 || ! enabled gpl || enabled nonfree || die "ERROR: OpenSSL >=3.0.0 requires --enable-version3"; }; } ||
                                 { enabled gpl && ! enabled nonfree && die "ERROR: OpenSSL <3.0.0 is incompatible with the gpl"; } ||
 -                               check_pkg_config openssl "openssl >= 1.1.1" openssl/ssl.h DTLS_get_data_mtu ||
--                               check_lib openssl openssl/ssl.h DTLS_get_data_mtu -lssl -lcrypto ||
--                               check_lib openssl openssl/ssl.h DTLS_get_data_mtu -lssl -lcrypto -lws2_32 -lgdi32 ||
--                               die "ERROR: openssl (>= 1.1.1) not found"; }
 +                               check_pkg_config openssl "openssl >= 1.1.0" openssl/ssl.h OPENSSL_init_ssl ||
-+                               check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto ||
-+                               check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto -lws2_32 -lgdi32 ||
-+                               die "ERROR: openssl (>= 1.1.0) not found"; }
- enabled pocketsphinx      && require_pkg_config pocketsphinx pocketsphinx pocketsphinx/pocketsphinx.h ps_init
- enabled rkmpp             && { require_pkg_config rkmpp "rockchip_mpp >= 1.3.8" "rockchip/rk_mpi.h rockchip/mpp_buffer.h" "mpp_create mpp_buffer_sync_begin_f" &&
-                                { enabled libdrm ||
+                                check_lib openssl openssl/ssl.h DTLS_get_data_mtu -lssl -lcrypto ||
+                                check_lib openssl openssl/ssl.h DTLS_get_data_mtu -lssl -lcrypto -lws2_32 -lgdi32 ||
+                                die "ERROR: openssl (>= 1.1.1) not found"; }
Index: graphics/ffmpeg/patches/patch-ffbuild_library_mak
===================================================================
RCS file: /cvs/ports/graphics/ffmpeg/patches/patch-ffbuild_library_mak,v
retrieving revision 1.5
diff -u -p -u -i -p -r1.5 patch-ffbuild_library_mak
--- graphics/ffmpeg/patches/patch-ffbuild_library_mak	21 May 2026 16:24:15 -0000	1.5
+++ graphics/ffmpeg/patches/patch-ffbuild_library_mak	23 Aug 2026 09:30:43 -0000
@@ -1,7 +1,7 @@
 Index: ffbuild/library.mak
 --- ffbuild/library.mak.orig
 +++ ffbuild/library.mak
-@@ -96,8 +96,6 @@ clean::
+@@ -113,8 +113,6 @@ clean::
  install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
  	$(Q)mkdir -p "$(SHLIBDIR)"
  	$$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
Index: graphics/ffmpeg/patches/patch-libavcodec_cabac_functions_h
===================================================================
RCS file: graphics/ffmpeg/patches/patch-libavcodec_cabac_functions_h
diff -N graphics/ffmpeg/patches/patch-libavcodec_cabac_functions_h
--- graphics/ffmpeg/patches/patch-libavcodec_cabac_functions_h	20 Jan 2026 17:22:00 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-
-Disable mips64-specific asm code that clang fails to assemble.
-
-Index: libavcodec/cabac_functions.h
---- libavcodec/cabac_functions.h.orig
-+++ libavcodec/cabac_functions.h
-@@ -48,7 +48,7 @@
- #if ARCH_X86
- #   include "x86/cabac.h"
- #endif
--#if ARCH_MIPS
-+#if 0
- #   include "mips/cabac.h"
- #endif
- #if ARCH_LOONGARCH64
Index: graphics/ffmpeg/patches/patch-libavcodec_mips_cabac_h
===================================================================
RCS file: graphics/ffmpeg/patches/patch-libavcodec_mips_cabac_h
diff -N graphics/ffmpeg/patches/patch-libavcodec_mips_cabac_h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ graphics/ffmpeg/patches/patch-libavcodec_mips_cabac_h	23 Aug 2026 09:30:43 -0000
@@ -0,0 +1,89 @@
+- avcodec/mips/cabac: Fix building on OpenBSD/mips64
+  7c533d0f86f13a06ec93968f6194349665b3536a
+
+Index: libavcodec/mips/cabac.h
+--- libavcodec/mips/cabac.h.orig
++++ libavcodec/mips/cabac.h
+@@ -101,8 +101,15 @@ static av_always_inline int get_cabac_inline_mips(CABA
+ #else
+         "slt          %[tmp0],         %[c_bytestream],     %[c_bytestream_end]  \n\t"
+         PTR_ADDIU    "%[tmp2],         %[c_bytestream],     0x02                 \n\t"
++#if HAVE_MIPS32R2 || HAVE_MIPS64R2
+         "movn         %[c_bytestream], %[tmp2],             %[tmp0]              \n\t"
++#else
++        "beqz         %[tmp0],         2f                                      \n\t"
++        " nop                                                               \n\t"
++        "move         %[c_bytestream], %[tmp2]                               \n\t"
++        "2:                                                                 \n\t"
+ #endif
++#endif
+         "1:                                                        \n\t"
+     : [bit]"=&r"(bit), [tmp0]"=&r"(tmp0), [tmp1]"=&r"(tmp1), [tmp2]"=&r"(tmp2),
+       [c_range]"+&r"(c->range), [c_low]"+&r"(c->low),
+@@ -152,14 +159,29 @@ static av_always_inline int get_cabac_bypass_mips(CABA
+ #else
+         "slt        %[tmp0],         %[c_bytestream], %[c_bytestream_end] \n\t"
+         PTR_ADDIU  "%[tmp1],         %[c_bytestream], 0x02                \n\t"
++#if HAVE_MIPS32R2 || HAVE_MIPS64R2
+         "movn       %[c_bytestream], %[tmp1],         %[tmp0]             \n\t"
++#else
++        "beqz       %[tmp0],         2f                                  \n\t"
++        " nop                                                            \n\t"
++        "move       %[c_bytestream], %[tmp1]                              \n\t"
++        "2:                                                              \n\t"
+ #endif
++#endif
+         "1:                                                               \n\t"
+         PTR_SLL    "%[tmp1],         %[c_range],      0x11                \n\t"
+         "slt        %[tmp0],         %[c_low],        %[tmp1]             \n\t"
+         PTR_SUBU   "%[tmp1],         %[c_low],        %[tmp1]             \n\t"
++#if HAVE_MIPS32R2 || HAVE_MIPS64R2
+         "movz       %[res],          %[one],          %[tmp0]             \n\t"
+         "movz       %[c_low],        %[tmp1],         %[tmp0]             \n\t"
++#else
++        "bnez       %[tmp0],         2f                                \n\t"
++        " nop                                                      \n\t"
++        "move       %[res],          %[one]                          \n\t"
++        "move       %[c_low],        %[tmp1]                         \n\t"
++        "2:                                                       \n\t"
++#endif
+         : [tmp0]"=&r"(tmp0), [tmp1]"=&r"(tmp1), [res]"+&r"(res),
+           [c_range]"+&r"(c->range), [c_low]"+&r"(c->low),
+           [c_bytestream]"+&r"(c->bytestream)
+@@ -204,15 +226,36 @@ static av_always_inline int get_cabac_bypass_sign_mips
+ #else
+         "slt        %[tmp0],         %[c_bytestream], %[c_bytestream_end] \n\t"
+         PTR_ADDIU  "%[tmp1],         %[c_bytestream], 0x02                \n\t"
++#if HAVE_MIPS32R2 || HAVE_MIPS64R2
+         "movn       %[c_bytestream], %[tmp1],         %[tmp0]             \n\t"
++#else
++        "beqz       %[tmp0],         2f                                  \n\t"
++        " nop                                                            \n\t"
++        "move       %[c_bytestream], %[tmp1]                              \n\t"
++        "2:                                                              \n\t"
+ #endif
++#endif
+         "1:                                                               \n\t"
+         PTR_SLL    "%[tmp1],         %[c_range],      0x11                \n\t"
+         "slt        %[tmp0],         %[c_low],        %[tmp1]             \n\t"
+         PTR_SUBU   "%[tmp1],         %[c_low],        %[tmp1]             \n\t"
++#if HAVE_MIPS32R2 || HAVE_MIPS64R2
+         "movz       %[c_low],        %[tmp1],         %[tmp0]             \n\t"
++#else
++        "bnez       %[tmp0],         2f                                  \n\t"
++        " nop                                                            \n\t"
++        "move       %[c_low],        %[tmp1]                              \n\t"
++        "2:                                                              \n\t"
++#endif
+         PTR_SUBU   "%[tmp1],         %[zero],         %[res]              \n\t"
++#if HAVE_MIPS32R2 || HAVE_MIPS64R2
+         "movn       %[res],          %[tmp1],         %[tmp0]             \n\t"
++#else
++        "beqz       %[tmp0],         3f                                  \n\t"
++        " nop                                                            \n\t"
++        "move       %[res],          %[tmp1]                              \n\t"
++        "3:                                                              \n\t"
++#endif
+         : [tmp0]"=&r"(tmp0), [tmp1]"=&r"(tmp1), [res]"+&r"(res),
+           [c_range]"+&r"(c->range), [c_low]"+&r"(c->low),
+           [c_bytestream]"+&r"(c->bytestream)
Index: graphics/ffmpeg/patches/patch-libavformat_avformat_h
===================================================================
RCS file: /cvs/ports/graphics/ffmpeg/patches/patch-libavformat_avformat_h,v
retrieving revision 1.7
diff -u -p -u -i -p -r1.7 patch-libavformat_avformat_h
--- graphics/ffmpeg/patches/patch-libavformat_avformat_h	21 May 2026 16:24:15 -0000	1.7
+++ graphics/ffmpeg/patches/patch-libavformat_avformat_h	23 Aug 2026 09:30:43 -0000
@@ -3,7 +3,7 @@ Add av_stream_get_first_dts for Chromium
 Index: libavformat/avformat.h
 --- libavformat/avformat.h.orig
 +++ libavformat/avformat.h
-@@ -1178,6 +1178,10 @@ typedef struct AVStreamGroup {
+@@ -1229,6 +1229,10 @@ typedef struct AVStreamGroup {
  
  struct AVCodecParserContext *av_stream_get_parser(const AVStream *s);
  
Index: graphics/ffmpeg/patches/patch-libavformat_tls_openssl_c
===================================================================
RCS file: /cvs/ports/graphics/ffmpeg/patches/patch-libavformat_tls_openssl_c,v
retrieving revision 1.4
diff -u -p -u -i -p -r1.4 patch-libavformat_tls_openssl_c
--- graphics/ffmpeg/patches/patch-libavformat_tls_openssl_c	21 May 2026 16:24:15 -0000	1.4
+++ graphics/ffmpeg/patches/patch-libavformat_tls_openssl_c	23 Aug 2026 09:30:43 -0000
@@ -1,17 +1,16 @@
 Index: libavformat/tls_openssl.c
 --- libavformat/tls_openssl.c.orig
 +++ libavformat/tls_openssl.c
-@@ -32,13 +32,18 @@
- #include <openssl/ssl.h>
- #include <openssl/err.h>
- #include <openssl/x509v3.h>
-+#include <string.h>
+@@ -39,6 +39,8 @@
+ #endif
+ #include <string.h>
  
 +#define TLS_ST_OK SSL_ST_OK
 +
+ #define DTLS_HANDSHAKE_TIMEOUT_US 30000000
  /**
   * Convert an EVP_PKEY to a PEM string.
-  */
+@@ -46,6 +48,8 @@
  static int pkey_to_pem_string(EVP_PKEY *pkey, char *out, size_t out_sz)
  {
      BIO *mem = NULL;
@@ -20,7 +19,7 @@ Index: libavformat/tls_openssl.c
      size_t read_bytes = 0;
  
      if (!pkey || !out || !out_sz)
-@@ -50,9 +55,13 @@ static int pkey_to_pem_string(EVP_PKEY *pkey, char *ou
+@@ -57,9 +61,13 @@ static int pkey_to_pem_string(EVP_PKEY *pkey, char *ou
      if (!PEM_write_bio_PrivateKey(mem, pkey, NULL, NULL, 0, NULL, NULL))
          goto done;
  
@@ -35,7 +34,7 @@ Index: libavformat/tls_openssl.c
  done:
      BIO_free(mem);
      if (out && out_sz)
-@@ -66,6 +75,8 @@ done:
+@@ -73,6 +81,8 @@ done:
  static int cert_to_pem_string(X509 *cert, char *out, size_t out_sz)
  {
      BIO *mem = NULL;
@@ -44,7 +43,7 @@ Index: libavformat/tls_openssl.c
      size_t read_bytes = 0;
  
      if (!cert || !out || !out_sz)
-@@ -77,9 +88,13 @@ static int cert_to_pem_string(X509 *cert, char *out, s
+@@ -84,9 +94,13 @@ static int cert_to_pem_string(X509 *cert, char *out, s
      if (!PEM_write_bio_X509(mem, cert))
          goto done;
  
@@ -59,21 +58,21 @@ Index: libavformat/tls_openssl.c
  done:
      BIO_free(mem);
      if (out && out_sz)
-@@ -801,7 +816,9 @@ static int dtls_start(URLContext *h, const char *url, 
-         s->mtu = 1096;
-     SSL_set_options(c->ssl, SSL_OP_NO_QUERY_MTU);
-     SSL_set_mtu(c->ssl, s->mtu);
+@@ -847,7 +861,9 @@ static int tls_open(URLContext *h, const char *uri, in
+             s->mtu = 1096;
+         SSL_set_options(c->ssl, SSL_OP_NO_QUERY_MTU);
+         SSL_set_mtu(c->ssl, s->mtu);
 +#ifdef DTLS_set_link_mtu
-     DTLS_set_link_mtu(c->ssl, s->mtu);
+         DTLS_set_link_mtu(c->ssl, s->mtu);
 +#endif
-     init_bio_method(h);
+     }
  
-     /* This seems to be necessary despite explicitly setting client/server method above. */
-@@ -925,10 +942,12 @@ static int tls_write(URLContext *h, const uint8_t *buf
+     init_bio_method(h);
+@@ -960,10 +976,12 @@ static int tls_write(URLContext *h, const uint8_t *buf
      uc->flags &= ~AVIO_FLAG_NONBLOCK;
      uc->flags |= h->flags & AVIO_FLAG_NONBLOCK;
  
-+#ifdef DTLS_get_link_mtu
++#ifdef DTLS_get_data_mtu
      if (s->is_dtls) {
          const size_t mtu_size = DTLS_get_data_mtu(c->ssl);
          size = FFMIN(size, mtu_size);
Index: graphics/ffmpeg/patches/patch-libswscale_x86_ops_int_asm
===================================================================
RCS file: graphics/ffmpeg/patches/patch-libswscale_x86_ops_int_asm
diff -N graphics/ffmpeg/patches/patch-libswscale_x86_ops_int_asm
--- graphics/ffmpeg/patches/patch-libswscale_x86_ops_int_asm	13 Jun 2026 11:17:07 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
-Index: libswscale/x86/ops_int.asm
---- libswscale/x86/ops_int.asm.orig
-+++ libswscale/x86/ops_int.asm
-@@ -106,6 +106,7 @@ IF %1 > 3,  mov out3q, [execq + SwsOpExec.out3]
- %endif
- align function_align
- current_function %+ _return:
-+    _CET_ENDBR
- 
-             ; op chain always returns back here
-             mov implq, [rsp + 8]
Index: graphics/ffmpeg/pkg/PLIST
===================================================================
RCS file: /cvs/ports/graphics/ffmpeg/pkg/PLIST,v
retrieving revision 1.45
diff -u -p -u -i -p -r1.45 PLIST
--- graphics/ffmpeg/pkg/PLIST	21 May 2026 16:24:15 -0000	1.45
+++ graphics/ffmpeg/pkg/PLIST	23 Aug 2026 09:30:43 -0000
@@ -122,6 +122,7 @@ include/libavutil/pixelutils.h
 include/libavutil/pixfmt.h
 include/libavutil/random_seed.h
 include/libavutil/rational.h
+include/libavutil/raw_color_params.h
 include/libavutil/rc4.h
 include/libavutil/refstruct.h
 include/libavutil/replaygain.h
Index: x11/mplayer/Makefile
===================================================================
RCS file: /cvs/ports/x11/mplayer/Makefile,v
retrieving revision 1.344
diff -u -p -u -i -p -r1.344 Makefile
--- x11/mplayer/Makefile	19 Aug 2026 12:56:58 -0000	1.344
+++ x11/mplayer/Makefile	23 Aug 2026 09:30:43 -0000
@@ -1,8 +1,8 @@
 COMMENT=	movie player supporting many formats
 
 V=		20251123
-FFMPEG_V=	8.1.2
-REVISION=	4
+FFMPEG_V=	9.0.1
+REVISION=	5
 DISTNAME=	mplayer-${V}
 CATEGORIES=	x11 multimedia
 SITES=		https://comstyle.com/source/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.