aboutsummaryrefslogtreecommitdiff
path: root/audio/libtunepimp-old
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@FreeBSD.org>2008-04-07 20:37:23 +0000
committerChristian Weisgerber <naddy@FreeBSD.org>2008-04-07 20:37:23 +0000
commitfc6f8996911202c6df18b1ee15a9cb205ba4ea49 (patch)
tree539cb57de0e25c0fcfd062eb36d849e1f96fdb90 /audio/libtunepimp-old
parente736f59941a3e760ba36b76c2472497f04a3d7da (diff)
downloadports-fc6f8996911202c6df18b1ee15a9cb205ba4ea49.tar.gz
ports-fc6f8996911202c6df18b1ee15a9cb205ba4ea49.zip
Notes
Diffstat (limited to 'audio/libtunepimp-old')
-rw-r--r--audio/libtunepimp-old/Makefile2
-rw-r--r--audio/libtunepimp-old/files/patch-plugins-flac-flacdecode.cpp57
-rw-r--r--audio/libtunepimp-old/files/patch-plugins-flac-flacdecode.h11
3 files changed, 69 insertions, 1 deletions
diff --git a/audio/libtunepimp-old/Makefile b/audio/libtunepimp-old/Makefile
index b10f19cae313..329aff572a8c 100644
--- a/audio/libtunepimp-old/Makefile
+++ b/audio/libtunepimp-old/Makefile
@@ -7,7 +7,7 @@
PORTNAME= libtunepimp-old
PORTVERSION= 0.4.2
-PORTREVISION= 4
+PORTREVISION= 5
PORTEPOCH= 2
CATEGORIES= audio
MASTER_SITES= http://ftp.musicbrainz.org/pub/musicbrainz/ \
diff --git a/audio/libtunepimp-old/files/patch-plugins-flac-flacdecode.cpp b/audio/libtunepimp-old/files/patch-plugins-flac-flacdecode.cpp
new file mode 100644
index 000000000000..0c87b4def541
--- /dev/null
+++ b/audio/libtunepimp-old/files/patch-plugins-flac-flacdecode.cpp
@@ -0,0 +1,57 @@
+--- plugins/flac/flacdecode.cpp.orig 2008-03-28 21:05:11.000000000 +0100
++++ plugins/flac/flacdecode.cpp 2008-03-28 21:08:21.000000000 +0100
+@@ -28,6 +28,14 @@
+ #include <string.h>
+ #include "flacdecode.h"
+
++#include <FLAC/export.h>
++/* FLAC 1.1.3 has FLAC_API_VERSION_CURRENT == 8 */
++#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8
++#define LEGACY_FLAC
++#else
++#undef LEGACY_FLAC
++#endif
++
+ void FLAC_errorcb(const FLAC__StreamDecoder * decoder,
+ FLAC__StreamDecoderErrorStatus status, void *client_data)
+ {
+@@ -99,7 +107,11 @@ FLAC__StreamDecoderWriteStatus FLAC_writ
+
+ FLAC__StreamDecoderReadStatus FLAC_readcb(const FLAC__StreamDecoder *decoder,
+ FLAC__byte buffer[],
++#ifdef LEGACY_FLAC
+ unsigned *bytes,
++#else
++ size_t *bytes,
++#endif
+ void *client_data)
+ {
+ clientdata_t *cd = reinterpret_cast < clientdata_t * >(client_data);
+@@ -131,6 +143,7 @@ FlacDecode::FlacDecode(const string & fi
+ if (!cd.in)
+ return;
+
++#ifdef LEGACY_FLAC
+ if (!FLAC__stream_decoder_set_read_callback(decoder, &FLAC_readcb))
+ return;
+
+@@ -149,6 +162,10 @@ FlacDecode::FlacDecode(const string & fi
+ state = FLAC__stream_decoder_init(decoder);
+ if (state != FLAC__STREAM_DECODER_SEARCH_FOR_METADATA)
+ return;
++#else
++ if (FLAC__stream_decoder_init_stream(decoder, &FLAC_readcb, NULL, NULL, NULL, NULL, &FLAC_writecb, &FLAC_metadatacb, &FLAC_errorcb, &cd) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
++ return;
++#endif
+
+ FLAC__stream_decoder_process_until_end_of_metadata(decoder);
+ state = FLAC__stream_decoder_get_state(decoder);
+@@ -221,6 +238,8 @@ int FlacDecode::read(char *data, int max
+ break;
+
+ state = FLAC__stream_decoder_get_state(decoder);
++ if (state == FLAC__STREAM_DECODER_END_OF_STREAM)
++ break;
+ if (state != FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC ||
+ state != FLAC__STREAM_DECODER_READ_FRAME)
+ {
diff --git a/audio/libtunepimp-old/files/patch-plugins-flac-flacdecode.h b/audio/libtunepimp-old/files/patch-plugins-flac-flacdecode.h
new file mode 100644
index 000000000000..6b2f7dffea8a
--- /dev/null
+++ b/audio/libtunepimp-old/files/patch-plugins-flac-flacdecode.h
@@ -0,0 +1,11 @@
+--- plugins/flac/flacdecode.h.orig 2008-03-28 21:08:34.000000000 +0100
++++ plugins/flac/flacdecode.h 2008-03-28 21:08:49.000000000 +0100
+@@ -27,7 +27,7 @@
+ #ifndef __VORBIS_DECODE_H
+ #define __VORBIS_DECODE_H
+
+-#include <FLAC/file_decoder.h>
++#include <FLAC/stream_decoder.h>
+ #include <string>
+ #include "decode_plugin.h"
+ #include "fileio.h"