adapt FLAC support to the FLAC 1.1.3+ API; ok mgrimm@
This commit is contained in:
parent
1cf89e98a3
commit
68ccde1d59
@ -1,8 +1,8 @@
|
|||||||
# $OpenBSD: Makefile,v 1.11 2007/09/16 02:53:13 merdely Exp $
|
# $OpenBSD: Makefile,v 1.12 2007/09/18 18:29:14 naddy Exp $
|
||||||
|
|
||||||
COMMENT= library that handles the decoding of sound file formats
|
COMMENT= library that handles the decoding of sound file formats
|
||||||
DISTNAME= SDL_sound-1.0.1
|
DISTNAME= SDL_sound-1.0.1
|
||||||
PKGNAME= ${DISTNAME:L:S/_/-/}p4
|
PKGNAME= ${DISTNAME:L:S/_/-/}p5
|
||||||
SHARED_LIBS= SDL_sound 2.0
|
SHARED_LIBS= SDL_sound 2.0
|
||||||
CATEGORIES= devel audio
|
CATEGORIES= devel audio
|
||||||
MASTER_SITES= http://offload1.icculus.org/SDL_sound/downloads/
|
MASTER_SITES= http://offload1.icculus.org/SDL_sound/downloads/
|
||||||
@ -23,7 +23,7 @@ LIB_DEPENDS+= physfs::devel/physfs \
|
|||||||
smpeg.>=1.3::devel/smpeg \
|
smpeg.>=1.3::devel/smpeg \
|
||||||
mikmod.>=2.4::audio/libmikmod \
|
mikmod.>=2.4::audio/libmikmod \
|
||||||
vorbis.>=2.0,vorbisenc.>=2.0,vorbisfile.>=3.0::audio/libvorbis \
|
vorbis.>=2.0,vorbisenc.>=2.0,vorbisfile.>=3.0::audio/libvorbis \
|
||||||
FLAC.>=5.2::audio/flac \
|
FLAC.>=8::audio/flac \
|
||||||
speex.>=2.2::audio/speex
|
speex.>=2.2::audio/speex
|
||||||
|
|
||||||
USE_X11= Yes
|
USE_X11= Yes
|
||||||
|
@ -1,6 +1,33 @@
|
|||||||
$OpenBSD: patch-configure,v 1.2 2007/05/02 19:01:07 naddy Exp $
|
$OpenBSD: patch-configure,v 1.3 2007/09/18 18:29:14 naddy Exp $
|
||||||
--- configure.orig Sun Oct 12 20:54:57 2003
|
--- configure.orig Sun Oct 12 20:54:57 2003
|
||||||
+++ configure Wed May 2 19:01:01 2007
|
+++ configure Sat Sep 15 20:53:00 2007
|
||||||
|
@@ -7089,7 +7089,7 @@ EOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
-x="C__seekable_stream_decoder_process_single"
|
||||||
|
+x="C__stream_decoder_process_single"
|
||||||
|
flcsym="FLA$x"
|
||||||
|
# Check whether --enable-flac or --disable-flac was given.
|
||||||
|
if test "${enable_flac+set}" = set; then
|
||||||
|
@@ -7147,7 +7147,7 @@ if eval "test \"\${$as_ac_Lib+set}\" = set"; then
|
||||||
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
|
else
|
||||||
|
ac_check_lib_save_LIBS=$LIBS
|
||||||
|
-LIBS="-lFLAC $LIBS"
|
||||||
|
+LIBS="-lFLAC -logg $LIBS"
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
#line 7152 "configure"
|
||||||
|
#include "confdefs.h"
|
||||||
|
@@ -7195,7 +7195,7 @@ if test `eval echo '${'$as_ac_Lib'}'` = yes; then
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test x$have_flac_hdr = xyes -a x$have_flac_lib = xyes; then
|
||||||
|
- LIBS="$LIBS -lFLAC"
|
||||||
|
+ LIBS="$LIBS -lFLAC -logg"
|
||||||
|
cat >>confdefs.h <<\EOF
|
||||||
|
#define SOUND_SUPPORTS_FLAC 1
|
||||||
|
EOF
|
||||||
@@ -7363,16 +7363,11 @@ int main (int argc, char *argv[])
|
@@ -7363,16 +7363,11 @@ int main (int argc, char *argv[])
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
96
devel/sdl-sound/patches/patch-decoders_flac_c
Normal file
96
devel/sdl-sound/patches/patch-decoders_flac_c
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
$OpenBSD: patch-decoders_flac_c,v 1.1 2007/09/18 18:29:14 naddy Exp $
|
||||||
|
--- decoders/flac.c.orig Mon Mar 10 23:44:14 2003
|
||||||
|
+++ decoders/flac.c Sat Sep 15 21:50:42 2007
|
||||||
|
@@ -44,42 +44,33 @@
|
||||||
|
#define __SDL_SOUND_INTERNAL__
|
||||||
|
#include "SDL_sound_internal.h"
|
||||||
|
|
||||||
|
-#include <FLAC/seekable_stream_decoder.h>
|
||||||
|
+#include <FLAC/stream_decoder.h>
|
||||||
|
|
||||||
|
-#define D_END_OF_STREAM FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM
|
||||||
|
+#define D_END_OF_STREAM FLAC__STREAM_DECODER_END_OF_STREAM
|
||||||
|
|
||||||
|
-#define d_new() FLAC__seekable_stream_decoder_new()
|
||||||
|
-#define d_init(x) FLAC__seekable_stream_decoder_init(x)
|
||||||
|
-#define d_process_metadata(x) FLAC__seekable_stream_decoder_process_until_end_of_metadata(x)
|
||||||
|
-#define d_process_one_frame(x) FLAC__seekable_stream_decoder_process_single(x)
|
||||||
|
-#define d_get_state(x) FLAC__seekable_stream_decoder_get_state(x)
|
||||||
|
-#define d_finish(x) FLAC__seekable_stream_decoder_finish(x)
|
||||||
|
-#define d_delete(x) FLAC__seekable_stream_decoder_delete(x)
|
||||||
|
-#define d_set_read_callback(x, y) FLAC__seekable_stream_decoder_set_read_callback(x, y)
|
||||||
|
-#define d_set_write_callback(x, y) FLAC__seekable_stream_decoder_set_write_callback(x, y)
|
||||||
|
-#define d_set_metadata_callback(x, y) FLAC__seekable_stream_decoder_set_metadata_callback(x, y)
|
||||||
|
-#define d_set_error_callback(x, y) FLAC__seekable_stream_decoder_set_error_callback(x, y)
|
||||||
|
-#define d_set_client_data(x, y) FLAC__seekable_stream_decoder_set_client_data(x, y)
|
||||||
|
+#define d_new() FLAC__stream_decoder_new()
|
||||||
|
+#define d_init(a,b,c,d,e,f,g,h,i,j) FLAC__stream_decoder_init_stream(a,b,c,d,e,f,g,h,i,j)
|
||||||
|
+#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__SeekableStreamDecoder decoder_t;
|
||||||
|
-typedef FLAC__SeekableStreamDecoderReadStatus d_read_status_t;
|
||||||
|
+typedef FLAC__StreamDecoder decoder_t;
|
||||||
|
+typedef FLAC__StreamDecoderReadStatus d_read_status_t;
|
||||||
|
|
||||||
|
-#define D_SEEK_STATUS_OK FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK
|
||||||
|
-#define D_SEEK_STATUS_ERROR FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR
|
||||||
|
-#define D_TELL_STATUS_OK FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK
|
||||||
|
-#define D_TELL_STATUS_ERROR FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR
|
||||||
|
-#define D_LENGTH_STATUS_OK FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK
|
||||||
|
-#define D_LENGTH_STATUS_ERROR FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR
|
||||||
|
+#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_set_seek_callback(x, y) FLAC__seekable_stream_decoder_set_seek_callback(x, y)
|
||||||
|
-#define d_set_tell_callback(x, y) FLAC__seekable_stream_decoder_set_tell_callback(x, y)
|
||||||
|
-#define d_set_length_callback(x, y) FLAC__seekable_stream_decoder_set_length_callback(x, y)
|
||||||
|
-#define d_set_eof_callback(x, y) FLAC__seekable_stream_decoder_set_eof_callback(x, y)
|
||||||
|
-#define d_seek_absolute(x, y) FLAC__seekable_stream_decoder_seek_absolute(x, y)
|
||||||
|
+#define d_seek_absolute(x, y) FLAC__stream_decoder_seek_absolute(x, y)
|
||||||
|
|
||||||
|
-typedef FLAC__SeekableStreamDecoderSeekStatus d_seek_status_t;
|
||||||
|
-typedef FLAC__SeekableStreamDecoderTellStatus d_tell_status_t;
|
||||||
|
-typedef FLAC__SeekableStreamDecoderLengthStatus d_length_status_t;
|
||||||
|
+typedef FLAC__StreamDecoderSeekStatus d_seek_status_t;
|
||||||
|
+typedef FLAC__StreamDecoderTellStatus d_tell_status_t;
|
||||||
|
+typedef FLAC__StreamDecoderLengthStatus d_length_status_t;
|
||||||
|
|
||||||
|
#define D_WRITE_CONTINUE FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE
|
||||||
|
#define D_READ_END_OF_STREAM FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM
|
||||||
|
@@ -400,17 +391,6 @@ static int FLAC_open(Sound_Sample *sample, const char
|
||||||
|
BAIL_MACRO(ERR_OUT_OF_MEMORY, 0);
|
||||||
|
} /* if */
|
||||||
|
|
||||||
|
- d_set_read_callback(decoder, read_callback);
|
||||||
|
- d_set_write_callback(decoder, write_callback);
|
||||||
|
- d_set_metadata_callback(decoder, metadata_callback);
|
||||||
|
- d_set_error_callback(decoder, error_callback);
|
||||||
|
- d_set_seek_callback(decoder, seek_callback);
|
||||||
|
- d_set_tell_callback(decoder, tell_callback);
|
||||||
|
- d_set_length_callback(decoder, length_callback);
|
||||||
|
- d_set_eof_callback(decoder, eof_callback);
|
||||||
|
-
|
||||||
|
- d_set_client_data(decoder, f);
|
||||||
|
-
|
||||||
|
f->rw = internal->rw;
|
||||||
|
f->sample = sample;
|
||||||
|
f->decoder = decoder;
|
||||||
|
@@ -418,7 +398,9 @@ static int FLAC_open(Sound_Sample *sample, const char
|
||||||
|
f->is_flac = 0 /* !!! FIXME: should be "has_extension", not "0". */;
|
||||||
|
|
||||||
|
internal->decoder_private = f;
|
||||||
|
- d_init(decoder);
|
||||||
|
+ d_init(decoder, read_callback, seek_callback, tell_callback,
|
||||||
|
+ length_callback, eof_callback, write_callback, metadata_callback,
|
||||||
|
+ error_callback, f);
|
||||||
|
|
||||||
|
sample->flags = SOUND_SAMPLEFLAG_NONE;
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user