Skip to content
Browse files

fix tests to run when only FLAC is enabled, and fix immediate delete …

…of FLAC

encoder


git-svn-id: http://svn.annodex.net/libfishsound/branches/1.0-stable@3371 8158c8cd-e7e1-0310-9fa4-c5954c97daef
  • Loading branch information...
1 parent 0ce9090 commit 4c5a3eb27ff9d03ac59269780c6644dd1872e696 conrad committed Jan 21, 2008
Showing with 16 additions and 5 deletions.
  1. +8 −4 src/libfishsound/flac.c
  2. +3 −1 src/tests/comment-test.c
  3. +5 −0 src/tests/noop.c
View
12 src/libfishsound/flac.c
@@ -633,11 +633,15 @@ fs_flac_delete (FishSound * fsound)
#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->fse) {
+ FLAC__stream_encoder_finish(fi->fse);
+ FLAC__stream_encoder_delete(fi->fse);
+ }
if (fi->buffer) fs_free(fi->buffer);
}
View
4 src/tests/comment-test.c
@@ -64,8 +64,10 @@ main (int argc, char * argv[])
*/
#if HAVE_VORBIS
fsinfo.format = FISH_SOUND_VORBIS;
-#else
+#elif HAVE_SPEEX
fsinfo.format = FISH_SOUND_SPEEX;
+#else
+ fsinfo.format = FISH_SOUND_FLAC;
#endif
#if FS_ENCODE
View
5 src/tests/noop.c
@@ -83,5 +83,10 @@ main (int argc, char * argv[])
noop_test (FISH_SOUND_SPEEX);
#endif
+#if HAVE_FLAC
+ INFO ("Testing new/delete for FLAC");
+ noop_test (FISH_SOUND_FLAC);
+#endif
+
exit (0);
}

0 comments on commit 4c5a3eb

Please sign in to comment.
Something went wrong with that request. Please try again.