summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Gianelloni <wolf31o2@gentoo.org>2006-12-12 22:35:31 +0000
committerChris Gianelloni <wolf31o2@gentoo.org>2006-12-12 22:35:31 +0000
commita4f8468acd9b5f33daed08d72b5074e8a62b471c (patch)
tree33e34b781bb88a78d55f871dc1f7b163304be6a0 /media-libs/sdl-sound
parentrev bump to fix bug #157804 (diff)
downloadgentoo-2-a4f8468acd9b5f33daed08d72b5074e8a62b471c.tar.gz
gentoo-2-a4f8468acd9b5f33daed08d72b5074e8a62b471c.tar.bz2
gentoo-2-a4f8468acd9b5f33daed08d72b5074e8a62b471c.zip
Added patch from Josh Coalson (from FLAC) and closing bug #157849.
(Portage version: 2.1.2_rc2-r2)
Diffstat (limited to 'media-libs/sdl-sound')
-rw-r--r--media-libs/sdl-sound/ChangeLog6
-rw-r--r--media-libs/sdl-sound/files/flac-1.1.3.patch126
-rw-r--r--media-libs/sdl-sound/sdl-sound-1.0.1-r2.ebuild3
3 files changed, 133 insertions, 2 deletions
diff --git a/media-libs/sdl-sound/ChangeLog b/media-libs/sdl-sound/ChangeLog
index fd698be5a237..788a57833e32 100644
--- a/media-libs/sdl-sound/ChangeLog
+++ b/media-libs/sdl-sound/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for media-libs/sdl-sound
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-libs/sdl-sound/ChangeLog,v 1.23 2006/11/07 19:17:30 mr_bones_ Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-libs/sdl-sound/ChangeLog,v 1.24 2006/12/12 22:35:31 wolf31o2 Exp $
+
+ 12 Dec 2006; Chris Gianelloni <wolf31o2@gentoo.org>
+ +files/flac-1.1.3.patch, sdl-sound-1.0.1-r2.ebuild:
+ Added patch from Josh Coalson (from FLAC) and closing bug #157849.
07 Nov 2006; Michael Sterrett <mr_bones_@gentoo.org>
sdl-sound-1.0.1-r1.ebuild, sdl-sound-1.0.1-r2.ebuild:
diff --git a/media-libs/sdl-sound/files/flac-1.1.3.patch b/media-libs/sdl-sound/files/flac-1.1.3.patch
new file mode 100644
index 000000000000..d0ed49194d31
--- /dev/null
+++ b/media-libs/sdl-sound/files/flac-1.1.3.patch
@@ -0,0 +1,126 @@
+diff -u -r SDL_sound-1.0.1/configure.in SDL_sound-1.0.1-flac/configure.in
+--- SDL_sound-1.0.1/configure.in 2003-10-12 20:49:54.000000000 +0200
++++ SDL_sound-1.0.1-flac/configure.in 2006-12-11 20:43:46.546583251 +0100
+@@ -155,9 +155,12 @@
+ dnl FLAC developers tend to break their API with every release, so we're
+ dnl checking for the latest-and-greatest here so we don't have to support
+ dnl obsolete versions.
++dnl Starting with FLAC 1.1.3:
++dnl libFLAC supports Ogg FLAC (no more libOggFLAC) so we also need -logg
++dnl the libFLAC .so version is also #defined in FLAC/export.h
+
+ dnl Hooray for shitty autoconf bugs!
+-x="C__seekable_stream_decoder_process_single"
++x="C__stream_decoder_process_single"
+ flcsym="FLA$x"
+ dnl Check for libFLAC
+ AC_ARG_ENABLE(flac,
+@@ -167,7 +170,7 @@
+ AC_CHECK_HEADER(FLAC/stream_decoder.h, have_flac_hdr=yes)
+ AC_CHECK_LIB(FLAC, $flcsym, have_flac_lib=yes)
+ if test x$have_flac_hdr = xyes -a x$have_flac_lib = xyes; then
+- LIBS="$LIBS -lFLAC"
++ LIBS="$LIBS -lFLAC -logg"
+ AC_DEFINE(SOUND_SUPPORTS_FLAC)
+ fi
+ fi
+diff -u -r SDL_sound-1.0.1/decoders/flac.c SDL_sound-1.0.1-flac/decoders/flac.c
+--- SDL_sound-1.0.1/decoders/flac.c 2003-03-10 23:44:14.000000000 +0100
++++ SDL_sound-1.0.1-flac/decoders/flac.c 2006-12-11 20:43:57.880097062 +0100
+@@ -44,6 +44,16 @@
+ #define __SDL_SOUND_INTERNAL__
+ #include "SDL_sound_internal.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
++
++#ifdef LEGACY_FLAC
+ #include <FLAC/seekable_stream_decoder.h>
+
+ #define D_END_OF_STREAM FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM
+@@ -80,6 +90,34 @@
+ typedef FLAC__SeekableStreamDecoderSeekStatus d_seek_status_t;
+ typedef FLAC__SeekableStreamDecoderTellStatus d_tell_status_t;
+ typedef FLAC__SeekableStreamDecoderLengthStatus d_length_status_t;
++#else
++#include <FLAC/stream_decoder.h>
++
++#define D_END_OF_STREAM FLAC__STREAM_DECODER_END_OF_STREAM
++
++#define d_new() FLAC__stream_decoder_new()
++#define d_process_metadata(x) FLAC__stream_decoder_process_until_end_of_metadata(x)
++#define d_process_one_frame(x) FLAC__stream_decoder_process_single(x)
++#define d_get_state(x) FLAC__stream_decoder_get_state(x)
++#define d_finish(x) FLAC__stream_decoder_finish(x)
++#define d_delete(x) FLAC__stream_decoder_delete(x)
++
++typedef FLAC__StreamDecoder decoder_t;
++typedef FLAC__StreamDecoderReadStatus d_read_status_t;
++
++#define D_SEEK_STATUS_OK FLAC__STREAM_DECODER_SEEK_STATUS_OK
++#define D_SEEK_STATUS_ERROR FLAC__STREAM_DECODER_SEEK_STATUS_ERROR
++#define D_TELL_STATUS_OK FLAC__STREAM_DECODER_TELL_STATUS_OK
++#define D_TELL_STATUS_ERROR FLAC__STREAM_DECODER_TELL_STATUS_ERROR
++#define D_LENGTH_STATUS_OK FLAC__STREAM_DECODER_LENGTH_STATUS_OK
++#define D_LENGTH_STATUS_ERROR FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR
++
++#define d_seek_absolute(x, y) FLAC__stream_decoder_seek_absolute(x, y)
++
++typedef FLAC__StreamDecoderSeekStatus d_seek_status_t;
++typedef FLAC__StreamDecoderTellStatus d_tell_status_t;
++typedef FLAC__StreamDecoderLengthStatus d_length_status_t;
++#endif
+
+ #define D_WRITE_CONTINUE FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE
+ #define D_READ_END_OF_STREAM FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM
+@@ -141,9 +179,15 @@
+ } /* free_flac */
+
+
++#ifdef LEGACY_FLAC
+ static d_read_status_t read_callback(
+ const decoder_t *decoder, FLAC__byte buffer[],
+ unsigned int *bytes, void *client_data)
++#else
++static d_read_status_t read_callback(
++ const decoder_t *decoder, FLAC__byte buffer[],
++ size_t *bytes, void *client_data)
++#endif
+ {
+ flac_t *f = (flac_t *) client_data;
+ Uint32 retval;
+@@ -400,6 +444,7 @@
+ BAIL_MACRO(ERR_OUT_OF_MEMORY, 0);
+ } /* if */
+
++#ifdef LEGACY_FLAC
+ d_set_read_callback(decoder, read_callback);
+ d_set_write_callback(decoder, write_callback);
+ d_set_metadata_callback(decoder, metadata_callback);
+@@ -410,6 +455,7 @@
+ d_set_eof_callback(decoder, eof_callback);
+
+ d_set_client_data(decoder, f);
++#endif
+
+ f->rw = internal->rw;
+ f->sample = sample;
+@@ -418,7 +464,12 @@
+ f->is_flac = 0 /* !!! FIXME: should be "has_extension", not "0". */;
+
+ internal->decoder_private = f;
++ /* really should check the init return value here: */
++#ifdef LEGACY_FLAC
+ d_init(decoder);
++#else
++ FLAC__stream_decoder_init_stream(decoder, read_callback, seek_callback, tell_callback, length_callback, eof_callback, write_callback, metadata_callback, error_callback, f);
++#endif
+
+ sample->flags = SOUND_SAMPLEFLAG_NONE;
+
diff --git a/media-libs/sdl-sound/sdl-sound-1.0.1-r2.ebuild b/media-libs/sdl-sound/sdl-sound-1.0.1-r2.ebuild
index d7a8fe96d261..372e839ba037 100644
--- a/media-libs/sdl-sound/sdl-sound-1.0.1-r2.ebuild
+++ b/media-libs/sdl-sound/sdl-sound-1.0.1-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-libs/sdl-sound/sdl-sound-1.0.1-r2.ebuild,v 1.9 2006/11/08 20:58:14 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-libs/sdl-sound/sdl-sound-1.0.1-r2.ebuild,v 1.10 2006/12/12 22:35:31 wolf31o2 Exp $
WANT_AUTOCONF="latest"
WANT_AUTOMAKE="latest"
@@ -32,6 +32,7 @@ src_unpack() {
unpack ${A}
cd "${S}"
epatch "${FILESDIR}"/gcc331.patch
+ epatch "${FILESDIR}"/flac-1.1.3.patch
eautoreconf
}