Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Sep 2010 20:02:01 GMT
From:      Ganael Laplanche <ganael.laplanche@martymac.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/150510: Port updates: depend on audio/musepack instead of audio/libmpcdec (when possible)
Message-ID:  <201009122002.o8CK21MS076419@www.freebsd.org>
Resent-Message-ID: <201009122010.o8CKA74h035286@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         150510
>Category:       ports
>Synopsis:       Port updates: depend on audio/musepack instead of audio/libmpcdec (when possible)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 12 20:10:07 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Ganael Laplanche
>Release:        8.1-STABLE
>Organization:
http://contribs.martymac.org
>Environment:
FreeBSD home.martymac.com 8.1-STABLE FreeBSD 8.1-STABLE #7: Wed Sep  1 10:25:03 CEST 2010     root@home.martymac.com:/usr/obj/usr/src/sys/MYKERNEL  amd64
>Description:
Following a discussion on freebsd-multimedia@, here is a patch to switch dependencies from audio/musepack to audio/libmpcdec when possible.

This patch includes the following changes :

1) Fix audio/musepack build on 6.X by removing an unsupported compiler optimization option (-fvisibility=hidden)

2) Make the following ports depend on audio/musepack instead of audio/libmpcdec (those ones support both old and new mpcdec libraries out-of-the-box) :

* audio/xmms2 (patched detection)
* multimedia/gstreamer-plugins
* multimedia/vlc
* multimedia/quodlibet
* sysutils/k3b-kde4
* audio/aqualung
* audio/cmus (patched detection)

Their PORTREVISION have been bumped.

3) Patch audio/libtunepimp to support latest musepack's libmpcdec API (patch from Debian, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=476378#39). This patch will allow us to keep the MUSEPACK option for multimedia/transkode which was failing because of a dependency CONFLICT.

4) Unfortunately, the following ports do not have support for musepack (only for older libmpcdec), so they currently remain unmodified :

audio/bmp-musepack
audio/cynthiune
audio/py-musepack
multimedia/mplayer
multimedia/gmerlin-avdecoder
sysutils/k3b

We may choose in a near future to either :
- leave them as-is and keep libmpcdec in ports
- deprecate their MUSEPACK option and remove libmpcdec from ports
- patch them and remove libmpcdec from ports

>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -aurN audio/moc.orig/Makefile audio/moc/Makefile
--- audio/moc.orig/Makefile	2010-09-10 10:56:48.852761847 +0200
+++ audio/moc/Makefile	2010-09-10 23:05:51.409572756 +0200
@@ -7,7 +7,7 @@
 
 PORTNAME=	moc
 PORTVERSION=	2.4.4
-PORTREVISION=	5
+PORTREVISION=	6
 CATEGORIES=	audio
 MASTER_SITES=	ftp://ftp.daper.net/pub/soft/moc/stable/
 
@@ -56,7 +56,7 @@
 .endif
 
 .if defined(WITH_MUSEPACK)
-LIB_DEPENDS+=	mpcdec.5:${PORTSDIR}/audio/libmpcdec \
+LIB_DEPENDS+=	mpcdec.7:${PORTSDIR}/audio/musepack \
 		tag_c.0:${PORTSDIR}/audio/taglib
 PLIST_FILES+=	lib/moc/decoder_plugins/libmusepack_decoder.a \
 		lib/moc/decoder_plugins/libmusepack_decoder.la \
diff -aurN audio/musicpd.orig/Makefile audio/musicpd/Makefile
--- audio/musicpd.orig/Makefile	2010-09-10 10:54:07.515574291 +0200
+++ audio/musicpd/Makefile	2010-09-10 23:07:25.490812993 +0200
@@ -7,6 +7,7 @@
 
 PORTNAME=	musicpd
 PORTVERSION=	0.15.12
+PORTREVISION=	1
 CATEGORIES=	audio ipv6
 MASTER_SITES=	SF/${PORTNAME}/mpd/${PORTVERSION}
 DISTNAME=	mpd-${PORTVERSION}
@@ -126,7 +127,7 @@
 .endif
 
 .if defined(WITH_MUSEPACK)
-LIB_DEPENDS+=	mpcdec.5:${PORTSDIR}/audio/libmpcdec
+LIB_DEPENDS+=	mpcdec.7:${PORTSDIR}/audio/musepack
 .else
 CONFIGURE_ARGS+=--disable-mpc
 .endif
diff -aurN audio/xmms2.orig/Makefile audio/xmms2/Makefile
--- audio/xmms2.orig/Makefile	2010-09-10 22:36:26.871318188 +0200
+++ audio/xmms2/Makefile	2010-09-10 23:08:59.529918205 +0200
@@ -7,7 +7,7 @@
 
 PORTNAME?=	xmms2
 PORTVERSION=	0.6
-PORTREVISION=	7
+PORTREVISION=	8
 DISTVERSIONSUFFIX=DrMattDestruction
 CATEGORIES?=	audio
 MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTVERSION}%20DrMattDestruction
@@ -242,7 +242,7 @@
 .endif
 
 .if !defined(WITHOUT_MUSEPACK)
-LIB_DEPENDS+=	mpcdec.5:${PORTSDIR}/audio/libmpcdec
+LIB_DEPENDS+=	mpcdec.7:${PORTSDIR}/audio/musepack
 PLIST_SUB+=	MUSEPACK=""
 .else
 EXCLUDE+=	--without-plugins="musepack"
diff -aurN audio/xmms2.orig/files/patch-patch-src-plugins-musepack-wscript audio/xmms2/files/patch-patch-src-plugins-musepack-wscript
--- audio/xmms2.orig/files/patch-patch-src-plugins-musepack-wscript	1970-01-01 01:00:00.000000000 +0100
+++ audio/xmms2/files/patch-patch-src-plugins-musepack-wscript	2010-09-10 23:03:42.154230426 +0200
@@ -0,0 +1,11 @@
+--- src/plugins/musepack/wscript.orig	2010-09-10 22:55:03.412930402 +0200
++++ src/plugins/musepack/wscript	2010-09-10 23:02:05.738208553 +0200
+@@ -5,7 +5,7 @@
+         if not conf.check_cc(header_name="mpcdec/mpcdec.h", defines="HAVE_MPCDEC_OLD", uselib_store="mpcdec"):
+             return False
+ 
+-    if not conf.check_cc(lib="mpcdec", uselib_store="mpcdec"):
++    if not conf.check_cc(lib="mpcdec", uselib="math", uselib_store="mpcdec"):
+         return False
+ 
+     return True
diff -aurN multimedia/gstreamer-plugins.orig/Makefile multimedia/gstreamer-plugins/Makefile
--- multimedia/gstreamer-plugins.orig/Makefile	2010-09-10 22:23:28.299951736 +0200
+++ multimedia/gstreamer-plugins/Makefile	2010-09-10 22:24:34.108010487 +0200
@@ -8,7 +8,7 @@
 
 PORTNAME=	gstreamer
 PORTVERSION?=	${BASE_PORTVERSION}
-PORTREVISION?=	0
+PORTREVISION?=	1
 PORTEPOCH=	3
 CATEGORIES?=	multimedia audio
 MASTER_SITES=	http://gstreamer.freedesktop.org/src/gst-plugins-base/:base \
diff -aurN multimedia/gstreamer-plugins.orig/Makefile.common multimedia/gstreamer-plugins/Makefile.common
--- multimedia/gstreamer-plugins.orig/Makefile.common	2010-09-10 22:23:28.299951736 +0200
+++ multimedia/gstreamer-plugins/Makefile.common	2010-09-10 22:24:04.470032587 +0200
@@ -363,7 +363,7 @@
 gst_mpeg2dec_DIST=	ugly
 
 # musepack
-gst_musepack_LIB_DEPENDS+=	mpcdec.5:${PORTSDIR}/audio/libmpcdec
+gst_musepack_LIB_DEPENDS+=	mpcdec.7:${PORTSDIR}/audio/musepack
 gst_musepack_PLIST_FILES=	${GST_LIB_DIR}/libgstmusepack.la \
 		${GST_LIB_DIR}/libgstmusepack.so
 gst_musepack_DIST=	bad
diff -aurN multimedia/vlc.orig/Makefile multimedia/vlc/Makefile
--- multimedia/vlc.orig/Makefile	2010-09-10 22:28:52.430802304 +0200
+++ multimedia/vlc/Makefile	2010-09-10 22:29:51.481871493 +0200
@@ -7,7 +7,7 @@
 
 PORTNAME=	vlc
 DISTVERSION=	1.1.4
-PORTREVISION=	1
+PORTREVISION=	2
 PORTEPOCH=	3
 CATEGORIES=	multimedia audio ipv6 net www
 MASTER_SITES=	http://download.videolan.org/pub/videolan/${PORTNAME}/${DISTVERSION}/ \
@@ -401,7 +401,7 @@
 .if defined(WITHOUT_MUSEPACK)
 CONFIGURE_ARGS+=--disable-mpc
 .else
-LIB_DEPENDS+=	mpcdec.5:${PORTSDIR}/audio/libmpcdec
+LIB_DEPENDS+=	mpcdec.7:${PORTSDIR}/audio/musepack
 CONFIGURE_ARGS+=--enable-mpc
 .endif
 
diff -aurN multimedia/quodlibet.orig/Makefile multimedia/quodlibet/Makefile
--- multimedia/quodlibet.orig/Makefile	2010-09-10 22:15:23.240700508 +0200
+++ multimedia/quodlibet/Makefile	2010-09-10 23:12:14.611462351 +0200
@@ -7,7 +7,7 @@
 
 PORTNAME=	quodlibet
 PORTVERSION=	2.2
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	multimedia audio python gnome
 MASTER_SITES=	${MASTER_SITE_GOOGLE_CODE}
 
@@ -72,7 +72,7 @@
 .endif
 
 .if !defined(WITHOUT_MUSEPACK)
-LIB_DEPENDS+=	mpcdec.5:${PORTSDIR}/audio/libmpcdec
+LIB_DEPENDS+=	mpcdec.7:${PORTSDIR}/audio/musepack
 USE_GSTREAMER+=	musepack
 .endif
 
diff -aurN sysutils/k3b-kde4.orig/Makefile k3b-kde4/Makefile
--- sysutils/k3b-kde4.orig/Makefile	2010-09-10 23:13:37.118260185 +0200
+++ sysutils/k3b-kde4/Makefile	2010-09-10 23:14:58.067837429 +0200
@@ -7,7 +7,7 @@
 
 PORTNAME=	k3b
 PORTVERSION=	2.0.1
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	sysutils multimedia kde
 MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTVERSION}
 
@@ -38,7 +38,7 @@
 		FFMPEG "Decoder: various (multimedia/ffmpeg)" OFF \
 		FLAC "Decoder: flac (audio/flac)" ON \
 		MAD "Decoder: mp3 (audio/libmad)" ON \
-		MPC "Decoder: musepack (audio/libmpcdec)" OFF \
+		MUSEPACK "Decoder: musepack (audio/libmpcdec)" OFF \
 		SNDFILE "Decoder: various (audio/libsndfile)" ON \
 		VORBIS_DEC "Decoder: ogg/vorbis" ON \
 		LAME "Encoder: mp3 (audio/lame)" OFF \
@@ -92,13 +92,13 @@
 PLIST_SUB+=	MAD="@comment "
 .endif
 
-.if defined(WITH_MPC)
+.if defined(WITH_MUSEPACK)
 CMAKE_ARGS+=	-DCMAKE_REQUIRED_INCLUDES:STRING="${LOCALBASE}/include"
-LIB_DEPENDS+=	mpcdec:${PORTSDIR}/audio/libmpcdec
-PLIST_SUB+=	MPC=""
+LIB_DEPENDS+=	mpcdec:${PORTSDIR}/audio/musepack
+PLIST_SUB+=	MUSEPACK=""
 .else
 CMAKE_ARGS+=	-DK3B_BUILD_MUSE_DECODER_PLUGIN:BOOL=OFF
-PLIST_SUB+=	MPC="@comment "
+PLIST_SUB+=	MUSEPACK="@comment "
 .endif
 
 .if defined(WITH_SNDFILE)
diff -aurN sysutils/k3b-kde4.orig/pkg-plist k3b-kde4/pkg-plist
--- sysutils/k3b-kde4.orig/pkg-plist	2010-09-10 23:13:37.118260185 +0200
+++ sysutils/k3b-kde4/pkg-plist	2010-09-10 23:15:17.800713893 +0200
@@ -124,7 +124,7 @@
 %%LAME%%lib/kde4/k3blameencoder.so
 %%SNDFILE%%lib/kde4/k3blibsndfiledecoder.so
 %%MAD%%lib/kde4/k3bmaddecoder.so
-%%MPC%%lib/kde4/k3bmpcdecoder.so
+%%MUSEPACK%%lib/kde4/k3bmpcdecoder.so
 %%VORBIS_DEC%%lib/kde4/k3boggvorbisdecoder.so
 %%VORBIS_ENC%%lib/kde4/k3boggvorbisencoder.so
 %%SOX%%lib/kde4/k3bsoxencoder.so
@@ -319,7 +319,7 @@
 %%LAME%%share/kde4/services/k3blameencoder.desktop
 %%SNDFILE%%share/kde4/services/k3blibsndfiledecoder.desktop
 %%MAD%%share/kde4/services/k3bmaddecoder.desktop
-%%MPC%%share/kde4/services/k3bmpcdecoder.desktop
+%%MUSEPACK%%share/kde4/services/k3bmpcdecoder.desktop
 %%VORBIS_DEC%%share/kde4/services/k3boggvorbisdecoder.desktop
 %%VORBIS_ENC%%share/kde4/services/k3boggvorbisencoder.desktop
 %%SOX%%share/kde4/services/k3bsoxencoder.desktop
diff -aurN audio/aqualung.orig/Makefile audio/aqualung/Makefile
--- audio/aqualung.orig/Makefile	2010-09-10 23:21:49.185360459 +0200
+++ audio/aqualung/Makefile	2010-09-10 23:22:07.854509729 +0200
@@ -7,7 +7,7 @@
 
 PORTNAME=	aqualung
 DISTVERSION=	0.9beta11
-PORTREVISION=	8
+PORTREVISION=	9
 CATEGORIES=	audio
 MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${DISTVERSION} \
  		http://wickedmachine.net/mirror/
@@ -23,7 +23,7 @@
 		speex.1:${PORTSDIR}/audio/speex \
 		mad.2:${PORTSDIR}/audio/libmad \
 		modplug.1:${PORTSDIR}/audio/libmodplug \
-		mpcdec.5:${PORTSDIR}/audio/libmpcdec \
+		mpcdec.7:${PORTSDIR}/audio/musepack \
 		mac.2:${PORTSDIR}/audio/mac \
 		tag.1:${PORTSDIR}/audio/taglib \
 		lrdf.2:${PORTSDIR}/textproc/liblrdf \
diff -aurN audio/cmus.orig/Makefile audio/cmus/Makefile
--- audio/cmus.orig/Makefile	2010-09-10 23:33:52.988362100 +0200
+++ audio/cmus/Makefile	2010-09-10 23:34:21.313682230 +0200
@@ -7,7 +7,7 @@
 
 PORTNAME=	cmus
 PORTVERSION=	2.3.3
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	audio
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	${PORTNAME}
@@ -80,7 +80,7 @@
 .endif
 
 .if defined(WITH_MUSEPACK)
-LIB_DEPENDS+=	mpcdec:${PORTSDIR}/audio/libmpcdec
+LIB_DEPENDS+=	mpcdec:${PORTSDIR}/audio/musepack
 CONFIGURE_ARGS+=CONFIG_MPC=y
 PLIST_SUB+=	MPC=""
 .else
diff -aurN audio/cmus.orig/files/patch-configure audio/cmus/files/patch-configure
--- audio/cmus.orig/files/patch-configure	1970-01-01 01:00:00.000000000 +0100
+++ audio/cmus/files/patch-configure	2010-09-10 23:38:23.132616357 +0200
@@ -0,0 +1,11 @@
+--- configure.orig	2010-09-10 23:37:55.577146100 +0200
++++ configure	2010-09-10 23:38:07.609090631 +0200
+@@ -135,7 +135,7 @@
+ {
+ 	check_header mpc/mpcdec.h
+ 	MPC_SV7=$?
+-	check_library MPC "" "-lmpcdec"
++	check_library MPC "" "-lmpcdec -lm"
+ 	return $?
+ }
+ 
diff -aurN audio/libtunepimp.orig/Makefile audio/libtunepimp/Makefile
--- audio/libtunepimp.orig/Makefile	2010-09-10 23:41:04.997697784 +0200
+++ audio/libtunepimp/Makefile	2010-09-10 23:41:37.137649467 +0200
@@ -7,7 +7,7 @@
 
 PORTNAME=	libtunepimp
 PORTVERSION=	0.5.3
-PORTREVISION=	8
+PORTREVISION=	9
 PORTEPOCH=	1
 CATEGORIES=	audio
 MASTER_SITES=	http://ftp.musicbrainz.org/pub/musicbrainz/ \
@@ -25,7 +25,7 @@
 		tag:${PORTSDIR}/audio/taglib \
 		vorbis:${PORTSDIR}/audio/libvorbis \
 		ofa:${PORTSDIR}/audio/libofa \
-		mpcdec:${PORTSDIR}/audio/libmpcdec
+		mpcdec:${PORTSDIR}/audio/musepack
 
 CONFLICTS=	trm-0*
 USE_GMAKE=	yes
diff -aurN audio/libtunepimp.orig/files/patch-configure audio/libtunepimp/files/patch-configure
--- audio/libtunepimp.orig/files/patch-configure	1970-01-01 01:00:00.000000000 +0100
+++ audio/libtunepimp/files/patch-configure	2010-09-11 11:47:55.338901654 +0200
@@ -0,0 +1,56 @@
+--- configure.orig	2006-11-28 21:34:18.000000000 +0100
++++ configure	2010-09-11 11:46:56.333821556 +0200
+@@ -21669,9 +21669,9 @@
+   fi
+ 
+ 
+-{ echo "$as_me:$LINENO: checking for mpc_decoder_decode in -lmpcdec" >&5
+-echo $ECHO_N "checking for mpc_decoder_decode in -lmpcdec... $ECHO_C" >&6; }
+-if test "${ac_cv_lib_mpcdec_mpc_decoder_decode+set}" = set; then
++{ echo "$as_me:$LINENO: checking for mpc_demux_decode in -lmpcdec" >&5
++echo $ECHO_N "checking for mpc_demux_decode in -lmpcdec... $ECHO_C" >&6; }
++if test "${ac_cv_lib_mpcdec_mpc_demux_decode+set}" = set; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+@@ -21689,11 +21689,11 @@
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+-char mpc_decoder_decode ();
++char mpc_demux_decode ();
+ int
+ main ()
+ {
+-return mpc_decoder_decode ();
++return mpc_demux_decode ();
+   ;
+   return 0;
+ }
+@@ -21732,21 +21732,21 @@
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; }; then
+-  ac_cv_lib_mpcdec_mpc_decoder_decode=yes
++  ac_cv_lib_mpcdec_mpc_demux_decode=yes
+ else
+   echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+-	ac_cv_lib_mpcdec_mpc_decoder_decode=no
++	ac_cv_lib_mpcdec_mpc_demux_decode=no
+ fi
+ 
+ rm -f core conftest.err conftest.$ac_objext \
+       conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-{ echo "$as_me:$LINENO: result: $ac_cv_lib_mpcdec_mpc_decoder_decode" >&5
+-echo "${ECHO_T}$ac_cv_lib_mpcdec_mpc_decoder_decode" >&6; }
+-if test $ac_cv_lib_mpcdec_mpc_decoder_decode = yes; then
++{ echo "$as_me:$LINENO: result: $ac_cv_lib_mpcdec_mpc_demux_decode" >&5
++echo "${ECHO_T}$ac_cv_lib_mpcdec_mpc_demux_decode" >&6; }
++if test $ac_cv_lib_mpcdec_mpc_demux_decode = yes; then
+   have_mpcdec=yes
+ fi
+ 
diff -aurN audio/libtunepimp.orig/files/patch-plugins-mpc-mpcdecode.cpp audio/libtunepimp/files/patch-plugins-mpc-mpcdecode.cpp
--- audio/libtunepimp.orig/files/patch-plugins-mpc-mpcdecode.cpp	1970-01-01 01:00:00.000000000 +0100
+++ audio/libtunepimp/files/patch-plugins-mpc-mpcdecode.cpp	2010-09-11 11:47:23.049478324 +0200
@@ -0,0 +1,165 @@
+--- plugins/mpc/mpcdecode.cpp.orig	2006-11-18 11:51:08.000000000 +0100
++++ plugins/mpc/mpcdecode.cpp	2010-09-11 11:46:56.335821789 +0200
+@@ -29,8 +29,9 @@
+ #include <assert.h>
+ #include <time.h>
+ #include "fileio.h"
++#include "config.h"
+ 
+-#include <mpcdec/mpcdec.h> 
++#include <mpc/mpcdec.h>
+ 
+ extern char *mpcErrorString;
+ 
+@@ -40,35 +41,35 @@
+ } reader_data;
+ 
+ static mpc_int32_t
+-read_impl(void *data, void *ptr, mpc_int32_t size)
++read_impl(mpc_reader *data, void *ptr, mpc_int32_t size)
+ {
+-    reader_data *d = (reader_data *) data;
++    reader_data *d = (reader_data *) data->data;
+     return tread(ptr, 1, size, d->file);
+ }
+ 
+ static mpc_bool_t
+-seek_impl(void *data, mpc_int32_t offset)
++seek_impl(mpc_reader *data, mpc_int32_t offset)
+ {
+-    reader_data *d = (reader_data *) data;
++    reader_data *d = (reader_data *) data->data;
+     return !tseek(d->file, offset, SEEK_SET);
+ }
+ 
+ static mpc_int32_t
+-tell_impl(void *data)
++tell_impl(mpc_reader *data)
+ {
+-    reader_data *d = (reader_data *) data;
++    reader_data *d = (reader_data *) data->data;
+     return ttell(d->file);
+ }
+ 
+ static mpc_int32_t
+-get_size_impl(void *data)
++get_size_impl(mpc_reader *data)
+ {
+-    reader_data *d = (reader_data *) data;
++    reader_data *d = (reader_data *) data->data;
+     return d->size;
+ }
+ 
+ static mpc_bool_t
+-canseek_impl(void *data)
++canseek_impl(mpc_reader *data)
+ {
+     return true;
+ } 
+@@ -76,7 +77,7 @@
+ typedef struct mpc_decode_struct_t {
+     TFILE *file;
+     reader_data rdata;
+-    mpc_decoder decoder;
++    mpc_demux *decoder;
+     mpc_reader reader;
+     mpc_streaminfo info;
+     MPC_SAMPLE_FORMAT buffer[MPC_DECODER_BUFFER_LENGTH];
+@@ -114,27 +115,21 @@
+     ds->reader.canseek = canseek_impl;
+     ds->reader.data = &ds->rdata;     
+     
+-    /* read file's streaminfo data */
+-    mpc_streaminfo_init(&ds->info);
+-    if (mpc_streaminfo_read(&ds->info, &ds->reader) != ERROR_CODE_OK) {
+-        mpcErrorString = "Not a valid Musepack file.";
+-        goto error;
+-    }     
+-    
+-    /* instantiate a decoder with our file reader */
+-    mpc_decoder_setup(&ds->decoder, &ds->reader);
+-    if (!mpc_decoder_initialize(&ds->decoder, &ds->info)) {
+-        mpcErrorString = "Error initializing decoder.";
+-        goto error;
+-    }     
+-    
++    ds->decoder = mpc_demux_init(&ds->reader);
++    if (!ds->decoder) {
++	mpcErrorString = "Error initializing decoder.";
++	goto error;
++    }
++
++    mpc_demux_get_info(ds->decoder, &ds->info);
++
+     return ds;
+     
+ error:
+-    if (ds)
+-        delete ds;
+-    
+-    return NULL;
++    if (ds) {
++      mpc_demux_exit(ds->decoder);
++      delete ds;
++    }
+ }
+ 
+ extern "C" int
+@@ -144,7 +139,8 @@
+         return 0;
+         
+     if (duration)
+-        *duration = (ds->info.pcm_samples * 1000) / ds->info.sample_freq;
++        *duration = ((ds->info.samples - ds->info.beg_silence) * 1000)
++	  / ds->info.sample_freq;
+     if (samplesPerSecond)
+         *samplesPerSecond = ds->info.sample_freq;
+     if (bitsPerSample)
+@@ -173,6 +169,8 @@
+         return -1;
+         
+     unsigned status, maxSamples = maxBytes / 2 / ds->info.channels, samples, offset;
++    mpc_frame_info frame;
++    mpc_status err;
+     
+     if (ds->samples > 0) {
+         samples = ds->samples;
+@@ -182,15 +180,18 @@
+         goto convert;
+     }
+     
+-    status = mpc_decoder_decode(&ds->decoder, ds->buffer, 0, 0);
+-    
+-    if (status == (unsigned)(-1)) { //decode error
+-        mpcErrorString = "Error decoding file.";
+-        return -1;
++    frame.buffer = ds->buffer;
++    err = mpc_demux_decode(ds->decoder, &frame);
++
++    if (err != MPC_STATUS_OK) { //decode error
++	mpcErrorString = "Error decoding file.";
++	return -1;
+     }
+-    else if (status == 0) { //EOF
+-        return 0;
++    else if (frame.bits == -1) { //EOF
++	return 0;
+     }
++
++    status = frame.samples;
+     
+     if (status > maxSamples) {
+         ds->samples = status - maxSamples;
+@@ -230,8 +231,10 @@
+ extern "C" void
+ mpcDecodeEnd(mpc_decode_struct_t *ds)
+ {
+-    if (ds) 
+-        delete ds;
++  if (ds) {
++      mpc_demux_exit(ds->decoder);
++      delete ds;
++  }
+ }
+ 
+ 
diff -aurN audio/musepack.orig/Makefile audio/musepack/Makefile
--- audio/musepack.orig/Makefile	2010-09-12 12:36:01.104802565 +0000
+++ audio/musepack/Makefile	2010-09-12 12:41:27.985441864 +0000
@@ -23,8 +23,9 @@
 
 .include <bsd.port.pre.mk>
 
+post-patch:
 .if ${OSVERSION} < 700000
-BROKEN=		does not build on 6.X
+	@${REINPLACE_CMD} '/^AM_CFLAGS =/s/-fvisibility=hidden//' ${WRKSRC}/libmpcdec/Makefile.am
 .endif
 
 .include <bsd.port.post.mk>


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009122002.o8CK21MS076419>