This commit is contained in:
parent
4885466ba5
commit
7360db1396
@ -1,11 +0,0 @@
|
|||||||
--- configure.ac
|
|
||||||
+++ configure.ac
|
|
||||||
@@ -31,6 +31,8 @@ AC_LANG([C])
|
|
||||||
SHARED_VERSION_INFO="1:17:0"
|
|
||||||
|
|
||||||
AC_PROG_CC
|
|
||||||
+AM_PROG_CC_C_O
|
|
||||||
+AC_PROG_CXX
|
|
||||||
AM_PROG_LIBTOOL
|
|
||||||
|
|
||||||
AC_CHECK_PROG(autogen, autogen, yes, no)
|
|
@ -1,38 +0,0 @@
|
|||||||
--- src/flac.c-dist 2007-09-20 15:19:03.000000000 +0200
|
|
||||||
+++ src/flac.c 2007-09-20 15:19:45.000000000 +0200
|
|
||||||
@@ -50,7 +50,7 @@ flac_open (SF_PRIVATE *psf)
|
|
||||||
** Private static functions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
-#define ENC_BUFFER_SIZE 4096
|
|
||||||
+#define ENC_BUFFER_SIZE 8192
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{ PFLAC_PCM_SHORT = 0,
|
|
||||||
@@ -172,6 +172,17 @@ flac_buffer_copy (SF_PRIVATE *psf)
|
|
||||||
const FLAC__int32* const *buffer = pflac->wbuffer ;
|
|
||||||
unsigned i = 0, j, offset ;
|
|
||||||
|
|
||||||
+ /*
|
|
||||||
+ ** frame->header.blocksize is variable and we're using a constant blocksize
|
|
||||||
+ ** of FLAC__MAX_BLOCK_SIZE.
|
|
||||||
+ ** Check our assumptions here.
|
|
||||||
+ */
|
|
||||||
+ if (frame->header.blocksize > FLAC__MAX_BLOCK_SIZE)
|
|
||||||
+ { psf_log_printf (psf, "Ooops : frame->header.blocksize (%d) > FLAC__MAX_BLOCK_SIZE (%d)\n", __func__, __LINE__, frame->header.blocksize, FLAC__MAX_BLOCK_SIZE) ;
|
|
||||||
+ psf->error = SFE_INTERNAL ;
|
|
||||||
+ return 0 ;
|
|
||||||
+ } ;
|
|
||||||
+
|
|
||||||
if (pflac->ptr == NULL)
|
|
||||||
{ /*
|
|
||||||
** Not sure why this code is here and not elsewhere.
|
|
||||||
@@ -180,7 +191,7 @@ flac_buffer_copy (SF_PRIVATE *psf)
|
|
||||||
pflac->bufferbackup = SF_TRUE ;
|
|
||||||
for (i = 0 ; i < frame->header.channels ; i++)
|
|
||||||
{ if (pflac->rbuffer [i] == NULL)
|
|
||||||
- pflac->rbuffer [i] = calloc (frame->header.blocksize, sizeof (FLAC__int32)) ;
|
|
||||||
+ pflac->rbuffer [i] = calloc (FLAC__MAX_BLOCK_SIZE, sizeof (FLAC__int32)) ;
|
|
||||||
memcpy (pflac->rbuffer [i], buffer [i], frame->header.blocksize * sizeof (FLAC__int32)) ;
|
|
||||||
} ;
|
|
||||||
pflac->wbuffer = (const FLAC__int32* const*) pflac->rbuffer ;
|
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:76f7f9e8a9e81e63aa6581862cb44baa10dc91630957139be20bad473193038b
|
|
||||||
size 627070
|
|
3
libsndfile-1.0.18.tar.bz2
Normal file
3
libsndfile-1.0.18.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:30ab8021e203e36e3c3208f59f7bcba5b7b747b75553e61e6ea2f0de7c2770ac
|
||||||
|
size 728257
|
@ -1,18 +0,0 @@
|
|||||||
--- acinclude.m4
|
|
||||||
+++ acinclude.m4
|
|
||||||
@@ -254,7 +254,6 @@
|
|
||||||
fi
|
|
||||||
|
|
||||||
)
|
|
||||||
-]
|
|
||||||
|
|
||||||
if test $ac_cv_c_byte_order = big ; then
|
|
||||||
ac_cv_c_big_endian=1
|
|
||||||
@@ -273,6 +272,7 @@
|
|
||||||
AC_MSG_WARN([[*****************************************************************]])
|
|
||||||
fi
|
|
||||||
|
|
||||||
+]
|
|
||||||
)# AC_C_FIND_ENDIAN
|
|
||||||
|
|
||||||
|
|
@ -1,29 +1,16 @@
|
|||||||
--- examples/cooledit-fixer.c
|
--- examples/sndfile-to-text.c-dist 2009-02-09 12:36:49.000000000 +0100
|
||||||
+++ examples/cooledit-fixer.c
|
+++ examples/sndfile-to-text.c 2009-02-09 12:37:05.000000000 +0100
|
||||||
@@ -48,7 +48,9 @@
|
@@ -101,6 +101,7 @@ main (int argc, char * argv [])
|
||||||
usage_exit (argv [0]) ;
|
return 1 ;
|
||||||
|
} ;
|
||||||
for (k = 1 ; k < argc ; k++)
|
|
||||||
- { if ((sndfile = sf_open (argv [k], SFM_READ, &sfinfo)) == NULL)
|
|
||||||
+ {
|
|
||||||
+ memset(&sfinfo, 0, sizeof(sfinfo));
|
|
||||||
+ if ((sndfile = sf_open (argv [k], SFM_READ, &sfinfo)) == NULL)
|
|
||||||
{ /*-printf ("Failed to open : %s\n", argv [k]) ;-*/
|
|
||||||
continue ;
|
|
||||||
} ;
|
|
||||||
--- examples/generate.c
|
|
||||||
+++ examples/generate.c
|
|
||||||
@@ -84,6 +84,7 @@
|
|
||||||
k = 16 - strlen (outfilename) ;
|
|
||||||
PUT_DOTS (k) ;
|
|
||||||
|
|
||||||
+ memset(&sfinfo, 0, sizeof(sfinfo));
|
+ memset(&sfinfo, 0, sizeof(sfinfo));
|
||||||
if (! (infile = sf_open (infilename, SFM_READ, &sfinfo)))
|
if ((infile = sf_open (infilename, SFM_READ, &sfinfo)) == NULL)
|
||||||
{ printf ("Error : could not open file : %s\n", infilename) ;
|
{ printf ("Not able to open input file %s.\n", infilename) ;
|
||||||
puts (sf_strerror (NULL)) ;
|
puts (sf_strerror (NULL)) ;
|
||||||
--- examples/sfprocess.c
|
--- examples/sfprocess.c-dist 2009-02-07 05:07:34.000000000 +0100
|
||||||
+++ examples/sfprocess.c
|
+++ examples/sfprocess.c 2009-02-09 12:36:23.000000000 +0100
|
||||||
@@ -17,6 +17,7 @@
|
@@ -31,6 +31,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -31,7 +18,7 @@
|
|||||||
|
|
||||||
/* Include this header file to use functions from libsndfile. */
|
/* Include this header file to use functions from libsndfile. */
|
||||||
#include <sndfile.h>
|
#include <sndfile.h>
|
||||||
@@ -69,6 +70,7 @@
|
@@ -83,6 +84,7 @@ main (void)
|
||||||
** sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_16 ;
|
** sfinfo.format = SF_FORMAT_RAW | SF_FORMAT_PCM_16 ;
|
||||||
** sfinfo.channels = 2 ;
|
** sfinfo.channels = 2 ;
|
||||||
*/
|
*/
|
||||||
@ -39,13 +26,13 @@
|
|||||||
if (! (infile = sf_open (infilename, SFM_READ, &sfinfo)))
|
if (! (infile = sf_open (infilename, SFM_READ, &sfinfo)))
|
||||||
{ /* Open failed so print an error message. */
|
{ /* Open failed so print an error message. */
|
||||||
printf ("Not able to open input file %s.\n", infilename) ;
|
printf ("Not able to open input file %s.\n", infilename) ;
|
||||||
--- examples/sndfile-convert.c
|
--- examples/generate.c-dist 2009-02-07 05:07:44.000000000 +0100
|
||||||
+++ examples/sndfile-convert.c
|
+++ examples/generate.c 2009-02-09 12:36:23.000000000 +0100
|
||||||
@@ -242,6 +242,7 @@
|
@@ -98,6 +98,7 @@ encode_file (const char *infilename, con
|
||||||
exit (1) ;
|
k = 16 - strlen (outfilename) ;
|
||||||
} ;
|
PUT_DOTS (k) ;
|
||||||
|
|
||||||
+ memset(&sfinfo, 0, sizeof(sfinfo));
|
+ memset(&sfinfo, 0, sizeof(sfinfo));
|
||||||
if ((infile = sf_open (infilename, SFM_READ, &sfinfo)) == NULL)
|
if (! (infile = sf_open (infilename, SFM_READ, &sfinfo)))
|
||||||
{ printf ("Not able to open input file %s.\n", infilename) ;
|
{ printf ("Error : could not open file : %s\n", infilename) ;
|
||||||
puts (sf_strerror (NULL)) ;
|
puts (sf_strerror (NULL)) ;
|
||||||
|
@ -1,348 +0,0 @@
|
|||||||
--- src/flac.c-dist 2007-04-13 14:16:47.000000000 +0200
|
|
||||||
+++ src/flac.c 2007-04-13 14:36:40.000000000 +0200
|
|
||||||
@@ -60,8 +60,8 @@ typedef enum
|
|
||||||
} PFLAC_PCM ;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
-{ FLAC__SeekableStreamDecoder *fsd ;
|
|
||||||
- FLAC__SeekableStreamEncoder *fse ;
|
|
||||||
+{ FLAC__StreamDecoder *fsd ;
|
|
||||||
+ FLAC__StreamEncoder *fse ;
|
|
||||||
PFLAC_PCM pcmtype ;
|
|
||||||
void* ptr ;
|
|
||||||
unsigned pos, len, remain ;
|
|
||||||
@@ -108,21 +108,21 @@ static void d2flac24_clip_array (const
|
|
||||||
static int flac_command (SF_PRIVATE *psf, int command, void *data, int datasize) ;
|
|
||||||
|
|
||||||
/* Decoder Callbacks */
|
|
||||||
-static FLAC__SeekableStreamDecoderReadStatus sf_flac_read_callback (const FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer [], unsigned *bytes, void *client_data) ;
|
|
||||||
-static FLAC__SeekableStreamDecoderSeekStatus sf_flac_seek_callback (const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) ;
|
|
||||||
-static FLAC__SeekableStreamDecoderTellStatus sf_flac_tell_callback (const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data) ;
|
|
||||||
-static FLAC__SeekableStreamDecoderLengthStatus sf_flac_length_callback (const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data) ;
|
|
||||||
-static FLAC__bool sf_flac_eof_callback (const FLAC__SeekableStreamDecoder *decoder, void *client_data) ;
|
|
||||||
-static FLAC__StreamDecoderWriteStatus sf_flac_write_callback (const FLAC__SeekableStreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data) ;
|
|
||||||
-static void sf_flac_meta_callback (const FLAC__SeekableStreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) ;
|
|
||||||
-static void sf_flac_error_callback (const FLAC__SeekableStreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) ;
|
|
||||||
+static FLAC__StreamDecoderReadStatus sf_flac_read_callback (const FLAC__StreamDecoder *decoder, FLAC__byte buffer [], unsigned *bytes, void *client_data) ;
|
|
||||||
+static FLAC__StreamDecoderSeekStatus sf_flac_seek_callback (const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) ;
|
|
||||||
+static FLAC__StreamDecoderTellStatus sf_flac_tell_callback (const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data) ;
|
|
||||||
+static FLAC__StreamDecoderLengthStatus sf_flac_length_callback (const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data) ;
|
|
||||||
+static FLAC__bool sf_flac_eof_callback (const FLAC__StreamDecoder *decoder, void *client_data) ;
|
|
||||||
+static FLAC__StreamDecoderWriteStatus sf_flac_write_callback (const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data) ;
|
|
||||||
+static void sf_flac_meta_callback (const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) ;
|
|
||||||
+static void sf_flac_error_callback (const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) ;
|
|
||||||
|
|
||||||
/* Encoder Callbacks */
|
|
||||||
-static FLAC__SeekableStreamEncoderSeekStatus sf_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data) ;
|
|
||||||
+static FLAC__StreamEncoderSeekStatus sf_flac_enc_seek_callback (const FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data) ;
|
|
||||||
#ifdef HAVE_FLAC_1_1_1
|
|
||||||
-static FLAC__SeekableStreamEncoderTellStatus sf_flac_enc_tell_callback (const FLAC__SeekableStreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data) ;
|
|
||||||
+static FLAC__StreamEncoderTellStatus sf_flac_enc_tell_callback (const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data) ;
|
|
||||||
#endif
|
|
||||||
-static FLAC__StreamEncoderWriteStatus sf_flac_enc_write_callback (const FLAC__SeekableStreamEncoder *encoder, const FLAC__byte buffer [], unsigned bytes, unsigned samples, unsigned current_frame, void *client_data) ;
|
|
||||||
+static FLAC__StreamEncoderWriteStatus sf_flac_enc_write_callback (const FLAC__StreamEncoder *encoder, const FLAC__byte buffer [], unsigned bytes, unsigned samples, unsigned current_frame, void *client_data) ;
|
|
||||||
|
|
||||||
static const int legal_sample_rates [] =
|
|
||||||
{ 8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000
|
|
||||||
@@ -283,51 +283,53 @@ flac_buffer_copy (SF_PRIVATE *psf)
|
|
||||||
} /* flac_buffer_copy */
|
|
||||||
|
|
||||||
|
|
||||||
-static FLAC__SeekableStreamDecoderReadStatus
|
|
||||||
-sf_flac_read_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__byte buffer [], unsigned *bytes, void *client_data)
|
|
||||||
+static FLAC__StreamDecoderReadStatus
|
|
||||||
+sf_flac_read_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__byte buffer [], unsigned *bytes, void *client_data)
|
|
||||||
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
|
|
||||||
|
|
||||||
*bytes = psf_fread (buffer, 1, *bytes, psf) ;
|
|
||||||
if (*bytes > 0 && psf->error == 0)
|
|
||||||
- return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK ;
|
|
||||||
+ return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE ;
|
|
||||||
|
|
||||||
- return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR ;
|
|
||||||
+ if (!*bytes)
|
|
||||||
+ return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM ;
|
|
||||||
+ return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
|
|
||||||
} /* sf_flac_read_callback */
|
|
||||||
|
|
||||||
-static FLAC__SeekableStreamDecoderSeekStatus
|
|
||||||
-sf_flac_seek_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__uint64 absolute_byte_offset, void *client_data)
|
|
||||||
+static FLAC__StreamDecoderSeekStatus
|
|
||||||
+sf_flac_seek_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__uint64 absolute_byte_offset, void *client_data)
|
|
||||||
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
|
|
||||||
|
|
||||||
psf_fseek (psf, absolute_byte_offset, SEEK_SET) ;
|
|
||||||
if (psf->error)
|
|
||||||
- return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR ;
|
|
||||||
+ return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR ;
|
|
||||||
|
|
||||||
- return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK ;
|
|
||||||
+ return FLAC__STREAM_DECODER_SEEK_STATUS_OK ;
|
|
||||||
} /* sf_flac_seek_callback */
|
|
||||||
|
|
||||||
-static FLAC__SeekableStreamDecoderTellStatus
|
|
||||||
-sf_flac_tell_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__uint64 *absolute_byte_offset, void *client_data)
|
|
||||||
+static FLAC__StreamDecoderTellStatus
|
|
||||||
+sf_flac_tell_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__uint64 *absolute_byte_offset, void *client_data)
|
|
||||||
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
|
|
||||||
|
|
||||||
*absolute_byte_offset = psf_ftell (psf) ;
|
|
||||||
if (psf->error)
|
|
||||||
- return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR ;
|
|
||||||
+ return FLAC__STREAM_DECODER_TELL_STATUS_ERROR ;
|
|
||||||
|
|
||||||
- return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK ;
|
|
||||||
+ return FLAC__STREAM_DECODER_TELL_STATUS_OK ;
|
|
||||||
} /* sf_flac_tell_callback */
|
|
||||||
|
|
||||||
-static FLAC__SeekableStreamDecoderLengthStatus
|
|
||||||
-sf_flac_length_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__uint64 *stream_length, void *client_data)
|
|
||||||
+static FLAC__StreamDecoderLengthStatus
|
|
||||||
+sf_flac_length_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__uint64 *stream_length, void *client_data)
|
|
||||||
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
|
|
||||||
|
|
||||||
if ((*stream_length = psf->filelength) == 0)
|
|
||||||
- return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR ;
|
|
||||||
+ return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR ;
|
|
||||||
|
|
||||||
- return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK ;
|
|
||||||
+ return FLAC__STREAM_DECODER_LENGTH_STATUS_OK ;
|
|
||||||
} /* sf_flac_length_callback */
|
|
||||||
|
|
||||||
static FLAC__bool
|
|
||||||
-sf_flac_eof_callback (const FLAC__SeekableStreamDecoder *UNUSED (decoder), void *client_data)
|
|
||||||
+sf_flac_eof_callback (const FLAC__StreamDecoder *UNUSED (decoder), void *client_data)
|
|
||||||
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
|
|
||||||
|
|
||||||
if (psf_ftell (psf) == psf->filelength)
|
|
||||||
@@ -337,7 +339,7 @@ sf_flac_eof_callback (const FLAC__Seekab
|
|
||||||
} /* sf_flac_eof_callback */
|
|
||||||
|
|
||||||
static FLAC__StreamDecoderWriteStatus
|
|
||||||
-sf_flac_write_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data)
|
|
||||||
+sf_flac_write_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data)
|
|
||||||
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
|
|
||||||
FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ;
|
|
||||||
|
|
||||||
@@ -353,7 +355,7 @@ sf_flac_write_callback (const FLAC__Seek
|
|
||||||
} /* sf_flac_write_callback */
|
|
||||||
|
|
||||||
static void
|
|
||||||
-sf_flac_meta_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), const FLAC__StreamMetadata *metadata, void *client_data)
|
|
||||||
+sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC__StreamMetadata *metadata, void *client_data)
|
|
||||||
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
|
|
||||||
|
|
||||||
switch (metadata->type)
|
|
||||||
@@ -387,7 +389,7 @@ sf_flac_meta_callback (const FLAC__Seeka
|
|
||||||
} /* sf_flac_meta_callback */
|
|
||||||
|
|
||||||
static void
|
|
||||||
-sf_flac_error_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__StreamDecoderErrorStatus status, void *client_data)
|
|
||||||
+sf_flac_error_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__StreamDecoderErrorStatus status, void *client_data)
|
|
||||||
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
|
|
||||||
|
|
||||||
psf_log_printf (psf, "ERROR : %s\n", FLAC__StreamDecoderErrorStatusString [status]) ;
|
|
||||||
@@ -407,32 +409,30 @@ sf_flac_error_callback (const FLAC__Seek
|
|
||||||
return ;
|
|
||||||
} /* sf_flac_error_callback */
|
|
||||||
|
|
||||||
-static FLAC__SeekableStreamEncoderSeekStatus
|
|
||||||
-sf_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder * UNUSED (encoder), FLAC__uint64 absolute_byte_offset, void *client_data)
|
|
||||||
+static FLAC__StreamEncoderSeekStatus
|
|
||||||
+sf_flac_enc_seek_callback (const FLAC__StreamEncoder * UNUSED (encoder), FLAC__uint64 absolute_byte_offset, void *client_data)
|
|
||||||
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
|
|
||||||
|
|
||||||
psf_fseek (psf, absolute_byte_offset, SEEK_SET) ;
|
|
||||||
if (psf->error)
|
|
||||||
- return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_ERROR ;
|
|
||||||
+ return FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR ;
|
|
||||||
|
|
||||||
- return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_OK ;
|
|
||||||
+ return FLAC__STREAM_ENCODER_SEEK_STATUS_OK ;
|
|
||||||
} /* sf_flac_enc_seek_callback */
|
|
||||||
|
|
||||||
-#ifdef HAVE_FLAC_1_1_1
|
|
||||||
-static FLAC__SeekableStreamEncoderTellStatus
|
|
||||||
-sf_flac_enc_tell_callback (const FLAC__SeekableStreamEncoder *UNUSED (encoder), FLAC__uint64 *absolute_byte_offset, void *client_data)
|
|
||||||
+static FLAC__StreamEncoderTellStatus
|
|
||||||
+sf_flac_enc_tell_callback (const FLAC__StreamEncoder *UNUSED (encoder), FLAC__uint64 *absolute_byte_offset, void *client_data)
|
|
||||||
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
|
|
||||||
|
|
||||||
*absolute_byte_offset = psf_ftell (psf) ;
|
|
||||||
if (psf->error)
|
|
||||||
- return FLAC__SEEKABLE_STREAM_ENCODER_TELL_STATUS_ERROR ;
|
|
||||||
+ return FLAC__STREAM_ENCODER_TELL_STATUS_ERROR ;
|
|
||||||
|
|
||||||
- return FLAC__SEEKABLE_STREAM_ENCODER_TELL_STATUS_OK ;
|
|
||||||
+ return FLAC__STREAM_ENCODER_TELL_STATUS_OK ;
|
|
||||||
} /* sf_flac_enc_tell_callback */
|
|
||||||
-#endif
|
|
||||||
|
|
||||||
static FLAC__StreamEncoderWriteStatus
|
|
||||||
-sf_flac_enc_write_callback (const FLAC__SeekableStreamEncoder * UNUSED (encoder), const FLAC__byte buffer [], unsigned bytes, unsigned UNUSED (samples), unsigned UNUSED (current_frame), void *client_data)
|
|
||||||
+sf_flac_enc_write_callback (const FLAC__StreamEncoder * UNUSED (encoder), const FLAC__byte buffer [], unsigned bytes, unsigned UNUSED (samples), unsigned UNUSED (current_frame), void *client_data)
|
|
||||||
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
|
|
||||||
|
|
||||||
if (psf_fwrite (buffer, 1, bytes, psf) == bytes && psf->error == 0)
|
|
||||||
@@ -509,15 +509,15 @@ flac_close (SF_PRIVATE *psf)
|
|
||||||
return 0 ;
|
|
||||||
|
|
||||||
if (psf->mode == SFM_WRITE)
|
|
||||||
- { FLAC__seekable_stream_encoder_finish (pflac->fse) ;
|
|
||||||
- FLAC__seekable_stream_encoder_delete (pflac->fse) ;
|
|
||||||
+ { FLAC__stream_encoder_finish (pflac->fse) ;
|
|
||||||
+ FLAC__stream_encoder_delete (pflac->fse) ;
|
|
||||||
if (pflac->encbuffer)
|
|
||||||
free (pflac->encbuffer) ;
|
|
||||||
} ;
|
|
||||||
|
|
||||||
if (psf->mode == SFM_READ)
|
|
||||||
- { FLAC__seekable_stream_decoder_finish (pflac->fsd) ;
|
|
||||||
- FLAC__seekable_stream_decoder_delete (pflac->fsd) ;
|
|
||||||
+ { FLAC__stream_decoder_finish (pflac->fsd) ;
|
|
||||||
+ FLAC__stream_decoder_delete (pflac->fsd) ;
|
|
||||||
} ;
|
|
||||||
|
|
||||||
for (k = 0 ; k < ARRAY_LEN (pflac->rbuffer) ; k++)
|
|
||||||
@@ -546,17 +546,10 @@ flac_enc_init (SF_PRIVATE *psf)
|
|
||||||
return SFE_FLAC_BAD_SAMPLE_RATE ;
|
|
||||||
|
|
||||||
psf_fseek (psf, 0, SEEK_SET) ;
|
|
||||||
- if ((pflac->fse = FLAC__seekable_stream_encoder_new ()) == NULL)
|
|
||||||
+ if ((pflac->fse = FLAC__stream_encoder_new ()) == NULL)
|
|
||||||
return SFE_FLAC_NEW_DECODER ;
|
|
||||||
- FLAC__seekable_stream_encoder_set_write_callback (pflac->fse, sf_flac_enc_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.samplerate) ;
|
|
||||||
+ FLAC__stream_encoder_set_channels (pflac->fse, psf->sf.channels) ;
|
|
||||||
+ FLAC__stream_encoder_set_sample_rate (pflac->fse, psf->sf.samplerate) ;
|
|
||||||
|
|
||||||
switch (psf->sf.format & SF_FORMAT_SUBMASK)
|
|
||||||
{ case SF_FORMAT_PCM_S8 :
|
|
||||||
@@ -574,10 +567,16 @@ flac_enc_init (SF_PRIVATE *psf)
|
|
||||||
break ;
|
|
||||||
} ;
|
|
||||||
|
|
||||||
- FLAC__seekable_stream_encoder_set_bits_per_sample (pflac->fse, bps) ;
|
|
||||||
+ FLAC__stream_encoder_set_bits_per_sample (pflac->fse, bps) ;
|
|
||||||
|
|
||||||
- if ((bps = FLAC__seekable_stream_encoder_init (pflac->fse)) != 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)) ;
|
|
||||||
+ bps = FLAC__stream_encoder_init_stream (pflac->fse,
|
|
||||||
+ sf_flac_enc_write_callback,
|
|
||||||
+ sf_flac_enc_seek_callback,
|
|
||||||
+ sf_flac_enc_tell_callback,
|
|
||||||
+ NULL, psf);
|
|
||||||
+ if (bps != FLAC__STREAM_ENCODER_INIT_STATUS_OK)
|
|
||||||
+ {
|
|
||||||
+ psf_log_printf (psf, "Error : FLAC encoder init returned error : %s\n", FLAC__stream_encoder_get_resolved_state_string (pflac->fse)) ;
|
|
||||||
return SFE_FLAC_INIT_DECODER ;
|
|
||||||
} ;
|
|
||||||
|
|
||||||
@@ -593,26 +592,25 @@ flac_read_header (SF_PRIVATE *psf)
|
|
||||||
{ FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ;
|
|
||||||
|
|
||||||
psf_fseek (psf, 0, SEEK_SET) ;
|
|
||||||
- if ((pflac->fsd = FLAC__seekable_stream_decoder_new ()) == NULL)
|
|
||||||
+ if ((pflac->fsd = FLAC__stream_decoder_new ()) == NULL)
|
|
||||||
return SFE_FLAC_NEW_DECODER ;
|
|
||||||
|
|
||||||
- FLAC__seekable_stream_decoder_set_read_callback (pflac->fsd, sf_flac_read_callback) ;
|
|
||||||
- FLAC__seekable_stream_decoder_set_seek_callback (pflac->fsd, sf_flac_seek_callback) ;
|
|
||||||
- FLAC__seekable_stream_decoder_set_tell_callback (pflac->fsd, sf_flac_tell_callback) ;
|
|
||||||
- FLAC__seekable_stream_decoder_set_length_callback (pflac->fsd, sf_flac_length_callback) ;
|
|
||||||
- FLAC__seekable_stream_decoder_set_eof_callback (pflac->fsd, sf_flac_eof_callback) ;
|
|
||||||
- FLAC__seekable_stream_decoder_set_write_callback (pflac->fsd, sf_flac_write_callback) ;
|
|
||||||
- FLAC__seekable_stream_decoder_set_metadata_callback (pflac->fsd, sf_flac_meta_callback) ;
|
|
||||||
- FLAC__seekable_stream_decoder_set_error_callback (pflac->fsd, sf_flac_error_callback) ;
|
|
||||||
- FLAC__seekable_stream_decoder_set_client_data (pflac->fsd, psf) ;
|
|
||||||
-
|
|
||||||
- if (FLAC__seekable_stream_decoder_init (pflac->fsd) != FLAC__SEEKABLE_STREAM_DECODER_OK)
|
|
||||||
+ 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_error_callback,
|
|
||||||
+ psf) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
|
|
||||||
return SFE_FLAC_INIT_DECODER ;
|
|
||||||
|
|
||||||
- FLAC__seekable_stream_decoder_process_until_end_of_metadata (pflac->fsd) ;
|
|
||||||
+ FLAC__stream_decoder_process_until_end_of_metadata (pflac->fsd) ;
|
|
||||||
if (psf->error == 0)
|
|
||||||
{ FLAC__uint64 position ;
|
|
||||||
- FLAC__seekable_stream_decoder_get_decode_position (pflac->fsd, &position) ;
|
|
||||||
+ FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ;
|
|
||||||
psf->dataoffset = position ;
|
|
||||||
} ;
|
|
||||||
|
|
||||||
@@ -676,11 +674,9 @@ flac_read_loop (SF_PRIVATE *psf, unsigne
|
|
||||||
flac_buffer_copy (psf) ;
|
|
||||||
|
|
||||||
while (pflac->pos < pflac->len)
|
|
||||||
- { if (FLAC__seekable_stream_decoder_process_single (pflac->fsd) == 0)
|
|
||||||
+ { if (FLAC__stream_decoder_process_single (pflac->fsd) == 0)
|
|
||||||
break ;
|
|
||||||
- if (FLAC__seekable_stream_decoder_get_state (pflac->fsd) != FLAC__SEEKABLE_STREAM_DECODER_OK)
|
|
||||||
- break ;
|
|
||||||
- } ;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
pflac->ptr = NULL ;
|
|
||||||
|
|
||||||
@@ -795,7 +791,7 @@ flac_write_s2flac (SF_PRIVATE *psf, cons
|
|
||||||
while (len > 0)
|
|
||||||
{ writecount = (len >= bufferlen) ? bufferlen : (int) len ;
|
|
||||||
convert (ptr + total, buffer, writecount) ;
|
|
||||||
- if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
|
|
||||||
+ if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
|
|
||||||
thiswrite = writecount ;
|
|
||||||
else
|
|
||||||
break ;
|
|
||||||
@@ -837,7 +833,7 @@ flac_write_i2flac (SF_PRIVATE *psf, cons
|
|
||||||
while (len > 0)
|
|
||||||
{ writecount = (len >= bufferlen) ? bufferlen : (int) len ;
|
|
||||||
convert (ptr + total, buffer, writecount) ;
|
|
||||||
- if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
|
|
||||||
+ if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
|
|
||||||
thiswrite = writecount ;
|
|
||||||
else
|
|
||||||
break ;
|
|
||||||
@@ -879,7 +875,7 @@ flac_write_f2flac (SF_PRIVATE *psf, cons
|
|
||||||
while (len > 0)
|
|
||||||
{ writecount = (len >= bufferlen) ? bufferlen : (int) len ;
|
|
||||||
convert (ptr + total, buffer, writecount, psf->norm_float) ;
|
|
||||||
- if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
|
|
||||||
+ if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
|
|
||||||
thiswrite = writecount ;
|
|
||||||
else
|
|
||||||
break ;
|
|
||||||
@@ -1011,7 +1007,7 @@ flac_write_d2flac (SF_PRIVATE *psf, cons
|
|
||||||
while (len > 0)
|
|
||||||
{ writecount = (len >= bufferlen) ? bufferlen : (int) len ;
|
|
||||||
convert (ptr + total, buffer, writecount, psf->norm_double) ;
|
|
||||||
- if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
|
|
||||||
+ if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
|
|
||||||
thiswrite = writecount ;
|
|
||||||
else
|
|
||||||
break ;
|
|
||||||
@@ -1131,8 +1127,8 @@ flac_seek (SF_PRIVATE *psf, int UNUSED (
|
|
||||||
|
|
||||||
if (psf->mode == SFM_READ)
|
|
||||||
{ FLAC__uint64 position ;
|
|
||||||
- if (FLAC__seekable_stream_decoder_seek_absolute (pflac->fsd, offset))
|
|
||||||
- { FLAC__seekable_stream_decoder_get_decode_position (pflac->fsd, &position) ;
|
|
||||||
+ if (FLAC__stream_decoder_seek_absolute (pflac->fsd, offset))
|
|
||||||
+ { FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ;
|
|
||||||
return offset ;
|
|
||||||
} ;
|
|
||||||
|
|
@ -1,3 +1,15 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Feb 9 12:40:43 CET 2009 - tiwai@suse.de
|
||||||
|
|
||||||
|
- updated to version 1.0.18
|
||||||
|
* Add Ogg/Vorbis support (disabled right now due to vorbis
|
||||||
|
version mismatch; SVN version is required)
|
||||||
|
* Remove captive FLAC library.
|
||||||
|
* Many new features and bug fixes.
|
||||||
|
* Generate Win32 and Win64 pre-compiled binaries.
|
||||||
|
- Dropped libsndfile-octave subpackage (as octave itself is
|
||||||
|
dropped from FACTORY)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Jan 7 12:34:56 CET 2009 - olh@suse.de
|
Wed Jan 7 12:34:56 CET 2009 - olh@suse.de
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# spec file for package libsndfile (Version 1.0.17)
|
# spec file for package libsndfile (Version 1.0.18)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
#
|
#
|
||||||
@ -18,10 +18,10 @@
|
|||||||
|
|
||||||
|
|
||||||
Name: libsndfile
|
Name: libsndfile
|
||||||
BuildRequires: alsa-devel flac-devel gcc-c++ pkgconfig sqlite-devel
|
BuildRequires: alsa-devel flac-devel gcc-c++ libjack-devel pkgconfig sqlite-devel
|
||||||
Summary: A Library to Handle Various Audio File Formats
|
Summary: A Library to Handle Various Audio File Formats
|
||||||
Version: 1.0.17
|
Version: 1.0.18
|
||||||
Release: 172
|
Release: 1
|
||||||
License: LGPL v2.1 or later
|
License: LGPL v2.1 or later
|
||||||
Group: System/Libraries
|
Group: System/Libraries
|
||||||
Obsoletes: libsnd
|
Obsoletes: libsnd
|
||||||
@ -32,11 +32,7 @@ Obsoletes: libsndfile-64bit
|
|||||||
%endif
|
%endif
|
||||||
#
|
#
|
||||||
Source: libsndfile-%{version}.tar.bz2
|
Source: libsndfile-%{version}.tar.bz2
|
||||||
Patch: libsndfile-flac-1.1.4-fix.diff
|
Patch: libsndfile-example-fix.diff
|
||||||
Patch1: libsndfile-ac.diff
|
|
||||||
Patch2: libsndfile-1.0.17-flac-buffer-overflow.patch
|
|
||||||
Patch3: libsndfile-1.0.17-ac.diff
|
|
||||||
Patch4: libsndfile-example-fix.diff
|
|
||||||
Url: http://www.mega-nerd.com/libsndfile/
|
Url: http://www.mega-nerd.com/libsndfile/
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
|
|
||||||
@ -85,24 +81,6 @@ This package includes the example programs for libsndfile.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Authors:
|
|
||||||
--------
|
|
||||||
Erik de Castro Lopo <erikd@mega-nerd.com>
|
|
||||||
|
|
||||||
%package octave
|
|
||||||
License: LGPL v2.1 or later
|
|
||||||
Summary: A library to handle various audio file formats
|
|
||||||
Group: System/Libraries
|
|
||||||
Requires: octave
|
|
||||||
|
|
||||||
%description octave
|
|
||||||
The libsndfile is a C library for reading and writing sound files such
|
|
||||||
as AIFF, AU and WAV iles through one standard interface. It can
|
|
||||||
currently read/write 8, 16, 24 and 32-bit PCM files as well as 32-bit
|
|
||||||
floating point WAV files and a number of compressed formats.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Authors:
|
Authors:
|
||||||
--------
|
--------
|
||||||
Erik de Castro Lopo <erikd@mega-nerd.com>
|
Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||||
@ -110,14 +88,10 @@ Authors:
|
|||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
%patch
|
%patch
|
||||||
%patch1
|
|
||||||
%patch2
|
|
||||||
%patch3
|
|
||||||
%patch4
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%define warn_flags -W -Wall -Wstrict-prototypes -Wpointer-arith -Wno-unused-parameter
|
%define warn_flags -W -Wall -Wstrict-prototypes -Wpointer-arith -Wno-unused-parameter
|
||||||
autoreconf --force --install
|
# autoreconf --force --install
|
||||||
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing %{warn_flags}"
|
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing %{warn_flags}"
|
||||||
export CFLAGS
|
export CFLAGS
|
||||||
%configure \
|
%configure \
|
||||||
@ -159,16 +133,16 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%{_libdir}/pkgconfig/*.pc
|
%{_libdir}/pkgconfig/*.pc
|
||||||
%doc examples
|
%doc examples
|
||||||
|
|
||||||
%files octave
|
|
||||||
%defattr(644, root, root, 755)
|
|
||||||
%dir %{_datadir}/octave
|
|
||||||
%dir %{_datadir}/octave/site
|
|
||||||
%dir %{_datadir}/octave/site/m
|
|
||||||
%{_datadir}/octave/site/m/sndfile_load.m
|
|
||||||
%{_datadir}/octave/site/m/sndfile_play.m
|
|
||||||
%{_datadir}/octave/site/m/sndfile_save.m
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Feb 09 2009 tiwai@suse.de
|
||||||
|
- updated to version 1.0.18
|
||||||
|
* Add Ogg/Vorbis support (disabled right now due to vorbis
|
||||||
|
version mismatch; SVN version is required)
|
||||||
|
* Remove captive FLAC library.
|
||||||
|
* Many new features and bug fixes.
|
||||||
|
* Generate Win32 and Win64 pre-compiled binaries.
|
||||||
|
- Dropped libsndfile-octave subpackage (as octave itself is
|
||||||
|
dropped from FACTORY)
|
||||||
* Wed Jan 07 2009 olh@suse.de
|
* Wed Jan 07 2009 olh@suse.de
|
||||||
- obsolete old -XXbit packages (bnc#437293)
|
- obsolete old -XXbit packages (bnc#437293)
|
||||||
* Tue Oct 14 2008 meissner@suse.de
|
* Tue Oct 14 2008 meissner@suse.de
|
||||||
|
Loading…
x
Reference in New Issue
Block a user