[xiph-commits] r3539 - in libfishsound/branches/0.9.1: . src/libfishsound src/tests

conrad at svn.annodex.net conrad at svn.annodex.net
Sun Apr 6 13:43:55 PDT 2008


Author: conrad
Date: 2008-04-06 13:43:55 -0700 (Sun, 06 Apr 2008)
New Revision: 3539

Modified:
   libfishsound/branches/0.9.1/configure.ac
   libfishsound/branches/0.9.1/src/libfishsound/flac.c
   libfishsound/branches/0.9.1/src/tests/comment-test.c
   libfishsound/branches/0.9.1/src/tests/noop.c
Log:
merge r3368, r3369, r3371, r3373 from branches/1.0-stable
(FLAC configure and testing fixes)


Modified: libfishsound/branches/0.9.1/configure.ac
===================================================================
--- libfishsound/branches/0.9.1/configure.ac	2008-04-06 20:25:41 UTC (rev 3538)
+++ libfishsound/branches/0.9.1/configure.ac	2008-04-06 20:43:55 UTC (rev 3539)
@@ -135,7 +135,7 @@
 
 ac_enable_vorbis=yes
 AC_ARG_ENABLE(vorbis,
-     [  --disable-vorbis        enable building of Vorbis codec support ],
+     [  --disable-vorbis        disable building of Vorbis codec support ],
      [ ac_enable_vorbis=no ], [ ac_enable_vorbis=yes] )
 
 if test "x${ac_enable_vorbis}" = xyes ; then
@@ -194,7 +194,7 @@
 
 ac_enable_speex=yes
 AC_ARG_ENABLE(speex,
-     [  --disable-speex         enable building of Speex codec support ],
+     [  --disable-speex         disable building of Speex codec support ],
      [ ac_enable_speex=no ], [ ac_enable_speex=yes] )
 
 if test "x${ac_enable_speex}" = xyes ; then
@@ -252,7 +252,7 @@
 
 ac_enable_flac=yes
 AC_ARG_ENABLE(flac,
-     [  --disable-flac        enable building of Flac codec support ],
+     [  --disable-flac          disable building of Flac codec support ],
      [ ac_enable_flac=no ], [ ac_enable_flac=yes] )
 
 if test "x${ac_enable_flac}" = xyes ; then
@@ -277,10 +277,12 @@
 dnl
 dnl  Check codec disabling sanity
 dnl
-if test "x${ac_enable_vorbis}" = xno && test "x${ac_enable_speex}" = xno ; then
+if test "x${ac_enable_vorbis}" = xno && test "x${ac_enable_speex}" = xno &&
+test "x${ac_enable_flac}" = xno ; then
   AC_MSG_ERROR([
 ***
-*** You have attempted to explicitly disable both Vorbis and Speex support.
+*** You have attempted to explicitly disable support for all codecs:
+*** FLAC, Speex and Vorbis.
 ***
 *** If you want a fish that does nothing, try kfishd:
 ***
@@ -292,9 +294,10 @@
 fi
 
 dnl
-dnl Set overall configuration success to no if neither vorbis or speex found
+dnl Set overall configuration success to no if none of FLAC, Vorbis or Speex
+dnl has been found.
 dnl
-if test "x$HAVE_VORBIS" = "xno" && test "x$HAVE_SPEEX" = "xno"; then
+if test "x$HAVE_VORBIS" = "xno" && test "x$HAVE_SPEEX" = "xno" && test "x$HAVE_FLAC" = "xno" ; then
   fishsound_config_ok=no
 fi
 

Modified: libfishsound/branches/0.9.1/src/libfishsound/flac.c
===================================================================
--- libfishsound/branches/0.9.1/src/libfishsound/flac.c	2008-04-06 20:25:41 UTC (rev 3538)
+++ libfishsound/branches/0.9.1/src/libfishsound/flac.c	2008-04-06 20:43:55 UTC (rev 3539)
@@ -633,12 +633,19 @@
 #endif
 
   if (fsound->mode == FISH_SOUND_DECODE) {
-    FLAC__stream_decoder_finish(fi->fsd);
-    FLAC__stream_decoder_delete(fi->fsd);
+    if (fi->fsd) {
+      FLAC__stream_decoder_finish(fi->fsd);
+      FLAC__stream_decoder_delete(fi->fsd);
+    }
   } else if (fsound->mode == FISH_SOUND_ENCODE) {
-    FLAC__stream_encoder_finish(fi->fse);
-    FLAC__stream_encoder_delete(fi->fse);
-    if (fi->buffer) fs_free(fi->buffer);
+    if (fi->fse) {
+      FLAC__stream_encoder_finish(fi->fse);
+      FLAC__stream_encoder_delete(fi->fse);
+    }
+    if (fi->buffer) {
+      fs_free(fi->buffer);
+      fi->buffer = NULL;
+    }
   }
 
   if (fi->ipcm) fs_free(fi->ipcm);
@@ -704,11 +711,12 @@
 
   fi = fs_malloc (sizeof (FishSoundFlacInfo));
   if (fi == NULL) return NULL;
+  fi->fsd = NULL;
+  fi->fse = NULL;
+  fi->buffer = NULL;
   fi->packetno = 0;
   fi->header = 0;
   fi->header_packets = 0;
-  fi->fsd = NULL;
-  fi->fse = NULL;
 
   fi->ipcm = NULL;
   for (i = 0; i < 8; i++) {

Modified: libfishsound/branches/0.9.1/src/tests/comment-test.c
===================================================================
--- libfishsound/branches/0.9.1/src/tests/comment-test.c	2008-04-06 20:25:41 UTC (rev 3538)
+++ libfishsound/branches/0.9.1/src/tests/comment-test.c	2008-04-06 20:43:55 UTC (rev 3539)
@@ -64,8 +64,10 @@
    */
 #if HAVE_VORBIS
   fsinfo.format = FISH_SOUND_VORBIS;
+#elif HAVE_SPEEX
+  fsinfo.format = FISH_SOUND_SPEEX;
 #else
-  fsinfo.format = FISH_SOUND_SPEEX;
+  fsinfo.format = FISH_SOUND_FLAC;
 #endif
 
 #if FS_ENCODE

Modified: libfishsound/branches/0.9.1/src/tests/noop.c
===================================================================
--- libfishsound/branches/0.9.1/src/tests/noop.c	2008-04-06 20:25:41 UTC (rev 3538)
+++ libfishsound/branches/0.9.1/src/tests/noop.c	2008-04-06 20:43:55 UTC (rev 3539)
@@ -83,5 +83,10 @@
   noop_test (FISH_SOUND_SPEEX);
 #endif
 
+#if HAVE_FLAC
+  INFO ("Testing new/delete for FLAC");
+  noop_test (FISH_SOUND_FLAC);
+#endif
+
   exit (0);
 }



More information about the commits mailing list