View | Details | Raw Unified | Return to bug 270291 | Differences between
and this patch

Collapse All | Expand All

(-)b/multimedia/libxine/Makefile (-6 / +6 lines)
Lines 1-10 Link Here
1
PORTNAME=	xine
1
PORTNAME=	xine
2
DISTVERSION=	1.2.12
2
DISTVERSION=	1.2.13
3
PORTREVISION=	5
4
CATEGORIES=	multimedia
3
CATEGORIES=	multimedia
5
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}-lib/${PORTVERSION}
4
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}-lib/${DISTVERSION}
6
PKGNAMEPREFIX=	lib
5
PKGNAMEPREFIX=	lib
7
DISTNAME=	${PORTNAME}-lib-${PORTVERSION}
6
DISTNAME=	${PORTNAME}-lib-${DISTVERSION}
8
7
9
MAINTAINER=	ports@FreeBSD.org
8
MAINTAINER=	ports@FreeBSD.org
10
COMMENT=	Libraries for xine multimedia player
9
COMMENT=	Libraries for xine multimedia player
Lines 50-56 USE_LDCONFIG= yes Link Here
50
CONFIGURE_ARGS=	--with-libflac \
49
CONFIGURE_ARGS=	--with-libflac \
51
		--enable-musepack \
50
		--enable-musepack \
52
		--enable-real-codecs \
51
		--enable-real-codecs \
53
		--without-esound
52
		--without-esound \
53
		--disable-crypto
54
54
55
MAKE_ENV=	V=1
55
MAKE_ENV=	V=1
56
MAKE_ARGS=	pkgdatadir="${DATADIR}" \
56
MAKE_ARGS=	pkgdatadir="${DATADIR}" \
Lines 62-68 CFLAGS_i386= -fomit-frame-pointer Link Here
62
DOCSDIR=	${PREFIX}/share/doc/xine-lib
62
DOCSDIR=	${PREFIX}/share/doc/xine-lib
63
# Please sync with XINE_PLUGINSDIR in multimedia/xine
63
# Please sync with XINE_PLUGINSDIR in multimedia/xine
64
# and multimedia/vdr-plugin-xineliboutput
64
# and multimedia/vdr-plugin-xineliboutput
65
PLUGINSDIR=	lib/xine/plugins/2.10
65
PLUGINSDIR=	lib/xine/plugins/2.11
66
PLIST_SUB=	PLUGINSDIR="${PLUGINSDIR}"
66
PLIST_SUB=	PLUGINSDIR="${PLUGINSDIR}"
67
67
68
OPTIONS_DEFINE=		AALIB ALSA AOM CACA DAV1D DOCS DMX_IMAGE DVB \
68
OPTIONS_DEFINE=		AALIB ALSA AOM CACA DAV1D DOCS DMX_IMAGE DVB \
(-)b/multimedia/libxine/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1646930905
1
TIMESTAMP = 1679084820
2
SHA256 (xine-lib-1.2.12.tar.xz) = d606270468e1540c2a89c0d7f5fdf11e17ecc0c2698cc0bcb1065ff26abee098
2
SHA256 (xine-lib-1.2.13.tar.xz) = 5f10d6d718a4a51c17ed1b32b031d4f9b80b061e8276535b2be31e5ac4b75e6f
3
SIZE (xine-lib-1.2.12.tar.xz) = 5341212
3
SIZE (xine-lib-1.2.13.tar.xz) = 5004196
(-)a/multimedia/libxine/files/patch-dav1d-1.0 (-47 lines)
Removed Link Here
1
https://sourceforge.net/p/xine/tickets/11/
2
3
dav1d.c:547:12: error: no member named 'n_frame_threads' in 'struct Dav1dSettings'
4
  settings.n_frame_threads = (ncpu > 8) ? 4 : (ncpu < 2) ? 1 : ncpu/2;
5
  ~~~~~~~~ ^
6
dav1d.c:548:12: error: no member named 'n_tile_threads' in 'struct Dav1dSettings'
7
  settings.n_tile_threads = MAX(1, ncpu - settings.n_frame_threads + 1);
8
  ~~~~~~~~ ^
9
dav1d.c:548:52: error: no member named 'n_frame_threads' in 'struct Dav1dSettings'
10
  settings.n_tile_threads = MAX(1, ncpu - settings.n_frame_threads + 1);
11
                                          ~~~~~~~~ ^
12
dav1d.c:548:52: error: no member named 'n_frame_threads' in 'struct Dav1dSettings'
13
  settings.n_tile_threads = MAX(1, ncpu - settings.n_frame_threads + 1);
14
                                          ~~~~~~~~ ^
15
/usr/include/sys/param.h:306:34: note: expanded from macro 'MAX'
16
#define MAX(a,b) (((a)>(b))?(a):(b))
17
                                 ^
18
dav1d.c:551:22: error: no member named 'n_frame_threads' in 'struct Dav1dSettings'
19
            settings.n_frame_threads, settings.n_tile_threads);
20
            ~~~~~~~~ ^
21
dav1d.c:551:48: error: no member named 'n_tile_threads' in 'struct Dav1dSettings'
22
            settings.n_frame_threads, settings.n_tile_threads);
23
                                      ~~~~~~~~ ^
24
../../include/xine/xineutils.h:687:40: note: expanded from macro 'xprintf'
25
        xine_log(xine, XINE_LOG_TRACE, __VA_ARGS__);                        \
26
                                       ^~~~~~~~~~~
27
28
--- src/video_dec/dav1d.c.orig	2022-03-06 16:31:24 UTC
29
+++ src/video_dec/dav1d.c
30
@@ -544,11 +544,17 @@ static video_decoder_t *_open_plugin(video_decoder_cla
31
 
32
   /* multithreading */
33
   ncpu = xine_cpu_count();
34
+#if DAV1D_API_VERSION_MAJOR > 5
35
+  settings.n_threads = ncpu + 1;
36
+  xprintf(stream->xine, XINE_VERBOSITY_DEBUG, LOG_MODULE ": "
37
+            "Using %d threads\n", settings.n_threads);
38
+#else
39
   settings.n_frame_threads = (ncpu > 8) ? 4 : (ncpu < 2) ? 1 : ncpu/2;
40
   settings.n_tile_threads = MAX(1, ncpu - settings.n_frame_threads + 1);
41
   xprintf(stream->xine, XINE_VERBOSITY_DEBUG, LOG_MODULE ": "
42
             "Using %d frame threads, %d tile threads\n",
43
             settings.n_frame_threads, settings.n_tile_threads);
44
+#endif
45
 
46
   /* dri frame allocator */
47
   settings.allocator.cookie = this;
(-)a/multimedia/libxine/files/patch-include-xine-xineutils.h (-22 lines)
Removed Link Here
1
Unbreak build of phonon-xine
2
3
In file included from xine/plugins.c:23:
4
In file included from /usr/local/include/xine/input_plugin.h:27:
5
/usr/local/include/xine/xineutils.h:197:8: error: unknown type name 'inline'
6
static inline void _x_freep(void *ptr) {
7
       ^
8
/usr/local/include/xine/xineutils.h:197:15: error: expected identifier or '('
9
static inline void _x_freep(void *ptr) {
10
              ^
11
12
--- include/xine/xineutils.h.orig
13
+++ include/xine/xineutils.h
14
@@ -146,7 +146,7 @@ void *xine_xcalloc(size_t nmemb, size_t 
15
  * Free allocated memory and set pointer to NULL
16
  * @param ptr Pointer to the pointer to the memory block which should be freed.
17
  */
18
-static inline void _x_freep(void *ptr) {
19
+static void _x_freep(void *ptr) {
20
   void **p = (void **)ptr;
21
   free (*p);
22
   *p = NULL;
(-)b/multimedia/libxine/files/patch-src_combined_ffmpeg_demux__avformat.c (+35 lines)
Added Link Here
1
--- src/combined/ffmpeg/demux_avformat.c.orig	2022-09-08 21:43:29 UTC
2
+++ src/combined/ffmpeg/demux_avformat.c
3
@@ -1,5 +1,5 @@
4
 /*
5
- * Copyright (C) 2013-2022 the xine project
6
+ * Copyright (C) 2013-2023 the xine project
7
  * Copyright (C) 2013-2020 Petri Hintukainen <phintuka@users.sourceforge.net>
8
  *
9
  * This file is part of xine, a free video player.
10
@@ -423,8 +423,13 @@ static int find_avformat_streams(avformat_demux_plugin
11
     }
12
 
13
 #ifdef XFF_CODECPAR
14
+#  if XFF_AUDIO_CHANNEL_LAYOUT < 2
15
     if (st->codecpar && st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
16
         st->codecpar->sample_rate != 0 && st->codecpar->channels != 0)
17
+#  else
18
+    if (st->codecpar && st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
19
+        st->codecpar->sample_rate != 0 && st->codecpar->ch_layout.nb_channels != 0)
20
+#  endif
21
 #else
22
     if (st->codec && st->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
23
         st->codec->sample_rate != 0 && st->codec->channels != 0)
24
@@ -501,7 +506,11 @@ static void send_headers_audio(avformat_demux_plugin_t
25
   buf->size = extradata_size + sizeof(xine_waveformatex);
26
   buf->decoder_info[1] = ctx->sample_rate;
27
   buf->decoder_info[2] = ctx->bits_per_coded_sample;
28
+#if XFF_AUDIO_CHANNEL_LAYOUT < 2
29
   buf->decoder_info[3] = ctx->channels;
30
+#else
31
+  buf->decoder_info[3] = ctx->ch_layout.nb_channels;
32
+#endif
33
   buf->decoder_flags = BUF_FLAG_HEADER | BUF_FLAG_STDHEADER | BUF_FLAG_FRAME_END;
34
 
35
   this->stream->audio_fifo->put (this->stream->audio_fifo, buf);
(-)b/multimedia/libxine/files/patch-src_combined_ffmpeg_ff__audio__decoder.c (+152 lines)
Added Link Here
1
--- src/combined/ffmpeg/ff_audio_decoder.c.orig	2022-09-08 21:43:29 UTC
2
+++ src/combined/ffmpeg/ff_audio_decoder.c
3
@@ -1,5 +1,5 @@
4
 /*
5
- * Copyright (C) 2001-2022 the xine project
6
+ * Copyright (C) 2001-2023 the xine project
7
  *
8
  * This file is part of xine, a free video player.
9
  *
10
@@ -303,7 +303,11 @@ static void ff_audio_init_codec(ff_audio_decoder_t *th
11
 
12
   this->context->bits_per_sample = this->ff_bits;
13
   this->context->sample_rate = this->ff_sample_rate;
14
+#if XFF_AUDIO_CHANNEL_LAYOUT < 2
15
   this->context->channels    = this->ff_channels;
16
+#else
17
+  this->context->ch_layout.nb_channels = this->ff_channels;
18
+#endif
19
   this->context->codec_id    = this->codec->id;
20
   this->context->codec_type  = this->codec->type;
21
   this->context->codec_tag   = _x_stream_info_get(this->stream, XINE_STREAM_INFO_AUDIO_FOURCC);
22
@@ -527,17 +531,76 @@ static void ff_audio_output_close(ff_audio_decoder_t *
23
   this->ao_mode = 0;
24
 }
25
 
26
+static unsigned int ff_list_channels (uint8_t *list, uint64_t map) {
27
+  unsigned int n, bit;
28
+
29
+  for (n = bit = 0; map; map >>= 1, bit++) {
30
+    uint32_t b = map & 1;
31
+
32
+    list[n] = bit;
33
+    n += b;
34
+  }
35
+  return n;
36
+}
37
+
38
 static void ff_map_channels (ff_audio_decoder_t *this) {
39
   uint64_t ff_map;
40
+  uint8_t ff_list[64];
41
+  unsigned int ff_num;
42
+  const char *type = "native";
43
   int caps = this->stream->audio_out->get_capabilities (this->stream->audio_out);
44
 
45
+#if XFF_AUDIO_CHANNEL_LAYOUT < 2
46
+
47
   /* safety kludge for very old libavcodec */
48
-#ifdef AV_CH_FRONT_LEFT
49
+#  ifdef AV_CH_FRONT_LEFT
50
   ff_map = this->context->channel_layout;
51
   if (!ff_map) /* wma2 bug */
52
-#endif
53
+#  endif
54
     ff_map = ((uint64_t)1 << this->context->channels) - 1;
55
+  ff_num = ff_list_channels (ff_list, ff_map);
56
 
57
+#else /* XFF_AUDIO_CHANNEL_LAYOUT == 2 */
58
+
59
+  ff_num = this->context->ch_layout.nb_channels;
60
+  if (ff_num > (int)(sizeof (ff_list) / sizeof (ff_list[0])))
61
+    ff_num = sizeof (ff_list) / sizeof (ff_list[0]);
62
+  switch (this->context->ch_layout.order) {
63
+    const AVChannelCustom *cmap;
64
+    unsigned int i;
65
+
66
+    case AV_CHANNEL_ORDER_UNSPEC:
67
+      type = "unknown";
68
+      goto _fallback;
69
+
70
+    case AV_CHANNEL_ORDER_NATIVE:
71
+      ff_map = this->context->ch_layout.u.mask;
72
+      if (!ff_map) /* wma2 bug */
73
+        ff_map = ((uint64_t)1 << ff_num) - 1;
74
+      ff_num = ff_list_channels (ff_list, ff_map);
75
+      break;
76
+
77
+    case AV_CHANNEL_ORDER_CUSTOM:
78
+      type = "custom";
79
+      if (!(cmap = this->context->ch_layout.u.map))
80
+        goto _fallback;
81
+      ff_map = 0;
82
+      for (i = 0; i < ff_num; i++) {
83
+        ff_list[i] = cmap[i].id;
84
+        ff_map |= (uint64_t)1 << ff_list[i];
85
+      }
86
+      break;
87
+
88
+    default:
89
+      type = "unsupported";
90
+      /* fall through */
91
+    _fallback:
92
+      ff_map = ((uint64_t)1 << ff_num) - 1;
93
+      ff_num = ff_list_channels (ff_list, ff_map);
94
+  }
95
+
96
+#endif
97
+
98
   if ((caps != this->ao_caps) || (ff_map != this->ff_map)) {
99
     unsigned int i, j;
100
     /* ff: see names[] below; xine: L R RL RR C LFE */
101
@@ -562,7 +625,7 @@ static void ff_map_channels (ff_audio_decoder_t *this)
102
 
103
     this->ao_caps     = caps;
104
     this->ff_map      = ff_map;
105
-    this->ff_channels = this->context->channels;
106
+    this->ff_channels = ff_num;
107
 
108
     /* silence out */
109
     for (i = 0; i < MAX_CHANNELS; i++)
110
@@ -576,20 +639,23 @@ static void ff_map_channels (ff_audio_decoder_t *this)
111
       this->left[0] = this->right[0] = 0;
112
       tries = wishlist + 0 * num_modes;
113
     } else if (this->ff_channels == 2) { /* stereo */
114
+      /* FIXME: libxine does not yet support audio selection _after_ decoding.
115
+       * For now, treat the most common "dual mono" case as stereo. */
116
       name_map[0] = 0;
117
       name_map[1] = 1;
118
       this->left[0] = 0;
119
       this->right[0] = 1;
120
       tries = wishlist + 1 * num_modes;
121
     } else {
122
-      for (i = j = 0; i < sizeof (base_map) / sizeof (base_map[0]); i++) {
123
-        if ((ff_map >> i) & 1) {
124
-          int8_t target = base_map[i];
125
-          if ((target >= 0) && (this->map[target] < 0))
126
-            this->map[target] = j;
127
-          name_map[j] = i; /* for debug output below */
128
-          j++;
129
-        }
130
+      for (i = 0; i < ff_num; i++) {
131
+        int8_t target;
132
+        uint32_t num = ff_list[i];
133
+        if (num >= sizeof (base_map) / sizeof (base_map[0]))
134
+          continue;
135
+        target = base_map[num];
136
+        if ((target >= 0) && (this->map[target] < 0))
137
+          this->map[target] = i;
138
+        name_map[i] = num; /* for debug output below */
139
       }
140
       this->left[0]  = this->map[0] < 0 ? 0 : this->map[0];
141
       this->map[0]   = -1;
142
@@ -641,8 +707,8 @@ static void ff_map_channels (ff_audio_decoder_t *this)
143
         "rear center",
144
         "side left", "side right"
145
       };
146
-      int8_t buf[200];
147
-      int p = sprintf (buf, "ff_audio_dec: channel layout: ");
148
+      int8_t buf[256];
149
+      int p = sprintf (buf, "ff_audio_dec: %s channel layout: ", type);
150
       int8_t *indx = this->left;
151
       for (i = 0; i < 2; i++) {
152
         buf[p++] = '[';
(-)b/multimedia/libxine/pkg-plist (-1 / +1 lines)
Lines 49-55 lib/libxine.la Link Here
49
lib/libxine-interface.la
49
lib/libxine-interface.la
50
lib/libxine.so
50
lib/libxine.so
51
lib/libxine.so.2
51
lib/libxine.so.2
52
lib/libxine.so.2.10.0
52
lib/libxine.so.2.11.0
53
%%PLUGINSDIR%%/mime.types
53
%%PLUGINSDIR%%/mime.types
54
%%PLUGINSDIR%%/post/xineplug_post_audio_filters.so
54
%%PLUGINSDIR%%/post/xineplug_post_audio_filters.so
55
%%PLUGINSDIR%%/post/xineplug_post_goom.so
55
%%PLUGINSDIR%%/post/xineplug_post_goom.so

Return to bug 270291