diff options
author | Michael Nottebrock <lofi@FreeBSD.org> | 2007-10-15 17:39:53 +0000 |
---|---|---|
committer | Michael Nottebrock <lofi@FreeBSD.org> | 2007-10-15 17:39:53 +0000 |
commit | 343151a0cfb771f2aefd80a17b709ede0d900668 (patch) | |
tree | b60820b2641cc98f7177155dddb8cab4292230e5 /audio | |
parent | - Port was building stuffs on post-patch: target, fix it using do build: [1] (diff) |
Patch to support the new FLAC API as of FLAC 1.1.3.
Submitted by: naddy
Notes
Notes:
svn path=/head/; revision=201509
Diffstat (limited to 'audio')
-rw-r--r-- | audio/ices0/files/patch-configure | 128 | ||||
-rw-r--r-- | audio/ices0/files/patch-src_in_flac.c | 86 |
2 files changed, 211 insertions, 3 deletions
diff --git a/audio/ices0/files/patch-configure b/audio/ices0/files/patch-configure index e196604755d7..2186643ebb22 100644 --- a/audio/ices0/files/patch-configure +++ b/audio/ices0/files/patch-configure @@ -1,5 +1,5 @@ ---- configure.orig Thu Sep 16 00:06:59 2004 -+++ configure Thu Sep 16 00:15:56 2004 +--- configure.orig.orig Sat Aug 28 21:03:47 2004 ++++ configure Mon Oct 15 19:24:28 2007 @@ -22725,6 +22725,12 @@ if test "$have_faad" != "no" @@ -35,7 +35,129 @@ fi fi -@@ -22995,6 +23007,12 @@ +@@ -22851,18 +22863,18 @@ + LDFLAGS="$LDFLAGS -L$with_flac/lib" + fi + +- if test "${ac_cv_header_faad_h+set}" = set; then +- echo "$as_me:$LINENO: checking for faad.h" >&5 +-echo $ECHO_N "checking for faad.h... $ECHO_C" >&6 +-if test "${ac_cv_header_faad_h+set}" = set; then ++ if test "${ac_cv_header_FLAC_stream_decoder_h+set}" = set; then ++ echo "$as_me:$LINENO: checking for FLAC/stream_decoder.h" >&5 ++echo $ECHO_N "checking for FLAC/stream_decoder.h... $ECHO_C" >&6 ++if test "${ac_cv_header_FLAC_stream_decoder_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + fi +-echo "$as_me:$LINENO: result: $ac_cv_header_faad_h" >&5 +-echo "${ECHO_T}$ac_cv_header_faad_h" >&6 ++echo "$as_me:$LINENO: result: $ac_cv_header_FLAC_stream_decoder_h" >&5 ++echo "${ECHO_T}$ac_cv_header_FLAC_stream_decoder_h" >&6 + else + # Is the header compilable? +-echo "$as_me:$LINENO: checking faad.h usability" >&5 +-echo $ECHO_N "checking faad.h usability... $ECHO_C" >&6 ++echo "$as_me:$LINENO: checking FLAC/stream_decoder.h usability" >&5 ++echo $ECHO_N "checking FLAC/stream_decoder.h usability... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +@@ -22870,7 +22882,7 @@ + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + $ac_includes_default +-#include <faad.h> ++#include <FLAC/stream_decoder.h> + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +@@ -22906,15 +22918,15 @@ + echo "${ECHO_T}$ac_header_compiler" >&6 + + # Is the header present? +-echo "$as_me:$LINENO: checking faad.h presence" >&5 +-echo $ECHO_N "checking faad.h presence... $ECHO_C" >&6 ++echo "$as_me:$LINENO: checking FLAC/stream_decoder.h presence" >&5 ++echo $ECHO_N "checking FLAC/stream_decoder.h presence... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ +-#include <faad.h> ++#include <FLAC/stream_decoder.h> + _ACEOF + if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +@@ -22948,25 +22960,25 @@ + # So? What about this header? + case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) +- { echo "$as_me:$LINENO: WARNING: faad.h: accepted by the compiler, rejected by the preprocessor!" >&5 +-echo "$as_me: WARNING: faad.h: accepted by the compiler, rejected by the preprocessor!" >&2;} +- { echo "$as_me:$LINENO: WARNING: faad.h: proceeding with the compiler's result" >&5 +-echo "$as_me: WARNING: faad.h: proceeding with the compiler's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: FLAC/stream_decoder.h: accepted by the compiler, rejected by the preprocessor!" >&5 ++echo "$as_me: WARNING: FLAC/stream_decoder.h: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { echo "$as_me:$LINENO: WARNING: FLAC/stream_decoder.h: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: FLAC/stream_decoder.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) +- { echo "$as_me:$LINENO: WARNING: faad.h: present but cannot be compiled" >&5 +-echo "$as_me: WARNING: faad.h: present but cannot be compiled" >&2;} +- { echo "$as_me:$LINENO: WARNING: faad.h: check for missing prerequisite headers?" >&5 +-echo "$as_me: WARNING: faad.h: check for missing prerequisite headers?" >&2;} +- { echo "$as_me:$LINENO: WARNING: faad.h: see the Autoconf documentation" >&5 +-echo "$as_me: WARNING: faad.h: see the Autoconf documentation" >&2;} +- { echo "$as_me:$LINENO: WARNING: faad.h: section \"Present But Cannot Be Compiled\"" >&5 +-echo "$as_me: WARNING: faad.h: section \"Present But Cannot Be Compiled\"" >&2;} +- { echo "$as_me:$LINENO: WARNING: faad.h: proceeding with the preprocessor's result" >&5 +-echo "$as_me: WARNING: faad.h: proceeding with the preprocessor's result" >&2;} +- { echo "$as_me:$LINENO: WARNING: faad.h: in the future, the compiler will take precedence" >&5 +-echo "$as_me: WARNING: faad.h: in the future, the compiler will take precedence" >&2;} ++ { echo "$as_me:$LINENO: WARNING: FLAC/stream_decoder.h: present but cannot be compiled" >&5 ++echo "$as_me: WARNING: FLAC/stream_decoder.h: present but cannot be compiled" >&2;} ++ { echo "$as_me:$LINENO: WARNING: FLAC/stream_decoder.h: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: FLAC/stream_decoder.h: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: FLAC/stream_decoder.h: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: FLAC/stream_decoder.h: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: FLAC/stream_decoder.h: section \"Present But Cannot Be Compiled\"" >&5 ++echo "$as_me: WARNING: FLAC/stream_decoder.h: section \"Present But Cannot Be Compiled\"" >&2;} ++ { echo "$as_me:$LINENO: WARNING: FLAC/stream_decoder.h: proceeding with the preprocessor's result" >&5 ++echo "$as_me: WARNING: FLAC/stream_decoder.h: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: FLAC/stream_decoder.h: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: FLAC/stream_decoder.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX + ## ------------------------------- ## +@@ -22977,24 +22989,30 @@ + sed "s/^/$as_me: WARNING: /" >&2 + ;; + esac +-echo "$as_me:$LINENO: checking for faad.h" >&5 +-echo $ECHO_N "checking for faad.h... $ECHO_C" >&6 +-if test "${ac_cv_header_faad_h+set}" = set; then ++echo "$as_me:$LINENO: checking for FLAC/stream_decoder.h" >&5 ++echo $ECHO_N "checking for FLAC/stream_decoder.h... $ECHO_C" >&6 ++if test "${ac_cv_header_FLAC_stream_decoder_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else +- ac_cv_header_faad_h=$ac_header_preproc ++ ac_cv_header_FLAC_stream_decoder_h=$ac_header_preproc + fi +-echo "$as_me:$LINENO: result: $ac_cv_header_faad_h" >&5 +-echo "${ECHO_T}$ac_cv_header_faad_h" >&6 ++echo "$as_me:$LINENO: result: $ac_cv_header_FLAC_stream_decoder_h" >&5 ++echo "${ECHO_T}$ac_cv_header_FLAC_stream_decoder_h" >&6 + + fi +-if test $ac_cv_header_faad_h = yes; then ++if test $ac_cv_header_FLAC_stream_decoder_h = yes; then + have_flac="maybe" + fi + if test "$have_flac" != "no" then diff --git a/audio/ices0/files/patch-src_in_flac.c b/audio/ices0/files/patch-src_in_flac.c new file mode 100644 index 000000000000..7a12748e20b4 --- /dev/null +++ b/audio/ices0/files/patch-src_in_flac.c @@ -0,0 +1,86 @@ +--- src/in_flac.c.orig Sat Jul 31 19:52:24 2004 ++++ src/in_flac.c Mon Oct 15 19:27:01 2007 +@@ -45,9 +45,14 @@ + static int ices_flac_close (input_stream_t* self); + + /* -- FLAC callbacks -- */ ++#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <= 7 ++# define FLAC_BUFSIZE_TYPE unsigned ++#else ++# define FLAC_BUFSIZE_TYPE size_t ++#endif /* !FLAC_API_VERSION_CURRENT || FLAC_API_VERSION_CURRENT <= 7 */ + static FLAC__StreamDecoderReadStatus + flac_read_cb(const FLAC__StreamDecoder* decoder, FLAC__byte buffer[], +- unsigned* bytes, void* client_data); ++ FLAC_BUFSIZE_TYPE* bytes, void* client_data); + static FLAC__StreamDecoderWriteStatus + flac_write_cb(const FLAC__StreamDecoder* decoder, const FLAC__Frame* frame, + const FLAC__int32* const buffer[], void* client_data); +@@ -76,10 +81,32 @@ + return -1; + } + ++#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <= 7 + FLAC__stream_decoder_set_read_callback(decoder, flac_read_cb); + FLAC__stream_decoder_set_write_callback(decoder, flac_write_cb); + FLAC__stream_decoder_set_metadata_callback(decoder, flac_metadata_cb); + FLAC__stream_decoder_set_error_callback(decoder, flac_error_cb); ++ FLAC__stream_decoder_set_client_data(decoder, self); ++ ++ switch (FLAC__stream_decoder_init(decoder)) { ++ case FLAC__STREAM_DECODER_SEARCH_FOR_METADATA: ++ break; ++ case FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR: ++ ices_log_error("Could not allocate memory during FLAC decoder init"); ++ goto errDecoder; ++ default: ++ ices_log_error("Unexpected error during FLAC decoder init"); ++ goto errDecoder; ++ } ++#else ++ if (FLAC__stream_decoder_init_stream(decoder, flac_read_cb, NULL, NULL, NULL, ++ NULL, flac_write_cb, flac_metadata_cb, ++ flac_error_cb, self) ++ != FLAC__STREAM_DECODER_INIT_STATUS_OK) { ++ ices_log_error("ices_flac_open: Error initializing FLAC decoder"); ++ goto errDecoder; ++ } ++#endif /* !FLAC_API_VERSION_CURRENT || FLAC_API_VERSION_CURRENT <= 7 */ + + FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT); + +@@ -87,7 +114,6 @@ + ices_log_error ("Malloc failed in ices_flac_open"); + goto errDecoder; + } +- FLAC__stream_decoder_set_client_data(decoder, self); + + flac_data->decoder = decoder; + flac_data->parsed = 0; +@@ -96,17 +122,6 @@ + + self->data = flac_data; + +- switch (FLAC__stream_decoder_init(decoder)) { +- case FLAC__STREAM_DECODER_SEARCH_FOR_METADATA: +- break; +- case FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR: +- ices_log_error("Could not allocate memory during FLAC decoder init"); +- goto errData; +- default: +- ices_log_error("Unexpected error during FLAC decoder init"); +- goto errData; +- } +- + if (!FLAC__stream_decoder_process_single(decoder)) { + ices_log_error("Could not find FLAC metadata header"); + free(flac_data); +@@ -179,7 +194,7 @@ + /* -- callbacks -- */ + static FLAC__StreamDecoderReadStatus + flac_read_cb(const FLAC__StreamDecoder* decoder, FLAC__byte buffer[], +- unsigned* bytes, void* client_data) ++ FLAC_BUFSIZE_TYPE* bytes, void* client_data) + { + input_stream_t* self = (input_stream_t*)client_data; + flac_in_t* flac_data = (flac_in_t*)self->data; |