Skip to content

Commit

Permalink
fix tests to run when only FLAC is enabled, and fix immediate delete …
Browse files Browse the repository at this point in the history
…of FLAC

encoder


git-svn-id: http://svn.annodex.net/libfishsound/branches/1.0-stable@3371 8158c8cd-e7e1-0310-9fa4-c5954c97daef
  • Loading branch information
conrad committed Jan 21, 2008
1 parent 0ce9090 commit 4c5a3eb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/libfishsound/flac.c
Expand Up @@ -633,11 +633,15 @@ fs_flac_delete (FishSound * fsound)
#endif #endif


if (fsound->mode == FISH_SOUND_DECODE) { if (fsound->mode == FISH_SOUND_DECODE) {
FLAC__stream_decoder_finish(fi->fsd); if (fi->fsd) {
FLAC__stream_decoder_delete(fi->fsd); FLAC__stream_decoder_finish(fi->fsd);
FLAC__stream_decoder_delete(fi->fsd);
}
} else if (fsound->mode == FISH_SOUND_ENCODE) { } else if (fsound->mode == FISH_SOUND_ENCODE) {
FLAC__stream_encoder_finish(fi->fse); if (fi->fse) {
FLAC__stream_encoder_delete(fi->fse); FLAC__stream_encoder_finish(fi->fse);
FLAC__stream_encoder_delete(fi->fse);
}
if (fi->buffer) fs_free(fi->buffer); if (fi->buffer) fs_free(fi->buffer);
} }


Expand Down
4 changes: 3 additions & 1 deletion src/tests/comment-test.c
Expand Up @@ -64,8 +64,10 @@ main (int argc, char * argv[])
*/ */
#if HAVE_VORBIS #if HAVE_VORBIS
fsinfo.format = FISH_SOUND_VORBIS; fsinfo.format = FISH_SOUND_VORBIS;
#else #elif HAVE_SPEEX
fsinfo.format = FISH_SOUND_SPEEX; fsinfo.format = FISH_SOUND_SPEEX;
#else
fsinfo.format = FISH_SOUND_FLAC;
#endif #endif


#if FS_ENCODE #if FS_ENCODE
Expand Down
5 changes: 5 additions & 0 deletions src/tests/noop.c
Expand Up @@ -83,5 +83,10 @@ main (int argc, char * argv[])
noop_test (FISH_SOUND_SPEEX); noop_test (FISH_SOUND_SPEEX);
#endif #endif


#if HAVE_FLAC
INFO ("Testing new/delete for FLAC");
noop_test (FISH_SOUND_FLAC);
#endif

exit (0); exit (0);
} }

0 comments on commit 4c5a3eb

Please sign in to comment.