Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Feb 2009 10:53:43 +0100
From:      Ed Schouten <ed@80386.nl>
To:        multimedia@FreeBSD.org
Subject:   Re: libsndfile 1.0.18!
Message-ID:  <20090208095343.GJ1230@hoeg.nl>
In-Reply-To: <20090208092553.GI1230@hoeg.nl>
References:  <20090208092553.GI1230@hoeg.nl>

next in thread | previous in thread | raw e-mail | index | archive | help

--ieONPShpRWd85B+o
Content-Type: multipart/mixed; boundary="ujOy8a1yc0D9aEKa"
Content-Disposition: inline


--ujOy8a1yc0D9aEKa
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Ed Schouten <ed@80386.nl> wrote:
> I'm currently busy (at FOSDEM), but I guess we should bump our port to
> this new version.

Because you're such a good customer: a preliminary patch. It turns out
libsndfile depends on a nonexistent version of libvorbis (?), so I
regexed it to 1.2.0.

--=20
 Ed Schouten <ed@80386.nl>
 WWW: http://80386.nl/

--ujOy8a1yc0D9aEKa
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="sndfile.diff"
Content-Transfer-Encoding: quoted-printable

--- audio/libsndfile/Makefile
+++ audio/libsndfile/Makefile
@@ -6,8 +6,7 @@
 #
=20
 PORTNAME=3D	libsndfile
-PORTVERSION=3D	1.0.17
-PORTREVISION=3D	2
+PORTVERSION=3D	1.0.18
 CATEGORIES=3D	audio
 MASTER_SITES=3D	http://www.mega-nerd.com/libsndfile/
=20
@@ -16,8 +15,7 @@
=20
 USE_GNOME=3D	gnomehack gnometarget pkgconfig
 GNU_CONFIGURE=3D	yes
-CONFIGURE_ARGS=3D	--enable-justsrc \
-		--disable-gcc-pipe \
+CONFIGURE_ARGS=3D	--disable-gcc-pipe \
 		--disable-sqlite
 CONFIGURE_ENV=3D	CPPFLAGS=3D"-isystem /usr/include -isystem ${LOCALBASE}/i=
nclude" \
 		LDFLAGS=3D"-L${LOCALBASE}/lib"
@@ -25,19 +23,23 @@
=20
 MAN1=3D		sndfile-convert.1 sndfile-info.1 sndfile-play.1
=20
-OPTIONS=3D	FLAC "Enable flac support" On
+OPTIONS=3D	EXTERNAL "Enable FLAC and Ogg Vorbis support" on
=20
 .include <bsd.port.pre.mk>
=20
-.if !defined(WITHOUT_FLAC)
-LIB_DEPENDS+=3D	FLAC.10:${PORTSDIR}/audio/flac
-CONFIGURE_ARGS+=3D--enable-flac
+.if defined(WITHOUT_EXTERNAL)
+CONFIGURE_ARGS+=3D--disable-external-libs
 .else
-CONFIGURE_ARGS+=3D--disable-flac
+LIB_DEPENDS+=3D	FLAC.10:${PORTSDIR}/audio/flac \
+		vorbis.4:${PORTSDIR}/audio/libvorbis
 .endif
=20
 post-patch:
 	@${REINPLACE_CMD} -e '/^SUBDIRS =3D/s/ doc / /g' ${WRKSRC}/Makefile.in
+	@${REINPLACE_CMD} \
+	    -e 's/vorbis >=3D 1\.2\.1/vorbis >=3D 1.2.0/g' \
+	    -e 's/vorbisenc >=3D 1\.2\.1/vorbisenc >=3D 1.2.0/g' \
+	    ${WRKSRC}/configure
=20
 post-install:
 .if !defined(NOPORTDOCS)
--- audio/libsndfile/distinfo
+++ audio/libsndfile/distinfo
@@ -1,3 +1,3 @@
-MD5 (libsndfile-1.0.17.tar.gz) =3D 2d126c35448503f6dbe33934d9581f6b
-SHA256 (libsndfile-1.0.17.tar.gz) =3D 1792e4e60386b450ef8ec07c756e8f3ecfe9=
6ebda7d0b09148da5f436d065ef2
-SIZE (libsndfile-1.0.17.tar.gz) =3D 819456
+MD5 (libsndfile-1.0.18.tar.gz) =3D 9fde6efb1b75ef38398acf856f252416
+SHA256 (libsndfile-1.0.18.tar.gz) =3D c0821534a8510982d26b3085b148d9091ded=
e53780733515eb49c99a65da293a
+SIZE (libsndfile-1.0.18.tar.gz) =3D 923666
--- audio/libsndfile/files/patch-examples_sndfile-play.c
+++ audio/libsndfile/files/patch-examples_sndfile-play.c
@@ -1,29 +0,0 @@
---- examples/sndfile-play.c.orig	Thu Oct 14 18:07:25 2004
-+++ examples/sndfile-play.c	Thu Oct 14 18:11:13 2004
-@@ -34,7 +34,7 @@
- 	#include <sys/time.h>
- #endif
-=20
--#if defined (__linux__)
-+#if defined (__linux__) || defined (__FreeBSD__)
- 	#include 	<fcntl.h>
- 	#include 	<sys/ioctl.h>
- 	#include 	<sys/soundcard.h>
-@@ -326,7 +326,7 @@
- **	Linux/OSS functions for playing a sound.
- */
-=20
--#if defined (__linux__)
-+#if defined (__linux__) || defined (__FreeBSD__)
-=20
- static	int	linux_open_dsp_device (int channels, int srate) ;
-=20
-@@ -869,7 +869,7 @@
- 		return 1 ;
- 		} ;
-=20
--#if defined (__linux__)
-+#if defined (__linux__) || defined(__FreeBSD__)
- 	#if HAVE_ALSA_ASOUNDLIB_H
- 		if (access ("/proc/asound/cards", R_OK) =3D=3D 0)
- 			alsa_play (argc, argv) ;
--- audio/libsndfile/files/patch-src_flac.c
+++ audio/libsndfile/files/patch-src_flac.c
@@ -1,501 +0,0 @@
---- src/flac.c.orig	2006-08-31 11:22:19.000000000 +0200
-+++ src/flac.c	2008-03-28 17:07:29.000000000 +0100
-@@ -46,6 +46,13 @@
- #include	"sfendian.h"
- #include	"float_cast.h"
-=20
-+/* FLAC 1.1.3 has FLAC_API_VERSION_CURRENT =3D=3D 8 */
-+#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8
-+#define LEGACY_FLAC
-+#else
-+#undef LEGACY_FLAC
-+#endif
-+
- /*-----------------------------------------------------------------------=
-------
- ** Private static functions.
- */
-@@ -60,8 +67,14 @@
- } PFLAC_PCM ;
-=20
- typedef struct
--{	FLAC__SeekableStreamDecoder *fsd ;
-+{
-+#ifdef LEGACY_FLAC
-+	FLAC__SeekableStreamDecoder *fsd ;
- 	FLAC__SeekableStreamEncoder *fse ;
-+#else
-+	FLAC__StreamDecoder *fsd ;
-+	FLAC__StreamEncoder *fse ;
-+#endif
- 	PFLAC_PCM pcmtype ;
- 	void* ptr ;
- 	unsigned pos, len, remain ;
-@@ -108,6 +121,7 @@
- static int flac_command (SF_PRIVATE *psf, int command, void *data, int da=
tasize) ;
-=20
- /* Decoder Callbacks */
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamDecoderReadStatus sf_flac_read_callback (const=
 FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer [], unsigned *byte=
s, void *client_data) ;
- static FLAC__SeekableStreamDecoderSeekStatus sf_flac_seek_callback (const=
 FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, v=
oid *client_data) ;
- static FLAC__SeekableStreamDecoderTellStatus sf_flac_tell_callback (const=
 FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, =
void *client_data) ;
-@@ -116,13 +130,29 @@
- static FLAC__StreamDecoderWriteStatus sf_flac_write_callback (const FLAC_=
_SeekableStreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int3=
2 * const buffer [], void *client_data) ;
- static void sf_flac_meta_callback (const FLAC__SeekableStreamDecoder *dec=
oder, const FLAC__StreamMetadata *metadata, void *client_data) ;
- static void sf_flac_error_callback (const FLAC__SeekableStreamDecoder *de=
coder, FLAC__StreamDecoderErrorStatus status, void *client_data) ;
-+#else
-+static FLAC__StreamDecoderReadStatus sf_flac_read_callback (const FLAC__S=
treamDecoder *decoder, FLAC__byte buffer [], size_t *bytes, void *client_da=
ta) ;
-+static FLAC__StreamDecoderSeekStatus sf_flac_seek_callback (const FLAC__S=
treamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data=
) ;
-+static FLAC__StreamDecoderTellStatus sf_flac_tell_callback (const FLAC__S=
treamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_dat=
a) ;
-+static FLAC__StreamDecoderLengthStatus sf_flac_length_callback (const FLA=
C__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data) ;
-+static FLAC__bool sf_flac_eof_callback (const FLAC__StreamDecoder *decode=
r, void *client_data) ;
-+static FLAC__StreamDecoderWriteStatus sf_flac_write_callback (const FLAC_=
_StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * cons=
t buffer [], void *client_data) ;
-+static void sf_flac_meta_callback (const FLAC__StreamDecoder *decoder, co=
nst FLAC__StreamMetadata *metadata, void *client_data) ;
-+static void sf_flac_error_callback (const FLAC__StreamDecoder *decoder, F=
LAC__StreamDecoderErrorStatus status, void *client_data) ;
-+#endif
-=20
- /* Encoder Callbacks */
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamEncoderSeekStatus sf_flac_enc_seek_callback (c=
onst FLAC__SeekableStreamEncoder *encoder, FLAC__uint64 absolute_byte_offse=
t, void *client_data) ;
- #ifdef HAVE_FLAC_1_1_1
- static FLAC__SeekableStreamEncoderTellStatus sf_flac_enc_tell_callback (c=
onst FLAC__SeekableStreamEncoder *encoder, FLAC__uint64 *absolute_byte_offs=
et, void *client_data) ;
- #endif
- static FLAC__StreamEncoderWriteStatus sf_flac_enc_write_callback (const F=
LAC__SeekableStreamEncoder *encoder, const FLAC__byte buffer [], unsigned b=
ytes, unsigned samples, unsigned current_frame, void *client_data) ;
-+#else
-+static FLAC__StreamEncoderSeekStatus sf_flac_enc_seek_callback (const FLA=
C__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_=
data) ;
-+static FLAC__StreamEncoderTellStatus sf_flac_enc_tell_callback (const FLA=
C__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client=
_data) ;
-+static FLAC__StreamEncoderWriteStatus sf_flac_enc_write_callback (const F=
LAC__StreamEncoder *encoder, const FLAC__byte buffer [], size_t bytes, unsi=
gned samples, unsigned current_frame, void *client_data) ;
-+#endif
-=20
- static const int legal_sample_rates [] =3D
- {	8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000
-@@ -283,51 +313,99 @@
- } /* flac_buffer_copy */
-=20
-=20
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamDecoderReadStatus
- sf_flac_read_callback (const FLAC__SeekableStreamDecoder * UNUSED (decode=
r), FLAC__byte buffer [], unsigned *bytes, void *client_data)
-+#else
-+static FLAC__StreamDecoderReadStatus
-+sf_flac_read_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC=
__byte buffer [], size_t *bytes, void *client_data)
-+#endif
- {	SF_PRIVATE *psf =3D (SF_PRIVATE*) client_data ;
-=20
- 	*bytes =3D psf_fread (buffer, 1, *bytes, psf) ;
- 	if (*bytes > 0 && psf->error =3D=3D 0)
-+#ifdef LEGACY_FLAC
- 		return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK ;
-=20
-     return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR ;
-+#else
-+		return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE ;
-+
-+    return FLAC__STREAM_DECODER_READ_STATUS_ABORT ;
-+#endif
- } /* sf_flac_read_callback */
-=20
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamDecoderSeekStatus
- sf_flac_seek_callback (const FLAC__SeekableStreamDecoder * UNUSED (decode=
r), FLAC__uint64 absolute_byte_offset, void *client_data)
-+#else
-+static FLAC__StreamDecoderSeekStatus
-+sf_flac_seek_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC=
__uint64 absolute_byte_offset, void *client_data)
-+#endif
- {	SF_PRIVATE *psf =3D (SF_PRIVATE*) client_data ;
-=20
- 	psf_fseek (psf, absolute_byte_offset, SEEK_SET) ;
- 	if (psf->error)
-+#ifdef LEGACY_FLAC
- 		return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR ;
-=20
- 	return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK ;
-+#else
-+		return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR ;
-+
-+	return FLAC__STREAM_DECODER_SEEK_STATUS_OK ;
-+#endif
- } /* sf_flac_seek_callback */
-=20
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamDecoderTellStatus
- sf_flac_tell_callback (const FLAC__SeekableStreamDecoder * UNUSED (decode=
r), FLAC__uint64 *absolute_byte_offset, void *client_data)
-+#else
-+static FLAC__StreamDecoderTellStatus
-+sf_flac_tell_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC=
__uint64 *absolute_byte_offset, void *client_data)
-+#endif
- {	SF_PRIVATE *psf =3D (SF_PRIVATE*) client_data ;
-=20
- 	*absolute_byte_offset =3D psf_ftell (psf) ;
- 	if (psf->error)
-+#ifdef LEGACY_FLAC
- 		return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR ;
-=20
- 	return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK ;
-+#else
-+		return FLAC__STREAM_DECODER_TELL_STATUS_ERROR ;
-+
-+	return FLAC__STREAM_DECODER_TELL_STATUS_OK ;
-+#endif
- } /* sf_flac_tell_callback */
-=20
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamDecoderLengthStatus
- sf_flac_length_callback (const FLAC__SeekableStreamDecoder * UNUSED (deco=
der), FLAC__uint64 *stream_length, void *client_data)
-+#else
-+static FLAC__StreamDecoderLengthStatus
-+sf_flac_length_callback (const FLAC__StreamDecoder * UNUSED (decoder), FL=
AC__uint64 *stream_length, void *client_data)
-+#endif
- {	SF_PRIVATE *psf =3D (SF_PRIVATE*) client_data ;
-=20
- 	if ((*stream_length =3D psf->filelength) =3D=3D 0)
-+#ifdef LEGACY_FLAC
- 		return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR ;
-=20
- 	return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK ;
-+#else
-+		return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR ;
-+
-+	return FLAC__STREAM_DECODER_LENGTH_STATUS_OK ;
-+#endif
- } /* sf_flac_length_callback */
-=20
- static FLAC__bool
-+#ifdef LEGACY_FLAC
- sf_flac_eof_callback (const FLAC__SeekableStreamDecoder *UNUSED (decoder)=
, void *client_data)
-+#else
-+sf_flac_eof_callback (const FLAC__StreamDecoder *UNUSED (decoder), void *=
client_data)
-+#endif
- {	SF_PRIVATE *psf =3D (SF_PRIVATE*) client_data ;
-=20
- 	if (psf_ftell (psf) =3D=3D psf->filelength)
-@@ -337,7 +415,11 @@
- } /* sf_flac_eof_callback */
-=20
- static FLAC__StreamDecoderWriteStatus
-+#ifdef LEGACY_FLAC
- sf_flac_write_callback (const FLAC__SeekableStreamDecoder * UNUSED (decod=
er), const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *c=
lient_data)
-+#else
-+sf_flac_write_callback (const FLAC__StreamDecoder * UNUSED (decoder), con=
st FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_da=
ta)
-+#endif
- {	SF_PRIVATE *psf =3D (SF_PRIVATE*) client_data ;
- 	FLAC_PRIVATE* pflac =3D (FLAC_PRIVATE*) psf->codec_data ;
-=20
-@@ -353,7 +435,27 @@
- } /* sf_flac_write_callback */
-=20
- static void
-+sf_flac_meta_getvorbiscomment (SF_PRIVATE *psf, int str_type, const FLAC_=
_StreamMetadata *metadata, const char *tag)
-+{
-+	int i;
-+	const char *value, *s;
-+
-+	i =3D FLAC__metadata_object_vorbiscomment_find_entry_from(metadata, 0, t=
ag);
-+	if (i >=3D 0) {
-+		value =3D metadata->data.vorbis_comment.comments[i].entry;
-+		if ((s =3D strchr(value, '=3D')) !=3D NULL)
-+			value =3D s + 1;
-+	=09
-+		psf_store_string (psf, str_type, value);
-+	}
-+}
-+
-+static void
-+#ifdef LEGACY_FLAC
- sf_flac_meta_callback (const FLAC__SeekableStreamDecoder * UNUSED (decode=
r), const FLAC__StreamMetadata *metadata, void *client_data)
-+#else
-+sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), cons=
t FLAC__StreamMetadata *metadata, void *client_data)
-+#endif
- {	SF_PRIVATE *psf =3D (SF_PRIVATE*) client_data ;
-=20
- 	switch (metadata->type)
-@@ -378,6 +480,10 @@
- 				} ;
- 			break ;
-=20
-+		case FLAC__METADATA_TYPE_VORBIS_COMMENT :
-+			sf_flac_meta_getvorbiscomment (psf, SF_STR_ARTIST, metadata, "artist");
-+			sf_flac_meta_getvorbiscomment (psf, SF_STR_TITLE, metadata, "title");
-+			break;
- 		default :
- 			psf_log_printf (psf, "sf_flac_meta_callback : metadata-type %d not yet=
 implemented.\n", metadata->type) ;
- 		break ;
-@@ -387,7 +493,11 @@
- } /* sf_flac_meta_callback */
-=20
- static void
-+#ifdef LEGACY_FLAC
- sf_flac_error_callback (const FLAC__SeekableStreamDecoder * UNUSED (decod=
er), FLAC__StreamDecoderErrorStatus status, void *client_data)
-+#else
-+sf_flac_error_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLA=
C__StreamDecoderErrorStatus status, void *client_data)
-+#endif
- {	SF_PRIVATE *psf =3D (SF_PRIVATE*) client_data ;
-=20
- 	psf_log_printf (psf, "ERROR : %s\n", FLAC__StreamDecoderErrorStatusStrin=
g [status]) ;
-@@ -407,17 +517,29 @@
- 	return ;
- } /* sf_flac_error_callback */
-=20
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamEncoderSeekStatus
- sf_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder * UNUSED (en=
coder), FLAC__uint64 absolute_byte_offset, void *client_data)
-+#else
-+static FLAC__StreamEncoderSeekStatus
-+sf_flac_enc_seek_callback (const FLAC__StreamEncoder * UNUSED (encoder), =
FLAC__uint64 absolute_byte_offset, void *client_data)
-+#endif
- {	SF_PRIVATE *psf =3D (SF_PRIVATE*) client_data ;
-=20
- 	psf_fseek (psf, absolute_byte_offset, SEEK_SET) ;
- 	if (psf->error)
-+#ifdef LEGACY_FLAC
- 		return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_ERROR ;
-=20
-     return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_OK ;
-+#else
-+		return FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR ;
-+
-+    return FLAC__STREAM_ENCODER_SEEK_STATUS_OK ;
-+#endif
- } /* sf_flac_enc_seek_callback */
-=20
-+#ifdef LEGACY_FLAC
- #ifdef HAVE_FLAC_1_1_1
- static FLAC__SeekableStreamEncoderTellStatus
- sf_flac_enc_tell_callback (const FLAC__SeekableStreamEncoder *UNUSED (enc=
oder), FLAC__uint64 *absolute_byte_offset, void *client_data)
-@@ -430,9 +552,25 @@
- 	return FLAC__SEEKABLE_STREAM_ENCODER_TELL_STATUS_OK ;
- } /* sf_flac_enc_tell_callback */
- #endif
-+#else
-+static FLAC__StreamEncoderTellStatus
-+sf_flac_enc_tell_callback (const FLAC__StreamEncoder *UNUSED (encoder), F=
LAC__uint64 *absolute_byte_offset, void *client_data)
-+{	SF_PRIVATE *psf =3D (SF_PRIVATE*) client_data ;
-+
-+	*absolute_byte_offset =3D psf_ftell (psf) ;
-+	if (psf->error)
-+		return FLAC__STREAM_ENCODER_TELL_STATUS_ERROR ;
-+
-+	return FLAC__STREAM_ENCODER_TELL_STATUS_OK ;
-+} /* sf_flac_enc_tell_callback */
-+#endif
-=20
- static FLAC__StreamEncoderWriteStatus
-+#ifdef LEGACY_FLAC
- sf_flac_enc_write_callback (const FLAC__SeekableStreamEncoder * UNUSED (e=
ncoder), const FLAC__byte buffer [], unsigned bytes, unsigned UNUSED (sampl=
es), unsigned UNUSED (current_frame), void *client_data)
-+#else
-+sf_flac_enc_write_callback (const FLAC__StreamEncoder * UNUSED (encoder),=
 const FLAC__byte buffer [], size_t bytes, unsigned UNUSED (samples), unsig=
ned UNUSED (current_frame), void *client_data)
-+#endif
- {	SF_PRIVATE *psf =3D (SF_PRIVATE*) client_data ;
-=20
- 	if (psf_fwrite (buffer, 1, bytes, psf) =3D=3D bytes && psf->error =3D=3D=
 0)
-@@ -509,15 +647,27 @@
- 		return 0 ;
-=20
- 	if (psf->mode =3D=3D SFM_WRITE)
--	{	FLAC__seekable_stream_encoder_finish (pflac->fse) ;
-+	{
-+#ifdef LEGACY_FLAC
-+		FLAC__seekable_stream_encoder_finish (pflac->fse) ;
- 		FLAC__seekable_stream_encoder_delete (pflac->fse) ;
-+#else
-+		FLAC__stream_encoder_finish (pflac->fse) ;
-+		FLAC__stream_encoder_delete (pflac->fse) ;
-+#endif
- 		if (pflac->encbuffer)
- 			free (pflac->encbuffer) ;
- 		} ;
-=20
- 	if (psf->mode =3D=3D SFM_READ)
--	{	FLAC__seekable_stream_decoder_finish (pflac->fsd) ;
-+	{
-+#ifdef LEGACY_FLAC
-+		FLAC__seekable_stream_decoder_finish (pflac->fsd) ;
- 		FLAC__seekable_stream_decoder_delete (pflac->fsd) ;
-+#else
-+		FLAC__stream_decoder_finish (pflac->fsd) ;
-+		FLAC__stream_decoder_delete (pflac->fsd) ;
-+#endif
- 		} ;
-=20
- 	for (k =3D 0 ; k < ARRAY_LEN (pflac->rbuffer) ; k++)
-@@ -546,17 +696,6 @@
- 		return SFE_FLAC_BAD_SAMPLE_RATE ;
-=20
- 	psf_fseek (psf, 0, SEEK_SET) ;
--	if ((pflac->fse =3D FLAC__seekable_stream_encoder_new ()) =3D=3D NULL)
--		return SFE_FLAC_NEW_DECODER ;
--	FLAC__seekable_stream_encoder_set_write_callback (pflac->fse, sf_flac_en=
c_write_callback) ;
--	FLAC__seekable_stream_encoder_set_seek_callback (pflac->fse, sf_flac_enc=
_seek_callback) ;
--
--#ifdef HAVE_FLAC_1_1_1
--	FLAC__seekable_stream_encoder_set_tell_callback (pflac->fse, sf_flac_enc=
_tell_callback) ;
--#endif
--	FLAC__seekable_stream_encoder_set_client_data (pflac->fse, psf) ;
--	FLAC__seekable_stream_encoder_set_channels (pflac->fse, psf->sf.channels=
) ;
--	FLAC__seekable_stream_encoder_set_sample_rate (pflac->fse, psf->sf.sampl=
erate) ;
-=20
- 	switch (psf->sf.format & SF_FORMAT_SUBMASK)
- 	{	case SF_FORMAT_PCM_S8 :
-@@ -574,12 +713,36 @@
- 			break ;
- 		} ;
-=20
-+#ifdef LEGACY_FLAC
-+	if ((pflac->fse =3D FLAC__seekable_stream_encoder_new ()) =3D=3D NULL)
-+		return SFE_FLAC_NEW_DECODER ;
-+	FLAC__seekable_stream_encoder_set_write_callback (pflac->fse, sf_flac_en=
c_write_callback) ;
-+	FLAC__seekable_stream_encoder_set_seek_callback (pflac->fse, sf_flac_enc=
_seek_callback) ;
-+
-+#ifdef HAVE_FLAC_1_1_1
-+	FLAC__seekable_stream_encoder_set_tell_callback (pflac->fse, sf_flac_enc=
_tell_callback) ;
-+#endif
-+	FLAC__seekable_stream_encoder_set_client_data (pflac->fse, psf) ;
-+	FLAC__seekable_stream_encoder_set_channels (pflac->fse, psf->sf.channels=
) ;
-+	FLAC__seekable_stream_encoder_set_sample_rate (pflac->fse, psf->sf.sampl=
erate) ;
- 	FLAC__seekable_stream_encoder_set_bits_per_sample (pflac->fse, bps) ;
-=20
- 	if ((bps =3D FLAC__seekable_stream_encoder_init (pflac->fse)) !=3D FLAC_=
_SEEKABLE_STREAM_DECODER_OK)
- 	{	psf_log_printf (psf, "Error : FLAC encoder init returned error : %s\n"=
, FLAC__seekable_stream_encoder_get_resolved_state_string (pflac->fse)) ;
- 		return SFE_FLAC_INIT_DECODER ;
- 		} ;
-+#else
-+	if ((pflac->fse =3D FLAC__stream_encoder_new ()) =3D=3D NULL)
-+		return SFE_FLAC_NEW_DECODER ;
-+	FLAC__stream_encoder_set_channels (pflac->fse, psf->sf.channels) ;
-+	FLAC__stream_encoder_set_sample_rate (pflac->fse, psf->sf.samplerate) ;
-+	FLAC__stream_encoder_set_bits_per_sample (pflac->fse, bps) ;
-+
-+	if ((bps =3D FLAC__stream_encoder_init_stream (pflac->fse, sf_flac_enc_w=
rite_callback, sf_flac_enc_seek_callback, sf_flac_enc_tell_callback, NULL, =
psf)) !=3D FLAC__STREAM_DECODER_INIT_STATUS_OK)
-+	{	psf_log_printf (psf, "Error : FLAC encoder init returned error : %s\n"=
, FLAC__StreamEncoderInitStatusString[bps]) ;
-+		return SFE_FLAC_INIT_DECODER ;
-+		} ;
-+#endif
-=20
- 	if (psf->error =3D=3D 0)
- 		psf->dataoffset =3D psf_ftell (psf) ;
-@@ -593,6 +756,7 @@
- {	FLAC_PRIVATE* pflac =3D (FLAC_PRIVATE*) psf->codec_data ;
-=20
- 	psf_fseek (psf, 0, SEEK_SET) ;
-+#ifdef LEGACY_FLAC
- 	if ((pflac->fsd =3D FLAC__seekable_stream_decoder_new ()) =3D=3D NULL)
- 		return SFE_FLAC_NEW_DECODER ;
-=20
-@@ -603,6 +767,7 @@
- 	FLAC__seekable_stream_decoder_set_eof_callback (pflac->fsd, sf_flac_eof_=
callback) ;
- 	FLAC__seekable_stream_decoder_set_write_callback (pflac->fsd, sf_flac_wr=
ite_callback) ;
- 	FLAC__seekable_stream_decoder_set_metadata_callback (pflac->fsd, sf_flac=
_meta_callback) ;
-+	FLAC__seekable_stream_decoder_set_metadata_respond(pflac->fsd, FLAC__MET=
ADATA_TYPE_VORBIS_COMMENT);
- 	FLAC__seekable_stream_decoder_set_error_callback (pflac->fsd, sf_flac_er=
ror_callback) ;
- 	FLAC__seekable_stream_decoder_set_client_data (pflac->fsd, psf) ;
-=20
-@@ -610,9 +775,24 @@
- 		return SFE_FLAC_INIT_DECODER ;
-=20
- 	FLAC__seekable_stream_decoder_process_until_end_of_metadata (pflac->fsd)=
 ;
-+#else
-+	if ((pflac->fsd =3D FLAC__stream_decoder_new ()) =3D=3D NULL)
-+		return SFE_FLAC_NEW_DECODER ;
-+
-+	FLAC__stream_decoder_set_metadata_respond(pflac->fsd, FLAC__METADATA_TYP=
E_VORBIS_COMMENT);
-+
-+	if (FLAC__stream_decoder_init_stream (pflac->fsd, sf_flac_read_callback,=
 sf_flac_seek_callback, sf_flac_tell_callback, sf_flac_length_callback, sf_=
flac_eof_callback, sf_flac_write_callback, sf_flac_meta_callback, sf_flac_e=
rror_callback, psf) !=3D FLAC__STREAM_DECODER_INIT_STATUS_OK)
-+		return SFE_FLAC_INIT_DECODER ;
-+
-+	FLAC__stream_decoder_process_until_end_of_metadata (pflac->fsd) ;
-+#endif
- 	if (psf->error =3D=3D 0)
- 	{	FLAC__uint64 position ;
-+#ifdef LEGACY_FLAC
- 		FLAC__seekable_stream_decoder_get_decode_position (pflac->fsd, &positio=
n) ;
-+#else
-+		FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ;
-+#endif
- 		psf->dataoffset =3D position ;
- 		} ;
-=20
-@@ -676,10 +856,18 @@
- 		flac_buffer_copy (psf) ;
-=20
- 	while (pflac->pos < pflac->len)
--	{	if (FLAC__seekable_stream_decoder_process_single (pflac->fsd) =3D=3D 0)
-+	{
-+#ifdef LEGACY_FLAC
-+		if (FLAC__seekable_stream_decoder_process_single (pflac->fsd) =3D=3D 0)
- 			break ;
- 		if (FLAC__seekable_stream_decoder_get_state (pflac->fsd) !=3D FLAC__SEE=
KABLE_STREAM_DECODER_OK)
- 			break ;
-+#else
-+		if (FLAC__stream_decoder_process_single (pflac->fsd) =3D=3D 0)
-+			break ;
-+		if (FLAC__stream_decoder_get_state (pflac->fsd) >=3D FLAC__STREAM_DECOD=
ER_END_OF_STREAM)
-+			break ;
-+#endif
- 		} ;
-=20
- 	pflac->ptr =3D NULL ;
-@@ -795,7 +983,11 @@
- 	while (len > 0)
- 	{	writecount =3D (len >=3D bufferlen) ? bufferlen : (int) len ;
- 		convert (ptr + total, buffer, writecount) ;
-+#ifdef LEGACY_FLAC
- 		if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buff=
er, writecount/psf->sf.channels))
-+#else
-+		if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, write=
count/psf->sf.channels))
-+#endif
- 			thiswrite =3D writecount ;
- 		else
- 			break ;
-@@ -837,7 +1029,11 @@
- 	while (len > 0)
- 	{	writecount =3D (len >=3D bufferlen) ? bufferlen : (int) len ;
- 		convert (ptr + total, buffer, writecount) ;
-+#ifdef LEGACY_FLAC
- 		if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buff=
er, writecount/psf->sf.channels))
-+#else
-+		if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, write=
count/psf->sf.channels))
-+#endif
- 			thiswrite =3D writecount ;
- 		else
- 			break ;
-@@ -879,7 +1075,11 @@
- 	while (len > 0)
- 	{	writecount =3D (len >=3D bufferlen) ? bufferlen : (int) len ;
- 		convert (ptr + total, buffer, writecount, psf->norm_float) ;
-+#ifdef LEGACY_FLAC
- 		if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buff=
er, writecount/psf->sf.channels))
-+#else
-+		if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, write=
count/psf->sf.channels))
-+#endif
- 			thiswrite =3D writecount ;
- 		else
- 			break ;
-@@ -1011,7 +1211,11 @@
- 	while (len > 0)
- 	{	writecount =3D (len >=3D bufferlen) ? bufferlen : (int) len ;
- 		convert (ptr + total, buffer, writecount, psf->norm_double) ;
-+#ifdef LEGACY_FLAC
- 		if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buff=
er, writecount/psf->sf.channels))
-+#else
-+		if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, write=
count/psf->sf.channels))
-+#endif
- 			thiswrite =3D writecount ;
- 		else
- 			break ;
-@@ -1131,10 +1335,17 @@
-=20
- 	if (psf->mode =3D=3D SFM_READ)
- 	{	FLAC__uint64 position ;
-+#ifdef LEGACY_FLAC
- 		if (FLAC__seekable_stream_decoder_seek_absolute (pflac->fsd, offset))
- 		{	FLAC__seekable_stream_decoder_get_decode_position (pflac->fsd, &posit=
ion) ;
- 			return offset ;
- 			} ;
-+#else
-+		if (FLAC__stream_decoder_seek_absolute (pflac->fsd, offset))
-+		{	FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ;
-+			return offset ;
-+			} ;
-+#endif
-=20
- 		return ((sf_count_t) -1) ;
- 		} ;
--- audio/libsndfile/pkg-plist
+++ audio/libsndfile/pkg-plist
@@ -1,5 +1,9 @@
+bin/sndfile-cmp
 bin/sndfile-convert
 bin/sndfile-info
+bin/sndfile-jackplay
+bin/sndfile-metadata-get
+bin/sndfile-metadata-set
 bin/sndfile-play
 bin/sndfile-regtest
 include/sndfile.h
@@ -28,11 +32,6 @@
 %%PORTDOCS%%%%DOCSDIR%%/octave.html
 %%PORTDOCS%%%%DOCSDIR%%/pkgconfig.html
 %%PORTDOCS%%%%DOCSDIR%%/sndfile_info.html
+%%PORTDOCS%%%%DOCSDIR%%/tutorial.html
 %%PORTDOCS%%%%DOCSDIR%%/win32.html
-share/octave/site/m/sndfile_load.m
-share/octave/site/m/sndfile_play.m
-share/octave/site/m/sndfile_save.m
-@dirrmtry share/octave/site/m
-@dirrmtry share/octave/site
-@dirrmtry share/octave
 %%PORTDOCS%%@dirrm %%DOCSDIR%%

--ujOy8a1yc0D9aEKa--

--ieONPShpRWd85B+o
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkmOq6cACgkQ52SDGA2eCwXxtACeKM/oZuc+LUK6RJYlBGjk04Az
jEcAn32kpcndJk4geIscCTtMtMQhA+aZ
=oKcg
-----END PGP SIGNATURE-----

--ieONPShpRWd85B+o--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090208095343.GJ1230>