Download raw body.
retire some python 2 ports
> ah, so xmms2 wasn't on the list - the new devel branch has py3 support.
> here's a start at it, but I don't understand waf enough to figure out
> how to tell it to link with -lm for frexpf/ldexpf.
oh, duh...
It builds with this, and is at least able to play tracks, I don't know
my way around it at all.
Index: Makefile
===================================================================
RCS file: /cvs/ports/audio/xmms2/Makefile,v
retrieving revision 1.63
diff -u -p -r1.63 Makefile
--- Makefile 21 Feb 2024 19:23:43 -0000 1.63
+++ Makefile 21 Feb 2024 20:02:32 -0000
@@ -1,9 +1,8 @@
COMMENT = audio player daemon with library management
-V = 0.8
-DISTNAME = xmms2-${V}DrO_o
-PKGNAME = xmms2-${V}
-REVISION = 18
+V = 0.9.3
+DISTNAME = xmms2-${V}
+EXTRACT_SUFX = .tar.xz
SHARED_LIBS += xmmsclient++ 2.0 # 4.0.0
SHARED_LIBS += xmmsclient++-glib 1.0 # 1.0.0
@@ -20,25 +19,23 @@ PERMIT_PACKAGE = Yes
WANTLIB += ${COMPILER_LIBCXX} FLAC ao avahi-client avahi-common
WANTLIB += avahi-glib avcodec avutil c curl ffi gio-2.0 glib-2.0
-WANTLIB += gmodule-2.0 gobject-2.0 gthread-2.0 intl jack m mpg123
-WANTLIB += ogg opus pcre2-8 perl python2.7 readline sndfile sqlite3
-WANTLIB += swresample vorbis vorbisenc vorbisfile xml2 z
+WANTLIB += gmodule-2.0 gobject-2.0 intl jack m mpg123 ogg opus
+WANTLIB += opusfile pcre2-8 perl readline sndfile sqlite3
+WANTLIB += swresample util vorbis vorbisenc vorbisfile xml2 z
-SITES = ${SITE_SOURCEFORGE:=xmms2/}
+SITES = https://github.com/xmms2/xmms2-devel/releases/download/$V/
MODPERL_REGEN_PPPORT = src/clients/lib/perl/ppport.h
-EXTRACT_SUFX = .tar.bz2
-
-COMPILER = base-clang ports-gcc base-gcc
+COMPILER = base-clang ports-gcc
MODULES = lang/python \
perl
-MODPY_VERSION = ${MODPY_DEFAULT_VERSION_2}
NO_TEST = Yes
BUILD_DEPENDS = devel/boost \
+ lang/cython${MODPY_FLAVOR} \
textproc/p5-Pod-Parser
LIB_DEPENDS = devel/glib2 \
@@ -46,6 +43,7 @@ LIB_DEPENDS = devel/glib2 \
graphics/ffmpeg \
audio/libao \
audio/jack \
+ audio/opusfile \
textproc/libxml \
net/curl \
audio/mpg123 \
@@ -69,10 +67,9 @@ do-configure:
--mandir=${PREFIX}/man \
--conf-prefix=${PREFIX} \
--with-default-output-plugin=ao \
- --no-cython \
--disable-shmvis-server \
--without-optionals=medialib-updater,tests,xmmsclient-cf,xmmsclient-ecore,ruby \
- --without-plugins=airplay,alsa,cdda,coreaudio,faad,gme,ices,mac,mad,mms,modplug,musepack,nms,ofa,oss,pulse,samba,sid,speex,sun,tremor,vocoder,waveout,wavpack
+ --without-plugins=airplay,alsa,asf,cdda,coreaudio,faad,fluidsynth,gme,ices,mac,mad,mid1,midsquash,mms,modplug,musepack,nms,ofa,oss,pulse,samba,sid,speex,sun,tremor,vocoder,waveout,wavpack
post-configure:
# avoid linking to bogus libraries
Index: distinfo
===================================================================
RCS file: /cvs/ports/audio/xmms2/distinfo,v
retrieving revision 1.4
diff -u -p -r1.4 distinfo
--- distinfo 18 Jan 2015 03:12:51 -0000 1.4
+++ distinfo 21 Feb 2024 20:02:32 -0000
@@ -1,2 +1,2 @@
-SHA256 (xmms2-0.8DrO_o.tar.bz2) = x35B571XiIidWi94Mxyox0i4chvS5Z82w2rUx8roaUo=
-SIZE (xmms2-0.8DrO_o.tar.bz2) = 1670726
+SHA256 (xmms2-0.9.3.tar.xz) = /iR5jbLmzY2OsTHumADSEVJf/r5WHBxcBXcQzXuQqBs=
+SIZE (xmms2-0.9.3.tar.xz) = 1741548
Index: patches/patch-src_clients_lib_xmmsclient-glib_wscript
===================================================================
RCS file: /cvs/ports/audio/xmms2/patches/patch-src_clients_lib_xmmsclient-glib_wscript,v
retrieving revision 1.4
diff -u -p -r1.4 patch-src_clients_lib_xmmsclient-glib_wscript
--- patches/patch-src_clients_lib_xmmsclient-glib_wscript 11 Mar 2022 18:20:36 -0000 1.4
+++ patches/patch-src_clients_lib_xmmsclient-glib_wscript 21 Feb 2024 20:02:32 -0000
@@ -1,11 +1,12 @@
---- src/clients/lib/xmmsclient-glib/wscript.orig Thu Oct 20 21:26:08 2011
-+++ src/clients/lib/xmmsclient-glib/wscript Tue May 8 01:11:50 2012
+Index: src/clients/lib/xmmsclient-glib/wscript
+--- src/clients/lib/xmmsclient-glib/wscript.orig
++++ src/clients/lib/xmmsclient-glib/wscript
@@ -7,7 +7,7 @@ def build(bld):
source = 'xmmsclient-glib.c',
uselib = 'glib2',
- use = 'xmmsclient',
-- vnum = '1.0.0'
-+ vnum = '${LIBxmmsclient-glib_VERSION}'
+ use = 'xmmsclient xmmsc-glib',
+- vnum = '1.0.0',
++ vnum = '${LIBxmmsclient-glib_VERSION}',
+ defines = 'G_LOG_DOMAIN="xmmsclient-glib"'
)
- tool.add_install_flag(bld, obj)
Index: patches/patch-src_clients_lib_xmmsclient_wscript
===================================================================
RCS file: /cvs/ports/audio/xmms2/patches/patch-src_clients_lib_xmmsclient_wscript,v
retrieving revision 1.4
diff -u -p -r1.4 patch-src_clients_lib_xmmsclient_wscript
--- patches/patch-src_clients_lib_xmmsclient_wscript 11 Mar 2022 18:20:36 -0000 1.4
+++ patches/patch-src_clients_lib_xmmsclient_wscript 21 Feb 2024 20:02:32 -0000
@@ -1,11 +1,12 @@
---- src/clients/lib/xmmsclient/wscript.orig Thu Oct 20 21:26:08 2011
-+++ src/clients/lib/xmmsclient/wscript Tue May 8 01:12:42 2012
-@@ -31,7 +31,7 @@ def build(bld):
+Index: src/clients/lib/xmmsclient/wscript
+--- src/clients/lib/xmmsclient/wscript.orig
++++ src/clients/lib/xmmsclient/wscript
+@@ -36,7 +36,7 @@ def build(bld):
source = source,
uselib = 'socket time',
use = 'xmmsipc xmmssocket xmmsutils xmmstypes xmmsvisualization',
-- vnum = '6.0.0'
-+ vnum = '${LIBxmmsclient_VERSION}'
- )
-
- tool.add_install_flag(bld, obj)
+- vnum = '6.0.0',
++ vnum = '${LIBxmmsclient_VERSION}',
+ defines = [
+ 'XMMSC_LOG_DOMAIN="xmmsclient"',
+ "HAVE_SEMTIMEDOP=%d" % int(bld.env.have_semtimedop),
Index: patches/patch-src_include_xmmsclient_xmmsclient++_coll_h
===================================================================
RCS file: patches/patch-src_include_xmmsclient_xmmsclient++_coll_h
diff -N patches/patch-src_include_xmmsclient_xmmsclient++_coll_h
--- patches/patch-src_include_xmmsclient_xmmsclient++_coll_h 11 Mar 2022 18:20:36 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-work-around. maybe coll_ should be const ref ?
-
-Index: src/include/xmmsclient/xmmsclient++/coll.h
---- src/include/xmmsclient/xmmsclient++/coll.h.orig
-+++ src/include/xmmsclient/xmmsclient++/coll.h
-@@ -612,7 +612,7 @@ namespace Xmms
-
- template< typename keyT, typename valT >
- AbstractElement< keyT, valT >::AbstractElement( const Coll& coll, keyT index )
-- : coll_ (coll), index_( index )
-+ : coll_ (const_cast<Coll&>(coll)), index_( index )
- {
- xmmsv_coll_ref( coll_.getColl() );
- }
Index: patches/patch-src_plugins_avcodec_avcodec_c
===================================================================
RCS file: patches/patch-src_plugins_avcodec_avcodec_c
diff -N patches/patch-src_plugins_avcodec_avcodec_c
--- patches/patch-src_plugins_avcodec_avcodec_c 11 Mar 2022 18:20:36 -0000 1.5
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,508 +0,0 @@
-Deal with newer FFmpeg API.
-
---- src/plugins/avcodec/avcodec.c.orig Thu Mar 27 01:42:57 2014
-+++ src/plugins/avcodec/avcodec.c Thu Mar 27 01:52:27 2014
-@@ -23,6 +23,7 @@
- #include <stdlib.h>
- #include <string.h>
- #include <glib.h>
-+#include <libavutil/mem.h>
-
- #include "avcodec_compat.h"
-
-@@ -36,6 +37,8 @@ typedef struct {
- guint buffer_size;
- gboolean no_demuxer;
-
-+ AVFrame *read_out_frame;
-+
- guint channels;
- guint samplerate;
- xmms_sample_format_t sampleformat;
-@@ -53,10 +56,14 @@ typedef struct {
- static gboolean xmms_avcodec_plugin_setup (xmms_xform_plugin_t *xform_plugin);
- static gboolean xmms_avcodec_init (xmms_xform_t *xform);
- static void xmms_avcodec_destroy (xmms_xform_t *xform);
-+static gint xmms_avcodec_internal_read_some (xmms_xform_t *xform, xmms_avcodec_data_t *data, xmms_error_t *error);
-+static gint xmms_avcodec_internal_decode_some (xmms_avcodec_data_t *data);
-+static void xmms_avcodec_internal_append (xmms_avcodec_data_t *data);
- static gint xmms_avcodec_read (xmms_xform_t *xform, xmms_sample_t *buf, gint len,
- xmms_error_t *error);
- static gint64 xmms_avcodec_seek (xmms_xform_t *xform, gint64 samples,
- xmms_xform_seek_mode_t whence, xmms_error_t *err);
-+static xmms_sample_format_t xmms_avcodec_translate_sample_format (enum AVSampleFormat av_sample_format);
-
- /*
- * Plugin header
-@@ -85,13 +92,23 @@ xmms_avcodec_plugin_setup (xmms_xform_plugin_t *xform_
- xmms_magic_add ("A/52 (AC-3) header", "audio/x-ffmpeg-ac3",
- "0 beshort 0x0b77", NULL);
- xmms_magic_add ("DTS header", "audio/x-ffmpeg-dca",
-- "0 belong 0x7ffe8001", NULL);
-+ "0 belong 0x7ffe8001", NULL);
-
- xmms_xform_plugin_indata_add (xform_plugin,
- XMMS_STREAM_TYPE_MIMETYPE,
- "audio/x-ffmpeg-*",
- NULL);
-
-+ XMMS_DBG ("avcodec version at build time is %d.%d.%d",
-+ (LIBAVCODEC_VERSION_INT >> 16),
-+ (LIBAVCODEC_VERSION_INT >> 8) & 0xff,
-+ LIBAVCODEC_VERSION_INT & 0xff);
-+ XMMS_DBG ("avcodec version at run time is %d.%d.%d",
-+ (avcodec_version() >> 16),
-+ (avcodec_version() >> 8) & 0xff,
-+ avcodec_version() & 0xff);
-+ XMMS_DBG ("avcodec configuration is %s", avcodec_configuration());
-+
- return TRUE;
- }
-
-@@ -107,6 +124,7 @@ xmms_avcodec_destroy (xmms_xform_t *xform)
-
- avcodec_close (data->codecctx);
- av_free (data->codecctx);
-+ av_frame_free (&data->read_out_frame);
-
- g_string_free (data->outbuf, TRUE);
- g_free (data->buffer);
-@@ -132,9 +150,10 @@ xmms_avcodec_init (xmms_xform_t *xform)
- data->buffer_size = AVCODEC_BUFFER_SIZE;
- data->codecctx = NULL;
-
-+ data->read_out_frame = av_frame_alloc ();
-+
- xmms_xform_private_data_set (xform, data);
-
-- avcodec_init ();
- avcodec_register_all ();
-
- mimetype = xmms_xform_indata_get_str (xform,
-@@ -161,12 +180,12 @@ xmms_avcodec_init (xmms_xform_t *xform)
- data->channels = ret;
- }
-
-- /* bitrate required for WMA files */
-+ /* Required by WMA xform. */
- xmms_xform_auxdata_get_int (xform,
- "bitrate",
- &data->bitrate);
-
-- /* ALAC and MAC require bits per sample field to be 16 */
-+ /* Required by tta and apefile xforms. */
- xmms_xform_auxdata_get_int (xform,
- "samplebits",
- &data->samplebits);
-@@ -188,7 +207,8 @@ xmms_avcodec_init (xmms_xform_t *xform)
- !strcmp (data->codec_id, "adpcm_swf") ||
- !strcmp (data->codec_id, "pcm_s16le") ||
- !strcmp (data->codec_id, "ac3") ||
-- !strcmp (data->codec_id, "dca")) {
-+ !strcmp (data->codec_id, "dca") ||
-+ !strcmp (data->codec_id, "nellymoser")) {
- /* number 1024 taken from libavformat raw.c RAW_PACKET_SIZE */
- data->extradata = g_malloc0 (1024);
- data->extradata_size = 1024;
-@@ -196,22 +216,22 @@ xmms_avcodec_init (xmms_xform_t *xform)
- } else {
- /* A demuxer plugin forgot to give decoder config? */
- xmms_log_error ("Decoder config data not found!");
-- return FALSE;
-+ goto err;
- }
- }
-
-- data->codecctx = avcodec_alloc_context ();
-+ data->codecctx = avcodec_alloc_context3 (codec);
- data->codecctx->sample_rate = data->samplerate;
- data->codecctx->channels = data->channels;
- data->codecctx->bit_rate = data->bitrate;
-- CONTEXT_BPS (data->codecctx) = data->samplebits;
-+ data->codecctx->bits_per_coded_sample = data->samplebits;
- data->codecctx->block_align = data->block_align;
- data->codecctx->extradata = data->extradata;
- data->codecctx->extradata_size = data->extradata_size;
- data->codecctx->codec_id = codec->id;
- data->codecctx->codec_type = codec->type;
-
-- if (avcodec_open (data->codecctx, codec) < 0) {
-+ if (avcodec_open2 (data->codecctx, codec, NULL) < 0) {
- XMMS_DBG ("Opening decoder '%s' failed", codec->name);
- goto err;
- } else {
-@@ -220,7 +240,7 @@ xmms_avcodec_init (xmms_xform_t *xform)
-
- /* some codecs need to have something read before they set
- * the samplerate and channels correctly, unfortunately... */
-- if ((ret = xmms_avcodec_read (xform, buf, 42, &error)) > 0) {
-+ if ((ret = xmms_avcodec_read (xform, buf, sizeof (buf), &error)) > 0) {
- g_string_insert_len (data->outbuf, 0, buf, ret);
- } else {
- XMMS_DBG ("First read failed, codec is not working...");
-@@ -231,19 +251,27 @@ xmms_avcodec_init (xmms_xform_t *xform)
-
- data->samplerate = data->codecctx->sample_rate;
- data->channels = data->codecctx->channels;
-+ data->sampleformat = xmms_avcodec_translate_sample_format (data->codecctx->sample_fmt);
-+ if (data->sampleformat == XMMS_SAMPLE_FORMAT_UNKNOWN) {
-+ avcodec_close (data->codecctx);
-+ goto err;
-+ }
-
- xmms_xform_outdata_type_add (xform,
- XMMS_STREAM_TYPE_MIMETYPE,
- "audio/pcm",
- XMMS_STREAM_TYPE_FMT_FORMAT,
-- XMMS_SAMPLE_FORMAT_S16,
-+ data->sampleformat,
- XMMS_STREAM_TYPE_FMT_CHANNELS,
- data->channels,
- XMMS_STREAM_TYPE_FMT_SAMPLERATE,
- data->samplerate,
- XMMS_STREAM_TYPE_END);
-
-- XMMS_DBG ("Decoder '%s' initialized successfully!", codec->name);
-+ XMMS_DBG ("Decoder %s at rate %d with %d channels of format %s initialized",
-+ codec->name, data->codecctx->sample_rate,
-+ data->codecctx->channels,
-+ av_get_sample_fmt_name (data->codecctx->sample_fmt));
-
- return TRUE;
-
-@@ -251,6 +279,9 @@ err:
- if (data->codecctx) {
- av_free (data->codecctx);
- }
-+ if (data->read_out_frame) {
-+ avcodec_free_frame (&data->read_out_frame);
-+ }
- g_string_free (data->outbuf, TRUE);
- g_free (data->extradata);
- g_free (data);
-@@ -263,102 +294,24 @@ xmms_avcodec_read (xmms_xform_t *xform, xmms_sample_t
- xmms_error_t *error)
- {
- xmms_avcodec_data_t *data;
-- char outbuf[AVCODEC_MAX_AUDIO_FRAME_SIZE];
-- gint outbufsize, bytes_read = 0;
- guint size;
-
- data = xmms_xform_private_data_get (xform);
- g_return_val_if_fail (data, -1);
-
-- size = MIN (data->outbuf->len, len);
-- while (size == 0) {
-- AVPacket packet;
-- av_init_packet (&packet);
-+ while (0 == (size = MIN (data->outbuf->len, len))) {
-+ gint res;
-
- if (data->no_demuxer || data->buffer_length == 0) {
-- gint read_total;
-+ gint bytes_read;
-
-- bytes_read = xmms_xform_read (xform,
-- (gchar *) (data->buffer + data->buffer_length),
-- data->buffer_size - data->buffer_length,
-- error);
--
-- if (bytes_read < 0) {
-- XMMS_DBG ("Error while reading data");
-- return bytes_read;
-- } else if (bytes_read == 0) {
-- XMMS_DBG ("EOF");
-- return 0;
-- }
--
-- read_total = bytes_read;
--
-- /* If we have a demuxer plugin, make sure we read the whole packet */
-- while (read_total == data->buffer_size && !data->no_demuxer) {
-- /* multiply the buffer size and try to read again */
-- data->buffer = g_realloc (data->buffer, data->buffer_size * 2);
-- bytes_read = xmms_xform_read (xform,
-- (gchar *) data->buffer +
-- data->buffer_size,
-- data->buffer_size,
-- error);
-- data->buffer_size *= 2;
--
-- if (bytes_read < 0) {
-- XMMS_DBG ("Error while reading data");
-- return bytes_read;
-- }
--
-- read_total += bytes_read;
--
-- if (read_total < data->buffer_size) {
-- /* finally double the buffer size for performance reasons, the
-- * hotspot handling likes to fit two frames in the buffer */
-- data->buffer = g_realloc (data->buffer, data->buffer_size * 2);
-- data->buffer_size *= 2;
-- XMMS_DBG ("Reallocated avcodec internal buffer to be %d bytes",
-- data->buffer_size);
--
-- break;
-- }
-- }
--
-- /* Update the buffer length */
-- data->buffer_length += read_total;
-+ bytes_read = xmms_avcodec_internal_read_some (xform, data, error);
-+ if (bytes_read <= 0) { return bytes_read; }
- }
-
-- packet.data = data->buffer;
-- packet.size = data->buffer_length;
--
-- outbufsize = sizeof (outbuf);
-- bytes_read = avcodec_decode_audio3 (data->codecctx, (short *) outbuf,
-- &outbufsize, &packet);
--
-- /* The DTS decoder of ffmpeg is buggy and always returns
-- * the input buffer length, get frame length from header */
-- if (!strcmp (data->codec_id, "dca") && bytes_read > 0) {
-- bytes_read = ((int)data->buffer[5] << 12) |
-- ((int)data->buffer[6] << 4) |
-- ((int)data->buffer[7] >> 4);
-- bytes_read = (bytes_read & 0x3fff) + 1;
-- }
--
-- if (bytes_read < 0 || bytes_read > data->buffer_length) {
-- XMMS_DBG ("Error decoding data!");
-- return -1;
-- } else if (bytes_read != data->buffer_length) {
-- g_memmove (data->buffer,
-- data->buffer + bytes_read,
-- data->buffer_length - bytes_read);
-- }
--
-- data->buffer_length -= bytes_read;
--
-- if (outbufsize > 0) {
-- g_string_append_len (data->outbuf, outbuf, outbufsize);
-- }
--
-- size = MIN (data->outbuf->len, len);
-+ res = xmms_avcodec_internal_decode_some (data);
-+ if (res < 0) { return res; }
-+ if (res > 0) { xmms_avcodec_internal_append (data); }
- }
-
- memcpy (buf, data->outbuf->str, size);
-@@ -371,8 +324,6 @@ static gint64
- xmms_avcodec_seek (xmms_xform_t *xform, gint64 samples, xmms_xform_seek_mode_t whence, xmms_error_t *err)
- {
- xmms_avcodec_data_t *data;
-- char outbuf[AVCODEC_MAX_AUDIO_FRAME_SIZE];
-- gint outbufsize, bytes_read = 0;
- gint64 ret = -1;
-
- g_return_val_if_fail (xform, -1);
-@@ -390,23 +341,11 @@ xmms_avcodec_seek (xmms_xform_t *xform, gint64 samples
-
- /* The buggy ape decoder doesn't flush buffers, so we need to finish decoding
- * the frame before seeking to avoid segfaults... this hack sucks */
-+ /* FIXME: Is ^^^ still true? */
- while (data->buffer_length > 0) {
-- AVPacket packet;
-- av_init_packet (&packet);
-- packet.data = data->buffer;
-- packet.size = data->buffer_length;
--
-- outbufsize = sizeof (outbuf);
-- bytes_read = avcodec_decode_audio3 (data->codecctx, (short *) outbuf,
-- &outbufsize, &packet);
--
-- if (bytes_read < 0 || bytes_read > data->buffer_length) {
-- XMMS_DBG ("Error decoding data!");
-+ if (xmms_avcodec_internal_decode_some (data) < 0) {
- return -1;
- }
--
-- data->buffer_length -= bytes_read;
-- g_memmove (data->buffer, data->buffer + bytes_read, data->buffer_length);
- }
-
- ret = xmms_xform_seek (xform, samples, whence, err);
-@@ -419,4 +358,179 @@ xmms_avcodec_seek (xmms_xform_t *xform, gint64 samples
- }
-
- return ret;
-+}
-+
-+static xmms_sample_format_t
-+xmms_avcodec_translate_sample_format (enum AVSampleFormat av_sample_format)
-+{
-+ switch (av_sample_format) {
-+ case AV_SAMPLE_FMT_U8:
-+ case AV_SAMPLE_FMT_U8P:
-+ return XMMS_SAMPLE_FORMAT_U8;
-+ case AV_SAMPLE_FMT_S16:
-+ case AV_SAMPLE_FMT_S16P:
-+ return XMMS_SAMPLE_FORMAT_S16;
-+ case AV_SAMPLE_FMT_S32:
-+ case AV_SAMPLE_FMT_S32P:
-+ return XMMS_SAMPLE_FORMAT_S32;
-+ case AV_SAMPLE_FMT_FLT:
-+ case AV_SAMPLE_FMT_FLTP:
-+ return XMMS_SAMPLE_FORMAT_FLOAT;
-+ case AV_SAMPLE_FMT_DBL:
-+ case AV_SAMPLE_FMT_DBLP:
-+ return XMMS_SAMPLE_FORMAT_DOUBLE;
-+ default:
-+ XMMS_DBG ("AVSampleFormat (%i: %s) not supported.", av_sample_format,
-+ av_get_sample_fmt_name (av_sample_format));
-+ return XMMS_SAMPLE_FORMAT_UNKNOWN;
-+ }
-+}
-+
-+/*
-+Read some data from our source of data to data->buffer, updating buffer_length
-+and buffer_size as needed.
-+
-+Returns: on error: negative
-+ on EOF: zero
-+ otherwise: number of bytes read.
-+*/
-+static gint
-+xmms_avcodec_internal_read_some (xmms_xform_t *xform,
-+ xmms_avcodec_data_t *data,
-+ xmms_error_t *error)
-+{
-+ gint bytes_read, read_total;
-+
-+ bytes_read = xmms_xform_read (xform,
-+ (gchar *) (data->buffer + data->buffer_length),
-+ data->buffer_size - data->buffer_length,
-+ error);
-+
-+ if (bytes_read < 0) {
-+ XMMS_DBG ("Error while reading data");
-+ return bytes_read;
-+ } else if (bytes_read == 0) {
-+ XMMS_DBG ("EOF");
-+ return 0;
-+ }
-+
-+ read_total = bytes_read;
-+
-+ /* If we have a demuxer plugin, make sure we read the whole packet */
-+ while (read_total == data->buffer_size && !data->no_demuxer) {
-+ /* multiply the buffer size and try to read again */
-+ data->buffer = g_realloc (data->buffer, data->buffer_size * 2);
-+ bytes_read = xmms_xform_read (xform,
-+ (gchar *) data->buffer +
-+ data->buffer_size,
-+ data->buffer_size,
-+ error);
-+ data->buffer_size *= 2;
-+
-+ if (bytes_read < 0) {
-+ XMMS_DBG ("Error while reading data");
-+ return bytes_read;
-+ }
-+
-+ read_total += bytes_read;
-+
-+ if (read_total < data->buffer_size) {
-+ /* finally double the buffer size for performance reasons, the
-+ * hotspot handling likes to fit two frames in the buffer */
-+ data->buffer = g_realloc (data->buffer, data->buffer_size * 2);
-+ data->buffer_size *= 2;
-+ XMMS_DBG ("Reallocated avcodec internal buffer to be %d bytes",
-+ data->buffer_size);
-+
-+ break;
-+ }
-+ }
-+
-+ /* Update the buffer length */
-+ data->buffer_length += read_total;
-+
-+ return read_total;
-+}
-+
-+/*
-+Decode some data from data->buffer[0..data->buffer_length-1] to
-+data->read_out_frame
-+
-+Returns: on error: negative
-+ on no new data produced: zero
-+ otherwise: positive
-+
-+FIXME: data->buffer should be at least data->buffer_length +
-+FF_INPUT_BUFFER_PADDING_SIZE long.
-+*/
-+static gint
-+xmms_avcodec_internal_decode_some (xmms_avcodec_data_t *data)
-+{
-+ int got_frame = 0;
-+ gint bytes_read = 0;
-+ AVPacket packet;
-+
-+ av_init_packet (&packet);
-+ packet.data = data->buffer;
-+ packet.size = data->buffer_length;
-+
-+ /* clear buffers and reset fields to defaults */
-+ av_frame_unref (data->read_out_frame);
-+
-+ bytes_read = avcodec_decode_audio4 (
-+ data->codecctx, data->read_out_frame, &got_frame, &packet);
-+
-+ /* The DTS decoder of ffmpeg is buggy and always returns
-+ * the input buffer length, get frame length from header */
-+ /* FIXME: Is ^^^^ still true? */
-+ if (!strcmp (data->codec_id, "dca") && bytes_read > 0) {
-+ bytes_read = ((int)data->buffer[5] << 12) |
-+ ((int)data->buffer[6] << 4) |
-+ ((int)data->buffer[7] >> 4);
-+ bytes_read = (bytes_read & 0x3fff) + 1;
-+ }
-+
-+ if (bytes_read < 0 || bytes_read > data->buffer_length) {
-+ XMMS_DBG ("Error decoding data!");
-+ return -1;
-+ }
-+
-+ if (bytes_read < data->buffer_length) {
-+ data->buffer_length -= bytes_read;
-+ g_memmove (data->buffer,
-+ data->buffer + bytes_read,
-+ data->buffer_length);
-+ } else {
-+ data->buffer_length = 0;
-+ }
-+
-+ return got_frame ? 1 : 0;
-+}
-+
-+static void
-+xmms_avcodec_internal_append (xmms_avcodec_data_t *data)
-+{
-+ enum AVSampleFormat fmt = (enum AVSampleFormat) data->read_out_frame->format;
-+ int samples = data->read_out_frame->nb_samples;
-+ int channels = data->codecctx->channels;
-+ int bps = av_get_bytes_per_sample (fmt);
-+
-+ if (av_sample_fmt_is_planar (fmt)) {
-+ /* Convert from planar to packed format */
-+ gint i, j;
-+
-+ for (i = 0; i < samples; i++) {
-+ for (j = 0; j < channels; j++) {
-+ g_string_append_len (
-+ data->outbuf,
-+ (gchar *) (data->read_out_frame->extended_data[j] + i*bps),
-+ bps
-+ );
-+ }
-+ }
-+ } else {
-+ g_string_append_len (data->outbuf,
-+ (gchar *) data->read_out_frame->extended_data[0],
-+ samples * channels * bps);
-+ }
- }
Index: patches/patch-src_plugins_avcodec_avcodec_compat_h
===================================================================
RCS file: patches/patch-src_plugins_avcodec_avcodec_compat_h
diff -N patches/patch-src_plugins_avcodec_avcodec_compat_h
--- patches/patch-src_plugins_avcodec_avcodec_compat_h 11 Mar 2022 18:20:36 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,62 +0,0 @@
-Deal with newer FFmpeg API.
-
---- src/plugins/avcodec/avcodec_compat.h.orig Thu Mar 27 01:42:51 2014
-+++ src/plugins/avcodec/avcodec_compat.h Thu Mar 27 01:46:20 2014
-@@ -21,47 +21,16 @@
- # include "avcodec.h"
- #endif
-
--/* Map avcodec_decode_audio2 into the deprecated version
-- * avcodec_decode_audio in versions earlier than 51.28 */
--#if LIBAVCODEC_VERSION_INT < 0x331c00
--# define avcodec_decode_audio2 avcodec_decode_audio
-+/* Map avcodec_free_frame to av_freep if the former doesn't exist.
-+ * (This is in versions earlier than 54.28.0 (libav) or 54.59.100 (ffmpeg)) */
-+#if ! HAVE_AVCODEC_FREE_FRAME
-+# define avcodec_free_frame av_freep
- #endif
-
--/* Handle API change that happened in libavcodec 52.00 */
--#if LIBAVCODEC_VERSION_INT < 0x340000
--# define CONTEXT_BPS(codecctx) (codecctx)->bits_per_sample
--#else
--# define CONTEXT_BPS(codecctx) (codecctx)->bits_per_coded_sample
-+/* Map av_frame_alloc, av_frame_unref, av_frame_free into their
-+ * deprecated versions in versions earlier than 55.28.1 */
-+#if LIBAVCODEC_VERSION_INT < 0x371c01
-+# define av_frame_alloc avcodec_alloc_frame
-+# define av_frame_unref avcodec_get_frame_defaults
-+# define av_frame_free avcodec_free_frame
- #endif
--
--/* Before 52.23 AVPacket was defined in avformat.h which we
-- * do not want to depend on, so we define part of it manually
-- * on versions smaller than 52.23 (this makes me cry) */
--#if LIBAVCODEC_VERSION_INT < 0x341700
--typedef struct AVPacket {
-- uint8_t *data;
-- int size;
--} AVPacket;
--#endif
--
--/* Same thing as above for av_init_packet and version 52.25 */
--#if LIBAVCODEC_VERSION_INT < 0x341900
--# define av_init_packet(pkt) do { \
-- (pkt)->data = NULL; \
-- (pkt)->size = 0; \
-- } while(0)
--#endif
--
--/* Map avcodec_decode_audio3 into the deprecated version
-- * avcodec_decode_audio2 in versions earlier than 52.26 */
--#if LIBAVCODEC_VERSION_INT < 0x341a00
--# define avcodec_decode_audio3(avctx, samples, frame_size_ptr, avpkt) \
-- avcodec_decode_audio2(avctx, samples, frame_size_ptr, \
-- (avpkt)->data, (avpkt)->size)
--#endif
--
--/* Handle API change that happened in libavcodec 52.64 */
--#if LIBAVCODEC_VERSION_INT < 0x344000
--# define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO
--#endif
--
Index: patches/patch-waftools_man_py
===================================================================
RCS file: /cvs/ports/audio/xmms2/patches/patch-waftools_man_py,v
retrieving revision 1.3
diff -u -p -r1.3 patch-waftools_man_py
--- patches/patch-waftools_man_py 11 Mar 2022 18:20:36 -0000 1.3
+++ patches/patch-waftools_man_py 21 Feb 2024 20:02:32 -0000
@@ -1,8 +1,9 @@
Bypass the gzip function that compress man files.
---- waftools/man.py.orig Thu Oct 20 21:26:08 2011
-+++ waftools/man.py Tue May 8 12:50:16 2012
-@@ -24,11 +24,11 @@ def gzip_func(task):
+Index: waftools/man.py
+--- waftools/man.py.orig
++++ waftools/man.py
+@@ -29,11 +29,11 @@ def gzip_func(task):
if outf:
outf.close()
@@ -16,7 +17,7 @@ Bypass the gzip function that compress m
source = self.to_nodes(getattr(self, 'source', []))
self.source = []
-@@ -43,13 +43,7 @@ def process_man(self):
+@@ -48,13 +48,7 @@ def process_man(self):
if not s:
raise Errors.BuildError('cannot determine man section from filename')
Index: patches/patch-wscript
===================================================================
RCS file: /cvs/ports/audio/xmms2/patches/patch-wscript,v
retrieving revision 1.4
diff -u -p -r1.4 patch-wscript
--- patches/patch-wscript 11 Mar 2022 18:20:36 -0000 1.4
+++ patches/patch-wscript 21 Feb 2024 20:02:32 -0000
@@ -1,10 +1,11 @@
---- wscript.orig Thu Oct 20 21:26:08 2011
-+++ wscript Tue May 8 01:22:59 2012
-@@ -342,6 +342,7 @@ def configure(conf):
- if Options.platform != 'win32':
- conf.env.append_unique('CFLAGS_cstlib', ['-fPIC', '-DPIC'])
- conf.env.append_unique('CPPFLAGS_cxxshlib', ['-fPIC', '-DPIC'])
-+ conf.env["LINKFLAGS"] += ['-fPIC']
+Index: wscript
+--- wscript.orig
++++ wscript
+@@ -433,6 +433,7 @@ def configure(conf):
+ conf.env.CFLAGS_cstlib = ['-fPIC', '-DPIC']
+ conf.env.CPPFLAGS_cxxshlib = ['-fPIC', '-DPIC']
+ conf.env.CPPFLAGS_cxxstlib = ['-fPIC', '-DPIC']
++ conf.env["LINKFLAGS"] += ['-fPIC', '-lm']
else:
# As we have to change target platform after the tools
# have been loaded there are a few variables that needs
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/audio/xmms2/pkg/PLIST,v
retrieving revision 1.9
diff -u -p -r1.9 PLIST
--- pkg/PLIST 11 Mar 2022 18:20:36 -0000 1.9
+++ pkg/PLIST 21 Feb 2024 20:02:32 -0000
@@ -1,4 +1,6 @@
-bin/nyxmms2
+@bin bin/_xmms2-migrate-collections-v0
+@bin bin/s4
+@bin bin/sqlite2s4
@bin bin/xmms2
@bin bin/xmms2-et
@bin bin/xmms2-find-avahi
@@ -21,11 +23,14 @@ include/xmms2/xmms/xmms_streamtype.h
include/xmms2/xmms/xmms_util.h
include/xmms2/xmms/xmms_xformplugin.h
include/xmms2/xmmsc/
+include/xmms2/xmmsc/xmmsc-glib.h
include/xmms2/xmmsc/xmmsc_compiler.h
include/xmms2/xmmsc/xmmsc_errorcodes.h
include/xmms2/xmmsc/xmmsc_idnumbers.h
+include/xmms2/xmmsc/xmmsc_idnumbers_extra.h
include/xmms2/xmmsc/xmmsc_ipc_msg.h
include/xmms2/xmmsc/xmmsc_ipc_transport.h
+include/xmms2/xmmsc/xmmsc_log.h
include/xmms2/xmmsc/xmmsc_sockets.h
include/xmms2/xmmsc/xmmsc_stdbool.h
include/xmms2/xmmsc/xmmsc_stdint.h
@@ -37,11 +42,13 @@ include/xmms2/xmmsc/xmmsc_visualization.
include/xmms2/xmmsc/xmmsv.h
include/xmms2/xmmsc/xmmsv_bitbuffer.h
include/xmms2/xmmsc/xmmsv_build.h
+include/xmms2/xmmsc/xmmsv_c2c.h
include/xmms2/xmmsc/xmmsv_coll.h
include/xmms2/xmmsc/xmmsv_deprecated.h
include/xmms2/xmmsc/xmmsv_dict.h
include/xmms2/xmmsc/xmmsv_general.h
include/xmms2/xmmsc/xmmsv_list.h
+include/xmms2/xmmsc/xmmsv_service.h
include/xmms2/xmmsc/xmmsv_util.h
include/xmms2/xmmsclient/
include/xmms2/xmmsclient/xmmsclient++/
@@ -95,20 +102,23 @@ lib/python${MODPY_VERSION}/site-packages
lib/python${MODPY_VERSION}/site-packages/xmmsclient/glib.py
lib/python${MODPY_VERSION}/site-packages/xmmsclient/propdict.py
lib/python${MODPY_VERSION}/site-packages/xmmsclient/qt3.py
+lib/python${MODPY_VERSION}/site-packages/xmmsclient/samples/
+lib/python${MODPY_VERSION}/site-packages/xmmsclient/samples/__init__.py
+lib/python${MODPY_VERSION}/site-packages/xmmsclient/samples/scwatch.py
+lib/python${MODPY_VERSION}/site-packages/xmmsclient/samples/service.py
+lib/python${MODPY_VERSION}/site-packages/xmmsclient/service.py
lib/python${MODPY_VERSION}/site-packages/xmmsclient/sync.py
-@so lib/python${MODPY_VERSION}/site-packages/xmmsclient/xmmsapi.so
-@so lib/python${MODPY_VERSION}/site-packages/xmmsclient/xmmsvalue.so
+@so lib/python${MODPY_VERSION}/site-packages/xmmsclient/xmmsapi.${MODPY_PYC_MAGIC_TAG}so
+@so lib/python${MODPY_VERSION}/site-packages/xmmsclient/xmmsvalue.${MODPY_PYC_MAGIC_TAG}so
lib/xmms2/
@so lib/xmms2/libxmms_ao.so
@so lib/xmms2/libxmms_apefile.so
-@so lib/xmms2/libxmms_asf.so
@so lib/xmms2/libxmms_asx.so
@so lib/xmms2/libxmms_avcodec.so
@so lib/xmms2/libxmms_cue.so
@so lib/xmms2/libxmms_curl.so
@so lib/xmms2/libxmms_daap.so
@so lib/xmms2/libxmms_diskwrite.so
-@so lib/xmms2/libxmms_equalizer.so
@so lib/xmms2/libxmms_file.so
@so lib/xmms2/libxmms_flac.so
@so lib/xmms2/libxmms_flv.so
@@ -124,8 +134,8 @@ lib/xmms2/
@so lib/xmms2/libxmms_normalize.so
@so lib/xmms2/libxmms_null.so
@so lib/xmms2/libxmms_nulstripper.so
+@so lib/xmms2/libxmms_opus.so
@so lib/xmms2/libxmms_pls.so
-@so lib/xmms2/libxmms_replaygain.so
@so lib/xmms2/libxmms_rss.so
@so lib/xmms2/libxmms_sndfile.so
@so lib/xmms2/libxmms_tta.so
retire some python 2 ports