summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2007-01-13 15:35:52 +0000
committerwiz <wiz@pkgsrc.org>2007-01-13 15:35:52 +0000
commit3e7b0f1f18cf5a8112f60f2b72403981dc090dad (patch)
treea39c490b96321116445b443d39034da73aea7464
parentd65c641ce6b461dd25fe4fccffd2a019b13c5a19 (diff)
downloadpkgsrc-3e7b0f1f18cf5a8112f60f2b72403981dc090dad.tar.gz
Add support for flac-1.1.3 based on Josh Coalson's patches.
Bump PKGREVISION because previously it would just disable flac support.
-rw-r--r--audio/vorbis-tools/Makefile4
-rw-r--r--audio/vorbis-tools/distinfo15
-rw-r--r--audio/vorbis-tools/patches/patch-ab6
-rw-r--r--audio/vorbis-tools/patches/patch-ac12
-rw-r--r--audio/vorbis-tools/patches/patch-ag19
-rw-r--r--audio/vorbis-tools/patches/patch-ah12
-rw-r--r--audio/vorbis-tools/patches/patch-ai208
-rw-r--r--audio/vorbis-tools/patches/patch-aj171
-rw-r--r--audio/vorbis-tools/patches/patch-ak26
-rw-r--r--audio/vorbis-tools/patches/patch-an83
-rw-r--r--audio/vorbis-tools/patches/patch-ao15
-rw-r--r--audio/vorbis-tools/patches/patch-ap12
-rw-r--r--audio/vorbis-tools/patches/patch-aq13
13 files changed, 582 insertions, 14 deletions
diff --git a/audio/vorbis-tools/Makefile b/audio/vorbis-tools/Makefile
index 234b2650b6a..b4ec4ff7f42 100644
--- a/audio/vorbis-tools/Makefile
+++ b/audio/vorbis-tools/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.44 2007/01/07 12:25:53 wiz Exp $
+# $NetBSD: Makefile,v 1.45 2007/01/13 15:35:52 wiz Exp $
DISTNAME= vorbis-tools-1.1.1
-PKGREVISION= 3
+PKGREVISION= 4
CATEGORIES= audio
MASTER_SITES= http://downloads.xiph.org/releases/vorbis/
diff --git a/audio/vorbis-tools/distinfo b/audio/vorbis-tools/distinfo
index baeac584f32..cf1377681f2 100644
--- a/audio/vorbis-tools/distinfo
+++ b/audio/vorbis-tools/distinfo
@@ -1,11 +1,20 @@
-$NetBSD: distinfo,v 1.18 2006/11/02 07:57:56 wiz Exp $
+$NetBSD: distinfo,v 1.19 2007/01/13 15:35:52 wiz Exp $
SHA1 (vorbis-tools-1.1.1.tar.gz) = a1394b39905b389d72f12c2a9f0c86a33d07a487
RMD160 (vorbis-tools-1.1.1.tar.gz) = ed38929b8a81f833f726e489e55e9f62d5ed69ec
Size (vorbis-tools-1.1.1.tar.gz) = 948837 bytes
SHA1 (patch-aa) = 2adc912765d58b19c1285c12ac0935b860b7da34
-SHA1 (patch-ab) = 6c154334ea5a7a7e76982f0588de30548c802fca
-SHA1 (patch-ac) = 7eb178a2d7a5dbecd83a5df0138c9ab41943251a
+SHA1 (patch-ab) = b706ae0bc9e13c5ccff689aa1451efc782e340e9
+SHA1 (patch-ac) = 65e07de0f0e4de30b6fed374146535adebba5ed6
SHA1 (patch-ad) = 729ca84168ee781335429840ee54a2b894b82f54
SHA1 (patch-ae) = 67bda1581c18dec0e43846f4c39aba35a7b2223e
SHA1 (patch-af) = eafb75d8b9aade62b9862e3df1380f15eba80f47
+SHA1 (patch-ag) = af25e010e1eb350a8614398d312dd0842a207060
+SHA1 (patch-ah) = fa01e42b339fe2cbd5d98c150e0bb618b43fd4a1
+SHA1 (patch-ai) = c44c9b0bec99b0e8a3883c0ef388f6d0856fa11a
+SHA1 (patch-aj) = 8cfa93518f71feb1e85f4db784d5e5c158dcf11e
+SHA1 (patch-ak) = fb0e11d1aff4753fbb3ee9088e6faeb5bcd58ef1
+SHA1 (patch-an) = a6a1aa59f2bf87b2217e827e6309233515d162c2
+SHA1 (patch-ao) = f509dde919b93ddfba0105189cb645c2667ba0e4
+SHA1 (patch-ap) = 4da7c1a2b92dad4a05322b05451a1ac4c34ce2fb
+SHA1 (patch-aq) = 237bbcb6c4d895dcd01f42cae5a48f11d2a695b1
diff --git a/audio/vorbis-tools/patches/patch-ab b/audio/vorbis-tools/patches/patch-ab
index a207a02ca36..cee43285ede 100644
--- a/audio/vorbis-tools/patches/patch-ab
+++ b/audio/vorbis-tools/patches/patch-ab
@@ -1,8 +1,8 @@
-$NetBSD: patch-ab,v 1.6 2003/12/08 14:43:48 wiz Exp $
+$NetBSD: patch-ab,v 1.7 2007/01/13 15:35:52 wiz Exp $
---- ogg123/ogg123.c.orig Tue Sep 2 21:37:05 2003
+--- ogg123/ogg123.c.orig 2005-06-03 10:15:09.000000000 +0000
+++ ogg123/ogg123.c
-@@ -606,7 +606,13 @@ void play (char *source_string)
+@@ -610,7 +610,13 @@ void play (char *source_string)
format->cleanup(decoder);
transport->close(source);
diff --git a/audio/vorbis-tools/patches/patch-ac b/audio/vorbis-tools/patches/patch-ac
index e26e2d04a6e..2b59c61f8ad 100644
--- a/audio/vorbis-tools/patches/patch-ac
+++ b/audio/vorbis-tools/patches/patch-ac
@@ -1,8 +1,8 @@
-$NetBSD: patch-ac,v 1.6 2003/12/08 14:43:48 wiz Exp $
+$NetBSD: patch-ac,v 1.7 2007/01/13 15:35:52 wiz Exp $
---- oggenc/oggenc.c.orig Tue Sep 16 00:04:00 2003
+--- oggenc/oggenc.c.orig 2005-06-03 10:15:10.000000000 +0000
+++ oggenc/oggenc.c
-@@ -640,6 +640,8 @@ static void parse_options(int argc, char
+@@ -659,6 +659,8 @@ static void parse_options(int argc, char
break;
case 'a':
@@ -11,7 +11,7 @@ $NetBSD: patch-ac,v 1.6 2003/12/08 14:43:48 wiz Exp $
opt->artist = realloc(opt->artist, (++opt->artist_count)*sizeof(char *));
opt->artist[opt->artist_count - 1] = strdup(optarg);
break;
-@@ -652,10 +654,14 @@ static void parse_options(int argc, char
+@@ -671,10 +673,14 @@ static void parse_options(int argc, char
opt->comments[opt->comment_count - 1] = strdup(optarg);
break;
case 'd':
@@ -26,7 +26,7 @@ $NetBSD: patch-ac,v 1.6 2003/12/08 14:43:48 wiz Exp $
opt->genre = realloc(opt->genre, (++opt->genre_count)*sizeof(char *));
opt->genre[opt->genre_count - 1] = strdup(optarg);
break;
-@@ -664,6 +670,8 @@ static void parse_options(int argc, char
+@@ -683,6 +689,8 @@ static void parse_options(int argc, char
exit(0);
break;
case 'l':
@@ -35,7 +35,7 @@ $NetBSD: patch-ac,v 1.6 2003/12/08 14:43:48 wiz Exp $
opt->album = realloc(opt->album, (++opt->album_count)*sizeof(char *));
opt->album[opt->album_count - 1] = strdup(optarg);
break;
-@@ -674,6 +682,8 @@ static void parse_options(int argc, char
+@@ -693,6 +701,8 @@ static void parse_options(int argc, char
opt->serial = 0; /* Failed, so just set to zero */
break;
case 't':
diff --git a/audio/vorbis-tools/patches/patch-ag b/audio/vorbis-tools/patches/patch-ag
new file mode 100644
index 00000000000..25cc4975623
--- /dev/null
+++ b/audio/vorbis-tools/patches/patch-ag
@@ -0,0 +1,19 @@
+$NetBSD: patch-ag,v 1.1 2007/01/13 15:35:52 wiz Exp $
+
+--- configure.ac.orig 2005-06-27 09:25:51.000000000 +0000
++++ configure.ac
+@@ -171,13 +171,8 @@ FLAC_LIBS=""
+ if test "x$build_flac" = xyes; then
+ AC_CHECK_LIB(m,log,FLAC_LIBS="-lm")
+ AC_CHECK_LIB(FLAC, [FLAC__stream_decoder_process_single],
+- [have_libFLAC=yes; FLAC_LIBS="-lFLAC $FLAC_LIBS"],
++ [have_libFLAC=yes; FLAC_LIBS="-lFLAC $FLAC_LIBS $OGG_LIBS"],
+ AC_MSG_WARN([libFLAC missing])
+- have_libFLAC=no, [$FLAC_LIBS]
+- )
+- AC_CHECK_LIB(OggFLAC, [OggFLAC__stream_decoder_new],
+- [FLAC_LIBS="-lOggFLAC $FLAC_LIBS $OGG_LIBS"],
+- AC_MSG_WARN([libOggFLAC missing])
+ have_libFLAC=no, [$FLAC_LIBS $OGG_LIBS]
+ )
+ AC_CHECK_HEADER(FLAC/stream_decoder.h,,
diff --git a/audio/vorbis-tools/patches/patch-ah b/audio/vorbis-tools/patches/patch-ah
new file mode 100644
index 00000000000..6fab9e5426d
--- /dev/null
+++ b/audio/vorbis-tools/patches/patch-ah
@@ -0,0 +1,12 @@
+$NetBSD: patch-ah,v 1.1 2007/01/13 15:35:52 wiz Exp $
+
+--- ogg123/Makefile.am.orig 2005-06-13 13:11:44.000000000 +0000
++++ ogg123/Makefile.am
+@@ -1,6 +1,6 @@
+ ## Process this file with automake to produce Makefile.in
+ if HAVE_LIBFLAC
+-flac_sources = flac_format.c easyflac.c easyflac.h
++flac_sources = flac_format.c
+ else
+ flac_sources =
+ endif
diff --git a/audio/vorbis-tools/patches/patch-ai b/audio/vorbis-tools/patches/patch-ai
new file mode 100644
index 00000000000..9ec1366902f
--- /dev/null
+++ b/audio/vorbis-tools/patches/patch-ai
@@ -0,0 +1,208 @@
+$NetBSD: patch-ai,v 1.1 2007/01/13 15:35:52 wiz Exp $
+
+--- ogg123/flac_format.c.orig 2005-06-03 10:15:09.000000000 +0000
++++ ogg123/flac_format.c
+@@ -25,13 +25,23 @@
+ #include "audio.h"
+ #include "format.h"
+ #include "i18n.h"
++#if !defined(FLAC_API_VERSION_CURRENT) || (FLAC_API_VERSION_CURRENT < 8)
++#define NEED_EASYFLAC 1
++#endif
++#if NEED_EASYFLAC
+ #include "easyflac.h"
++#else
++#include <FLAC/stream_decoder.h>
++#endif
+ #include "vorbis_comments.h"
+
+-#define DEFAULT_FLAC_FRAME_SIZE 4608
+-
+ typedef struct {
++#if NEED_EASYFLAC
+ EasyFLAC__StreamDecoder *decoder;
++#else
++ FLAC__StreamDecoder *decoder;
++ int is_oggflac;
++#endif
+ short channels;
+ int rate;
+ int bits_per_sample;
+@@ -67,10 +77,18 @@ format_t oggflac_format;
+
+
+ /* Private functions declarations */
+-FLAC__StreamDecoderReadStatus easyflac_read_callback(const EasyFLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
+-FLAC__StreamDecoderWriteStatus easyflac_write_callback(const EasyFLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
+-void easyflac_metadata_callback(const EasyFLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
+-void easyflac_error_callback(const EasyFLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
++#if NEED_EASYFLAC
++static FLAC__StreamDecoderReadStatus easyflac_read_callback(const EasyFLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
++static FLAC__StreamDecoderWriteStatus easyflac_write_callback(const EasyFLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
++static void easyflac_metadata_callback(const EasyFLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
++static void easyflac_error_callback(const EasyFLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
++#else
++static FLAC__StreamDecoderReadStatus read_callback(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data);
++static FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
++static void metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
++static void error_callback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
++static FLAC__bool eof_callback(const FLAC__StreamDecoder *decoder, void *client_data);
++#endif
+
+ void resize_buffer(flac_private_t *flac, int newchannels, int newsamples);
+ /*void copy_comments (vorbis_comment *v_comments, FLAC__StreamMetadata_VorbisComment *f_comments);*/
+@@ -155,6 +173,7 @@ decoder_t* flac_init (data_source_t *sou
+ private->buf_start = 0;
+
+ /* Setup FLAC decoder */
++#if NEED_EASYFLAC
+ if (oggflac_can_decode(source)) {
+ decoder->format = &oggflac_format;
+ private->decoder = EasyFLAC__stream_decoder_new(1);
+@@ -172,13 +191,39 @@ decoder_t* flac_init (data_source_t *sou
+ EasyFLAC__set_metadata_respond(private->decoder, FLAC__METADATA_TYPE_STREAMINFO);
+ EasyFLAC__set_metadata_respond(private->decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT);
+ EasyFLAC__init(private->decoder);
++#else
++ if (oggflac_can_decode(source)) {
++ private->is_oggflac = 1;
++ decoder->format = &oggflac_format;
++ } else {
++ private->is_oggflac = 0;
++ decoder->format = &flac_format;
++ }
++ private->decoder = FLAC__stream_decoder_new();
++
++ FLAC__stream_decoder_set_md5_checking(private->decoder, false);
++ FLAC__stream_decoder_set_metadata_respond(private->decoder, FLAC__METADATA_TYPE_STREAMINFO);
++ FLAC__stream_decoder_set_metadata_respond(private->decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT);
++ if(private->is_oggflac)
++ FLAC__stream_decoder_init_ogg_stream(private->decoder, read_callback, /*seek_callback=*/0, /*tell_callback=*/0, /*length_callback=*/0, eof_callback, write_callback, metadata_callback, error_callback, decoder);
++ else
++ FLAC__stream_decoder_init_stream(private->decoder, read_callback, /*seek_callback=*/0, /*tell_callback=*/0, /*length_callback=*/0, eof_callback, write_callback, metadata_callback, error_callback, decoder);
++#endif
+
+ /* Callback will set the total samples and sample rate */
++#if NEED_EASYFLAC
+ EasyFLAC__process_until_end_of_metadata(private->decoder);
++#else
++ FLAC__stream_decoder_process_until_end_of_metadata(private->decoder);
++#endif
+
+ /* Callback will set the number of channels and resize the
+ audio buffer */
++#if NEED_EASYFLAC
+ EasyFLAC__process_single(private->decoder);
++#else
++ FLAC__stream_decoder_process_single(private->decoder);
++#endif
+
+ /* FLAC API returns signed samples on all streams */
+ decoder->actual_fmt.signed_sample = 1;
+@@ -241,11 +286,19 @@ int flac_read (decoder_t *decoder, void
+ realsamples += copy;
+ }
+ else if (!priv->eos) {
++#if NEED_EASYFLAC
+ ret = EasyFLAC__process_single(priv->decoder);
+ if (!ret ||
+ EasyFLAC__get_state(priv->decoder)
+ == FLAC__STREAM_DECODER_END_OF_STREAM)
+ priv->eos = 1; /* Bail out! */
++#else
++ ret = FLAC__stream_decoder_process_single(priv->decoder);
++ if (!ret ||
++ FLAC__stream_decoder_get_state(priv->decoder)
++ == FLAC__STREAM_DECODER_END_OF_STREAM)
++ priv->eos = 1; /* Bail out! */
++#endif
+ } else
+ break;
+ }
+@@ -311,8 +364,13 @@ void flac_cleanup (decoder_t *decoder)
+ free(priv->buf[i]);
+
+ free(priv->buf);
++#if NEED_EASYFLAC
+ EasyFLAC__finish(priv->decoder);
+ EasyFLAC__stream_decoder_delete(priv->decoder);
++#else
++ FLAC__stream_decoder_finish(priv->decoder);
++ FLAC__stream_decoder_delete(priv->decoder);
++#endif
+
+ free(decoder->private);
+ free(decoder);
+@@ -342,7 +400,11 @@ format_t oggflac_format = {
+
+
+
++#if NEED_EASYFLAC
+ FLAC__StreamDecoderReadStatus easyflac_read_callback(const EasyFLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data)
++#else
++FLAC__StreamDecoderReadStatus read_callback(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data)
++#endif
+ {
+ decoder_t *e_decoder = client_data;
+ flac_private_t *priv = e_decoder->private;
+@@ -363,7 +425,11 @@ FLAC__StreamDecoderReadStatus easyflac_r
+ }
+
+
++#if NEED_EASYFLAC
+ FLAC__StreamDecoderWriteStatus easyflac_write_callback(const EasyFLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
++#else
++FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
++#endif
+ {
+ decoder_t *e_decoder = client_data;
+ flac_private_t *priv = e_decoder->private;
+@@ -389,7 +455,11 @@ FLAC__StreamDecoderWriteStatus easyflac_
+ }
+
+
++#if NEED_EASYFLAC
+ void easyflac_metadata_callback(const EasyFLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
++#else
++void metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
++#endif
+ {
+ decoder_t *e_decoder = client_data;
+ flac_private_t *priv = e_decoder->private;
+@@ -409,12 +479,24 @@ void easyflac_metadata_callback(const Ea
+ }
+
+
++#if NEED_EASYFLAC
+ void easyflac_error_callback(const EasyFLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
++#else
++void error_callback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
++#endif
+ {
+
+
+ }
+
++#if !NEED_EASYFLAC
++FLAC__bool eof_callback(const FLAC__StreamDecoder *decoder, void *client_data)
++{
++ // can't get this info from the data source, so we'll let the read callback handle it
++ return false;
++}
++#endif
++
+
+ void resize_buffer(flac_private_t *flac, int newchannels, int newsamples)
+ {
+@@ -457,7 +539,11 @@ void print_flac_stream_info (decoder_t *
+
+
+
++#if NEED_EASYFLAC
+ if (EasyFLAC__is_oggflac(priv->decoder))
++#else
++ if (priv->is_oggflac)
++#endif
+ cb->printf_metadata(decoder->callback_arg, 2,
+ _("Ogg FLAC stream: %d bits, %d channel, %ld Hz"),
+ priv->bits_per_sample,
diff --git a/audio/vorbis-tools/patches/patch-aj b/audio/vorbis-tools/patches/patch-aj
new file mode 100644
index 00000000000..6f8e2996163
--- /dev/null
+++ b/audio/vorbis-tools/patches/patch-aj
@@ -0,0 +1,171 @@
+$NetBSD: patch-aj,v 1.1 2007/01/13 15:35:52 wiz Exp $
+
+--- oggenc/flac.c.orig 2005-06-03 10:15:10.000000000 +0000
++++ oggenc/flac.c
+@@ -20,15 +20,21 @@
+ #include "platform.h"
+ #include "resample.h"
+
+-#define DEFAULT_FLAC_FRAME_SIZE 4608
++#if NEED_EASYFLAC
++static FLAC__StreamDecoderReadStatus easyflac_read_callback(const EasyFLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
++static FLAC__StreamDecoderWriteStatus easyflac_write_callback(const EasyFLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
++static void easyflac_metadata_callback(const EasyFLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
++static void easyflac_error_callback(const EasyFLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
++#else
++static FLAC__StreamDecoderReadStatus read_callback(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data);
++static FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
++static void metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
++static void error_callback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
++static FLAC__bool eof_callback(const FLAC__StreamDecoder *decoder, void *client_data);
++#endif
+
+-FLAC__StreamDecoderReadStatus easyflac_read_callback(const EasyFLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
+-FLAC__StreamDecoderWriteStatus easyflac_write_callback(const EasyFLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
+-void easyflac_metadata_callback(const EasyFLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
+-void easyflac_error_callback(const EasyFLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
+-
+-void resize_buffer(flacfile *flac, int newchannels, int newsamples);
+-void copy_comments (vorbis_comment *v_comments, FLAC__StreamMetadata_VorbisComment *f_comments);
++static void resize_buffer(flacfile *flac, int newchannels, int newsamples);
++static void copy_comments (vorbis_comment *v_comments, FLAC__StreamMetadata_VorbisComment *f_comments);
+
+
+ int flac_id(unsigned char *buf, int len)
+@@ -76,6 +82,7 @@ int flac_open(FILE *in, oe_enc_opt *opt,
+ flac->in = in;
+
+ /* Setup FLAC decoder */
++#if NEED_EASYFLAC
+ flac->decoder = EasyFLAC__stream_decoder_new(oggflac_id(oldbuf, buflen));
+ EasyFLAC__set_client_data(flac->decoder, flac);
+ EasyFLAC__set_read_callback(flac->decoder, &easyflac_read_callback);
+@@ -85,13 +92,31 @@ int flac_open(FILE *in, oe_enc_opt *opt,
+ EasyFLAC__set_metadata_respond(flac->decoder, FLAC__METADATA_TYPE_STREAMINFO);
+ EasyFLAC__set_metadata_respond(flac->decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT);
+ EasyFLAC__init(flac->decoder);
++#else
++ flac->decoder = FLAC__stream_decoder_new();
++ FLAC__stream_decoder_set_md5_checking(flac->decoder, false);
++ FLAC__stream_decoder_set_metadata_respond(flac->decoder, FLAC__METADATA_TYPE_STREAMINFO);
++ FLAC__stream_decoder_set_metadata_respond(flac->decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT);
++ if(oggflac_id(oldbuf, buflen))
++ FLAC__stream_decoder_init_ogg_stream(flac->decoder, read_callback, /*seek_callback=*/0, /*tell_callback=*/0, /*length_callback=*/0, eof_callback, write_callback, metadata_callback, error_callback, flac);
++ else
++ FLAC__stream_decoder_init_stream(flac->decoder, read_callback, /*seek_callback=*/0, /*tell_callback=*/0, /*length_callback=*/0, eof_callback, write_callback, metadata_callback, error_callback, flac);
++#endif
+
+ /* Callback will set the total samples and sample rate */
++#if NEED_EASYFLAC
+ EasyFLAC__process_until_end_of_metadata(flac->decoder);
++#else
++ FLAC__stream_decoder_process_until_end_of_metadata(flac->decoder);
++#endif
+
+ /* Callback will set the number of channels and resize the
+ audio buffer */
++#if NEED_EASYFLAC
+ EasyFLAC__process_single(flac->decoder);
++#else
++ FLAC__stream_decoder_process_single(flac->decoder);
++#endif
+
+ /* Copy format info for caller */
+ opt->rate = flac->rate;
+@@ -133,11 +158,19 @@ long flac_read(void *in, float **buffer,
+ }
+ else if (!flac->eos)
+ {
++#if NEED_EASYFLAC
+ ret = EasyFLAC__process_single(flac->decoder);
+ if (!ret ||
+ EasyFLAC__get_state(flac->decoder)
+ == FLAC__STREAM_DECODER_END_OF_STREAM)
+ flac->eos = 1; /* Bail out! */
++#else
++ ret = FLAC__stream_decoder_process_single(flac->decoder);
++ if (!ret ||
++ FLAC__stream_decoder_get_state(flac->decoder)
++ == FLAC__STREAM_DECODER_END_OF_STREAM)
++ flac->eos = 1; /* Bail out! */
++#endif
+ } else
+ break;
+ }
+@@ -157,13 +190,22 @@ void flac_close(void *info)
+ free(flac->buf);
+ free(flac->oldbuf);
+ free(flac->comments);
++#if NEED_EASYFLAC
+ EasyFLAC__finish(flac->decoder);
+ EasyFLAC__stream_decoder_delete(flac->decoder);
++#else
++ FLAC__stream_decoder_finish(flac->decoder);
++ FLAC__stream_decoder_delete(flac->decoder);
++#endif
+ free(flac);
+ }
+
+
++#if NEED_EASYFLAC
+ FLAC__StreamDecoderReadStatus easyflac_read_callback(const EasyFLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data)
++#else
++FLAC__StreamDecoderReadStatus read_callback(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data)
++#endif
+ {
+ flacfile *flac = (flacfile *) client_data;
+ int i = 0;
+@@ -200,7 +242,11 @@ FLAC__StreamDecoderReadStatus easyflac_r
+ return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
+ }
+
++#if NEED_EASYFLAC
+ FLAC__StreamDecoderWriteStatus easyflac_write_callback(const EasyFLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
++#else
++FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
++#endif
+ {
+ flacfile *flac = (flacfile *) client_data;
+ int samples = frame->header.blocksize;
+@@ -221,7 +267,11 @@ FLAC__StreamDecoderWriteStatus easyflac_
+ return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
+ }
+
++#if NEED_EASYFLAC
+ void easyflac_metadata_callback(const EasyFLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
++#else
++void metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
++#endif
+ {
+ flacfile *flac = (flacfile *) client_data;
+
+@@ -240,11 +290,24 @@ void easyflac_metadata_callback(const Ea
+ }
+ }
+
++#if NEED_EASYFLAC
+ void easyflac_error_callback(const EasyFLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
++#else
++void error_callback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
++#endif
++{
++ flacfile *flac = (flacfile *) client_data;
++
++}
++
++#if !NEED_EASYFLAC
++FLAC__bool eof_callback(const FLAC__StreamDecoder *decoder, void *client_data)
+ {
+ flacfile *flac = (flacfile *) client_data;
+
++ return feof(flac->in)? true : false;
+ }
++#endif
+
+
+ void resize_buffer(flacfile *flac, int newchannels, int newsamples)
+@@ -292,4 +355,3 @@ void copy_comments (vorbis_comment *v_co
+ free(comment);
+ }
+ }
+-
diff --git a/audio/vorbis-tools/patches/patch-ak b/audio/vorbis-tools/patches/patch-ak
new file mode 100644
index 00000000000..f8d61697901
--- /dev/null
+++ b/audio/vorbis-tools/patches/patch-ak
@@ -0,0 +1,26 @@
+$NetBSD: patch-ak,v 1.1 2007/01/13 15:35:52 wiz Exp $
+
+--- oggenc/flac.h.orig 2005-06-03 10:15:10.000000000 +0000
++++ oggenc/flac.h
+@@ -5,10 +5,21 @@
+ #include "encode.h"
+ #include "audio.h"
+ #include <stdio.h>
++#include <FLAC/stream_decoder.h>
++#if !defined(FLAC_API_VERSION_CURRENT) || (FLAC_API_VERSION_CURRENT < 8)
++#include <OggFLAC/stream_decoder.h>
++#define NEED_EASYFLAC 1
++#endif
++#if NEED_EASYFLAC
+ #include "easyflac.h"
++#endif
+
+ typedef struct {
++#if NEED_EASYFLAC
+ EasyFLAC__StreamDecoder *decoder;
++#else
++ FLAC__StreamDecoder *decoder;
++#endif
+ short channels;
+ int rate;
+ long totalsamples; /* per channel, of course */
diff --git a/audio/vorbis-tools/patches/patch-an b/audio/vorbis-tools/patches/patch-an
new file mode 100644
index 00000000000..87ed9fdf0d8
--- /dev/null
+++ b/audio/vorbis-tools/patches/patch-an
@@ -0,0 +1,83 @@
+$NetBSD: patch-an,v 1.1 2007/01/13 15:35:52 wiz Exp $
+
+--- configure.orig 2005-06-27 09:29:29.000000000 +0000
++++ configure
+@@ -27521,78 +27521,6 @@ echo "$as_me: WARNING: libFLAC missing"
+ have_libFLAC=no
+ fi
+
+- echo "$as_me:$LINENO: checking for OggFLAC__stream_decoder_new in -lOggFLAC" >&5
+-echo $ECHO_N "checking for OggFLAC__stream_decoder_new in -lOggFLAC... $ECHO_C" >&6
+-if test "${ac_cv_lib_OggFLAC_OggFLAC__stream_decoder_new+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+- ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lOggFLAC $FLAC_LIBS $OGG_LIBS
+- $LIBS"
+-cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-
+-/* Override any gcc2 internal prototype to avoid an error. */
+-#ifdef __cplusplus
+-extern "C"
+-#endif
+-/* We use char because int might match the return type of a gcc2
+- builtin and then its argument prototype would still apply. */
+-char OggFLAC__stream_decoder_new ();
+-int
+-main ()
+-{
+-OggFLAC__stream_decoder_new ();
+- ;
+- return 0;
+-}
+-_ACEOF
+-rm -f conftest.$ac_objext conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>conftest.er1
+- ac_status=$?
+- grep -v '^ *+' conftest.er1 >conftest.err
+- rm -f conftest.er1
+- cat conftest.err >&5
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; } &&
+- { ac_try='test -s conftest$ac_exeext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- ac_cv_lib_OggFLAC_OggFLAC__stream_decoder_new=yes
+-else
+- echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-ac_cv_lib_OggFLAC_OggFLAC__stream_decoder_new=no
+-fi
+-rm -f conftest.err conftest.$ac_objext \
+- conftest$ac_exeext conftest.$ac_ext
+-LIBS=$ac_check_lib_save_LIBS
+-fi
+-echo "$as_me:$LINENO: result: $ac_cv_lib_OggFLAC_OggFLAC__stream_decoder_new" >&5
+-echo "${ECHO_T}$ac_cv_lib_OggFLAC_OggFLAC__stream_decoder_new" >&6
+-if test $ac_cv_lib_OggFLAC_OggFLAC__stream_decoder_new = yes; then
+- FLAC_LIBS="-lOggFLAC $FLAC_LIBS $OGG_LIBS"
+-else
+- { echo "$as_me:$LINENO: WARNING: libOggFLAC missing" >&5
+-echo "$as_me: WARNING: libOggFLAC missing" >&2;}
+- have_libFLAC=no
+-fi
+-
+ 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
diff --git a/audio/vorbis-tools/patches/patch-ao b/audio/vorbis-tools/patches/patch-ao
new file mode 100644
index 00000000000..c214aff9031
--- /dev/null
+++ b/audio/vorbis-tools/patches/patch-ao
@@ -0,0 +1,15 @@
+$NetBSD: patch-ao,v 1.1 2007/01/13 15:35:52 wiz Exp $
+
+--- ogg123/Makefile.in.orig 2005-06-27 09:29:11.000000000 +0000
++++ ogg123/Makefile.in
+@@ -63,8 +63,8 @@ am__ogg123_SOURCES_DIST = audio.c buffer
+ format.h ogg123.h playlist.h status.h transport.h \
+ vorbis_comments.h flac_format.c easyflac.c easyflac.h \
+ speex_format.c
+-@HAVE_LIBFLAC_TRUE@am__objects_1 = flac_format.$(OBJEXT) \
+-@HAVE_LIBFLAC_TRUE@ easyflac.$(OBJEXT)
++@HAVE_LIBFLAC_TRUE@am__objects_1 = \
++@HAVE_LIBFLAC_TRUE@ flac_format.$(OBJEXT)
+ @HAVE_LIBSPEEX_TRUE@am__objects_2 = speex_format.$(OBJEXT)
+ am_ogg123_OBJECTS = audio.$(OBJEXT) buffer.$(OBJEXT) \
+ callbacks.$(OBJEXT) cfgfile_options.$(OBJEXT) \
diff --git a/audio/vorbis-tools/patches/patch-ap b/audio/vorbis-tools/patches/patch-ap
new file mode 100644
index 00000000000..c4faf2d0e93
--- /dev/null
+++ b/audio/vorbis-tools/patches/patch-ap
@@ -0,0 +1,12 @@
+$NetBSD: patch-ap,v 1.1 2007/01/13 15:35:52 wiz Exp $
+
+--- oggenc/Makefile.am.orig 2005-06-13 13:11:44.000000000 +0000
++++ oggenc/Makefile.am
+@@ -1,6 +1,6 @@
+ ## Process this file with automake to produce Makefile.in
+ if HAVE_LIBFLAC
+-flac_sources = flac.c flac.h easyflac.c easyflac.h
++flac_sources = flac.c flac.h
+ else
+ flac_sources =
+ endif
diff --git a/audio/vorbis-tools/patches/patch-aq b/audio/vorbis-tools/patches/patch-aq
new file mode 100644
index 00000000000..f748cf261f2
--- /dev/null
+++ b/audio/vorbis-tools/patches/patch-aq
@@ -0,0 +1,13 @@
+$NetBSD: patch-aq,v 1.1 2007/01/13 15:35:52 wiz Exp $
+
+--- oggenc/Makefile.in.orig 2005-06-27 09:29:13.000000000 +0000
++++ oggenc/Makefile.in
+@@ -56,7 +56,7 @@ PROGRAMS = $(bin_PROGRAMS)
+ am__oggenc_SOURCES_DIST = flac.c flac.h easyflac.c easyflac.h oggenc.c \
+ audio.c encode.c platform.c audio.h encode.h platform.h \
+ resample.c resample.h
+-@HAVE_LIBFLAC_TRUE@am__objects_1 = flac.$(OBJEXT) easyflac.$(OBJEXT)
++@HAVE_LIBFLAC_TRUE@am__objects_1 = flac.$(OBJEXT)
+ am_oggenc_OBJECTS = $(am__objects_1) oggenc.$(OBJEXT) audio.$(OBJEXT) \
+ encode.$(OBJEXT) platform.$(OBJEXT) resample.$(OBJEXT)
+ oggenc_OBJECTS = $(am_oggenc_OBJECTS)