diff --git a/include/FLAC/file_decoder.h b/include/FLAC/file_decoder.h index ff5c7ed9..c1f5c8d4 100644 --- a/include/FLAC/file_decoder.h +++ b/include/FLAC/file_decoder.h @@ -28,18 +28,14 @@ extern "C" { typedef enum { FLAC__FILE_DECODER_OK = 0, - FLAC__FILE_DECODER_SEEKING, /*@@@ NOTE: unused; remove this in the next minor-version */ FLAC__FILE_DECODER_END_OF_FILE, FLAC__FILE_DECODER_ERROR_OPENING_FILE, FLAC__FILE_DECODER_MEMORY_ALLOCATION_ERROR, FLAC__FILE_DECODER_SEEK_ERROR, - FLAC__FILE_DECODER_STREAM_ERROR, - FLAC__FILE_DECODER_MD5_ERROR, /*@@@ NOTE: unused; remove this in the next minor-version */ - FLAC__FILE_DECODER_STREAM_DECODER_ERROR, + FLAC__FILE_DECODER_SEEKABLE_STREAM_DECODER_ERROR, FLAC__FILE_DECODER_ALREADY_INITIALIZED, FLAC__FILE_DECODER_INVALID_CALLBACK, - FLAC__FILE_DECODER_UNINITIALIZED, - FLAC__FILE_DECODER_SEEKABLE_STREAM_ERROR = FLAC__FILE_DECODER_STREAM_ERROR /*@@@ NOTE: do the actual replacement in the next minor-version */ + FLAC__FILE_DECODER_UNINITIALIZED } FLAC__FileDecoderState; extern const char *FLAC__FileDecoderStateString[]; diff --git a/include/FLAC/seekable_stream_decoder.h b/include/FLAC/seekable_stream_decoder.h index ab6d28bc..4535885e 100644 --- a/include/FLAC/seekable_stream_decoder.h +++ b/include/FLAC/seekable_stream_decoder.h @@ -32,7 +32,7 @@ typedef enum { FLAC__SEEKABLE_STREAM_DECODER_SEEKING, FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM, FLAC__SEEKABLE_STREAM_DECODER_MEMORY_ALLOCATION_ERROR, - FLAC__SEEKABLE_STREAM_DECODER_STREAM_ERROR, + FLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR, FLAC__SEEKABLE_STREAM_DECODER_READ_ERROR, FLAC__SEEKABLE_STREAM_DECODER_SEEK_ERROR, FLAC__SEEKABLE_STREAM_DECODER_ALREADY_INITIALIZED, diff --git a/src/libFLAC/file_decoder.c b/src/libFLAC/file_decoder.c index d9a77d05..9b269d4a 100644 --- a/src/libFLAC/file_decoder.c +++ b/src/libFLAC/file_decoder.c @@ -72,13 +72,11 @@ typedef struct FLAC__FileDecoderPrivate { const char *FLAC__FileDecoderStateString[] = { "FLAC__FILE_DECODER_OK", - "FLAC__FILE_DECODER_SEEKING", "FLAC__FILE_DECODER_END_OF_FILE", "FLAC__FILE_DECODER_ERROR_OPENING_FILE", "FLAC__FILE_DECODER_MEMORY_ALLOCATION_ERROR", "FLAC__FILE_DECODER_SEEK_ERROR", - "FLAC__FILE_DECODER_STREAM_ERROR", - "FLAC__FILE_DECODER_STREAM_DECODER_ERROR", + "FLAC__FILE_DECODER_SEEKABLE_STREAM_DECODER_DECODER_ERROR", "FLAC__FILE_DECODER_ALREADY_INITIALIZED", "FLAC__FILE_DECODER_INVALID_CALLBACK", "FLAC__FILE_DECODER_UNINITIALIZED" @@ -188,7 +186,7 @@ FLAC__FileDecoderState FLAC__file_decoder_init(FLAC__FileDecoder *decoder) FLAC__seekable_stream_decoder_set_client_data(decoder->private_->seekable_stream_decoder, decoder); if(FLAC__seekable_stream_decoder_init(decoder->private_->seekable_stream_decoder) != FLAC__SEEKABLE_STREAM_DECODER_OK) - return decoder->protected_->state = FLAC__FILE_DECODER_STREAM_DECODER_ERROR; /*@@@ change this to FLAC__FILE_DECODER_SEEKABLE_STREAM_ERROR in next minor-revision */ + return decoder->protected_->state = FLAC__FILE_DECODER_SEEKABLE_STREAM_DECODER_ERROR; return decoder->protected_->state; } @@ -388,7 +386,7 @@ FLAC__bool FLAC__file_decoder_process_whole_file(FLAC__FileDecoder *decoder) ret = FLAC__seekable_stream_decoder_process_whole_stream(decoder->private_->seekable_stream_decoder); if(!ret) - decoder->protected_->state = FLAC__FILE_DECODER_SEEKABLE_STREAM_ERROR; + decoder->protected_->state = FLAC__FILE_DECODER_SEEKABLE_STREAM_DECODER_ERROR; return ret; } @@ -408,7 +406,7 @@ FLAC__bool FLAC__file_decoder_process_metadata(FLAC__FileDecoder *decoder) ret = FLAC__seekable_stream_decoder_process_metadata(decoder->private_->seekable_stream_decoder); if(!ret) - decoder->protected_->state = FLAC__FILE_DECODER_SEEKABLE_STREAM_ERROR; + decoder->protected_->state = FLAC__FILE_DECODER_SEEKABLE_STREAM_DECODER_ERROR; return ret; } @@ -428,7 +426,7 @@ FLAC__bool FLAC__file_decoder_process_one_frame(FLAC__FileDecoder *decoder) ret = FLAC__seekable_stream_decoder_process_one_frame(decoder->private_->seekable_stream_decoder); if(!ret) - decoder->protected_->state = FLAC__FILE_DECODER_SEEKABLE_STREAM_ERROR; + decoder->protected_->state = FLAC__FILE_DECODER_SEEKABLE_STREAM_DECODER_ERROR; return ret; } @@ -448,7 +446,7 @@ FLAC__bool FLAC__file_decoder_process_remaining_frames(FLAC__FileDecoder *decode ret = FLAC__seekable_stream_decoder_process_remaining_frames(decoder->private_->seekable_stream_decoder); if(!ret) - decoder->protected_->state = FLAC__FILE_DECODER_SEEKABLE_STREAM_ERROR; + decoder->protected_->state = FLAC__FILE_DECODER_SEEKABLE_STREAM_DECODER_ERROR; return ret; } diff --git a/src/libFLAC/seekable_stream_decoder.c b/src/libFLAC/seekable_stream_decoder.c index 5d36f57f..63b80411 100644 --- a/src/libFLAC/seekable_stream_decoder.c +++ b/src/libFLAC/seekable_stream_decoder.c @@ -75,7 +75,7 @@ const char *FLAC__SeekableStreamDecoderStateString[] = { "FLAC__SEEKABLE_STREAM_DECODER_SEEKING", "FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM", "FLAC__SEEKABLE_STREAM_DECODER_MEMORY_ALLOCATION_ERROR", - "FLAC__SEEKABLE_STREAM_DECODER_STREAM_ERROR", + "FLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR", "FLAC__SEEKABLE_STREAM_DECODER_READ_ERROR", "FLAC__SEEKABLE_STREAM_DECODER_SEEK_ERROR", "FLAC__SEEKABLE_STREAM_DECODER_ALREADY_INITIALIZED", @@ -209,7 +209,7 @@ FLAC__SeekableStreamDecoderState FLAC__seekable_stream_decoder_init(FLAC__Seekab FLAC__stream_decoder_set_client_data(decoder->private_->stream_decoder, decoder); if(FLAC__stream_decoder_init(decoder->private_->stream_decoder) != FLAC__STREAM_DECODER_SEARCH_FOR_METADATA) - return decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_STREAM_ERROR; + return decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR; return decoder->protected_->state; } @@ -448,7 +448,7 @@ FLAC__bool FLAC__seekable_stream_decoder_process_whole_stream(FLAC__SeekableStre ret = FLAC__stream_decoder_process_whole_stream(decoder->private_->stream_decoder); if(!ret) - decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_STREAM_ERROR; + decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR; return ret; } @@ -468,7 +468,7 @@ FLAC__bool FLAC__seekable_stream_decoder_process_metadata(FLAC__SeekableStreamDe ret = FLAC__stream_decoder_process_metadata(decoder->private_->stream_decoder); if(!ret) - decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_STREAM_ERROR; + decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR; return ret; } @@ -488,7 +488,7 @@ FLAC__bool FLAC__seekable_stream_decoder_process_one_frame(FLAC__SeekableStreamD ret = FLAC__stream_decoder_process_one_frame(decoder->private_->stream_decoder); if(!ret) - decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_STREAM_ERROR; + decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR; return ret; } @@ -508,7 +508,7 @@ FLAC__bool FLAC__seekable_stream_decoder_process_remaining_frames(FLAC__Seekable ret = FLAC__stream_decoder_process_remaining_frames(decoder->private_->stream_decoder); if(!ret) - decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_STREAM_ERROR; + decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR; return ret; } @@ -526,7 +526,7 @@ FLAC__bool FLAC__seekable_stream_decoder_seek_absolute(FLAC__SeekableStreamDecod decoder->protected_->md5_checking = false; if(!FLAC__stream_decoder_reset(decoder->private_->stream_decoder)) { - decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_STREAM_ERROR; + decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR; return false; } /* get the file length */ @@ -540,7 +540,7 @@ FLAC__bool FLAC__seekable_stream_decoder_seek_absolute(FLAC__SeekableStreamDecod return false; } if(!FLAC__stream_decoder_process_metadata(decoder->private_->stream_decoder)) { - decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_STREAM_ERROR; + decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR; return false; } if(sample > decoder->private_->stream_info.total_samples) { @@ -784,7 +784,7 @@ FLAC__bool seek_to_absolute_sample_(FLAC__SeekableStreamDecoder *decoder, FLAC__ return false; } if(!FLAC__stream_decoder_flush(decoder->private_->stream_decoder)) { - decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_STREAM_ERROR; + decoder->protected_->state = FLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR; return false; } }