Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Nov 2025 05:16:37 +0000
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 592e759fc55a - main - multimedia/libxine: fix build with ffmpeg8
Message-ID:  <691ff5b5.bda9.505f3893@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by bapt:

URL: https://cgit.FreeBSD.org/ports/commit/?id=592e759fc55a4318a7fe69e39f2490a579282960

commit 592e759fc55a4318a7fe69e39f2490a579282960
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2025-11-21 05:16:05 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2025-11-21 05:16:33 +0000

    multimedia/libxine: fix build with ffmpeg8
    
    Incorporate 2 upstream patches to fix build with ffmpeg8
---
 multimedia/libxine/Makefile              |   3 +
 multimedia/libxine/files/ffmpeg8-1.patch | 114 +++++++++++++++++++++++++++++++
 multimedia/libxine/files/ffmpeg8-2.patch |  20 ++++++
 3 files changed, 137 insertions(+)

diff --git a/multimedia/libxine/Makefile b/multimedia/libxine/Makefile
index 28a1a7c7d10b..e3f6a2d82ad7 100644
--- a/multimedia/libxine/Makefile
+++ b/multimedia/libxine/Makefile
@@ -32,6 +32,9 @@ LIB_DEPENDS=	libFLAC.so:audio/flac \
 		libogg.so:audio/libogg \
 		libdvdnav.so:multimedia/libdvdnav
 
+EXTRA_PATCHES=	${FILESDIR}/ffmpeg8-1.patch:-p1 \
+		${FILESDIR}/ffmpeg8-2.patch:-p1
+
 USES=		compiler cpe gl gmake gnome iconv libtool:keepla jpeg \
 		localbase pathfix perl5 pkgconfig tar:xz xorg
 LLD_UNSAFE=	yes
diff --git a/multimedia/libxine/files/ffmpeg8-1.patch b/multimedia/libxine/files/ffmpeg8-1.patch
new file mode 100644
index 000000000000..be5805b82061
--- /dev/null
+++ b/multimedia/libxine/files/ffmpeg8-1.patch
@@ -0,0 +1,114 @@
+# HG changeset patch
+# User Torsten Jager <t.jager@gmx.de>
+# Date 1757753985 -7200
+#      Sat Sep 13 10:59:45 2025 +0200
+# Node ID 9bb3977ea7e2b652742b3cdd200b0a4a72eb48bc
+# Parent  9e326869fe0faf21957642c8c7c5cac9ed4f445c
+FFmpeg compatibilty update.
+
+diff -r 9e326869fe0f -r 9bb3977ea7e2 src/combined/ffmpeg/ff_video_decoder.c
+--- a/src/combined/ffmpeg/ff_video_decoder.c	Sat May 31 15:55:00 2025 +0200
++++ b/src/combined/ffmpeg/ff_video_decoder.c	Sat Sep 13 10:59:45 2025 +0200
+@@ -60,6 +60,10 @@
+ 
+ #include "ffmpeg_compat.h"
+ 
++#if XFF_FRAME_RATE == 2
++#  include <avcodec/codec_desc.h>
++#endif
++
+ #if LIBAVCODEC_VERSION_INT >= XFF_INT_VERSION(59,0,100)
+ # undef HAVE_POSTPROC
+ #endif
+@@ -2289,8 +2293,8 @@
+       }
+ 
+       /* transfer some more frame settings for deinterlacing */
+-      img->progressive_frame = !this->av_frame->interlaced_frame;
+-      img->top_field_first   = this->av_frame->top_field_first;
++      img->progressive_frame = !XFF_FRAME_IS_INTERLACED (this->av_frame);
++      img->top_field_first   = !!XFF_FRAME_IS_TOP_FIELD_FIRST (this->av_frame);
+ 
+       /* get back reordered pts */
+       img->pts = ff_untag_pts (this, this->av_frame);
+@@ -2370,20 +2374,29 @@
+ 
+ static int ff_video_step_get (ff_video_decoder_t *this) {
+   /* use externally provided video_step or fall back to stream's time_base otherwise */
+-  int step = this->video_step;
++  int step = this->video_step, num_fields;
+   if (step || !this->context->time_base.den)
+     return step;
+ 
++#if XFF_FRAME_RATE == 1
++  num_fields = this->context->ticks_per_frame;
++#else /* XFF_FRAME_RATE == 2 */
++  {
++    const AVCodecDescriptor *desc = avcodec_descriptor_get (this->context->codec_id);
++    if (desc)
++      num_fields = (desc->props & AV_CODEC_PROP_FIELDS) ? 2 : 1;
++    else
++      num_fields = 2;
++  }
++#endif
+   /* good: 2 * 1001 / 48000. */
+-  step = (int64_t)90000 * this->context->ticks_per_frame
+-       * this->context->time_base.num / this->context->time_base.den;
++  step = (int64_t)90000 * num_fields * this->context->time_base.num / this->context->time_base.den;
+   if (step >= 90)
+     return step;
+ 
+   /* bad: 2 * 1 / 60000. seen this once from broken h.264 video usability info (VUI).
+    * VAAPI seems to apply a similar HACK.*/
+-  step = (int64_t)90000000 * this->context->ticks_per_frame
+-       * this->context->time_base.num / this->context->time_base.den;
++  step = (int64_t)90000000 * num_fields * this->context->time_base.num / this->context->time_base.den;
+   return step;
+ }
+ 
+@@ -2680,8 +2693,8 @@
+           img->duration = video_step_to_use;
+ 
+         /* transfer some more frame settings for deinterlacing */
+-        img->progressive_frame = !this->av_frame->interlaced_frame;
+-        img->top_field_first   = this->av_frame->top_field_first;
++        img->progressive_frame = !XFF_FRAME_IS_INTERLACED (this->av_frame);
++        img->top_field_first   = !!XFF_FRAME_IS_TOP_FIELD_FIRST (this->av_frame);
+ 
+         this->skipframes = img->draw(img, this->stream);
+         this->state = STATE_FRAME_SENT;
+@@ -2894,8 +2907,8 @@
+     if (video_step_to_use <= 750)
+       video_step_to_use = 0;
+     img->duration = this->av_frame2->repeat_pict ? video_step_to_use * 3 / 2 : video_step_to_use;
+-    img->progressive_frame = !this->av_frame2->interlaced_frame;
+-    img->top_field_first   = this->av_frame2->top_field_first;
++    img->progressive_frame = !XFF_FRAME_IS_INTERLACED (this->av_frame2);
++    img->top_field_first   = !!XFF_FRAME_IS_TOP_FIELD_FIRST (this->av_frame2);
+ 
+     this->skipframes = img->draw (img, this->stream);
+     if (free_img)
+diff -r 9e326869fe0f -r 9bb3977ea7e2 src/combined/ffmpeg/ffmpeg_compat.h
+--- a/src/combined/ffmpeg/ffmpeg_compat.h	Sat May 31 15:55:00 2025 +0200
++++ b/src/combined/ffmpeg/ffmpeg_compat.h	Sat Sep 13 10:59:45 2025 +0200
+@@ -319,4 +319,20 @@
+ #  error avcodec.h must be included first !
+ #endif /* defined(LIBAVCODEC_VERSION_INT) */
+ 
++#if LIBAVUTIL_VERSION_INT >= XFF_INT_VERSION(58,7,0)
++#  define XFF_FRAME_IS_INTERLACED(_frame) ((_frame)->flags & AV_FRAME_FLAG_INTERLACED)
++#  define XFF_FRAME_IS_TOP_FIELD_FIRST(_frame) ((_frame)->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST)
++#  define XFF_FRAME_IS_KEY(_frame) ((_frame)->flags & AV_FRAME_FLAG_KEY)
++#else
++#  define XFF_FRAME_IS_INTERLACED(_frame) ((_frame)->interlaced_frame)
++#  define XFF_FRAME_IS_TOP_FIELD_FIRST(_frame) ((_frame)->top_field_first)
++#  define XFF_FRAME_IS_KEY(_frame) ((_frame)->key_frame)
++#endif
++
++#if LIBAVCODEC_VERSION_INT >= XFF_INT_VERSION(60,0,0)
++#  define XFF_FRAME_RATE 2 /* AV_CODEC_PROP_FIELDS */
++#else
++#  define XFF_FRAME_RATE 1 /* AVCodecContext.ticks_per_frame */
++#endif
++
+ #endif /* XINE_AVCODEC_COMPAT_H */
diff --git a/multimedia/libxine/files/ffmpeg8-2.patch b/multimedia/libxine/files/ffmpeg8-2.patch
new file mode 100644
index 000000000000..dffc575f70cd
--- /dev/null
+++ b/multimedia/libxine/files/ffmpeg8-2.patch
@@ -0,0 +1,20 @@
+# HG changeset patch
+# User Xavier Bachelot <xavier@bachelot.org>
+# Date 1758280185 -7200
+#      Fri Sep 19 13:09:45 2025 +0200
+# Node ID a8fffd1193b2247c7f732d4df83dcc03fce96dbe
+# Parent  9bb3977ea7e2b652742b3cdd200b0a4a72eb48bc
+Fix FFmpeg compatibilty update.
+
+diff -r 9bb3977ea7e2 -r a8fffd1193b2 src/combined/ffmpeg/ff_video_decoder.c
+--- a/src/combined/ffmpeg/ff_video_decoder.c	Sat Sep 13 10:59:45 2025 +0200
++++ b/src/combined/ffmpeg/ff_video_decoder.c	Fri Sep 19 13:09:45 2025 +0200
+@@ -61,7 +61,7 @@
+ #include "ffmpeg_compat.h"
+ 
+ #if XFF_FRAME_RATE == 2
+-#  include <avcodec/codec_desc.h>
++#  include <libavcodec/codec_desc.h>
+ #endif
+ 
+ #if LIBAVCODEC_VERSION_INT >= XFF_INT_VERSION(59,0,100)


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?691ff5b5.bda9.505f3893>