[arch-commits] Commit in ardour/repos (6 files)

Jan de Groot jgc at archlinux.org
Sat May 2 16:48:36 EDT 2009


    Date: Saturday, May 2, 2009 @ 16:48:36
  Author: jgc
Revision: 37538

Merged revisions 26247,37532 via svnmerge from 
svn+ssh://svn.archlinux.org/srv/svn-packages/ardour/trunk

........
  r26247 | jgc | 2009-02-04 13:57:54 +0000 (Wed, 04 Feb 2009) | 2 lines
  
  Remove useless postinstall stuff, make desktop file valid
........
  r37532 | jgc | 2009-05-02 20:23:51 +0000 (Sat, 02 May 2009) | 3 lines
  
  upgpkg: ardour 2.8-1
      Upload to archlinux FTP, upstream sources are not fetchable by wget
  Build with system libraries as much as possible
........

Added:
  ardour/repos/extra-x86_64/100_syslibs.patch
    (from rev 37532, ardour/trunk/100_syslibs.patch)
Modified:
  ardour/repos/extra-x86_64/	(properties)
  ardour/repos/extra-x86_64/PKGBUILD
  ardour/repos/extra-x86_64/ardour.desktop
  ardour/repos/extra-x86_64/ardour.install
Deleted:
  ardour/repos/extra-x86_64/libsndfile.patch

-------------------+
 100_syslibs.patch |   53 +++++
 PKGBUILD          |   54 +++--
 ardour.desktop    |    3 
 ardour.install    |   25 --
 libsndfile.patch  |  521 ----------------------------------------------------
 5 files changed, 86 insertions(+), 570 deletions(-)


Property changes on: ardour/repos/extra-x86_64
___________________________________________________________________
Modified: svnmerge-integrated
   - /ardour/trunk:1-12265
   + /ardour/trunk:1-37537

Copied: ardour/repos/extra-x86_64/100_syslibs.patch (from rev 37532, ardour/trunk/100_syslibs.patch)
===================================================================
--- extra-x86_64/100_syslibs.patch	                        (rev 0)
+++ extra-x86_64/100_syslibs.patch	2009-05-02 20:48:36 UTC (rev 37538)
@@ -0,0 +1,53 @@
+
+diff --git a/SConstruct b/SConstruct
+index e7df3c7..3b3cb35 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -504,8 +504,8 @@ libraries = { }
+ 
+ libraries['core'] = LibraryInfo (CCFLAGS = '-Ilibs')
+ 
+-#libraries['sndfile'] = LibraryInfo()
+-#libraries['sndfile'].ParseConfig('pkg-config --cflags --libs sndfile')
++libraries['sndfile-ardour'] = LibraryInfo()
++libraries['sndfile-ardour'].ParseConfig('pkg-config --cflags --libs sndfile')
+ 
+ libraries['lrdf'] = LibraryInfo()
+ libraries['lrdf'].ParseConfig('pkg-config --cflags --libs lrdf')
+@@ -1089,10 +1088,6 @@ if env['SYSLIBS']:
+ # cannot use system one for the time being
+ #
+     
+-    libraries['sndfile-ardour'] = LibraryInfo(LIBS='libsndfile-ardour',
+-                                    LIBPATH='#libs/libsndfile',
+-                                    CPPPATH=['#libs/libsndfile/src'])
+-
+ #    libraries['libglademm'] = LibraryInfo()
+ #    libraries['libglademm'].ParseConfig ('pkg-config --cflags --libs libglademm-2.4')
+ 
+@@ -1112,7 +1107,6 @@ if env['SYSLIBS']:
+     ]
+     
+     subdirs = [
+-        'libs/libsndfile',
+         'libs/pbd',
+         'libs/midi++2',
+         'libs/ardour',
+@@ -1165,9 +1158,6 @@ else:
+     libraries['soundtouch'] = LibraryInfo(LIBS='soundtouch',
+                                           LIBPATH='#libs/soundtouch',
+                                           CPPPATH=['#libs', '#libs/soundtouch'])
+-    libraries['sndfile-ardour'] = LibraryInfo(LIBS='libsndfile-ardour',
+-                                    LIBPATH='#libs/libsndfile',
+-                                    CPPPATH=['#libs/libsndfile', '#libs/libsndfile/src'])
+ #    libraries['libglademm'] = LibraryInfo(LIBS='libglademm',
+ #                                          LIBPATH='#libs/libglademm',
+ #                                          CPPPATH='#libs/libglademm')
+@@ -1182,7 +1172,6 @@ else:
+     
+     subdirs = [
+         'libs/sigc++2',
+-        'libs/libsndfile',
+         'libs/pbd',
+         'libs/midi++2',
+         'libs/ardour',

Modified: extra-x86_64/PKGBUILD
===================================================================
--- extra-x86_64/PKGBUILD	2009-05-02 20:41:10 UTC (rev 37537)
+++ extra-x86_64/PKGBUILD	2009-05-02 20:48:36 UTC (rev 37538)
@@ -7,39 +7,49 @@
 # for fixed dependencies speaking in terms of versions
 
 pkgname=ardour
-pkgver=2.5
+pkgver=2.8
 pkgrel=1
 pkgdesc="A multichannel hard disk recorder and digital audio workstation"
 arch=(i686 x86_64)
-license=('GPL')
+license=('GPL2')
 url="http://ardour.org"
-depends=('liblrdf>=0.4.0-5' 'libsamplerate' 'jack-audio-connection-kit' 'flac'
-         'curl>=7.16.2' 'libart-lgpl' 'ladspa' 'libxslt' 'libgnomecanvas'
-         'liblo' 'libusb' 'fftw' 'aubio')
-makedepends=('librsvg' 'scons' 'boost')
+depends=('liblrdf>=0.4.0-5'
+         'ladspa>=1.13' 'libgnomecanvasmm>=2.26.0'
+         'liblo>=0.25' 'libusb>=0.1.12' 'aubio>=0.3.2' 'libsndfile>=1.0.19')
+makedepends=('scons' 'boost' 'soundtouch')
 install=${pkgname}.install
-source=(http://ardour.org/files/releases/${pkgname}-${pkgver}.tar.bz2 \
-        ${pkgname}.desktop libsndfile.patch)
-md5sums=('88180d400e8c19ceea41aabadc098116' '22ec67c24d53d2b44501f158de48c25b' \
-         '583f3da75ec960f9da2cf196ed717396')
+source=(ftp://ftp.archlinux.org/other/ardour/${pkgname}-${pkgver}.tar.bz2
+        ${pkgname}.desktop
+	100_syslibs.patch)
+md5sums=('24bd768dbe08f1f2724dc97704ee0518'
+         '8aeaf433ebf781733db48e5a16b0c4da'
+	 '98b6f1d56af73b18f126b200456ce312')
 
 build() {
   # start building ardour now
-  cd ${startdir}/src/${pkgname}-${pkgver}
-  patch -Np1 -i ../libsndfile.patch || return 1
-  sed -i -e "s@/configure@& --prefix=/usr at g" libs/libsndfile/SConscript
-  sed -i -e "s/lib64/lib/g" SConstruct
-  sed -i "s/_protocol.h>/\0\n#include <cstring>/g" libs/surfaces/tranzport/screen.cc
+  cd "${srcdir}/${pkgname}-${pkgver}"
+  patch -Np1 -i "${srcdir}/100_syslibs.patch" || return 1
+  sed -i -e "s@/configure@& --prefix=/usr at g" libs/libsndfile/SConscript || return 1
+  sed -i -e "s/lib64/lib/g" SConstruct || return 1
+  sed -i "s/_protocol.h>/\0\n#include <cstring>/g" libs/surfaces/tranzport/screen.cc || return 1
 
   # force -O2 from the CFLAGS in makepkg.conf
-  sed -i '/-O3/d' SConstruct
+  sed -i '/-O3/d' SConstruct || return 1
   scons ARCH="${CFLAGS}" \
         PREFIX="/usr" \
-        DESTDIR="${startdir}/pkg" || return 1
+	NLS=yes \
+	FREEDESKTOP=no \
+	NJOBS="${MAKEFLAGS}" \
+	SYSLIBS=yes \
+	VST=0 \
+        DESTDIR="${pkgdir}" || return 1
   scons PREFIX="/usr" \
-        DESTDIR="${startdir}/pkg" \
-        install || return 1
-   # install some freedesktop.org compatibility
-  install -D -m644 ${startdir}/src/${pkgname}.desktop \
-    ${startdir}/pkg/usr/share/applications/${pkgname}.desktop
+  	NLS=yes \
+	FREEDESKTOP=no \
+	SYSLIBS=yes \
+	VST=0 \
+        DESTDIR="${pkgdir}" install || return 1
+  # install some freedesktop.org compatibility
+  install -m755 -d "${pkgdir}/usr/share/applications"
+  install -m644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/" || return 1
 }

Modified: extra-x86_64/ardour.desktop
===================================================================
--- extra-x86_64/ardour.desktop	2009-05-02 20:41:10 UTC (rev 37537)
+++ extra-x86_64/ardour.desktop	2009-05-02 20:48:36 UTC (rev 37538)
@@ -1,5 +1,4 @@
 [Desktop Entry]
-Encoding=UTF-8
 Name=Ardour
 Comment=Multitrack hard disk recorder
 Exec=ardour2
@@ -7,4 +6,4 @@
 Terminal=false
 Type=Application
 X-MultipleArgs=false
-Categories=GTK;Audio;AudioVideoEditing;Multimedia
+Categories=GTK;Audio;AudioVideoEditing;AudioVideo;Video;

Modified: extra-x86_64/ardour.install
===================================================================
--- extra-x86_64/ardour.install	2009-05-02 20:41:10 UTC (rev 37537)
+++ extra-x86_64/ardour.install	2009-05-02 20:48:36 UTC (rev 37538)
@@ -14,29 +14,4 @@
 -->  qjackctl's patchbay and read the docs from http://ardour.org !
 
 EOM
-  echo "update desktop mime database..."
-  update-desktop-database -q
 }
-
-# arg 1:  the new package version
-# arg 2:  the old package version
-post_upgrade() {
-  post_install $1
-}
-
-# arg 1:  the old package version
-pre_remove() {
-  /bin/true
-}
-
-# arg 1:  the old package version
-post_remove() {
-  echo "update desktop mime database..."
-  update-desktop-database -q
-}
-
-op=$1
-shift
-$op $*
-
-# vim: ts=2 sw=2 et ft=sh

Deleted: extra-x86_64/libsndfile.patch
===================================================================
--- extra-x86_64/libsndfile.patch	2009-05-02 20:41:10 UTC (rev 37537)
+++ extra-x86_64/libsndfile.patch	2009-05-02 20:48:36 UTC (rev 37538)
@@ -1,521 +0,0 @@
-diff -urN ardour-2.0beta11.1.orig/libs/libsndfile/configure ardour-2.0beta11.1/libs/libsndfile/configure
---- ardour-2.0beta11.1.orig/libs/libsndfile/configure	2006-12-18 15:01:38 +0200
-+++ ardour-2.0beta11.1/libs/libsndfile/configure	2007-02-19 16:47:26 +0200
-@@ -12365,9 +12365,9 @@
- done
- 
- 	if test x$ac_cv_header_FLAC_all_h = xyes ; then
--		echo "$as_me:$LINENO: checking for FLAC__seekable_stream_encoder_set_tell_callback in -lFLAC" >&5
--echo $ECHO_N "checking for FLAC__seekable_stream_encoder_set_tell_callback in -lFLAC... $ECHO_C" >&6
--if test "${ac_cv_lib_FLAC_FLAC__seekable_stream_encoder_set_tell_callback+set}" = set; then
-+		echo "$as_me:$LINENO: checking for FLAC__stream_encoder_init_stream in -lFLAC" >&5
-+echo $ECHO_N "checking for FLAC__stream_encoder_init_stream in -lFLAC... $ECHO_C" >&6
-+if test "${ac_cv_lib_FLAC_FLAC__stream_encoder_init_stream+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   ac_check_lib_save_LIBS=$LIBS
-@@ -12385,11 +12385,11 @@
- #endif
- /* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
--char FLAC__seekable_stream_encoder_set_tell_callback ();
-+char FLAC__stream_encoder_init_stream ();
- int
- main ()
- {
--FLAC__seekable_stream_encoder_set_tell_callback ();
-+FLAC__stream_encoder_init_stream ();
-   ;
-   return 0;
- }
-@@ -12416,20 +12416,20 @@
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); }; }; then
--  ac_cv_lib_FLAC_FLAC__seekable_stream_encoder_set_tell_callback=yes
-+  ac_cv_lib_FLAC_FLAC__stream_encoder_init_stream=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
- 
--ac_cv_lib_FLAC_FLAC__seekable_stream_encoder_set_tell_callback=no
-+ac_cv_lib_FLAC_FLAC__stream_encoder_init_stream=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_FLAC_FLAC__seekable_stream_encoder_set_tell_callback" >&5
--echo "${ECHO_T}$ac_cv_lib_FLAC_FLAC__seekable_stream_encoder_set_tell_callback" >&6
--if test $ac_cv_lib_FLAC_FLAC__seekable_stream_encoder_set_tell_callback = yes; then
-+echo "$as_me:$LINENO: result: $ac_cv_lib_FLAC_FLAC__stream_encoder_init_stream" >&5
-+echo "${ECHO_T}$ac_cv_lib_FLAC_FLAC__stream_encoder_init_stream" >&6
-+if test $ac_cv_lib_FLAC_FLAC__stream_encoder_init_stream = yes; then
-   HAVE_FLAC_1_1_1="yes"
- fi
- 
-diff -urN ardour-2.0beta11.1.orig/libs/libsndfile/src/flac.c ardour-2.0beta11.1/libs/libsndfile/src/flac.c
---- ardour-2.0beta11.1.orig/libs/libsndfile/src/flac.c	2006-08-30 23:50:11 +0300
-+++ ardour-2.0beta11.1/libs/libsndfile/src/flac.c	2007-02-19 16:48:29 +0200
-@@ -46,6 +46,13 @@
- #include	"sfendian.h"
- #include	"float_cast.h"
- 
-+/* FLAC 1.1.3 has FLAC_API_VERSION_CURRENT == 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 ;
- 
- 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 datasize) ;
- 
- /* Decoder Callbacks */
-+#ifdef LEGACY_FLAC
- 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) ;
-@@ -116,13 +130,29 @@
- 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) ;
-+#else
-+static FLAC__StreamDecoderReadStatus sf_flac_read_callback (const FLAC__StreamDecoder *decoder, FLAC__byte buffer [], size_t *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) ;
-+#endif
- 
- /* Encoder Callbacks */
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamEncoderSeekStatus sf_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder *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) ;
- #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) ;
-+#else
-+static FLAC__StreamEncoderSeekStatus sf_flac_enc_seek_callback (const FLAC__StreamEncoder *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) ;
-+static FLAC__StreamEncoderWriteStatus sf_flac_enc_write_callback (const FLAC__StreamEncoder *encoder, const FLAC__byte buffer [], size_t bytes, unsigned samples, unsigned current_frame, void *client_data) ;
-+#endif
- 
- static const int legal_sample_rates [] =
- {	8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000
-@@ -283,51 +313,99 @@
- } /* flac_buffer_copy */
- 
- 
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamDecoderReadStatus
- sf_flac_read_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), 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 = (SF_PRIVATE*) client_data ;
- 
- 	*bytes = psf_fread (buffer, 1, *bytes, psf) ;
- 	if (*bytes > 0 && psf->error == 0)
-+#ifdef LEGACY_FLAC
- 		return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK ;
- 
-     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 */
- 
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamDecoderSeekStatus
- sf_flac_seek_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), 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 = (SF_PRIVATE*) client_data ;
- 
- 	psf_fseek (psf, absolute_byte_offset, SEEK_SET) ;
- 	if (psf->error)
-+#ifdef LEGACY_FLAC
- 		return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR ;
- 
- 	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 */
- 
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamDecoderTellStatus
- sf_flac_tell_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), 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 = (SF_PRIVATE*) client_data ;
- 
- 	*absolute_byte_offset = psf_ftell (psf) ;
- 	if (psf->error)
-+#ifdef LEGACY_FLAC
- 		return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR ;
- 
- 	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 */
- 
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamDecoderLengthStatus
- sf_flac_length_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__uint64 *stream_length, void *client_data)
-+#else
-+static FLAC__StreamDecoderLengthStatus
-+sf_flac_length_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__uint64 *stream_length, void *client_data)
-+#endif
- {	SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
- 
- 	if ((*stream_length = psf->filelength) == 0)
-+#ifdef LEGACY_FLAC
- 		return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR ;
- 
- 	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 */
- 
- 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 = (SF_PRIVATE*) client_data ;
- 
- 	if (psf_ftell (psf) == psf->filelength)
-@@ -337,7 +415,11 @@
- } /* sf_flac_eof_callback */
- 
- static FLAC__StreamDecoderWriteStatus
-+#ifdef LEGACY_FLAC
- sf_flac_write_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data)
-+#else
-+sf_flac_write_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data)
-+#endif
- {	SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
- 	FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->fdata ;
- 
-@@ -353,7 +435,11 @@
- } /* sf_flac_write_callback */
- 
- static void
-+#ifdef LEGACY_FLAC
- sf_flac_meta_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), const FLAC__StreamMetadata *metadata, void *client_data)
-+#else
-+sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC__StreamMetadata *metadata, void *client_data)
-+#endif
- {	SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
- 
- 	switch (metadata->type)
-@@ -387,7 +473,11 @@
- } /* sf_flac_meta_callback */
- 
- static void
-+#ifdef LEGACY_FLAC
- sf_flac_error_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__StreamDecoderErrorStatus status, void *client_data)
-+#else
-+sf_flac_error_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__StreamDecoderErrorStatus status, void *client_data)
-+#endif
- {	SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
- 
- 	psf_log_printf (psf, "ERROR : %s\n", FLAC__StreamDecoderErrorStatusString [status]) ;
-@@ -407,17 +497,29 @@
- 	return ;
- } /* sf_flac_error_callback */
- 
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamEncoderSeekStatus
- sf_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder * UNUSED (encoder), 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 = (SF_PRIVATE*) client_data ;
- 
- 	psf_fseek (psf, absolute_byte_offset, SEEK_SET) ;
- 	if (psf->error)
-+#ifdef LEGACY_FLAC
- 		return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_ERROR ;
- 
-     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 */
- 
-+#ifdef LEGACY_FLAC
- #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)
-@@ -430,9 +532,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), 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__STREAM_ENCODER_TELL_STATUS_ERROR ;
-+
-+	return FLAC__STREAM_ENCODER_TELL_STATUS_OK ;
-+} /* sf_flac_enc_tell_callback */
-+#endif
- 
- static FLAC__StreamEncoderWriteStatus
-+#ifdef LEGACY_FLAC
- 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)
-+#else
-+sf_flac_enc_write_callback (const FLAC__StreamEncoder * UNUSED (encoder), const FLAC__byte buffer [], size_t bytes, unsigned UNUSED (samples), unsigned UNUSED (current_frame), void *client_data)
-+#endif
- {	SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
- 
- 	if (psf_fwrite (buffer, 1, bytes, psf) == bytes && psf->error == 0)
-@@ -509,15 +627,27 @@
- 		return 0 ;
- 
- 	if (psf->mode == 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) ;
- 		} ;
- 
- 	if (psf->mode == 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
- 		} ;
- 
- 	for (k = 0 ; k < ARRAY_LEN (pflac->rbuffer) ; k++)
-@@ -546,17 +676,6 @@
- 		return SFE_FLAC_BAD_SAMPLE_RATE ;
- 
- 	psf_fseek (psf, 0, SEEK_SET) ;
--	if ((pflac->fse = FLAC__seekable_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) ;
- 
- 	switch (psf->sf.format & SF_FORMAT_SUBMASK)
- 	{	case SF_FORMAT_PCM_S8 :
-@@ -574,12 +693,36 @@
- 			break ;
- 		} ;
- 
-+#ifdef LEGACY_FLAC
-+	if ((pflac->fse = FLAC__seekable_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__seekable_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)) ;
- 		return SFE_FLAC_INIT_DECODER ;
- 		} ;
-+#else
-+	if ((pflac->fse = FLAC__stream_encoder_new ()) == 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 = FLAC__stream_encoder_init_stream (pflac->fse, sf_flac_enc_write_callback, sf_flac_enc_seek_callback, sf_flac_enc_tell_callback, NULL, psf)) != 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
- 
- 	if (psf->error == 0)
- 		psf->dataoffset = psf_ftell (psf) ;
-@@ -593,6 +736,7 @@
- {	FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->fdata ;
- 
- 	psf_fseek (psf, 0, SEEK_SET) ;
-+#ifdef LEGACY_FLAC
- 	if ((pflac->fsd = FLAC__seekable_stream_decoder_new ()) == NULL)
- 		return SFE_FLAC_NEW_DECODER ;
- 
-@@ -610,9 +754,22 @@
- 		return SFE_FLAC_INIT_DECODER ;
- 
- 	FLAC__seekable_stream_decoder_process_until_end_of_metadata (pflac->fsd) ;
-+#else
-+	if ((pflac->fsd = FLAC__stream_decoder_new ()) == NULL)
-+		return SFE_FLAC_NEW_DECODER ;
-+
-+	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__stream_decoder_process_until_end_of_metadata (pflac->fsd) ;
-+#endif
- 	if (psf->error == 0)
- 	{	FLAC__uint64 position ;
-+#ifdef LEGACY_FLAC
- 		FLAC__seekable_stream_decoder_get_decode_position (pflac->fsd, &position) ;
-+#else
-+		FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ;
-+#endif
- 		psf->dataoffset = position ;
- 		} ;
- 
-@@ -676,10 +833,18 @@
- 		flac_buffer_copy (psf) ;
- 
- 	while (pflac->pos < pflac->len)
--	{	if (FLAC__seekable_stream_decoder_process_single (pflac->fsd) == 0)
-+	{
-+#ifdef LEGACY_FLAC
-+		if (FLAC__seekable_stream_decoder_process_single (pflac->fsd) == 0)
- 			break ;
- 		if (FLAC__seekable_stream_decoder_get_state (pflac->fsd) != FLAC__SEEKABLE_STREAM_DECODER_OK)
- 			break ;
-+#else
-+		if (FLAC__stream_decoder_process_single (pflac->fsd) == 0)
-+			break ;
-+		if (FLAC__stream_decoder_get_state (pflac->fsd) >= FLAC__STREAM_DECODER_END_OF_STREAM)
-+			break ;
-+#endif
- 		} ;
- 
- 	pflac->ptr = NULL ;
-@@ -795,7 +960,11 @@
- 	while (len > 0)
- 	{	writecount = (len >= bufferlen) ? bufferlen : (int) len ;
- 		convert (ptr + total, buffer, writecount) ;
-+#ifdef LEGACY_FLAC
- 		if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
-+#else
-+		if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
-+#endif
- 			thiswrite = writecount ;
- 		else
- 			break ;
-@@ -837,7 +1006,11 @@
- 	while (len > 0)
- 	{	writecount = (len >= bufferlen) ? bufferlen : (int) len ;
- 		convert (ptr + total, buffer, writecount) ;
-+#ifdef LEGACY_FLAC
- 		if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
-+#else
-+		if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
-+#endif
- 			thiswrite = writecount ;
- 		else
- 			break ;
-@@ -879,7 +1052,11 @@
- 	while (len > 0)
- 	{	writecount = (len >= bufferlen) ? bufferlen : (int) len ;
- 		convert (ptr + total, buffer, writecount, psf->norm_float) ;
-+#ifdef LEGACY_FLAC
- 		if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
-+#else
-+		if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
-+#endif
- 			thiswrite = writecount ;
- 		else
- 			break ;
-@@ -1011,7 +1188,11 @@
- 	while (len > 0)
- 	{	writecount = (len >= bufferlen) ? bufferlen : (int) len ;
- 		convert (ptr + total, buffer, writecount, psf->norm_double) ;
-+#ifdef LEGACY_FLAC
- 		if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
-+#else
-+		if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
-+#endif
- 			thiswrite = writecount ;
- 		else
- 			break ;
-@@ -1131,10 +1312,17 @@
- 
- 	if (psf->mode == 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, &position) ;
- 			return offset ;
- 			} ;
-+#else
-+		if (FLAC__stream_decoder_seek_absolute (pflac->fsd, offset))
-+		{	FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ;
-+			return offset ;
-+			} ;
-+#endif
- 
- 		return ((sf_count_t) -1) ;
- 		} ;



More information about the arch-commits mailing list