pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/games/stratagus Support flac-1.1.3 using a patch from
details: https://anonhg.NetBSD.org/pkgsrc/rev/9ccd3525f3f8
branches: trunk
changeset: 523732:9ccd3525f3f8
user: wiz <wiz%pkgsrc.org@localhost>
date: Fri Jan 12 20:32:48 2007 +0000
description:
Support flac-1.1.3 using a patch from
ftp.altlinux.org /pub/people/thresh
diffstat:
games/stratagus/distinfo | 3 +-
games/stratagus/patches/patch-af | 54 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 56 insertions(+), 1 deletions(-)
diffs (72 lines):
diff -r 204ce870fbc7 -r 9ccd3525f3f8 games/stratagus/distinfo
--- a/games/stratagus/distinfo Fri Jan 12 20:28:03 2007 +0000
+++ b/games/stratagus/distinfo Fri Jan 12 20:32:48 2007 +0000
@@ -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-ab) = cd9235023dcb2bc05828857c8f1d538a0d06eab5
SHA1 (patch-ac) = 78aca58075dd730a799dc9d0fb79ca4c6c010a34
SHA1 (patch-ad) = 20dc341faf2fc160fbbd8b6ae68b1de1a9e21294
+SHA1 (patch-af) = 06e264e6a3fb785285da503f240405dedf851ec5
diff -r 204ce870fbc7 -r 9ccd3525f3f8 games/stratagus/patches/patch-af
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/games/stratagus/patches/patch-af Fri Jan 12 20:32:48 2007 +0000
@@ -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);
Home |
Main Index |
Thread Index |
Old Index