From 9ce060e4ad1558720da7049c39d870a8dbcf8951 Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Thu, 27 Jan 2005 04:00:36 +0000 Subject: [PATCH] add missing decoder finish calls --- src/test_seeking/main.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/test_seeking/main.c b/src/test_seeking/main.c index 52fa338..3e01b58 100644 --- a/src/test_seeking/main.c +++ b/src/test_seeking/main.c @@ -278,7 +278,7 @@ static FLAC__bool seek_barrage_native_flac(const char *filename, off_t filesize, else printf("seek past end failed as expected... "); - /* hack to work around a deficiency in the seek API's bahavior */ + /* hack to work around a deficiency in the seek API's behavior */ /* seeking past EOF sets the file decoder state to non-OK and there's no ..._flush() or ..._reset() call to reset it */ if(!FLAC__file_decoder_finish(decoder)) return die_f_("FLAC__file_decoder_finish() FAILED", decoder); @@ -320,6 +320,11 @@ static FLAC__bool seek_barrage_native_flac(const char *filename, off_t filesize, fflush(stdout); } + if(FLAC__file_decoder_get_state(decoder) != FLAC__FILE_DECODER_UNINITIALIZED) { + if(!FLAC__file_decoder_finish(decoder)) + return die_f_("FLAC__file_decoder_finish() FAILED", decoder); + } + printf("\nPASSED!\n"); return true; @@ -414,7 +419,7 @@ static FLAC__bool seek_barrage_ogg_flac(const char *filename, off_t filesize, un printf("seek failed, assuming it was past EOF... "); else printf("seek past end failed as expected... "); - /* hack to work around a deficiency in the seek API's bahavior */ + /* hack to work around a deficiency in the seek API's behavior */ /* seeking past EOF sets the file decoder state to non-OK and there's no ..._flush() or ..._reset() call to reset it */ if(!OggFLAC__file_decoder_finish(decoder)) return die_of_("OggFLAC__file_decoder_finish() FAILED", decoder); @@ -456,6 +461,11 @@ static FLAC__bool seek_barrage_ogg_flac(const char *filename, off_t filesize, un fflush(stdout); } + if(OggFLAC__file_decoder_get_state(decoder) != OggFLAC__FILE_DECODER_UNINITIALIZED) { + if(!OggFLAC__file_decoder_finish(decoder)) + return die_of_("OggFLAC__file_decoder_finish() FAILED", decoder); + } + printf("\nPASSED!\n"); return true; -- 2.7.4