fix FLAC::Decoder::Stream::finish() to return a bool like its C cousin
This commit is contained in:
parent
4c5d485b1d
commit
38bf3e6ca9
@ -143,7 +143,7 @@ namespace FLAC {
|
||||
virtual ::FLAC__StreamDecoderInitStatus init(); ///< Seek FLAC__stream_decoder_init_stream()
|
||||
virtual ::FLAC__StreamDecoderInitStatus init_ogg(); ///< Seek FLAC__stream_decoder_init_ogg_stream()
|
||||
|
||||
virtual void finish(); ///< See FLAC__stream_decoder_finish()
|
||||
virtual bool finish(); ///< See FLAC__stream_decoder_finish()
|
||||
|
||||
virtual bool flush(); ///< See FLAC__stream_decoder_flush()
|
||||
virtual bool reset(); ///< See FLAC__stream_decoder_reset()
|
||||
|
@ -53,7 +53,7 @@ namespace FLAC {
|
||||
Stream::~Stream()
|
||||
{
|
||||
if(0 != decoder_) {
|
||||
::FLAC__stream_decoder_finish(decoder_);
|
||||
(void)::FLAC__stream_decoder_finish(decoder_);
|
||||
::FLAC__stream_decoder_delete(decoder_);
|
||||
}
|
||||
}
|
||||
@ -171,10 +171,10 @@ namespace FLAC {
|
||||
return ::FLAC__stream_decoder_init_ogg_stream(decoder_, read_callback_, seek_callback_, tell_callback_, length_callback_, eof_callback_, write_callback_, metadata_callback_, error_callback_, /*client_data=*/(void*)this);
|
||||
}
|
||||
|
||||
void Stream::finish()
|
||||
bool Stream::finish()
|
||||
{
|
||||
FLAC__ASSERT(is_valid());
|
||||
::FLAC__stream_decoder_finish(decoder_);
|
||||
return (bool)::FLAC__stream_decoder_finish(decoder_);
|
||||
}
|
||||
|
||||
bool Stream::flush()
|
||||
|
@ -332,7 +332,11 @@ bool StreamDecoder::test_respond(bool is_ogg)
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing finish()... ");
|
||||
finish();
|
||||
if(!finish()) {
|
||||
State state = get_state();
|
||||
printf("FAILED, returned false, state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)state), state.as_cstring());
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
return true;
|
||||
@ -414,7 +418,11 @@ bool FileDecoder::test_respond(bool is_ogg)
|
||||
printf("OK\n");
|
||||
|
||||
printf("testing finish()... ");
|
||||
finish();
|
||||
if(!finish()) {
|
||||
State state = get_state();
|
||||
printf("FAILED, returned false, state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)state), state.as_cstring());
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
return true;
|
||||
@ -714,7 +722,11 @@ static bool test_stream_decoder(Layer layer, bool is_ogg)
|
||||
}
|
||||
|
||||
printf("testing finish()... ");
|
||||
decoder->finish();
|
||||
if(!decoder->finish()) {
|
||||
FLAC::Decoder::Stream::State state = decoder->get_state();
|
||||
printf("FAILED, returned false, state = %u (%s)\n", (unsigned)((::FLAC__StreamDecoderState)state), state.as_cstring());
|
||||
return false;
|
||||
}
|
||||
printf("OK\n");
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user