summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorwiz <wiz>2007-01-12 20:32:48 +0000
committerwiz <wiz>2007-01-12 20:32:48 +0000
commit747550f8c3f6a4992cafc403ce975f79f861d4c7 (patch)
tree797f280e782b6acba2eebfad515b6ff030c4517f /games
parent483f5959ba8056e533400bcecfa1a18be68b827b (diff)
downloadpkgsrc-747550f8c3f6a4992cafc403ce975f79f861d4c7.tar.gz
Support flac-1.1.3 using a patch from
ftp.altlinux.org /pub/people/thresh
Diffstat (limited to 'games')
-rw-r--r--games/stratagus/distinfo3
-rw-r--r--games/stratagus/patches/patch-af54
2 files changed, 56 insertions, 1 deletions
diff --git a/games/stratagus/distinfo b/games/stratagus/distinfo
index f5c6434e834..46dd3695aca 100644
--- a/games/stratagus/distinfo
+++ b/games/stratagus/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.5 2006/09/19 19:40:23 joerg Exp $
+$NetBSD: distinfo,v 1.6 2007/01/12 20:32:48 wiz Exp $
SHA1 (stratagus-2.1-src.tar.gz) = 33181d57e018825a450f1e8c0ec31b0887cbd39c
RMD160 (stratagus-2.1-src.tar.gz) = f5f97854cad9f17104de34613012fd3aa2efbb9b
@@ -7,3 +7,4 @@ SHA1 (patch-aa) = 2f1403d58b3a745845c3b3e94abb7cf65b00194d
SHA1 (patch-ab) = cd9235023dcb2bc05828857c8f1d538a0d06eab5
SHA1 (patch-ac) = 78aca58075dd730a799dc9d0fb79ca4c6c010a34
SHA1 (patch-ad) = 20dc341faf2fc160fbbd8b6ae68b1de1a9e21294
+SHA1 (patch-af) = 06e264e6a3fb785285da503f240405dedf851ec5
diff --git a/games/stratagus/patches/patch-af b/games/stratagus/patches/patch-af
new file mode 100644
index 00000000000..e898dfff031
--- /dev/null
+++ b/games/stratagus/patches/patch-af
@@ -0,0 +1,54 @@
+$NetBSD: patch-af,v 1.1 2007/01/12 20:32:48 wiz Exp $
+
+--- src/sound/flac.c.orig 2004-06-25 23:22:33.000000000 +0000
++++ src/sound/flac.c
+@@ -47,6 +47,13 @@
+ #include "iolib.h"
+ #include "sound_server.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
++
+ /*----------------------------------------------------------------------------
+ -- Declaration
+ ----------------------------------------------------------------------------*/
+@@ -88,7 +95,12 @@ static void FLAC_error_callback(const FL
+ */
+ static FLAC__StreamDecoderReadStatus FLAC_read_callback(
+ const FLAC__StreamDecoder* stream, FLAC__byte buffer[],
+- unsigned int* bytes, void* user)
++#ifdef LEGACY_FLAC
++ unsigned int* bytes,
++#else
++ size_t* bytes,
++#endif
++ void* user)
+ {
+ Sample* sample;
+ FlacData* data;
+@@ -339,12 +351,21 @@ Sample* LoadFlac(const char* name, int f
+ sample->Pos = 0;
+ sample->User = data;
+
++#ifdef LEGACY_FLAC
+ FLAC__stream_decoder_set_read_callback(stream, FLAC_read_callback);
+ FLAC__stream_decoder_set_write_callback(stream, FLAC_write_callback);
+ FLAC__stream_decoder_set_metadata_callback(stream, FLAC_metadata_callback);
+ FLAC__stream_decoder_set_error_callback(stream, FLAC_error_callback);
+ FLAC__stream_decoder_set_client_data(stream, sample);
+ FLAC__stream_decoder_init(stream);
++#else
++ if(FLAC__stream_decoder_init_stream(stream, FLAC_read_callback, NULL, NULL, NULL, NULL, FLAC_write_callback, FLAC_metadata_callback, FLAC_error_callback, sample) != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
++ FLAC__stream_decoder_delete(stream);
++ free(data);
++ free(sample);
++ return NULL;
++ }
++#endif
+
+ if (flags & PlayAudioStream) {
+ sample->Buffer = malloc(SOUND_BUFFER_SIZE);