aboutsummaryrefslogtreecommitdiff
path: root/audio/libtunepimp
diff options
context:
space:
mode:
authorMax Brazhnikov <makc@FreeBSD.org>2010-09-21 16:48:04 +0000
committerMax Brazhnikov <makc@FreeBSD.org>2010-09-21 16:48:04 +0000
commit2ee00782edeff84bd0019c4b56770b474ab02be6 (patch)
treee11051f9e683f2860aaa92e011b3c16720e557fe /audio/libtunepimp
parent17e550ca2fd180b150f6645ced5f3bb45bc32292 (diff)
Notes
Diffstat (limited to 'audio/libtunepimp')
-rw-r--r--audio/libtunepimp/Makefile4
-rw-r--r--audio/libtunepimp/files/patch-configure56
-rw-r--r--audio/libtunepimp/files/patch-plugins-mpc-mpcdecode.cpp165
3 files changed, 223 insertions, 2 deletions
diff --git a/audio/libtunepimp/Makefile b/audio/libtunepimp/Makefile
index e1a3599ee66b..71b302ab944f 100644
--- a/audio/libtunepimp/Makefile
+++ b/audio/libtunepimp/Makefile
@@ -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 @@ LIB_DEPENDS= FLAC:${PORTSDIR}/audio/flac \
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 --git a/audio/libtunepimp/files/patch-configure b/audio/libtunepimp/files/patch-configure
new file mode 100644
index 000000000000..0403270dc7df
--- /dev/null
+++ b/audio/libtunepimp/files/patch-configure
@@ -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 --git a/audio/libtunepimp/files/patch-plugins-mpc-mpcdecode.cpp b/audio/libtunepimp/files/patch-plugins-mpc-mpcdecode.cpp
new file mode 100644
index 000000000000..9a35eef03903
--- /dev/null
+++ b/audio/libtunepimp/files/patch-plugins-mpc-mpcdecode.cpp
@@ -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;
++ }
+ }
+
+